FooGallery – Image Gallery WordPress Plugin - Version 1.9.25

Version Description

Date Updated : 2020-06-04 * Fix : Fixed bug to prevent infinite loop with ResizeObserver in some themes * Fix : Fixed possible text-domain issue * Update : FooGallery client side 1.4.13

Download this release

Release Info

Developer bradvin
Plugin Icon 128x128 FooGallery – Image Gallery WordPress Plugin
Version 1.9.25
Comparing to
See all releases

Code changes from version 1.9.24 to 1.9.25

README.txt CHANGED
@@ -1,24 +1,24 @@
1
- === WordPress Gallery Plugin - FooGallery ===
2
  Contributors: bradvin, steveush, fooplugins
3
  Donate link: http://fooplugins.com
4
- Tags: gallery, image gallery, wordpress gallery plugin, responsive gallery, best gallery plugin
5
  Requires at least: 3.9
6
- Tested up to: 5.4.1
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- FooGallery is an easy-to-use WordPress gallery plugin, with stunning gallery layouts. It is also responsive, retina-ready and supports lazy loading for lightning fast photo galleries.
12
 
13
  == Description ==
14
 
15
- FooGallery is an easy-to-use WordPress gallery plugin, with stunning gallery layouts. It is also responsive, retina-ready and supports lazy loading for lightning fast photo galleries.
16
 
17
- Live previews are available while creating a gallery, and also within the Gutenberg block editor with our FooGallery Block. FooGallery was built to be highly configurable and extendable for developers or freelancers.
18
 
19
- We have done the research and compared the best free gallery plugins out there, and we know that the free version of FooGallery is the best gallery plugin available!
20
 
21
- [View the FooGallery Homepage](http://fooplugins.com/foogallery)
22
 
23
  **Features**
24
 
@@ -60,10 +60,10 @@ We have done the research and compared the best free gallery plugins out there,
60
  * Grid gallery template - [demo](https://fooplugins.com/foogallery/wordpress-grid-gallery/)
61
  * Slider gallery template - [demo](https://fooplugins.com/foogallery/wordpress-slider-gallery/)
62
  * Video Support - [demo](https://fooplugins.com/foogallery/wordpress-video-gallery/)
63
- * Filtered Galleries using Media Tags or Categories - [demo](https://fooplugins.com/foogallery/wordpress-filtered-gallery/)
64
  * Media tags and media category management for attachments
65
  * PRO image and media lightbox built in! [demo](https://fooplugins.com/foogallery/foogallery-pro-lightbox/)
66
- * Dynamic Galleries (load galleries from other sources):
67
  * Load from a folder on the server
68
  * Load from a collection from Adobe Lightroom (using WP/LR Sync)
69
  * Load all attachments with Media Tags
@@ -75,7 +75,7 @@ We have done the research and compared the best free gallery plugins out there,
75
  * 12 CSS thumbnail filters (Instagram) - [demo](https://fooplugins.com/foogallery/thumbnail-filters/)
76
  * Numbered pagination - [demo](https://fooplugins.com/foogallery/gallery-pagination/#numbered)
77
  * "Load More" pagination - [demo](https://fooplugins.com/foogallery/gallery-pagination/#load-more)
78
- * Infinite scroll galleries - [demo](https://fooplugins.com/foogallery/gallery-pagination/#infinite-scroll)
79
  * Animated Loaded Effects - [demo](https://fooplugins.com/foogallery/animated-loaded-effects/)
80
  * Bulk Copy Gallery Settings - [more info](https://fooplugins.com/bulk-copy-foogallery-pro/)
81
  * More on the way!
@@ -116,7 +116,7 @@ Albums are built in as an extension. Simply head over to the extensions page and
116
 
117
  **Built For Developers**
118
 
119
- FooGallery was designed to be the most developer-friendly gallery plugin available for WordPress. It was also built on top of a solid extension framework, which means different functionality is separated out into different areas in the codebase. It also means the core plugin is lightweight, but still allowing for the most flexibility.
120
 
121
  **Contribute**
122
 
@@ -206,6 +206,12 @@ Update now to get all the latest features, bug fixes and improvements!
206
 
207
  == Changelog ==
208
 
 
 
 
 
 
 
209
  = 1.9.24 =
210
  Date Updated : 2020-05-04
211
  * Fix : Fixed bug where thumbs were not loading on mobile in Justified and Portfolio galleries
@@ -227,7 +233,6 @@ Date Updated : 2020-05-02
227
  * Update : Freemius SDK 2.3.2
228
  * Update : FooGallery client side 1.4.11
229
 
230
-
231
  = 1.9.11 =
232
  Date Updated : 2020-03-29
233
  * Fix : Fix for Simple Portfolio template not saving "None" for captions.
@@ -236,7 +241,6 @@ Date Updated : 2020-03-29
236
  * Fix : Updated RankMath compatibility to work with pre PHP 5.4
237
  * New : Added filter "foogallery_build_dynamic_gallery" for dynamic gallery creation
238
  * New : Added WPML config file for better translations. (Also improves Polylang compatibility.)
239
-
240
  * Update : FooGallery client side 1.4.6 (including multiple bug fixes)
241
 
242
  = 1.9.8 =
@@ -245,29 +249,24 @@ Date Updated : 2020-03-08
245
  * New : Added new setting under Hover Effects : Invert Color. Invert the caption icon colors from dark to light.
246
  * New : All hover and loading icons converted to SVG format.
247
  * New : Lazy load gallery images when editing a gallery (improved performance for large galleries in the admin).
248
-
249
  * Fix : Previews not updating in some cases.
250
  * Update : FooGallery client side 1.4.0 (MAJOR UPDATE).
251
 
252
  = 1.8.20 =
253
  Date Updated : 2019-11-22
254
  * Fix : Fix for Masonry template layout issue in Firefox
255
-
256
  * Update : FooGallery client side 1.3.6
257
 
258
  = 1.8.18 =
259
  Date Updated : 2019-10-23
260
  * New : Elementor compatibility - gallery previews in Elementor editor work, and added a FooGallery widget to the Elementor editor
261
-
262
  * Fix : Images in Yoast SEO sitemaps pull correctly for all types of gallery embedding
263
  * Fix : Lazy-load issues on certain browsers (reverted back to old logic)
264
  * Fix : Updated WPThumb so that images with querystrings in the URL will work
265
  * Fix : Minor security issue fixed on the FooGallery settings page (only exploitable by administrators)
266
 
267
  = 1.8.14 =
268
-
269
  * New : Added setting to move "Add Media" button to front of attachment listing (Advanced tab in FooGallery Settings)
270
-
271
  * Fix : Lazy-load issues with Gutenberg Editor
272
  * Fix : Simple portfolio layout issue with certain themes
273
  * Update : FooGallery client side 1.3.4
1
+ === FooGallery Image Gallery - Responsive Photo Gallery ===
2
  Contributors: bradvin, steveush, fooplugins
3
  Donate link: http://fooplugins.com
4
+ Tags: gallery, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, best gallery plugin, albums, media gallery, video gallery, lightbox
5
  Requires at least: 3.9
6
+ Tested up to: 5.4.2
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ FooGallery is a powerful, responsive photo gallery plugin. Stunning gallery layouts with advanced settings for complete customization and control.
12
 
13
  == Description ==
14
 
15
+ Make gallery management in WordPress great again! With FooGallery you can easily add a stunning photo gallery to your website in minutes.
16
 
17
+ FooGallery is an easy-to-use image gallery plugin, with stunning gallery layouts. It is also responsive, retina-ready and supports lazy loading for lightning fast photo galleries.
18
 
19
+ Live previews are available while creating an image gallery, and also within the Gutenberg block editor with our FooGallery Block. FooGallery was built to be highly configurable and extendable for developers or freelancers.
20
 
21
+ [Visit the FooGallery Homepage](http://fooplugins.com/foogallery)
22
 
23
  **Features**
24
 
60
  * Grid gallery template - [demo](https://fooplugins.com/foogallery/wordpress-grid-gallery/)
61
  * Slider gallery template - [demo](https://fooplugins.com/foogallery/wordpress-slider-gallery/)
62
  * Video Support - [demo](https://fooplugins.com/foogallery/wordpress-video-gallery/)
63
+ * Filtered Image Gallery using Media Tags or Categories - [demo](https://fooplugins.com/foogallery/wordpress-filtered-gallery/)
64
  * Media tags and media category management for attachments
65
  * PRO image and media lightbox built in! [demo](https://fooplugins.com/foogallery/foogallery-pro-lightbox/)
66
+ * Dynamic Galleries (load images from other sources):
67
  * Load from a folder on the server
68
  * Load from a collection from Adobe Lightroom (using WP/LR Sync)
69
  * Load all attachments with Media Tags
75
  * 12 CSS thumbnail filters (Instagram) - [demo](https://fooplugins.com/foogallery/thumbnail-filters/)
76
  * Numbered pagination - [demo](https://fooplugins.com/foogallery/gallery-pagination/#numbered)
77
  * "Load More" pagination - [demo](https://fooplugins.com/foogallery/gallery-pagination/#load-more)
78
+ * Infinite scroll image gallery - [demo](https://fooplugins.com/foogallery/gallery-pagination/#infinite-scroll)
79
  * Animated Loaded Effects - [demo](https://fooplugins.com/foogallery/animated-loaded-effects/)
80
  * Bulk Copy Gallery Settings - [more info](https://fooplugins.com/bulk-copy-foogallery-pro/)
81
  * More on the way!
116
 
117
  **Built For Developers**
118
 
119
+ FooGallery was designed to be the most developer-friendly image gallery plugin available for WordPress. It was also built on top of a solid extension framework, which means different functionality is separated out into different areas in the codebase. It also means the core plugin is lightweight, but still allowing for the most flexibility.
120
 
121
  **Contribute**
122
 
206
 
207
  == Changelog ==
208
 
209
+ = 1.9.25 =
210
+ Date Updated : 2020-06-04
211
+ * Fix : Fixed bug to prevent infinite loop with ResizeObserver in some themes
212
+ * Fix : Fixed possible text-domain issue
213
+ * Update : FooGallery client side 1.4.13
214
+
215
  = 1.9.24 =
216
  Date Updated : 2020-05-04
217
  * Fix : Fixed bug where thumbs were not loading on mobile in Justified and Portfolio galleries
233
  * Update : Freemius SDK 2.3.2
234
  * Update : FooGallery client side 1.4.11
235
 
 
236
  = 1.9.11 =
237
  Date Updated : 2020-03-29
238
  * Fix : Fix for Simple Portfolio template not saving "None" for captions.
241
  * Fix : Updated RankMath compatibility to work with pre PHP 5.4
242
  * New : Added filter "foogallery_build_dynamic_gallery" for dynamic gallery creation
243
  * New : Added WPML config file for better translations. (Also improves Polylang compatibility.)
 
244
  * Update : FooGallery client side 1.4.6 (including multiple bug fixes)
245
 
246
  = 1.9.8 =
249
  * New : Added new setting under Hover Effects : Invert Color. Invert the caption icon colors from dark to light.
250
  * New : All hover and loading icons converted to SVG format.
251
  * New : Lazy load gallery images when editing a gallery (improved performance for large galleries in the admin).
 
252
  * Fix : Previews not updating in some cases.
253
  * Update : FooGallery client side 1.4.0 (MAJOR UPDATE).
254
 
255
  = 1.8.20 =
256
  Date Updated : 2019-11-22
257
  * Fix : Fix for Masonry template layout issue in Firefox
 
258
  * Update : FooGallery client side 1.3.6
259
 
260
  = 1.8.18 =
261
  Date Updated : 2019-10-23
262
  * New : Elementor compatibility - gallery previews in Elementor editor work, and added a FooGallery widget to the Elementor editor
 
263
  * Fix : Images in Yoast SEO sitemaps pull correctly for all types of gallery embedding
264
  * Fix : Lazy-load issues on certain browsers (reverted back to old logic)
265
  * Fix : Updated WPThumb so that images with querystrings in the URL will work
266
  * Fix : Minor security issue fixed on the FooGallery settings page (only exploitable by administrators)
267
 
268
  = 1.8.14 =
 
269
  * New : Added setting to move "Add Media" button to front of attachment listing (Advanced tab in FooGallery Settings)
 
270
  * Fix : Lazy-load issues with Gutenberg Editor
271
  * Fix : Simple portfolio layout issue with certain themes
272
  * Update : FooGallery client side 1.3.4
extensions/default-templates/shared/js/foogallery.js CHANGED
@@ -6690,6 +6690,8 @@
6690
  */
6691
  self._initialize = null;
6692
  self._checkTimeout = null;
 
 
6693
  self.initializing = false;
6694
  self.initialized = false;
6695
  self.destroying = false;
@@ -6700,9 +6702,9 @@
6700
  create: false,
6701
  children: false
6702
  };
6703
- self.robserver = new ResizeObserver(_fn.throttle(function () {
6704
  if (self.$el.is(":visible")) self.layout();
6705
- }, 250));
6706
  },
6707
 
6708
  // ################
@@ -7225,8 +7227,8 @@
7225
  },
7226
 
7227
  layout: function () {
7228
- var self = this;
7229
- if (self._initialize === null) return;
7230
  /**
7231
  * @summary Raised when the templates' {@link FooGallery.Template#layout|layout} method is called.
7232
  * @event FooGallery.Template~"layout.foogallery"
@@ -7243,7 +7245,30 @@
7243
  * }
7244
  * });
7245
  */
7246
- self.raise("layout");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7247
  },
7248
 
7249
  /**
6690
  */
6691
  self._initialize = null;
6692
  self._checkTimeout = null;
6693
+ self._layoutTimeout = null;
6694
+ self._layoutWidths = [];
6695
  self.initializing = false;
6696
  self.initialized = false;
6697
  self.destroying = false;
6702
  create: false,
6703
  children: false
6704
  };
6705
+ self.robserver = new ResizeObserver(function () {
6706
  if (self.$el.is(":visible")) self.layout();
6707
+ });
6708
  },
6709
 
6710
  // ################
7227
  },
7228
 
7229
  layout: function () {
7230
+ var self = this, width = self.getContainerWidth();
7231
+ if (self._initialize === null || self._checkWidth(width)) return;
7232
  /**
7233
  * @summary Raised when the templates' {@link FooGallery.Template#layout|layout} method is called.
7234
  * @event FooGallery.Template~"layout.foogallery"
7245
  * }
7246
  * });
7247
  */
7248
+ self.raise("layout", [width]);
7249
+ },
7250
+ /**
7251
+ * @summary This method was added to prevent an infinite loop in the ResizeObserver.
7252
+ * @description When the viewport has no scrollbar by default and is then resized down until the gallery layout requires a scrollbar
7253
+ * to show. There could be an infinite loop as follows:
7254
+ * 1. No scrollbar shown, layout occurs, scrollbar is then required.
7255
+ * 2. Scrollbar is shown, triggers ResizeObserver, layout occurs, scrollbar is no longer required, loops back round to #1.
7256
+ * To work around this the Template now has a 100ms two width memory and if the same size appears the layout is aborted exiting the loop.
7257
+ * @param {Number} width - The current width of the gallery.
7258
+ * @returns {boolean} True if the layout should be allowed to proceed.
7259
+ * @private
7260
+ */
7261
+ _checkWidth: function(width){
7262
+ var self = this, exists;
7263
+ if (!(exists = (self._layoutWidths.indexOf(width) !== -1))){
7264
+ self._layoutWidths.unshift(width);
7265
+ self._layoutWidths.splice(2, self._layoutWidths.length - 2);
7266
+ if (self._layoutTimeout != null) clearTimeout(self._layoutTimeout);
7267
+ self._layoutTimeout = setTimeout(function(){
7268
+ self._layoutWidths.splice(0, self._layoutWidths.length);
7269
+ }, 100);
7270
+ }
7271
+ return exists;
7272
  },
7273
 
7274
  /**
extensions/default-templates/shared/js/foogallery.min.js CHANGED
@@ -1,12 +1,12 @@
1
  /*
2
  * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
- * @version 1.4.12
4
  * @link
5
  * @copyright Steven Usher & Brad Vincent 2015
6
  * @license Released under the GPLv3 license.
7
  */
8
 
9
  !function(){"use strict";function a(a){this.time=a.time,this.target=a.target,this.rootBounds=a.rootBounds,this.boundingClientRect=a.boundingClientRect,this.intersectionRect=a.intersectionRect||i(),this.isIntersecting=!!a.intersectionRect;var b=this.boundingClientRect,c=b.width*b.height,d=this.intersectionRect,e=d.width*d.height;this.intersectionRatio=c?Number((e/c).toFixed(4)):this.isIntersecting?1:0}function b(a,b){var c=b||{};if("function"!=typeof a)throw new Error("callback must be a function");if(c.root&&1!=c.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=d(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=a,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(c.rootMargin),this.thresholds=this._initThresholds(c.threshold),this.root=c.root||null,this.rootMargin=this._rootMarginValues.map(function(a){return a.value+a.unit}).join(" ")}function c(){return window.performance&&performance.now&&performance.now()}function d(a,b){var c=null;return function(){c||(c=setTimeout(function(){a(),c=null},b))}}function e(a,b,c,d){"function"==typeof a.addEventListener?a.addEventListener(b,c,d||!1):"function"==typeof a.attachEvent&&a.attachEvent("on"+b,c)}function f(a,b,c,d){"function"==typeof a.removeEventListener?a.removeEventListener(b,c,d||!1):"function"==typeof a.detatchEvent&&a.detatchEvent("on"+b,c)}function g(a,b){var c=Math.max(a.top,b.top),d=Math.min(a.bottom,b.bottom),e=Math.max(a.left,b.left),f=Math.min(a.right,b.right),g=f-e,h=d-c;return g>=0&&h>=0&&{top:c,bottom:d,left:e,right:f,width:g,height:h}}function h(a){var b;try{b=a.getBoundingClientRect()}catch(a){}return b?(b.width&&b.height||(b={top:b.top,right:b.right,bottom:b.bottom,left:b.left,width:b.right-b.left,height:b.bottom-b.top}),b):i()}function i(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function j(a,b){for(var c=b;c;){if(c==a)return!0;c=k(c)}return!1}function k(a){var b=a.parentNode;return b&&11==b.nodeType&&b.host?b.host:b&&b.assignedSlot?b.assignedSlot.parentNode:b}if("object"==typeof window){if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return void("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}));var l=window.document,m=[];b.prototype.THROTTLE_TIMEOUT=100,b.prototype.POLL_INTERVAL=null,b.prototype.USE_MUTATION_OBSERVER=!0,b.prototype.observe=function(a){if(!this._observationTargets.some(function(b){return b.element==a})){if(!a||1!=a.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:a,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},b.prototype.unobserve=function(a){this._observationTargets=this._observationTargets.filter(function(b){return b.element!=a}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},b.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},b.prototype.takeRecords=function(){var a=this._queuedEntries.slice();return this._queuedEntries=[],a},b.prototype._initThresholds=function(a){var b=a||[0];return Array.isArray(b)||(b=[b]),b.sort().filter(function(a,b,c){if("number"!=typeof a||isNaN(a)||a<0||a>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return a!==c[b-1]})},b.prototype._parseRootMargin=function(a){var b=a||"0px",c=b.split(/\s+/).map(function(a){var b=/^(-?\d*\.?\d+)(px|%)$/.exec(a);if(!b)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(b[1]),unit:b[2]}});return c[1]=c[1]||c[0],c[2]=c[2]||c[0],c[3]=c[3]||c[1],c},b.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(e(window,"resize",this._checkForIntersections,!0),e(l,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(l,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},b.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,f(window,"resize",this._checkForIntersections,!0),f(l,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},b.prototype._checkForIntersections=function(){var b=this._rootIsInDom(),d=b?this._getRootRect():i();this._observationTargets.forEach(function(e){var f=e.element,g=h(f),i=this._rootContainsTarget(f),j=e.entry,k=b&&i&&this._computeTargetAndRootIntersection(f,d),l=e.entry=new a({time:c(),target:f,boundingClientRect:g,rootBounds:d,intersectionRect:k});j?b&&i?this._hasCrossedThreshold(j,l)&&this._queuedEntries.push(l):j&&j.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},b.prototype._computeTargetAndRootIntersection=function(a,b){if("none"!=window.getComputedStyle(a).display){for(var c=h(a),d=c,e=k(a),f=!1;!f;){var i=null,j=1==e.nodeType?window.getComputedStyle(e):{};if("none"==j.display)return;if(e==this.root||e==l?(f=!0,i=b):e!=l.body&&e!=l.documentElement&&"visible"!=j.overflow&&(i=h(e)),i&&!(d=g(i,d)))break;e=k(e)}return d}},b.prototype._getRootRect=function(){var a;if(this.root)a=h(this.root);else{var b=l.documentElement,c=l.body;a={top:0,left:0,right:b.clientWidth||c.clientWidth,width:b.clientWidth||c.clientWidth,bottom:b.clientHeight||c.clientHeight,height:b.clientHeight||c.clientHeight}}return this._expandRectByRootMargin(a)},b.prototype._expandRectByRootMargin=function(a){var b=this._rootMarginValues.map(function(b,c){return"px"==b.unit?b.value:b.value*(c%2?a.width:a.height)/100}),c={top:a.top-b[0],right:a.right+b[1],bottom:a.bottom+b[2],left:a.left-b[3]};return c.width=c.right-c.left,c.height=c.bottom-c.top,c},b.prototype._hasCrossedThreshold=function(a,b){var c=a&&a.isIntersecting?a.intersectionRatio||0:-1,d=b.isIntersecting?b.intersectionRatio||0:-1;if(c!==d)for(var e=0;e<this.thresholds.length;e++){var f=this.thresholds[e];if(f==c||f==d||f<c!=f<d)return!0}},b.prototype._rootIsInDom=function(){return!this.root||j(l,this.root)},b.prototype._rootContainsTarget=function(a){return j(this.root||l,a)},b.prototype._registerInstance=function(){m.indexOf(this)<0&&m.push(this)},b.prototype._unregisterInstance=function(){var a=m.indexOf(this);-1!=a&&m.splice(a,1)},window.IntersectionObserver=b,window.IntersectionObserverEntry=a}}(),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.ResizeObserver=b()}(this,function(){"use strict";function a(a,b){function c(){f&&(f=!1,a()),g&&e()}function d(){n(c)}function e(){var a=Date.now();if(f){if(a-h<o)return;g=!0}else f=!0,g=!1,setTimeout(d,b);h=a}var f=!1,g=!1,h=0;return e}function b(a){return parseFloat(a)||0}function c(a){for(var c=[],d=1;d<arguments.length;d++)c[d-1]=arguments[d];return c.reduce(function(c,d){return c+b(a["border-"+d+"-width"])},0)}function d(a){for(var c=["top","right","bottom","left"],d={},e=0,f=c;e<f.length;e++){var g=f[e],h=a["padding-"+g];d[g]=b(h)}return d}function e(a){var b=a.getBBox();return j(0,0,b.width,b.height)}function f(a){var e=a.clientWidth,f=a.clientHeight;if(!e&&!f)return v;var h=u(a).getComputedStyle(a),i=d(h),k=i.left+i.right,l=i.top+i.bottom,m=b(h.width),n=b(h.height);if("border-box"===h.boxSizing&&(Math.round(m+k)!==e&&(m-=c(h,"left","right")+k),Math.round(n+l)!==f&&(n-=c(h,"top","bottom")+l)),!g(a)){var o=Math.round(m+k)-e,p=Math.round(n+l)-f;1!==Math.abs(o)&&(m-=o),1!==Math.abs(p)&&(n-=p)}return j(i.left,i.top,m,n)}function g(a){return a===u(a).document.documentElement}function h(a){return l?w(a)?e(a):f(a):v}function i(a){var b=a.x,c=a.y,d=a.width,e=a.height,f="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,g=Object.create(f.prototype);return t(g,{x:b,y:c,width:d,height:e,top:c,right:b+d,bottom:e+c,left:b}),g}function j(a,b,c,d){return{x:a,y:b,width:c,height:d}}var k=function(){function a(a,b){var c=-1;return a.some(function(a,d){return a[0]===b&&(c=d,!0)}),c}return"undefined"!=typeof Map?Map:function(){function b(){this.__entries__=[]}return Object.defineProperty(b.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),b.prototype.get=function(b){var c=a(this.__entries__,b),d=this.__entries__[c];return d&&d[1]},b.prototype.set=function(b,c){var d=a(this.__entries__,b);~d?this.__entries__[d][1]=c:this.__entries__.push([b,c])},b.prototype.delete=function(b){var c=this.__entries__,d=a(c,b);~d&&c.splice(d,1)},b.prototype.has=function(b){return!!~a(this.__entries__,b)},b.prototype.clear=function(){this.__entries__.splice(0)},b.prototype.forEach=function(a,b){void 0===b&&(b=null);for(var c=0,d=this.__entries__;c<d.length;c++){var e=d[c];a.call(b,e[1],e[0])}},b}()}(),l="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,m=function(){return"undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),n=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(m):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)}}(),o=2,p=20,q=["top","right","bottom","left","width","height","size","weight"],r="undefined"!=typeof MutationObserver,s=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=a(this.refresh.bind(this),p)}return b.prototype.addObserver=function(a){~this.observers_.indexOf(a)||this.observers_.push(a),this.connected_||this.connect_()},b.prototype.removeObserver=function(a){var b=this.observers_,c=b.indexOf(a);~c&&b.splice(c,1),!b.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var a=this.observers_.filter(function(a){return a.gatherActive(),a.hasActive()});return a.forEach(function(a){return a.broadcastActive()}),a.length>0},b.prototype.connect_=function(){l&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),r?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},b.prototype.disconnect_=function(){l&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(a){var b=a.propertyName,c=void 0===b?"":b;q.some(function(a){return!!~c.indexOf(a)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),t=function(a,b){for(var c=0,d=Object.keys(b);c<d.length;c++){var e=d[c];Object.defineProperty(a,e,{value:b[e],enumerable:!1,writable:!1,configurable:!0})}return a},u=function(a){return a&&a.ownerDocument&&a.ownerDocument.defaultView||m},v=j(0,0,0,0),w=function(){return"undefined"!=typeof SVGGraphicsElement?function(a){return a instanceof u(a).SVGGraphicsElement}:function(a){return a instanceof u(a).SVGElement&&"function"==typeof a.getBBox}}(),x=function(){function a(a){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=j(0,0,0,0),this.target=a}return a.prototype.isActive=function(){var a=h(this.target);return this.contentRect_=a,a.width!==this.broadcastWidth||a.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var a=this.contentRect_;return this.broadcastWidth=a.width,this.broadcastHeight=a.height,a},a}(),y=function(){function a(a,b){var c=i(b);t(this,{target:a,contentRect:c})}return a}(),z=function(){function a(a,b,c){if(this.activeObservations_=[],this.observations_=new k,"function"!=typeof a)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=a,this.controller_=b,this.callbackCtx_=c}return a.prototype.observe=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof u(a).Element))throw new TypeError('parameter 1 is not of type "Element".');var b=this.observations_;b.has(a)||(b.set(a,new x(a)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof u(a).Element))throw new TypeError('parameter 1 is not of type "Element".');var b=this.observations_;b.has(a)&&(b.delete(a),b.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var a=this;this.clearActive(),this.observations_.forEach(function(b){b.isActive()&&a.activeObservations_.push(b)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var a=this.callbackCtx_,b=this.activeObservations_.map(function(a){return new y(a.target,a.broadcastRect())});this.callback_.call(a,b,a),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),A="undefined"!=typeof WeakMap?new WeakMap:new k,B=function(){function a(b){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var c=s.getInstance(),d=new z(b,c,this);A.set(this,d)}return a}();return["observe","unobserve","disconnect"].forEach(function(a){B.prototype[a]=function(){var b;return(b=A.get(this))[a].apply(b,arguments)}}),function(){return void 0!==m.ResizeObserver?m.ResizeObserver:B}()}),function(a,b){b.$=a}(jQuery,window.FooGallery=window.FooGallery||{}),function(a){if(!a)return void console.warn("jQuery must be included in the page prior to the FooGallery.utils library.");var b={$:a,version:"0.1.8"};b.versionCompare=function(a,b){function c(a){for(var b=a.split("."),c=[],d=0,e=b.length;d<e;d++)c[d]=parseInt(b[d]),isNaN(c[d])&&(c[d]=0);return c}if(!/[\d.]/.test(a)||!/[\d.]/.test(b))return NaN;for(var d=c(a),e=c(b);d.length<e.length;)d.push(0);for(;e.length<d.length;)e.push(0);for(var f=0;f<d.length;++f){if(e.length===f)return 1;if(d[f]!==e[f])return d[f]>e[f]?1:-1}return d.length!==e.length?-1:0},!function(){try{return!!window.FooGallery.utils}catch(a){return!1}}()?window.FooGallery.utils=b:b.versionCompare(b.version,window.FooGallery.utils.version)>0?(console.warn("An older version of FooGallery.utils ("+window.FooGallery.utils.version+") already exists in the page, version "+b.version+" will override it."),window.FooGallery.utils=b):console.warn("A newer version of FooGallery.utils ("+window.FooGallery.utils.version+") already exists in the page, version "+b.version+" will not register itself.")}(jQuery),function(a,b){"0.1.8"===b.version&&(b.is={},b.is.array=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b.is.boolean=function(a){return"[object Boolean]"===Object.prototype.toString.call(a)},b.is.element=function(a){return"object"==typeof HTMLElement?a instanceof HTMLElement:!!a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName},b.is.empty=function(a){if(b.is.undef(a)||null===a)return!0;if(b.is.number(a)&&0===a)return!0;if(b.is.boolean(a)&&!1===a)return!0;if(b.is.string(a)&&0===a.length)return!0;if(b.is.array(a)&&0===a.length)return!0;if(b.is.jq(a)&&0===a.length)return!0;if(b.is.hash(a)){for(var c in a)if(a.hasOwnProperty(c))return!1;return!0}return!1},b.is.error=function(a){return"[object Error]"===Object.prototype.toString.call(a)},b.is.fn=function(a){return a===window.alert||"[object Function]"===Object.prototype.toString.call(a)},b.is.hash=function(a){return b.is.object(a)&&a.constructor===Object&&!a.nodeType&&!a.setInterval},b.is.jq=function(c){return!b.is.undef(a)&&c instanceof a},b.is.number=function(a){return"[object Number]"===Object.prototype.toString.call(a)&&!isNaN(a)},b.is.object=function(a){return"[object Object]"===Object.prototype.toString.call(a)&&!b.is.undef(a)&&null!==a},b.is.promise=function(a){return b.is.object(a)&&b.is.fn(a.then)&&b.is.fn(a.promise)},b.is.size=function(a){return!!(b.is.string(a)&&!b.is.empty(a)||b.is.number(a))&&/^(auto|none|(?:[\d.]*)+?(?:%|px|mm|q|cm|in|pt|pc|em|ex|ch|rem|vh|vw|vmin|vmax)?)$/.test(a)},b.is.string=function(a){return"[object String]"===Object.prototype.toString.call(a)},b.is.undef=function(a){return void 0===a})}(FooGallery.utils.$,FooGallery.utils),function(a,b,c){if("0.1.8"===b.version){b.fn={};var d=Function.prototype.toString;b.fn.CONTAINS_SUPER=/xyz/.test(d.call(function(){xyz}))?/\b_super\b/:/.*/,b.fn.addOrOverride=function(a,e,f){if(c.object(a)&&c.string(e)&&!c.empty(e)&&c.fn(f)){var g=a[e],h=c.fn(g)&&b.fn.CONTAINS_SUPER.test(d.call(f));a[e]=h?function(a,b){return function(){var c=this._super;this._super=a;var d=b.apply(this,arguments);return this._super=c,d}}(g,f):f}},b.fn.apply=function(a,b){function d(){return a.apply(this,b)}return b=c.array(b)?b:[],d.prototype=a.prototype,new d},b.fn.arg2arr=function(a){return Array.prototype.slice.call(a)},b.fn.debounce=function(a,c){var d;return function(){var e=this,f=b.fn.arg2arr(arguments);clearTimeout(d),d=setTimeout(function(){a.apply(e,f)},c)}},b.fn.throttle=function(a,c){var d,e;return function(){var f=this,g=b.fn.arg2arr(arguments);d?(clearTimeout(e),e=setTimeout(function(){Date.now()-d>=c&&(a.apply(f,g),d=Date.now())},c-(Date.now()-d))):(a.apply(f,g),d=Date.now())}},b.fn.check=function(d,e,f,g){function h(a){return function(){return a.apply(d,arguments)}}return f=c.fn(f)?f:a.noop,d=c.object(d)?d:window,e=c.string(e)?b.fn.fetch(e,g):e,h(c.fn(e)?e:f)},b.fn.fetch=function(b,d){return!c.string(b)||c.empty(b)?null:(d=c.object(d)?d:window,a.each(b.split("."),function(a,b){if(!d[b])return!1;d=d[b]}),c.fn(d)?d:null)},b.fn.enqueue=function(d,e,f,g){function h(a,b){try{return n.push(a),b.apply(a,i)}catch(a){return j.reject(a,n),j}}var i=b.fn.arg2arr(arguments),j=a.Deferred(),k=a.Deferred(),l=k.promise(),m=[],n=[],o=!0;return d=i.shift(),e=i.shift(),a.each(d,function(a,d){c.fn(d[e])&&(l=l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}return o=!1,h(d,d[e])}))}),l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}o=!1,j.resolve(m)}),l.fail(function(){var a=b.fn.arg2arr(arguments);a.push(n),j.reject.apply(j,a)}),k.resolve(),j.promise()},b.fn.when=function(b){if(!c.array(b)||c.empty(b))return a.when();for(var d=a.Deferred(),e=[],f=b.length,g=0;g<b.length;g++)b[g].then(function(a){e.push(a)}).always(function(){--f||d.resolve(e)});return d.promise()},b.fn.rejectWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.reject.apply(e,f).promise()},b.fn.resolveWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.resolve.apply(e,f).promise()},b.fn.resolved=a.Deferred().resolve().promise(),b.fn.rejected=a.Deferred().reject().promise()}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b){if("0.1.8"===a.version){a.url={};var c=document.createElement("a");a.url.parts=function(a){c.href=a;var b=c.port?c.port:-1!==["http:","https:"].indexOf(c.protocol)?"https:"===c.protocol?"443":"80":"",d=c.hostname+(b?":"+b:""),e=c.origin?c.origin:c.protocol+"//"+d,f="/"===c.pathname.slice(0,1)?c.pathname:"/"+c.pathname;return{hash:c.hash,host:d,hostname:c.hostname,href:c.href,origin:e,pathname:f,port:b,protocol:c.protocol,search:c.search}},a.url.full=function(a){return!b.string(a)||b.empty(a)?null:(c.href=a,c.href)},a.url.param=function(a,c,d){if(!b.string(a)||!b.string(c)||b.empty(c))return a;var e,f,g,h;return b.undef(d)?(e=new RegExp("[?|&]"+c+"=([^&;]+?)(&|#|;|$)"),f=e.exec(a)||["",""],g=f[1].replace(/\+/g,"%20"),b.string(g)&&!b.empty(g)?decodeURIComponent(g):null):(b.empty(d)?(e=new RegExp("^([^#]*?)(([^#]*)&)?"+c+"(=[^&#]*)?(&|#|$)"),g=a.replace(e,"$1$3$5").replace(/^([^#]*)((\?)&|\?(#|$))/,"$1$3$4")):(e=new RegExp("([?&])"+c+"[^&]*"),h=c+"="+encodeURIComponent(d),(g=a.replace(e,"$1"+h))!==a||e.test(g)||(g+=(-1!==g.indexOf("?")?"&":"?")+h)),g)}}}(FooGallery.utils,FooGallery.utils.is),function(a,b,c){"0.1.8"===a.version&&(a.str={},a.str.camel=function(a){return b.empty(a)?a:a.toUpperCase()===a?a.toLowerCase():a.replace(/^([A-Z])|[-\s_]+(\w)/g,function(a,c,d){return b.string(d)?d.toUpperCase():c.toLowerCase()})},a.str.kebab=function(a){return b.empty(a)?a:a.match(/[A-Z]{2,}(?=[A-Z][a-z0-9]*|\b)|[A-Z]?[a-z0-9]*|[A-Z]|[0-9]+/g).filter(Boolean).map(function(a){return a.toLowerCase()}).join("-")},a.str.contains=function(a,c,d){return!(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c))&&(c.length<=a.length&&-1!==(d?a.toUpperCase().indexOf(c.toUpperCase()):a.indexOf(c)))},a.str.containsWord=function(a,c,d){if(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)||a.length<c.length)return!1;for(var e=a.split(/\W/),f=0,g=e.length;f<g;f++)if(d?e[f].toUpperCase()===c.toUpperCase():e[f]===c)return!0;return!1},a.str.endsWith=function(a,c){return!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)?a===c:a.slice(a.length-c.length)===c},a.str.escapeRegExp=function(a){return b.empty(a)?a:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},a.str.fnv1a=function(a){if(!b.string(a)||b.empty(a))return null;var c,d,e=2166136261;for(c=0,d=a.length;c<d;c++)e^=a.charCodeAt(c),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0},a.str.from=function(c,d){return!b.string(c)||b.empty(c)||!b.string(d)||b.empty(d)?null:a.str.contains(c,d)?c.substring(c.indexOf(d)+d.length):null},a.str.join=function(d,e,f){if(!b.string(d)||!b.string(e))return null;var g=c.arg2arr(arguments);d=g.shift();var h,i,j=g.shift();for(h=0,i=g.length;h<i;h++)e=g[h],b.empty(e)||(a.str.endsWith(j,d)&&(j=j.slice(0,j.length-d.length)),a.str.startsWith(e,d)&&(e=e.slice(d.length)),j+=d+e);return j},a.str.startsWith=function(a,c){return!b.empty(a)&&!b.empty(c)&&a.slice(0,c.length)===c},a.str.until=function(c,d){return b.empty(c)||b.empty(d)?c:a.str.contains(c,d)?c.substring(0,c.indexOf(d)):c},a.str.format=function(a,d,e){var f=c.arg2arr(arguments);if(a=f.shift(),b.empty(a)||b.empty(f))return a;1===f.length&&(b.array(f[0])||b.object(f[0]))&&(f=f[0]);for(var g in f)a=a.replace(new RegExp("\\{"+g+"\\}","gi"),f[g]);return a})}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d,e){if("0.1.8"===b.version){b.obj={};var f=function(){};b.obj.create=function(a){if(!c.object(a))throw TypeError("Argument must be an object");f.prototype=a;var b=new f;return f.prototype=null,b},b.obj.extend=function(e,f,g){e=c.object(e)?e:{};var h=d.arg2arr(arguments);return h.shift(),a.each(h,function(a,c){b.obj.merge(e,c)}),e},b.obj.merge=function(a,d){a=c.hash(a)?a:{},d=c.hash(d)?d:{};for(var e in d)d.hasOwnProperty(e)&&(c.hash(d[e])?(a[e]=c.hash(a[e])?a[e]:{},b.obj.merge(a[e],d[e])):c.array(d[e])?a[e]=d[e].slice():a[e]=d[e]);return a},b.obj.mergeValid=function(d,e,f,g){if(!c.hash(f)||!c.hash(e))return d;e=c.hash(e)?e:{},g=c.hash(g)?g:{};var h,i,j;for(h in e)e.hasOwnProperty(h)&&c.fn(e[h])&&(i=c.array(g[h])?g[h]:c.string(g[h])?[g[h]]:[h],a.each(i,function(a,g){if(j=b.obj.prop(f,g),!c.undef(j))return e[h](j)?(b.obj.prop(d,h,j),!1):void 0}));return d},b.obj.prop=function(b,d,f){if(c.object(b)&&!c.empty(d)){var g,h;if(c.undef(f))return e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){if(a===h)f=b[d];else{if(!c.hash(b[d]))return!1;b=b[d]}})):c.undef(b[d])||(f=b[d]),f;e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){a===h?b[d]=f:b=c.hash(b[d])?b[d]:b[d]={}})):c.undef(b[d])||(b[d]=f)}}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){if("0.1.8"===b.version){b.ready=function(a){function c(){try{a.call(window,b.$)}catch(a){console.error(a)}}(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?c():document.addEventListener("DOMContentLoaded",c,!1)};var d=0;b.uniqueId=function(a,b){var e=a.attr("id");return c.empty(e)&&(b=c.string(b)&&!c.empty(b)?b:"uid-",e=b+ ++d,a.attr("id",e).data("__uniqueId__",!0)),e},b.removeUniqueId=function(a){a.data("__uniqueId__")&&a.removeAttr("id").removeData("__uniqueId__")},b.selectify=function(a){if(c.empty(a))return null;if(c.hash(a)){var d,e={};for(var f in a)a.hasOwnProperty(f)&&(d=b.selectify(a[f]))&&(e[f]=d);return e}return c.string(a)||c.array(a)?(c.string(a)&&(a=[a]),a.map(function(a){return c.string(a)?"."+a.split(/\s/g).join("."):null}).join(",")):null},b.src=function(a,b,d,e,f,g,h){if(!c.string(a))return null;if(!c.string(b))return a;var i=b.replace(/(\s[\d.]+[whx]),/g,"$1 @,@ ").split(" @,@ "),j=i.map(function(a){return{url:/^\s*(\S*)/.exec(a)[1],w:parseFloat((/\S\s+(\d+)w/.exec(a)||[0,1/0])[1]),h:parseFloat((/\S\s+(\d+)h/.exec(a)||[0,1/0])[1]),x:parseFloat((/\S\s+([\d.]+)x/.exec(a)||[0,1])[1])}});if(!j.length)return a;j.unshift({url:a,w:j[0].w!==1/0&&j[0].h===1/0?d:1/0,h:j[0].h!==1/0&&j[0].w===1/0?e:1/0,x:1});var k=c.number(h)?h:window.devicePixelRatio||1,l={w:f*k,h:g*k,x:k},m=["w","h","x"];return m.forEach(function(a){var b=Math.max.apply(null,j.map(function(b){return b[a]}));j=j.filter(function(c){return c[a]>=l[a]||c[a]===b})}),m.forEach(function(a){var b=Math.min.apply(null,j.map(function(b){return b[a]}));j=j.filter(function(c){return c[a]===b})}),j[0].url},b.scrollParent=function(b,d,e){b=c.jq(b)?b:a(b),d=c.string(d)&&/^(x|y|xy|yx)$/i.test(d)?d:"xy";var f=a(!!b.length&&b[0].ownerDocument||document);if(e=c.jq(e)?e:f,!b.length)return e;var g=b.css("position"),h="absolute"===g,i=/(auto|scroll)/i,j=/x/i,k=/y/i,l=b.parentsUntil(e).filter(function(b,c){var e=a(this);if(h&&"static"===e.css("position"))return!1;var f=k.test(d)&&c.scrollHeight>c.clientHeight&&i.test(e.css("overflow-y")),g=j.test(d)&&c.scrollWidth>c.clientWidth&&i.test(e.css("overflow-x"));return f||g}).eq(0);return l.is("html")&&(l=f),"fixed"!==g&&l.length?l:e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c){function d(a){return setTimeout(a,1)}function e(a){clearTimeout(a)}if("0.1.8"===b.version){b.animation={},b.animation.requestFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||d).bind(window),b.animation.cancelFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||e).bind(window);var f=document.createElement("div");b.animation.supported=function(a){var b=a.style;return c.string(b.animation)||c.string(b.WebkitAnimation)||c.string(b.MozAnimation)||c.string(b.msAnimation)||c.string(b.OAnimation)}(f),b.animation.end=function(a){var b=a.style;return c.string(b.animation)?"animationend":c.string(b.WebkitAnimation)?"webkitAnimationEnd":c.string(b.MozAnimation)?"animationend":c.string(b.msAnimation)?"msAnimationEnd":c.string(b.OAnimation)?"oAnimationEnd":null}(f),b.animation.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("animation-duration");if(/^([\d.]*)+?(ms|s)$/i.test(d)){var e=d.match(/^([\d.]*)+?(ms|s)$/i),f=parseFloat(e[1]);return"s"===e[2].toLowerCase()&&(f*=1e3),f}return b},b.animation.iterations=function(a,b){if(b=c.number(b)?b:1,!c.jq(a))return b;var d=a.css("animation-iteration-count");return/^(\d+|infinite)$/i.test(d)?"infinite"===d?1/0:parseInt(d):b},b.animation.start=function(d,e,f,g){var h=a.Deferred(),i=h.promise();if(d=d.first(),b.animation.supported){d.prop("offsetTop");var j=d.data("animation_safety");if(c.hash(j)&&c.number(j.timer)&&(clearTimeout(j.timer),d.removeData("animation_safety").off(b.animation.end+".utils"),j.deferred.reject()),!c.number(g)){var k=b.animation.iterations(d);if(k===1/0)return h.reject("No timeout supplied with an infinite animation."),i;g=b.animation.duration(d)*k+50}j={deferred:h,timer:setTimeout(function(){d.removeData("animation_safety").off(b.animation.end+".utils"),h.resolve()},g)},d.data("animation_safety",j),d.on(b.animation.end+".utils",function(a){d.is(a.target)&&(clearTimeout(j.timer),d.removeData("animation_safety").off(b.animation.end+".utils"),h.resolve())})}return b.animation.requestFrame(function(){c.fn(e)?e.apply(d.get(0),[d]):d.toggleClass(e,f),b.animation.supported||h.resolve()}),i}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){if("0.1.8"===b.version){b.transition={};var e=document.createElement("div");b.transition.supported=function(a){var b=a.style;return c.string(b.transition)||c.string(b.WebkitTransition)||c.string(b.MozTransition)||c.string(b.msTransition)||c.string(b.OTransition)}(e),b.transition.end=function(a){var b=a.style;return c.string(b.transition)?"transitionend":c.string(b.WebkitTransition)?"webkitTransitionEnd":c.string(b.MozTransition)?"transitionend":c.string(b.msTransition)?"msTransitionEnd":c.string(b.OTransition)?"oTransitionEnd":null}(e),b.transition.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("transition-duration");if(/^([\d.]*)+?(ms|s)$/i.test(d)){var e=d.match(/^([\d.]*)+?(ms|s)$/i),f=parseFloat(e[1]);return"s"===e[2].toLowerCase()&&(f*=1e3),f}return b},b.transition.start=function(e,f,g,h){var i=a.Deferred(),j=i.promise();if(e=e.first(),b.transition.supported){e.prop("offsetTop");var k=e.data("transition_safety");c.hash(k)&&c.number(k.timer)&&(clearTimeout(k.timer),e.removeData("transition_safety").off(b.transition.end+".utils"),k.deferred.reject()),h=c.number(h)?h:b.transition.duration(e)+50,k={deferred:i,timer:setTimeout(function(){e.removeData("transition_safety").off(b.transition.end+".utils"),i.resolve()},h)},e.data("transition_safety",k),e.on(b.transition.end+".utils",function(a){e.is(a.target)&&(clearTimeout(k.timer),e.removeData("transition_safety").off(b.transition.end+".utils"),i.resolve())})}return d.requestFrame(function(){c.fn(f)?f.apply(e.get(0),[e]):e.toggleClass(f,g),b.transition.supported||i.resolve()}),j}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.animation),function(a,b,c,d,e){"0.1.8"===b.version&&(b.Class=function(){},b.Class.extend=function(a){function f(){if(!c.fn(this.construct))throw new SyntaxError('FooGallery.utils.Class objects must be constructed with the "new" keyword.');this.construct.apply(this,arguments)}a=c.hash(a)?a:{};var g=d.create(this.prototype);for(var h in a)a.hasOwnProperty(h)&&e.addOrOverride(g,h,a[h]);return g.construct=c.fn(g.construct)?g.construct:function(){},f.prototype=g,f.prototype.constructor=c.fn(g.__ctor__)?g.__ctor__:f,f.extend=b.Class.extend,f.override=b.Class.override,f},b.Class.override=function(a,b){e.addOrOverride(this.prototype,a,b)})}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj,FooGallery.utils.fn),function(a,b,c){"0.1.8"===a.version&&(a.Event=a.Class.extend({construct:function(a){
10
- if(b.empty(a))throw new SyntaxError("FooGallery.utils.Event objects must be supplied a `type`.");var d=c.contains(a,".");this.type=d?c.until(a,"."):a,this.namespace=d?c.from(a,"."):null,this.defaultPrevented=!1,this.target=null},preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented}}),a.EventClass=a.Class.extend({construct:function(){this.__handlers={}},destroy:function(){this.__handlers={}},on:function(a,c,d){var e=this;return b.object(a)?(d=b.undef(c)?this:c,Object.keys(a).forEach(function(b){b.split(" ").forEach(function(c){e.__on(c,a[b],d)})})):b.string(a)&&b.fn(c)&&(d=b.undef(d)?this:d,a.split(" ").forEach(function(a){e.__on(a,c,d)})),e},__on:function(a,d,e){var f=this,g=c.contains(a,"."),h=g?c.until(a,"."):a,i=g?c.from(a,"."):null;b.array(f.__handlers[h])||(f.__handlers[h]=[]),f.__handlers[h].some(function(a){return a.namespace===i&&a.fn===d&&a.thisArg===e})||f.__handlers[h].push({namespace:i,fn:d,thisArg:e})},off:function(a,c,d){var e=this;return b.object(a)?(d=b.undef(c)?this:c,Object.keys(a).forEach(function(c){c.split(" ").forEach(function(f){e.__off(f,b.fn(a[c])?a[c]:null,d)})})):b.string(a)&&(c=b.fn(c)?c:null,d=b.undef(d)?this:d,a.split(" ").forEach(function(a){e.__off(a,c,d)})),e},__off:function(a,d,e){var f=this,g=c.until(a,".")||null,h=c.from(a,".")||null,i=[];b.empty(g)?b.empty(h)||i.push.apply(i,Object.keys(f.__handlers)):i.push(g),i.forEach(function(a){b.array(f.__handlers[a])&&(f.__handlers[a]=f.__handlers[a].filter(function(a){return null!=d?!(a.namespace===h&&a.fn===d&&a.thisArg===e):null!=h&&a.namespace!==h}),0===f.__handlers[a].length&&delete f.__handlers[a])})},trigger:function(c,d){d=b.array(d)?d:[];var e=this,f=[];return c instanceof a.Event?(f.push(c),e.__trigger(c,d)):b.string(c)&&c.split(" ").forEach(function(b){var c=f.push(new a.Event(b))-1;e.__trigger(f[c],d)}),b.empty(f)?null:1===f.length?f[0]:f},__trigger:function(a,c){var d=this;a.target=d,b.array(d.__handlers[a.type])&&d.__handlers[a.type].forEach(function(b){null!=a.namespace&&b.namespace!==a.namespace||b.fn.apply(b.thisArg,[a].concat(c))})}}))}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.str),function(a,b,c){if("0.1.8"===b.version){b.Bounds=b.Class.extend({construct:function(){var a=this;a.top=0,a.right=0,a.bottom=0,a.left=0,a.width=0,a.height=0},inflate:function(a){var b=this;return c.number(a)&&(b.top-=a,b.right+=a,b.bottom+=a,b.left-=a,b.width+=2*a,b.height+=2*a),b},intersects:function(a){var b=this;return b.left<=a.right&&a.left<=b.right&&b.top<=a.bottom&&a.top<=b.bottom}});var d;b.getViewportBounds=function(c){d||(d=a(window));var e=new b.Bounds;return e.top=d.scrollTop(),e.left=d.scrollLeft(),e.width=d.width(),e.height=d.height(),e.right=e.left+e.width,e.bottom=e.top+e.height,e.inflate(c),e},b.getElementBounds=function(d){c.jq(d)||(d=a(d));var e=new b.Bounds;if(0!==d.length){var f=d.offset();e.top=f.top,e.left=f.left,e.width=d.width(),e.height=d.height()}return e.right=e.left+e.width,e.bottom=e.top+e.height,e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e){"0.1.8"===b.version&&(b.Timer=b.EventClass.extend({construct:function(a){this._super(),this.interval=c.number(a)?a:1e3,this.isRunning=!1,this.isPaused=!1,this.canResume=!1,this.canRestart=!1,this.__timeout=null,this.__decrement=!1,this.__time=0,this.__remaining=0,this.__current=0,this.__finish=0,this.__restart=[]},__reset:function(){clearTimeout(this.__timeout),this.__timeout=null,this.__decrement=!1,this.__time=0,this.__remaining=0,this.__current=0,this.__finish=0,this.isRunning=!1,this.isPaused=!1,this.canResume=!1},__eventArgs:function(a){return[this.__current,this.__time,this.__decrement].concat(d.arg2arr(arguments))},__tick:function(){var a=this;a.trigger("tick",a.__eventArgs()),a.__current===a.__finish?(a.trigger("complete",a.__eventArgs()),a.__reset()):(a.__decrement?a.__current--:a.__current++,a.__remaining--,a.canResume=a.__remaining>0,a.__timeout=setTimeout(function(){a.__tick()},a.interval))},start:function(a,b){var d=this;d.isRunning||(b=!!c.boolean(b)&&b,d.__restart=[a,b],d.__decrement=b,d.__time=a,d.__remaining=a,d.__current=b?a:0,d.__finish=b?0:a,d.canRestart=!0,d.isRunning=!0,d.isPaused=!1,d.trigger("start",d.__eventArgs()),d.__tick())},countdown:function(a){this.start(a,!0)},countup:function(a){this.start(a,!1)},restart:function(){this.stop(),this.canRestart&&this.start.apply(this,this.__restart)},stop:function(){(this.isRunning||this.isPaused)&&(this.__reset(),this.trigger("stop",this.__eventArgs()))},pause:function(){var a=this;return null!=a.__timeout&&(clearTimeout(a.__timeout),a.__timeout=null),a.isRunning&&(a.isRunning=!1,a.isPaused=!0,a.trigger("pause",a.__eventArgs())),a.__remaining},resume:function(){var a=this;a.canResume&&(a.isRunning=!0,a.isPaused=!1,a.trigger("resume",a.__eventArgs()),a.__tick())},reset:function(){this.__reset(),this.trigger("reset",this.__eventArgs())}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d){"0.1.8"===b.version&&(b.Factory=b.Class.extend({construct:function(){this.registered={}},contains:function(a){return!c.undef(this.registered[a])},load:function(b,e,f){var g,h,i=this,j=d.arg2arr(arguments),k=[],l=[];b=j.shift()||{};for(g in i.registered)if(i.registered.hasOwnProperty(g)){var m=i.registered[g];b.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&(m={name:g,klass:h,priority:i.registered[g].priority})),k.push(m)}for(g in b)b.hasOwnProperty(g)&&!i.registered.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&k.push({name:g,klass:h,priority:0}));return k.sort(function(a,b){return b.priority-a.priority}),a.each(k,function(a,b){c.fn(b.klass)&&l.push(d.apply(b.klass,j))}),l},make:function(a,b,e){var f,g=this,h=d.arg2arr(arguments);return a=h.shift(),f=g.registered[a],c.hash(f)&&c.fn(f.klass)?d.apply(f.klass,h):null},names:function(b){b=!!c.boolean(b)&&b;var d,e=[];if(b){var f=[];for(d in this.registered)this.registered.hasOwnProperty(d)&&f.push(this.registered[d]);f.sort(function(a,b){return b.priority-a.priority}),a.each(f,function(a,b){e.push(b.name)})}else for(d in this.registered)this.registered.hasOwnProperty(d)&&e.push(d);return e},register:function(a,b,d){if(!c.string(a)||c.empty(a)||!c.fn(b))return!1;d=c.number(d)?d:0;var e=this.registered[a];return this.registered[a]={name:a,klass:b,priority:c.undef(e)?d:e.priority},!0}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c){if("0.1.8"===a.version){var d=!1;try{d=!!window.localStorage}catch(a){d=!1}a.Debugger=a.Class.extend({construct:function(a){this.key=a,this.enabled=!!d&&!!localStorage.getItem(this.key)},enable:function(){d&&(this.enabled=!0,localStorage.setItem(this.key,this.enabled))},disable:function(){d&&(this.enabled=!1,localStorage.removeItem(this.key))},log:function(a,c){this.enabled&&console.log.apply(console,b.arg2arr(arguments))},logf:function(a,d,e){if(this.enabled){var f=b.arg2arr(arguments);a=f.shift(),d=f.shift(),f.unshift(c.format(a,d)),this.log.apply(this,f)}}})}}(FooGallery.utils,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){"0.1.8"===b.version&&(b.FullscreenAPI=b.EventClass.extend({construct:function(){this._super(),this.apis={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}},this.api=this.getAPI(),this.supported=null!=this.api,this.__listen()},destroy:function(){return this.__stopListening(),this._super()},getAPI:function(){for(var a in this.apis)if(this.apis.hasOwnProperty(a)&&this.apis[a].enabled in document)return this.apis[a];return null},element:function(){return this.supported?document[this.api.element]:null},request:function(b){if(this.supported&&b[this.api.request]){var d=b[this.api.request]();return d||a.Deferred(this.__resolver(this.api.request)).promise()}return c.rejected},exit:function(){if(this.supported&&this.element()){var b=document[this.api.exit]();return b||a.Deferred(this.__resolver(this.api.exit)).promise()}return c.rejected},toggle:function(a){return this.element()?this.exit():this.request(a)},__listen:function(){var b=this;b.supported&&a(document).on(b.api.events.change+".utils",function(){b.trigger("change")}).on(b.api.events.error+".utils",function(){b.trigger("error")})},__stopListening:function(){var b=this;b.supported&&a(document).off(b.api.events.change+".utils").off(b.api.events.error+".utils")},__resolver:function(b){var c=this;return function(d){function e(){d.resolve(),a(document).off(c.api.events.change,e).off(c.api.events.error,f)}function f(){d.reject(new TypeError),a(document).off(c.api.events.change,e).off(c.api.events.error,f)}if(b===c.api.exit&&c.element())return void setTimeout(function(){d.reject(new TypeError)},1);a(document).on(c.api.events.change,e).on(c.api.events.error,f)}}}),b.fullscreen=new b.FullscreenAPI)}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.fn),function(a,b,c,d,e){b.debug=new c.Debugger("__FooGallery__"),b.EMPTY_IMAGE="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b.DATA_TEMPLATE="__FooGallery__",b.DATA_ITEM="__FooGalleryItem__",b.get=function(c){return a(c).data(b.DATA_TEMPLATE)},b.init=function(c,e){if(e=d.jq(e)?e:a(e),e.length>0){var f=e.data(b.DATA_TEMPLATE);if(f instanceof b.Template)return f.destroy(!0).then(function(){return b.template.make(c,e).initialize()})}return b.template.make(c,e).initialize()},b.initAll=function(c){return e.when(a(".foogallery").map(function(a,d){return b.init(c,d)}).get())},a.fn.foogallery=function(c,e){return e=d.fn(e)?e:a.noop,this.each(function(f,g){if(d.string(c)){var h=a.data(g,b.DATA_TEMPLATE);if(h instanceof b.Template)switch(c){case"layout":return void h.layout();case"destroy":return void h.destroy()}}else b.init(c,g).then(e)})},b.isCached=function(a){var b=new Image;b.src=a;var c=b.complete;return b.src="",b=null,c},b.supportedExifProperties=["aperture","camera","date","exposure","focalLength","iso","orientation"],d.exif=function(a){if(d.object(a)){var c=Object.keys(a);return c.length>0&&c.some(function(c){return-1!==b.supportedExifProperties.indexOf(c)&&!d.empty(a[c])})}return!1}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c,d,e){var f="__FooGallerySwipe__",g="ontouchstart"in window,h=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!g,i=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!g,j=g||i;b.Swipe=c.Class.extend({construct:function(b,c){var d=this,f=".fgswipe";d.$el=a(b),d.opt=e.extend({threshold:20,allowPageScroll:!1,swipe:a.noop,data:{}},c),d.active=!1,d.startPoint=null,d.endPoint=null,d.events={start:(j?i?h?"MSPointerDown":"pointerdown":"touchstart":"mousedown")+f,move:(j?i?h?"MSPointerMove":"pointermove":"touchmove":"mousemove")+f,end:(j?i?h?"MSPointerUp":"pointerup":"touchend":"mouseup")+f,leave:(j?i?"mouseleave":null:"mouseleave")+f}},init:function(){var a=this;a.$el.on(a.events.start,{self:a},a.onStart),a.$el.on(a.events.move,{self:a},a.onMove),a.$el.on(a.events.end,{self:a},a.onEnd),d.string(a.events.leave)&&a.$el.on(a.events.leave,{self:a},a.onEnd),a.$el.data(f,a)},destroy:function(){var a=this;a.$el.off(a.events.start,a.onStart),a.$el.off(a.events.move,a.onMove),a.$el.off(a.events.end,a.onEnd),d.string(a.events.leave)&&a.$el.off(a.events.leave,a.onEnd),a.$el.removeData(f)},getAngle:function(a,b){var c=Math.atan2(a.x-b.x,a.y-b.y),d=Math.round(180*c/Math.PI);return 360-(d<0?360-Math.abs(d):d)},getDistance:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*=c,d*=d,Math.sqrt(c+d)},getDirection:function(a,b){var c=this,d=c.getAngle(a,b);return d>337.5||d<=22.5?"N":d>22.5&&d<=67.5?"NE":d>67.5&&d<=112.5?"E":d>112.5&&d<=157.5?"SE":d>157.5&&d<=202.5?"S":d>202.5&&d<=247.5?"SW":d>247.5&&d<=292.5?"W":d>292.5&&d<=337.5?"NW":"NONE"},getPoint:function(a){var b;return j&&!d.empty(b=a.originalEvent.touches||a.touches)?{x:b[0].pageX,y:b[0].pageY}:d.number(a.pageX)&&d.number(a.pageY)?{x:a.pageX,y:a.pageY}:null},getOffset:function(a){var b=this,c=b.$el.offset();return{left:a.x-c.left,top:a.y-c.top}},onStart:function(a){var b=a.data.self,c=b.getPoint(a);d.empty(c)||(b.active=!0,b.startPoint=b.endPoint=c)},onMove:function(b){var c=b.data.self,e=c.getPoint(b);if(c.active&&!d.empty(e))if(c.endPoint=e,c.opt.allowPageScroll){if(d.hash(c.opt.allowPageScroll)){var f=c.getDirection(c.startPoint,c.endPoint);c.opt.allowPageScroll.x||-1===a.inArray(f,["NE","E","SE","NW","W","SW"])||b.preventDefault(),c.opt.allowPageScroll.y||-1===a.inArray(f,["NW","N","NE","SW","S","SE"])||b.preventDefault()}}else b.preventDefault()},onEnd:function(a){var b=a.data.self;if(b.active){b.active=!1;var c={startPoint:b.startPoint,endPoint:b.endPoint,startOffset:b.getOffset(b.startPoint),endOffset:b.getOffset(b.endPoint),angle:b.getAngle(b.startPoint,b.endPoint),distance:b.getDistance(b.startPoint,b.endPoint),direction:b.getDirection(b.startPoint,b.endPoint)};if(b.opt.threshold>0&&c.distance<b.opt.threshold)return;b.opt.swipe.apply(this,[c,b.opt.data]),b.startPoint=null,b.endPoint=null}}}),a.fn.fgswipe=function(c){return this.each(function(){var e=a(this),g=e.data(f);if(g instanceof b.Swipe){if(d.string(c)&&d.fn(g[c]))return void g[c]();g.destroy()}d.hash(c)&&(g=new b.Swipe(this,c),g.init())})}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e,f){b.TemplateFactory=c.Factory.extend({construct:function(){this.registered={}},register:function(a,b,c,e,f,g){var h=this,i=h._super(a,b,g);if(i){var j=h.registered;j[a].opt=d.hash(c)?c:{},j[a].cls=d.hash(e)?e:{},j[a].il8n=d.hash(f)?f:{}}return i},make:function(b,c){c=d.jq(c)?c:a(c),b=f.extend({},b,c.data("foogallery"));var e=this,g=e.type(b,c);return e.contains(g)?(b=e.options(g,b),e._super(g,b,c)):null},type:function(b,e){e=d.jq(e)?e:a(e);var f=this,g=d.hash(b)&&d.hash(b)&&d.string(b.type)&&f.contains(b.type)?b.type:"core";if("core"===g&&e.length>0)for(var h=f.registered,i=f.names(!0),j=0,k=i.length;j<k;j++)if(h.hasOwnProperty(i[j])){var l=i[j],m=h[l].cls;if(d.string(m.container)){var n=c.selectify(m.container);if(e.is(n)){g=i[j];break}}}return g},configure:function(a,b,c,d){var e=this;if(e.contains(a)){var g=e.registered;f.extend(g[a].opt,b),f.extend(g[a].cls,c),f.extend(g[a].il8n,d)}},options:function(a,c){c=f.extend({type:a},c);var e=this,g=e.registered,h=g.core.opt,i=g.core.cls,j=g.core.il8n;return d.hash(c.cls)||(c.cls={}),d.hash(c.il8n)||(c.il8n={}),d.undef(b.filtering)||(c=b.filtering.merge(c)),d.undef(b.paging)||(c=b.paging.merge(c)),"core"!==a&&e.contains(a)?(c=f.extend({},h,g[a].opt,c),c.cls=f.extend({},i,g[a].cls,c.cls),c.il8n=f.extend({},j,g[a].il8n,c.il8n)):(c=f.extend({},h,c),c.cls=f.extend({},i,c.cls),c.il8n=f.extend({},j,c.il8n)),c}}),b.template=new b.TemplateFactory}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e){a.PagingFactory=b.Factory.extend({construct:function(){this.registered={}},register:function(a,b,d,e,f,g,h){var i=this,j=i._super(a,b,h);if(j){var k=i.registered;k[a].ctrl=c.fn(d)?d:null,k[a].opt=c.hash(e)?e:{},k[a].cls=c.hash(f)?f:{},k[a].il8n=c.hash(g)?g:{}}return j},type:function(a){var b,d=this;return c.hash(a)&&c.hash(b=a.paging)&&c.string(b.type)&&d.contains(b.type)?b.type:null},merge:function(a){a=e.extend({},a);var b=this,d=b.type(a),f=b.registered,g=f.default.opt,h=f.default.cls,i=f.default.il8n,j=c.hash(a.paging)?a.paging:{},k=c.hash(a.cls)&&c.hash(a.cls.paging)?e.extend({},a.cls.paging):{},l=c.hash(a.il8n)&&c.hash(a.il8n.paging)?e.extend({},a.il8n.paging):{};return c.hash(a.cls)||(a.cls={}),c.hash(a.il8n)||(a.il8n={}),"default"!==d&&b.contains(d)?(a.paging=e.extend({},g,f[d].opt,j,{type:d}),a.cls=e.extend(a.cls,{paging:h},{paging:f[d].cls},{paging:k}),a.il8n=e.extend(a.il8n,{paging:i},{paging:f[d].il8n},{paging:l})):(a.paging=e.extend({},g,j,{type:d}),a.cls=e.extend(a.cls,{paging:h},{paging:k}),a.il8n=e.extend(a.il8n,{paging:i},{paging:l})),a},configure:function(a,b,c,d){var f=this;if(f.contains(a)){var g=f.registered;e.extend(g[a].opt,b),e.extend(g[a].cls,c),e.extend(g[a].il8n,d)}},hasCtrl:function(a){var b=this,d=b.registered[a];return c.hash(d)&&c.fn(d.ctrl)},makeCtrl:function(a,b,d,e){var f=this,g=f.registered[a];return c.hash(g)&&c.fn(g.ctrl)?new g.ctrl(b,d,e):null}}),a.paging=new a.PagingFactory}(FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f){var g=0;b.Template=c.EventClass.extend({construct:function(f,h){var i=this;i._super(),i.namespace=".foogallery-"+ ++g,i.$el=d.jq(h)?h:a(h),i.$scrollParent=null,i.opt=f,i.template=f.template,i.id=i.$el.prop("id")||f.id,i.cls=f.cls,i.il8n=f.il8n,i.sel=c.selectify(i.cls),i.items=b.components.make("items",i),i.pages=d.undef(b.paging)?null:b.paging.make(f.paging.type,i),i.filter=d.undef(b.filtering)?null:b.filtering.make(f.filtering.type,i),i.state=b.components.make("state",i),i._initialize=null,i._checkTimeout=null,i.initializing=!1,i.initialized=!1,i.destroying=!1,i.destroyed=!1,i._undo={classes:"",style:"",create:!1,children:!1},i.robserver=new ResizeObserver(e.throttle(function(){i.$el.is(":visible")&&i.layout()},250))},initialize:function(b){var c=this;return d.promise(c._initialize)?c._initialize:c._initialize=a.Deferred(function(a){c.preInit(b)?c.init().then(function(){c.postInit()?c.firstLoad().then(function(){c.ready(),a.resolve(c)}).fail(a.reject):a.reject("post-init failed")}).fail(a.reject):a.reject("pre-init failed")}).fail(function(a){console.log("initialize failed",c,a),c.destroy()}).promise()},preInit:function(e){var f=this;if(f.destroying)return!1;if(e=d.jq(e)?e:a(e),f.initializing=!0,0===e.length&&0===f.$el.parent().length)return!1;0===f.$el.length&&(f.$el=f.create(),f._undo.create=!0),e.length>0&&f.$el.appendTo(e);var g;d.empty(f.opt.scrollParent)||0===(g=a(f.opt.scrollParent)).length?f.$scrollParent=a(document):f.$scrollParent=g.is("html")?a(document):g,f.$el.data(b.DATA_TEMPLATE,f),d.empty(f.opt.on)||f.$el.on(f.opt.on),f._undo.classes=f.$el.attr("class"),f._undo.style=f.$el.attr("style"),f.$el.is(f.sel.container)||f.$el.addClass(f.cls.container);var h=c.selectify(f.opt.classes);return null==h||f.$el.is(h)||f.$el.addClass(f.opt.classes),f.robserver.observe(f.$el.get(0)),0===f.$el.children().not(f.sel.item.elem).length&&(f.$el.append(f.createChildren()),f._undo.children=!0),!f.raise("pre-init").isDefaultPrevented()},init:function(){var a=this;return a.raise("init").isDefaultPrevented()?e.rejectWith("init default prevented"):a.items.fetch()},postInit:function(){var b=this;return!b.destroying&&(!b.raise("post-init").isDefaultPrevented()&&(b.state.init(),b.$scrollParent.on("scroll"+b.namespace,{self:b},e.throttle(function(){b.loadAvailable()},50)),a(window).on("popstate"+b.namespace,{self:b},b.onWindowPopState),!0))},firstLoad:function(){var a=this;return a.destroying?e.rejected:(a.raise("first-load"),a.loadAvailable())},ready:function(){var a=this;return!a.destroying&&(a.initializing=!1,a.initialized=!0,a._check(1e3),a.raise("ready"),!0)},create:function(){var b=this;return a("<div/>",{id:b.id,class:b.cls.container}).addClass(b.opt.classes)},createChildren:function(){return a()},destroy:function(b){var c=this,f=c._super.bind(c);return c.destroyed?e.resolved:(c.destroying=!0,a.Deferred(function(a){c.initializing&&d.promise(c._initialize)?c._initialize.always(function(){c.destroying=!1,c.doDestroy(b),a.resolve()}):(c.destroying=!1,c.doDestroy(b),a.resolve())}).then(function(){f()}).promise())},doDestroy:function(c){var e=this;e.destroyed||(e.raise("destroy"),e.robserver.disconnect(),e._checkTimeout&&clearTimeout(e._checkTimeout),e.$scrollParent.off(e.namespace),a(window).off(e.namespace),e.state.destroy(c),e.filter&&e.filter.destroy(),e.pages&&e.pages.destroy(),e.items.destroy(),d.empty(e.opt.on)||e.$el.off(e.opt.on),e.raise("destroyed"),e.$el.removeData(b.DATA_TEMPLATE),d.empty(e._undo.classes)?e.$el.removeAttr("class"):e.$el.attr("class",e._undo.classes),d.empty(e._undo.style)?e.$el.removeAttr("style"):e.$el.attr("style",e._undo.style),e._undo.children&&e.destroyChildren(),e._undo.create&&e.$el.remove(),e.$el=e.state=e.items=e.pages=null,e.destroyed=!0,e.initializing=!1,e.initialized=!1)},destroyChildren:function(){},getAvailable:function(){return this.pages?this.pages.available():this.items.available()},loadAvailable:function(){return this.items.load(this.getAvailable())},getItems:function(){return this.pages?this.pages.items():this.items.available()},_check:function(a){a=d.number(a)?a:0;var b=this;return b._checkTimeout&&clearTimeout(b._checkTimeout),b._checkTimeout=setTimeout(function(){b._checkTimeout=null,!b.initialized||b.destroying&&b.destroyed||b.loadAvailable()},a)},raise:function(c,e){if(this.destroying||this.destroyed||!d.string(c)||d.empty(c))return null;e=d.array(e)?e:[];var g=this,h=c.split(".")[0],i=f.camel("on-"+h),j=a.Event(h+".foogallery");return e.unshift(g),g.trigger(h,e).defaultPrevented&&j.preventDefault(),g.$el.trigger(j,e),b.debug.logf("{id}|{name}:",{id:g.id,name:h},e),d.fn(g[i])&&(e.unshift(j),g[i].apply(g.$el.get(0),e)),j},layout:function(){var a=this;null!==a._initialize&&a.raise("layout")},getContainerWidth:function(){var a=this;return a.$el.is(":visible")?a.$el.width():a.$el.parents(":visible:first").innerWidth()},getCSSClass:function(a,b){b=d.empty(b)?"":b;var c=a instanceof RegExp?a:d.string(a)&&this.opt.regex.hasOwnProperty(a)?this.opt.regex[a]:null,e=this.$el.prop("className")||"",f=null!=c?e.match(c):null;return null!=f&&f.length>=2?f[1]:b},onWindowPopState:function(a){var b=a.data.self,c=a.originalEvent.state;d.empty(c)||c.id!==b.id||(b.state.set(c),b.loadAvailable())}}),b.template.register("core",b.Template,{id:null,type:"core",classes:"",on:{},lazy:!0,viewport:200,items:[],fixLayout:!0,scrollParent:null,delay:0,throttle:50,timeout:6e4,srcset:"data-srcset-fg",src:"data-src-fg",template:{},regex:{theme:/(?:\s|^)(fg-(?:light|dark|custom))(?:\s|$)/,loadingIcon:/(?:\s|^)(fg-loading-(?:default|bars|dots|partial|pulse|trail))(?:\s|$)/,hoverIcon:/(?:\s|^)(fg-hover-(?:zoom|zoom2|zoom3|plus|circle-plus|eye|external|tint))(?:\s|$)/,videoIcon:/(?:\s|^)(fg-video-(?:default|1|2|3|4))(?:\s|$)/,hoverColor:/(?:\s|^)(fg-hover-(?:colorize|grayscale))(?:\s|$)/,hoverScale:/(?:\s|^)(fg-hover-scale)(?:\s|$)/,stickyVideoIcon:/(?:\s|^)(fg-video-sticky)(?:\s|$)/,insetShadow:/(?:\s|^)(fg-shadow-inset-(?:small|medium|large))(?:\s|$)/,filter:/(?:\s|^)(fg-filter-(?:1977|amaro|brannan|clarendon|earlybird|lofi|poprocket|reyes|toaster|walden|xpro2|xtreme))(?:\s|$)/}},{container:"foogallery"},{},-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){a.Component=b.Class.extend({construct:function(a){this.tmpl=a},destroy:function(){this.tmpl=null}}),a.EventComponent=b.EventClass.extend({construct:function(a,b){this._super(a),this.tmpl=a,this.tmplEventPrefix=b},destroy:function(){this._super(),this.tmpl=null},trigger:function(a,d){var e,f,g=this,h=g._super(a,d);return null!=g.tmpl&&(h instanceof b.Event&&!h.isDefaultPrevented()?(e=null!=h.namespace?[h.type,h.namespace].join("."):h.type,(f=g.tmpl.raise(g.tmplEventPrefix+e,d))&&f.isDefaultPrevented()&&h.preventDefault()):c.array(h)&&h.forEach(function(a){a.isDefaultPrevented()||(e=null!=a.namespace?[a.type,a.namespace].join("."):a.type,(f=g.tmpl.raise(g.tmplEventPrefix+e,d))&&f.isDefaultPrevented()&&a.preventDefault())})),c.empty(h)?null:1===h.length?h[0]:h}}),a.components=new b.Factory}(FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e){b.State=b.Component.extend({construct:function(a){var b=this;b._super(a),b.apiEnabled=!!window.history&&!!history.replaceState,b.opt=b.tmpl.opt.state,b.enabled=b.opt.enabled,b.current={filter:[],page:0,item:null},b.pushOrReplace=b.isPushOrReplace(b.opt.pushOrReplace)?b.opt.pushOrReplace:"replace",b.defaultMask="foogallery-gallery-{id}";var c=d.escapeRegExp(b.tmpl.id),e=d.escapeRegExp(b.getMasked()),f=d.escapeRegExp(b.opt.values),g=d.escapeRegExp(b.opt.pair);b.regex={exists:new RegExp("^#"+c+"\\"+f+".+?"),masked:new RegExp("^#"+e+"\\"+f+".+?"),values:new RegExp("(\\w+)"+g+"([^"+f+"]+)","g")}},destroy:function(a){var b=this;a||b.clear(),b.opt=b.regex={},b._super()},init:function(){this.set(this.initial())},getIdNumber:function(){return this.tmpl.id.match(/\d+/g)[0]},getMasked:function(){var a=this,b=d.contains(a.opt.mask,"{id}")?a.opt.mask:a.defaultMask;return d.format(b,{id:a.getIdNumber()})},isPushOrReplace:function(b){return-1!==a.inArray(b,["push","replace"])},exists:function(){return this.regex.values.lastIndex=0,(this.regex.exists.test(location.hash)||this.regex.masked.test(location.hash))&&this.regex.values.test(location.hash)},parse:function(){var b=this,c=b.tmpl,d={};if(b.exists())if(b.enabled){d.id=b.tmpl.id,b.regex.values.lastIndex=0;var e=location.hash.match(b.regex.values);a.each(e,function(a,e){var f,g=e.split(b.opt.pair);if(2===g.length)switch(g[0]){case b.opt.itemKey:f=c.items.fromHash(g[1]),null!==f&&(d.item=f);break;case b.opt.pageKey:c.pages&&null!==(f=c.pages.fromHash(g[1]))&&(d.page=f);break;case b.opt.filterKey:c.filter&&null!==(f=c.filter.fromHash(g[1]))&&(d.filter=f)}})}else b.apiEnabled?history.replaceState(null,"",location.pathname+location.search):location.hash="#";return d},hashify:function(a){var b=this,d=b.tmpl;if(c.hash(a)){var e=[],f=d.items.toHash(a.item);return null!==f&&e.push(b.opt.itemKey+b.opt.pair+f),d.filter&&null!==(f=d.filter.toHash(a.filter))&&e.push(b.opt.filterKey+b.opt.pair+f),d.pages&&null!==(f=d.pages.toHash(a.page))&&e.push(b.opt.pageKey+b.opt.pair+f),e.length>0&&e.unshift("#"+b.getMasked()),e.join(b.opt.values)}return""},replace:function(a){var d=this;if(d.enabled&&d.apiEnabled){a.id=d.tmpl.id;var f=d.hashify(a),g=c.empty(f),h=e.extend({},a,{item:a.item instanceof b.Item?a.item.id:a.item});history.replaceState(g?null:h,"",g?location.pathname+location.search:f)}},push:function(a){var d=this;if(d.enabled&&d.apiEnabled){a.id=d.tmpl.id;var f=d.hashify(a),g=c.empty(f),h=e.extend({},a,{item:a.item instanceof b.Item?a.item.id:a.item});history.pushState(g?null:h,"",g?location.pathname+location.search:f)}},update:function(a,b){var c=this;c.enabled&&c.apiEnabled&&(b=c.isPushOrReplace(b)?b:c.pushOrReplace,c[b](a))},clear:function(){this.exists()&&this.replace({})},initial:function(){var a=this,b=a.parse();return c.empty(b)?a.get():e.extend({filter:[],page:1,item:null},b)},get:function(a){var c,d=this,f=d.tmpl,g={};return a instanceof b.Item&&(g.item=a),f.filter&&null!==(c=f.filter.getState())&&(g.filter=c),f.pages&&null!==(c=f.pages.getState())&&(g.page=c),e.extend({filter:[],page:1,item:null},g)},set:function(a){var b=this,d=b.tmpl;if(c.hash(a)){var f=e.extend({filter:[],page:1,item:null},a);d.items.reset();d.raise("before-state",[f]).isDefaultPrevented()||(d.filter&&d.filter.setState(f),d.pages?d.pages.setState(f):(d.items.detach(d.items.all()),d.items.create(d.items.available(),!0)),f.item&&(b.opt.scrollTo&&f.item.scrollTo(),c.empty(a.item)||(a.item=null,b.replace(a))),b.current=f,d.raise("after-state",[f]))}}}),b.template.configure("core",{state:{enabled:!1,scrollTo:!0,pushOrReplace:"replace",mask:"foogallery-gallery-{id}",values:"/",pair:":",array:"+",arraySeparator:",",itemKey:"i",filterKey:"f",pageKey:"p"}}),b.components.register("state",b.State)}(FooGallery.$,FooGallery,FooGallery.utils.is,FooGallery.utils.str,FooGallery.utils.obj),function(a,b,c,d,e,f){b.Items=b.Component.extend({construct:function(a){var b=this;b.ALLOW_CREATE=!0,b.ALLOW_APPEND=!0,b.ALLOW_LOAD=!0,b._super(a),b.maps={},b._fetched=null,b._arr=[],b._available=[];var d=b.tmpl.cls.item.caption;b.tmpl.sel.item.caption.all=c.selectify([d.elem,d.inner,d.title,d.description])},fromHash:function(a){return this.get(a)},toHash:function(a){return a instanceof b.Item?a.id:null},destroy:function(){var b=this,c=b.all(),d=[];c.length>0&&(b.tmpl.raise("destroy-items",[c]),d=a.map(c,function(a){return a.destroy()?a:null}),d.length>0&&b.tmpl.raise("destroyed-items",[d])),b.maps={},b._fetched=null,b._arr=[],b._available=[],b._super()},fetch:function(b){var c=this;if(!b&&d.promise(c._fetched))return c._fetched;var e=c.tmpl,f=e.sel,g=e.opt.items,h=a.Deferred(),i=c.make(e.$el.find(f.item.elem));return d.empty(g)?(i.push.apply(i,c.make(window[e.id+"-items"])),h.resolve(i)):d.array(g)?(i.push.apply(i,c.make(g)),h.resolve(i)):d.string(g)?a.get(g).then(function(a){i.push.apply(i,c.make(a)),h.resolve(i)},function(a,b,c){console.log("FooGallery: GET items error.",g,a,b,c),h.resolve(i)}):h.resolve(i),h.then(function(a){c.setAll(a)}),c._fetched=h.promise()},toJSON:function(a){return(a?this.all():this.available()).map(function(a){return a.toJSON()})},all:function(){return this._arr.slice()},count:function(a){return a?this.all().length:this.available().length},available:function(a){return d.fn(a)?this._available.filter(a,this):this._available.slice()},get:function(a){var b=d.number(a)?"index":"id";return this.maps[b][a]?this.maps[b][a]:null},setAll:function(a){this._arr=d.array(a)?a:[],this.maps=this.createMaps(this._arr),this._available=this.all()},setAvailable:function(a){this.maps=this.createMaps(this._arr),this._available=d.array(a)?a:[]},reset:function(){this.setAvailable(this.all())},find:function(a,b){if(b=d.fn(b)?b:function(){return!0},d.array(a))for(var c=0,e=a.length;c<e;c++)if(!0===b.call(this,a[c]))return a[c];return null},first:function(a){return this.find(this._available,a)},last:function(a){return this.find(this._available.slice().reverse(),a)},next:function(a,c,e){if(!(a instanceof b.Item))return null;e=!!d.boolean(e)&&e;var f=this._available.slice(),g=f.indexOf(a);if(-1!==g){var h=f.slice(0,g);return f=f.slice(g+1),e&&(f=f.concat(h)),this.find(f,c)}return null},prev:function(a,c,e){if(!(a instanceof b.Item))return null;e=!!d.boolean(e)&&e;var f=this._available.slice().reverse(),g=f.indexOf(a);if(-1!==g){var h=f.slice(0,g);return f=f.slice(g+1),e&&(f=f.concat(h)),this.find(f,c)}return null},createMaps:function(b){b=d.array(b)?b:[];var c={id:{},index:{}};return a.each(b,function(a,b){d.empty(b.id)&&(b.id=""+(a+1)),b.index=a,c.id[b.id]=b,c.index[b.index]=b}),c},loadable:function(b){var e,f=this,g=f.tmpl.opt;return g.lazy&&(e=c.getViewportBounds(g.viewport)),f.ALLOW_LOAD&&d.array(b)?a.map(b,function(a){return a.isCreated&&a.isAttached&&!a.isLoading&&!a.isLoaded&&!a.isError&&(!g.lazy||g.lazy&&a.intersects(e))?a:null}):[]},creatable:function(c){return this.ALLOW_CREATE&&d.array(c)?a.map(c,function(a){return a instanceof b.Item&&!a.isCreated?a:null}):[]},appendable:function(c){return this.ALLOW_APPEND&&d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&!a.isAttached?a:null}):[]},detachable:function(c){return d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&a.isAttached?a:null}):[]},jquerify:function(b){return a(a.map(b,function(a){return a.$el.get()}))},make:function(c){var e=this,g=[];if(d.jq(c)||d.array(c)){var h=[],i=a.makeArray(c);if(0===i.length)return g;e.tmpl.raise("make-items",[i]).isDefaultPrevented()||(g=a.map(i,function(a){var c=e.type(a),g=f.extend(d.hash(a)?a:{},{type:c}),i=b.components.make(c,e.tmpl,g);return d.element(a)?i.parse(a)?(h.push(i),e.ALLOW_APPEND||i.detach(),i):null:i})),
11
- g.length>0&&e.tmpl.raise("made-items",[g]),h.length>0&&e.tmpl.raise("parsed-items",[h])}return g},type:function(c){var e;if(d.hash(c))e=c.type;else if(d.element(c)){var f=a(c),g=this.tmpl.sel.item;e=f.find(g.anchor).data("type")}return d.string(e)&&b.components.contains(e)?e:"image"},create:function(b,c){var e=this,f=[],g=e.creatable(b);if(g.length>0){e.tmpl.raise("create-items",[g]).isDefaultPrevented()||(f=a.map(g,function(a){return a.create()?a:null})),f.length>0&&e.tmpl.raise("created-items",[f])}return d.boolean(c)&&c?e.append(b):f},append:function(b){var c=this,d=[],e=c.appendable(b);if(e.length>0){c.tmpl.raise("append-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.append()?a:null})),d.length>0&&c.tmpl.raise("appended-items",[d])}return d},detach:function(b){var c=this,d=[],e=c.detachable(b);if(e.length>0){c.tmpl.raise("detach-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.detach()?a:null})),d.length>0&&c.tmpl.raise("detached-items",[d])}return d},load:function(b){var c=this;if(b=c.loadable(b),b.length>0){if(!c.tmpl.raise("load-items",[b]).isDefaultPrevented()){var d=a.map(b,function(a){return a.load()});return e.when(d).done(function(a){c.tmpl.raise("loaded-items",[a])})}}return e.resolveWith([])}}),b.components.register("items",b.Items)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f,g){b.Item=b.Component.extend({construct:function(a,b){var c=this;c._super(a),c.cls=a.cls.item,c.il8n=a.il8n.item,c.sel=a.sel.item,c.opt=f.extend({},a.opt.item,b),c.isAttached=!1,c.isCreated=!1,c.isDestroyed=!1,c.isLoading=!1,c.isLoaded=!1,c.isError=!1,c.isParsed=!1,c.$el=null,c.$inner=null,c.$anchor=null,c.$overlay=null,c.$wrap=null,c.$image=null,c.$caption=null,c.fixLayout=c.tmpl.opt.fixLayout,c.index=-1,c.type=c.opt.type,c.id=c.opt.id,c.productId=c.opt.productId,c.href=c.opt.href,c.src=c.opt.src,c.srcset=c.opt.srcset,c.width=c.opt.width,c.height=c.opt.height,c.title=c.opt.title,c.alt=c.opt.alt,c.caption=d.empty(c.opt.caption)?c.title:c.opt.caption,c.description=d.empty(c.opt.description)?c.alt:c.opt.description,c.attr=c.opt.attr,c.tags=c.opt.tags,c.maxWidth=c.opt.maxWidth,c.maxCaptionLength=c.opt.maxCaptionLength,c.maxDescriptionLength=c.opt.maxDescriptionLength,c.showCaptionTitle=c.opt.showCaptionTitle,c.showCaptionDescription=c.opt.showCaptionDescription,c.noLightbox=c.opt.noLightbox,c.panelHide=c.opt.panelHide,c.exif=c.opt.exif,c.hasExif=d.exif(c.exif),c._thumbUrl=null,c._load=null,c._undo={classes:"",style:"",loader:!1,wrap:!1,overlay:!1,placeholder:!1}},destroy:function(){var a=this;return a.tmpl.raise("destroy-item",[a]).isDefaultPrevented()||(a.isDestroyed=a.doDestroyItem()),a.isDestroyed&&(a.tmpl.raise("destroyed-item",[a]),a._super()),a.isDestroyed},doDestroyItem:function(){var a=this;return a.isParsed?(a.$anchor.add(a.$caption).off("click.foogallery"),a.append(),d.empty(a._undo.classes)?a.$el.removeAttr("class"):a.$el.attr("class",a._undo.classes),d.empty(a._undo.style)?a.$el.removeAttr("style"):a.$el.attr("style",a._undo.style),a._undo.overlay&&a.$overlay.remove(),a._undo.wrap&&(a.$anchor.append(a.$image),a.$wrap.remove()),a._undo.loader&&a.$el.find(a.sel.loader).remove(),a._undo.placeholder&&a.$image.prop("src")===b.EMPTY_IMAGE&&a.$image.removeAttr("src")):a.isCreated&&(a.detach(),a.$el.remove()),!0},parse:function(b){var c=this,d=a(b);return!c.tmpl.raise("parse-item",[c,d]).isDefaultPrevented()&&(c.isCreated=d.is(c.sel.elem))&&(c.isParsed=c.doParseItem(d),c.fixLayout&&c.fix()),c.isParsed&&c.tmpl.raise("parsed-item",[c]),c.isParsed},doParseItem:function(c){var e=this,g=e.tmpl.opt,h=e.cls,i=e.sel;if(e._undo.classes=c.attr("class")||"",e._undo.style=c.attr("style")||"",e.$el=c.data(b.DATA_ITEM,e),e.$inner=e.$el.children(i.inner),e.$anchor=e.$inner.children(i.anchor).on("click.foogallery",{self:e},e.onAnchorClick),e.$image=e.$anchor.find(i.image),e.$caption=e.$inner.children(i.caption.elem).on("click.foogallery",{self:e},e.onCaptionClick),!(e.$el.length&&e.$inner.length&&e.$anchor.length&&e.$image.length))return console.error("FooGallery Error: Invalid HTML markup. Check the item markup for additional elements or malformed HTML in the title or description.",e),e.isError=!0,e.tmpl.raise("error-item",[e]),0!==e.$el.length&&e.$el.remove(),!1;e.isAttached=e.$el.parent().length>0,e.isLoading=e.$el.is(i.loading),e.isLoaded=e.$el.is(i.loaded),e.isError=e.$el.is(i.error);var j=e.$anchor.attr("data-type",e.type).data();e.id=j.id||e.id,e.productId=j.productId||e.productId,e.tags=j.tags||e.tags,e.href=j.href||e.$anchor.attr("href")||e.href,e.src=e.$image.attr(g.src)||e.src,e.srcset=e.$image.attr(g.srcset)||e.srcset,e.width=parseInt(e.$image.attr("width"))||e.width,e.height=parseInt(e.$image.attr("height"))||e.height,e.title=e.$image.attr("title")||e.title,e.alt=e.$image.attr("alt")||e.alt,e.caption=j.title||j.captionTitle||e.caption||e.title,e.description=j.description||j.captionDesc||e.description||e.alt,e.noLightbox=e.$anchor.hasClass(h.noLightbox),e.panelHide=e.$anchor.hasClass(h.panelHide),d.exif(j.exif)&&(e.exif=f.extend(e.exif,j.exif),e.hasExif=!0),d.empty(e.caption)&&(e.caption=a.trim(e.$caption.find(i.caption.title).html())),d.empty(e.description)&&(e.description=a.trim(e.$caption.find(i.caption.description).html())),d.number(e.maxCaptionLength)&&e.maxCaptionLength>0&&!d.empty(e.caption)&&d.string(e.caption)&&e.caption.length>e.maxCaptionLength&&e.$caption.find(i.caption.title).html(e.caption.substr(0,e.maxCaptionLength)+"&hellip;"),d.number(e.maxDescriptionLength)&&e.maxDescriptionLength>0&&!d.empty(e.description)&&d.string(e.description)&&e.description.length>e.maxDescriptionLength&&e.$caption.find(i.caption.description).html(e.description.substr(0,e.maxDescriptionLength)+"&hellip;"),e.$overlay=e.$anchor.children(i.overlay),0===e.$overlay.length&&(e.$overlay=a("<span/>",{class:h.overlay}),e.$anchor.append(e.$overlay),e._undo.overlay=!0),e.$wrap=e.$anchor.children(i.wrap),0===e.$wrap.length&&(e.$wrap=a("<span/>",{class:h.wrap}),e.$anchor.append(e.$wrap.append(e.$image)),e._undo.wrap=!0),0===e.$el.children(i.loader).length&&(e.$el.append(a("<div/>",{class:h.loader})),e._undo.loader=!0);var k=e.$image.get(0);return d.empty(k.src)&&(k.src=b.EMPTY_IMAGE,e._undo.placeholder=!0),e.$el.addClass(e.getTypeClass()),e.hasExif&&e.$el.addClass(h.exif),!e.isCreated||!e.isAttached||e.isLoading||e.isLoaded||e.isError||e.$el.addClass(h.idle),!0},create:function(){var a=this;if(!a.isCreated&&d.string(a.href)&&d.string(a.src)&&d.number(a.width)&&d.number(a.height)){a.tmpl.raise("create-item",[a]).isDefaultPrevented()||(a.isCreated=a.doCreateItem()),a.isCreated&&a.tmpl.raise("created-item",[a])}return a.isCreated},doCreateItem:function(){var c=this,e=c.tmpl.opt,f=c.cls,g=c.attr,h=c.getTypeClass(),i=c.hasExif?f.exif:"";g.elem.class=[f.elem,h,i,f.idle].join(" "),g.inner.class=f.inner;var j=[f.anchor];c.noLightbox&&j.push(f.noLightbox),c.panelHide&&j.push(f.panelHide),g.anchor.class=j.join(" "),g.anchor.href=c.href,g.anchor["data-type"]=c.type,g.anchor["data-id"]=c.id,g.anchor["data-title"]=c.caption,g.anchor["data-description"]=c.description,d.empty(c.tags)||(g.anchor["data-tags"]=JSON.stringify(c.tags)),d.empty(c.productId)||(g.anchor["data-product-id"]=c.productId),g.image.class=f.image,g.image[e.src]=c.src,g.image[e.srcset]=c.srcset,g.image.width=c.width,g.image.height=c.height,g.image.title=c.title,g.image.alt=c.alt,c.$el=a("<div/>").attr(g.elem).data(b.DATA_ITEM,c),c.$inner=a("<figure/>").attr(g.inner).appendTo(c.$el),c.$anchor=a("<a/>").attr(g.anchor).appendTo(c.$inner).on("click.foogallery",{self:c},c.onAnchorClick),c.$overlay=a("<span/>",{class:f.overlay}).appendTo(c.$anchor),c.$wrap=a("<span/>",{class:f.wrap}).appendTo(c.$anchor),c.$image=a("<img/>").attr(g.image).appendTo(c.$wrap),f=c.cls.caption,g=c.attr.caption,g.elem.class=f.elem,c.$caption=a("<figcaption/>").attr(g.elem).on("click.foogallery",{self:c},c.onCaptionClick),g.inner.class=f.inner;var k=a("<div/>").attr(g.inner).appendTo(c.$caption),l=c.showCaptionTitle&&!d.empty(c.caption),m=c.showCaptionDescription&&!d.empty(c.description);if(l||m){if(g.title.class=f.title,g.description.class=f.description,l){var n=a("<div/>").attr(g.title),o=c.caption;d.number(c.maxCaptionLength)&&c.maxCaptionLength>0&&d.string(c.caption)&&c.caption.length>c.maxCaptionLength&&(o=c.caption.substr(0,c.maxCaptionLength)+"&hellip;"),n.get(0).innerHTML=o,k.append(n)}if(m){var p=a("<div/>").attr(g.description),q=c.description;d.number(c.maxDescriptionLength)&&c.maxDescriptionLength>0&&d.string(c.description)&&c.description.length>c.maxDescriptionLength&&(q=c.description.substr(0,c.maxDescriptionLength)+"&hellip;"),p.get(0).innerHTML=q,k.append(p)}}return c.$caption.appendTo(c.$inner),0===c.$el.find(c.sel.loader).length&&c.$el.append(a("<div/>",{class:c.cls.loader})),!0},append:function(){var a=this;if(a.isCreated&&!a.isAttached){a.tmpl.raise("append-item",[a]).isDefaultPrevented()||(a.tmpl.$el.append(a.$el),!a.fixLayout&&a.isParsed||a.fix(),a.isAttached=!0),a.isAttached&&a.tmpl.raise("appended-item",[a])}return a.isAttached},detach:function(){var a=this;if(a.isCreated&&a.isAttached){a.tmpl.raise("detach-item",[a]).isDefaultPrevented()||(a.$el.detach(),!a.fixLayout&&a.isParsed||a.unfix(),a.isAttached=!1),a.isAttached||a.tmpl.raise("detached-item",[a])}return!a.isAttached},load:function(){var b=this;if(d.promise(b._load))return b._load;if(!b.isCreated||!b.isAttached)return e.rejectWith("not created or attached");if(b.tmpl.raise("load-item",[b]).isDefaultPrevented())return e.rejectWith("default prevented");var c=b.cls,f=b.$image.get(0),g=f.src;return b.isLoading=!0,b.$el.removeClass(c.idle).removeClass(c.loaded).removeClass(c.error).addClass(c.loading),b._load=a.Deferred(function(a){f.onload=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isLoaded=!0,b.$el.removeClass(c.loading).addClass(c.loaded),!b.fixLayout&&b.isParsed||b.unfix(),b.tmpl.raise("loaded-item",[b]),a.resolve(b)},f.onerror=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isError=!0,b.$el.removeClass(c.loading).addClass(c.error),d.string(g)&&b.$image.prop("src",g),b.tmpl.raise("error-item",[b]),a.reject(b)},f.src=b.getThumbUrl(),f.complete&&f.onload()}).promise()},fix:function(){var a=this;if(null==a.tmpl)return a;if(a.isCreated&&!a.isLoading&&!a.isLoaded&&!a.isError){var b=a.width,c=a.height,e=a.$image.get(0);if(!isNaN(b)&&!isNaN(c)&&e){var f=d.fn(a.maxWidth)?a.maxWidth(a):a.$image.width();f<=0&&(f=b);var g=f/b,h=c*g;a.$image.css({width:f,height:h})}}return a},unfix:function(){var a=this;return null==a.tmpl?a:(a.isCreated&&a.$image.css({width:"",height:""}),a)},getThumbSrc:function(a,b){return c.src(this.src,this.srcset,this.width,this.height,a,b)},getThumbUrl:function(a){a=!!d.boolean(a)&&a;var b=this;return!a&&d.string(b._thumbUrl)?b._thumbUrl:b._thumbUrl=b.getThumbSrc(b.$anchor.innerWidth(),b.$anchor.innerHeight())},getTypeClass:function(){return this.cls.types.hasOwnProperty(this.type)?this.cls.types[this.type]:""},scrollTo:function(a){var b=this;if(b.isAttached){var d=b.bounds(),e=c.getViewportBounds();switch(a){case"top":d.left+=d.width/2-e.width/2,d.top-=e.height/5;break;default:d.left+=d.width/2-e.width/2,d.top+=d.height/2-e.height/2}window.scrollTo(d.left,d.top)}return b},bounds:function(){return this.isAttached?c.getElementBounds(this.$el):null},intersects:function(a){return!!this.isAttached&&this.bounds().intersects(a)},updateState:function(){this.tmpl.state.update(this.tmpl.state.get(this))},toJSON:function(){return{type:this.type,id:this.id,productId:this.productId,href:this.href,src:this.src,srcset:this.srcset,width:this.width,height:this.height,alt:this.alt,title:this.title,caption:this.caption,description:this.description,tags:this.tags.slice(),maxCaptionLength:this.maxCaptionLength,maxDescriptionLength:this.maxDescriptionLength,showCaptionTitle:this.showCaptionTitle,showCaptionDescription:this.showCaptionDescription,noLightbox:this.noLightbox,panelHide:this.panelHide,attr:f.extend({},this.attr)}},onAnchorClick:function(a){var b=a.data.self;b.tmpl.raise("anchor-click-item",[b]).isDefaultPrevented()?a.preventDefault():b.updateState()},onCaptionClick:function(b){var c=b.data.self;!c.tmpl.raise("caption-click-item",[c]).isDefaultPrevented()&&c.$anchor.length>0&&!a(b.target).is("a,:input")&&c.$anchor.get(0).click()}}),b.template.configure("core",{item:{type:"item",id:"",href:"",src:"",srcset:"",width:0,height:0,title:"",alt:"",caption:"",description:"",tags:[],maxWidth:null,maxCaptionLength:0,maxDescriptionLength:0,showCaptionTitle:!0,showCaptionDescription:!0,noLightbox:!1,panelHide:!1,exif:{aperture:null,camera:null,date:null,exposure:null,focalLength:null,iso:null,orientation:null},attr:{elem:{},inner:{},anchor:{},image:{},caption:{elem:{},inner:{},title:{},description:{}}}}},{item:{elem:"fg-item",inner:"fg-item-inner",exif:"fg-item-exif",anchor:"fg-thumb",overlay:"fg-image-overlay",wrap:"fg-image-wrap",image:"fg-image",loader:"fg-loader",idle:"fg-idle",loading:"fg-loading",loaded:"fg-loaded",error:"fg-error",noLightbox:"fg-no-lightbox",panelHide:"fg-panel-hide",types:{item:"fg-type-unknown"},caption:{elem:"fg-caption",inner:"fg-caption-inner",title:"fg-caption-title",description:"fg-caption-desc"}}},{item:{exif:{aperture:"Aperture",camera:"Camera",date:"Date",exposure:"Exposure",focalLength:"Focal Length",iso:"ISO",orientation:"Orientation"}}}),b.components.register("item",b.Item)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj,FooGallery.utils.str),function(a,b,c,d){b.Image=b.Item.extend({}),b.template.configure("core",null,{item:{types:{image:"fg-type-image"}}}),b.components.register("image",b.Image)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Paging=b.Component.extend({construct:function(a){var b=this;b._super(a),b.opt=b.tmpl.opt.paging,b.cls=b.tmpl.cls.paging,b.il8n=b.tmpl.il8n.paging,b.sel=b.tmpl.sel.paging,b.pushOrReplace=b.opt.pushOrReplace,b.type=b.opt.type,b.theme=b.opt.theme,b.size=b.opt.size,b.position=b.opt.position,b.scrollToTop=b.opt.scrollToTop,b.current=0,b.total=0,b.ctrls=[],b._arr=[]},fromHash:function(a){var b=parseInt(a);return isNaN(b)?null:b},toHash:function(a){return d.number(a)&&a>0?a.toString():null},getState:function(){return this.isValid(this.current)?this.current:null},setState:function(a){this.rebuild(),a.item&&!this.contains(a.page,a.item)&&(a.page=this.find(a.item),a.page=0!==a.page?a.page:1),this.set(a.page,!1,!1,!0)},destroy:function(){var b=this;b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b._super()},build:function(){var a=this,c=a.tmpl.items.available();a.total=a.size>0&&c.length>0?Math.ceil(c.length/a.size):1;for(var d=0;d<a.total;d++)a._arr.push(c.splice(0,a.size));if(a.total>1&&b.paging.hasCtrl(a.type)){var e,f,g=a.position;"both"!==g&&"top"!==g||(e=b.paging.makeCtrl(a.type,a.tmpl,a,"top"),e.create()&&(e.append(),a.ctrls.push(e))),"both"!==g&&"bottom"!==g||(f=b.paging.makeCtrl(a.type,a.tmpl,a,"bottom"),f.create()&&(f.append(),a.ctrls.push(f)))}},rebuild:function(){var b=this;b.current=0,b.total=0,b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b.build()},all:function(){return this._arr.slice()},available:function(){return this.get(this.current)},items:function(){return this.get(this.current)},controls:function(b){var c=this;c.isValid(b)&&a.each(c.ctrls,function(a,c){c.update(b)})},isValid:function(a){return d.number(a)&&a>0&&a<=this.total},number:function(a){return this.isValid(a)?a:0===this.current?1:this.current},create:function(a,b){var c=this;a=c.number(a);var d=a-1;c.tmpl.items.detach(c.tmpl.items.all()),c.current=a,c.tmpl.items.create(c._arr[d],!0)},get:function(a){var b=this;return b.isValid(a)?(a=b.number(a),b._arr[a-1]):[]},set:function(a,b,c,e){var f=this;if(f.isValid(a)){var g,h=f.number(a);if(h!==f.current){var i=f.current,j=function(){if(c=!d.boolean(c)||c,e=!!d.boolean(e)&&e,c&&1===f.current&&!f.tmpl.state.exists()&&(g=f.tmpl.state.get(),f.tmpl.state.update(g,f.pushOrReplace)),f.controls(a),f.create(h,e),c&&(g=f.tmpl.state.get(),f.tmpl.state.update(g,f.pushOrReplace)),f.scrollToTop&&d.boolean(b)&&b){var j=f.get(f.current);j.length>0&&j[0].scrollTo("top")}f.tmpl.raise("after-page-change",[f.current,i,e])};return!f.tmpl.raise("before-page-change",[f.current,h,j,e]).isDefaultPrevented()&&(j(),!0)}}return!1},find:function(b){for(var c=this,d=0,e=c._arr.length;d<e;d++)if(-1!==a.inArray(b,c._arr[d]))return d+1;return 0},contains:function(b,c){var d=this.get(b);return-1!==a.inArray(c,d)},first:function(){this.goto(1)},last:function(){this.goto(this._arr.length)},prev:function(){this.goto(this.current-1)},next:function(){this.goto(this.current+1)},goto:function(a){var b=this;b.set(a,!0)&&b.tmpl.loadAvailable()}}),b.PagingControl=b.Component.extend({construct:function(a,b,c){var d=this;d._super(a),d.pages=b,d.position=c,d.$container=null},create:function(){var b=this;return b.$container=a("<nav/>",{class:b.pages.cls.container}).addClass(b.pages.theme),!0},destroy:function(){var a=this;a.$container.remove(),a.$container=null},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},update:function(a){}}),b.paging.register("default",b.Paging,null,{type:"none",theme:"fg-light",size:30,pushOrReplace:"push",position:"none",scrollToTop:!0},{container:"fg-paging-container"},null,-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Dots=b.Paging.extend({}),b.DotsControl=b.PagingControl.extend({construct:function(b,c,d){this._super(b,c,d),this.$container=a(),this.$list=a(),this.$items=a()},create:function(){for(var b,c=this,d=c.pages.cls,e=c.pages.il8n,f=[],g=a("<ul/>",{class:d.list}),h=0,i=c.pages.total;h<i;h++)f.push(b=c.createItem(h+1,e.page)),g.append(b);return c.$list=g,c.$container=a("<nav/>",{class:d.container}).addClass(c.pages.theme).append(g),c.$items=a(a.map(f,function(a){return a.get()})),!0},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},destroy:function(){var b=this,c=b.pages.sel;b.$list.find(c.link).off("click.foogallery",b.onLinkClick),b.$container.remove(),b.$container=a(),b.$list=a(),b.$items=a()},update:function(a){this.setSelected(a-1)},setSelected:function(b){var c=this,e=c.pages.cls,f=c.pages.il8n,g=c.pages.sel;c.$items.filter(g.selected).removeClass(e.selected).each(function(b,c){var e=a(c),f=e.data("label"),h=e.find(g.reader);d.string(f)&&0!==h.length&&h.html(f)}),c.$items.eq(b).addClass(e.selected).each(function(b,c){var e=a(c),h=e.find(g.reader),i=h.html();d.string(i)&&0!==h.length&&(e.data("label",i),h.html(f.current))})},createItem:function(b,c,e,f,g){e=d.string(e)?e:b,c=d.string(c)?c:"";var h=this,i=h.pages.opt,j=h.pages.cls,k=a("<a/>",{class:j.link,href:"#page-"+b}).html(e).on("click.foogallery",{self:h,page:b},h.onLinkClick);d.empty(c)||k.attr("title",c.replace(/\{PAGE}/g,b).replace(/\{LIMIT}/g,i.limit+"")),g=d.string(g)?g:c,d.empty(g)||k.prepend(a("<span/>",{class:j.reader,text:g.replace(/\{PAGE}/g,"").replace(/\{LIMIT}/g,i.limit+"")}));var l=a("<li/>",{class:j.item}).append(k);return f=d.string(f)?f:"",d.empty(f)||l.addClass(f),l},onLinkClick:function(b){b.preventDefault();var c=b.data.self,d=b.data.page,e=c.pages.sel;a(this).closest(e.item).is(e.disabled)||(c.pages.set(d,!0),c.tmpl.loadAvailable())}}),b.paging.register("dots",b.Dots,b.DotsControl,{type:"dots",position:"both",pushOrReplace:"push"},{list:"fg-dots",item:"fg-dot-item",link:"fg-dot-link",disabled:"fg-disabled",selected:"fg-selected",visible:"fg-visible",reader:"fg-sr-only"},{current:"Current page",page:"Page {PAGE}"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.DefaultTemplate=b.Template.extend({}),b.template.register("default",b.DefaultTemplate,null,{container:"foogallery fg-default"})}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d){b.MasonryTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.masonry=null,this.style=null,this.$columnWidth=null},getStylesheet:function(){var a=this;return null===a.style&&(a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style)),a.style.sheet},delayedLayout:function(){var a=this;a._delayedLayout&&clearTimeout(a._delayedLayout),a._delayedLayout=setTimeout(function(){a._delayedLayout=null,a.masonry.layout()},20)},onPreInit:function(b,c){var e=c.sel,f=c.cls;f.layouts=a.map(f.layout,function(a){return a}).join(" ");for(var g=a.map(f.layout,function(a,b){return{key:b,value:a}}),h=0,i=g.length;h<i;h++)if(c.$el.hasClass(g[h].value)){c.template.layout=g[h].key;break}d.string(f.layout[c.template.layout])||(c.template.layout="col4");var j,k,l="fixed"===c.template.layout;if(c.template.isFitWidth=l,c.template.percentPosition=!l,c.template.transitionDuration=0,c.template.itemSelector=e.item.elem,c.$el.removeClass(f.layouts).addClass(f.layout[c.template.layout]),l||(0===c.$el.find(e.gutterWidth).length&&c.$el.prepend(a("<div/>").addClass(f.gutterWidth)),c.template.gutter=e.gutterWidth),0===c.$el.find(e.columnWidth).length&&c.$el.prepend(a("<div/>").addClass(f.columnWidth)),l&&d.number(c.template.columnWidth)){var m=c.$el.find(e.columnWidth).width(c.template.columnWidth);j=c.getStylesheet(),k="#"+c.id+e.container+" "+e.item.elem+" { width: "+m.outerWidth()+"px; }",j.insertRule(k,0)}c.template.columnWidth=e.columnWidth,l&&d.number(c.template.gutter)&&(j=c.getStylesheet(),k="#"+c.id+e.container+" "+e.item.elem+" { margin-bottom: "+c.template.gutter+"px; }",j.insertRule(k,0)),c.masonry=new Masonry(c.$el.get(0),c.template)},onPostInit:function(a,b){b.masonry.layout()},onFirstLoad:function(a,b){b.masonry.layout()},onReady:function(a,b){b.delayedLayout()},onDestroy:function(a,b){b._delayedLayout&&clearTimeout(b._delayedLayout),b.$el.find(b.sel.columnWidth).remove(),b.$el.find(b.sel.gutterWidth).remove(),b.style&&b.style.parentNode&&b.style.parentNode.removeChild(b.style)},onDestroyed:function(a,b){b.masonry instanceof Masonry&&b.masonry.destroy()},onLayout:function(a,b){b.masonry.layout()},onParsedItems:function(a,b,c){b.masonry.layout()},onAppendedItems:function(a,b,c){c=b.items.jquerify(c),c=b.masonry.addItems(c),b.masonry.layoutItems(c,!0)},onDetachItem:function(a,b,c){a.isDefaultPrevented()||(a.preventDefault(),b.masonry.remove(c.$el),c.isAttached=!1,c.unfix())},onDetachedItems:function(a,b,c){b.masonry.layout()},onLoadedItems:function(a,b,c){b.masonry.layout()}}),b.template.register("masonry",b.MasonryTemplate,{fixLayout:!0,template:{initLayout:!1,isInitLayout:!1,layout:"col4"}},{container:"foogallery fg-masonry",columnWidth:"fg-column-width",gutterWidth:"fg-gutter-width",layout:{fixed:"fg-masonry-fixed",col2:"fg-masonry-2col",col3:"fg-masonry-3col",col4:"fg-masonry-4col",col5:"fg-masonry-5col"}})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Justified=c.Class.extend({construct:function(c,d){this.tmpl=c,this.$el=c.$el,this.options=a.extend(!0,{},b.Justified.defaults,d),this._items=[]},init:function(){var a=this;d.string(a.options.maxRowHeight)&&(a.options.maxRowHeight.indexOf("%")?a.options.maxRowHeight=a.options.rowHeight*(parseInt(a.options.maxRowHeight)/100):a.options.maxRowHeight=parseInt(a.options.maxRowHeight))},destroy:function(){this.$el.removeAttr("style")},parse:function(){var b=this;return b._items=a.map(b.tmpl.getItems(),function(a,b){return{index:b,width:a.width,height:a.height,top:0,left:0,$item:a.$el}})},getMaxRowHeight:function(){var a=this;return d.string(a.options.maxRowHeight)&&(a.options.maxRowHeight.indexOf("%")?a.options.maxRowHeight=a.options.rowHeight*(parseInt(a.options.maxRowHeight)/100):a.options.maxRowHeight=parseInt(a.options.maxRowHeight)),d.number(a.options.maxRowHeight)?a.options.maxRowHeight:a.options.rowHeight},getContainerWidth:function(){var a=this;return a.$el.is(":visible")?a.$el.width():a.$el.parents(":visible:first").innerWidth()},layout:function(){this.parse();var b=this,c=0,d=b.getContainerWidth(),e=b.getMaxRowHeight(),f=b.rows(d,e);a.each(f,function(a,d){d.visible&&(a>0&&(c+=b.options.margins),c+=d.height),b.render(d)}),b.$el.height(c)},render:function(a){for(var b,c=0,d=a.items.length;c<d;c++)b=a.items[c],a.visible?b.$item.css({width:b.width,height:b.height,top:b.top,left:b.left,display:"",maxHeight:this.options.maxRowHeight>0?this.options.maxRowHeight:""}).addClass("fg-positioned"):b.$item.css("display","none")},justify:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f,h=g/a.width;a.width=a.width*h,a.height=a.height*h,a.top=b,a.height>d&&(a.height=d),a.left=0,a.width<g&&(a.left=(g-a.width)/2),a.width+=f;for(var i,j=a.left,k=0,l=a.items.length;k<l;k++)k>0&&(j+=e.options.margins),i=a.items[k],i.left=j,i.top=b,i.width=i.width*h,i.height=i.height*h,i.height>d&&(i.height=d),j+=i.width;return a.height},position:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f;if(a.top=b,a.left=0,a.width<g)switch(d){case"center":a.left=(g-a.width)/2;break;case"right":a.left=g-a.width}a.width+=f;for(var h,i=a.left,j=0,k=a.items.length;j<k;j++)j>0&&(i+=e.options.margins),h=a.items[j],h.left=i,h.top=b,i+=h.width;return a.height},lastRow:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f,h=a.width/g>e.options.justifyThreshold;switch(e.options.lastRow){case"hide":h?e.justify(a,b,c,d):a.visible=!1;break;case"justify":e.justify(a,b,c,d);break;case"nojustify":h?e.justify(a,b,c,d):e.position(a,b,c,"left");break;case"left":case"center":case"right":h?e.justify(a,b,c,d):e.position(a,b,c,e.options.lastRow)}},items:function(){return a.map(this._items,function(a){return{index:a.index,width:a.width,height:a.height,$item:a.$item,top:a.top,left:a.left}})},rows:function(a,b){function c(){var a={index:++h,visible:!0,width:0,height:e.options.rowHeight,top:0,left:0,items:[]};return g.push(a),a}for(var d,e=this,f=e.items(),g=[],h=-1,i=c(),j=0,k=0,l=0,m=f.length;l<m;l++){if(d=f[l],d.height!=e.options.rowHeight){var n=e.options.rowHeight/d.height;d.height=d.height*n,d.width=d.width*n}k+d.width>a&&l>0&&(g.length>1&&(j+=e.options.margins),j+=e.justify(i,j,a,b),i=c(),k=0),i.items.length>0&&(k+=e.options.margins),k+=d.width,i.width+=d.width,i.items.push(d)}return g.length>1&&(j+=e.options.margins),e.lastRow(i,j,a,b),g}}),b.Justified.defaults={itemSelector:".fg-item",rowHeight:150,maxRowHeight:"200%",margins:0,lastRow:"center",justifyThreshold:1,refreshInterval:250}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.JustifiedTemplate=b.Template.extend({onPreInit:function(a,c){c.justified=new b.Justified(c,c.template)},onInit:function(a,b){b.justified.init()},onFirstLoad:function(a,b){b.justified.layout()},onReady:function(a,b){b.justified.layout()},onDestroy:function(a,b){b.justified.destroy()},onLayout:function(a,b){b.justified.layout()},onAfterPageChange:function(a,b,c,d,e){e||b.justified.layout()},onAfterFilterChange:function(a,b){b.justified.layout()}}),b.template.register("justified",b.JustifiedTemplate,null,{container:"foogallery fg-justified"})}(FooGallery.$,FooGallery,FooGallery.utils.is),function(a,b,c,d,e){b.PortfolioTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.style=null,this.fullWidth=!1},getStylesheet:function(){var a=this;return null===a.style&&(a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style)),a.style.sheet},onPreInit:function(a,b){b.appendCSS()},onPostInit:function(a,b){b.checkCSS()},onDestroy:function(a,b){b.removeCSS()},onLayout:function(a,b){b.checkCSS()},checkCSS:function(){var a=this,b=a.getContainerWidth();b<a.template.columnWidth!==a.fullWidth&&a.appendCSS(b)},appendCSS:function(a){var b=this;a=d.number(a)?a:b.getContainerWidth(),b.removeCSS();var c,e=b.getStylesheet(),f="#"+b.id+b.sel.container,g=f+" "+b.sel.item.elem,h=b.template.columnWidth,i=Math.ceil(b.template.gutter/2);switch(b.template.align){case"center":c=f+" { justify-content: center; }",e.insertRule(c,0);break;case"left":c=f+" { justify-content: flex-start; }",e.insertRule(c,0);break;case"right":c=f+" { justify-content: flex-end; }",e.insertRule(c,0)}b.fullWidth=a<h,b.fullWidth?(c=g+" { max-width: 100%; margin: "+i+"px; }",e.insertRule(c,0)):(c=g+" { max-width: "+h+"px; min-width: "+h+"px; margin: "+i+"px; }",e.insertRule(c,0))},removeCSS:function(){var a=this;a.style&&a.style.parentNode&&(a.style.parentNode.removeChild(a.style),a.style=null,a.fullWidth=!1)}}),b.template.register("simple_portfolio",b.PortfolioTemplate,{template:{gutter:40,align:"center",columnWidth:250}},{container:"foogallery fg-simple_portfolio"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d){b.ImageViewerTemplate=b.Template.extend({construct:function(b,c){this._super(d.extend({},b,{paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),c),this.$inner=a(),this.$current=a(),this.$total=a(),this.$prev=a(),this.$next=a()},createChildren:function(){var b=this;return a("<div/>",{class:b.cls.inner}).append(a("<div/>",{class:b.cls.innerContainer}),a("<div/>",{class:b.cls.controls}).append(a("<div/>",{class:b.cls.prev}).append(a("<span/>",{text:b.il8n.prev})),a("<label/>",{class:b.cls.count,text:b.il8n.count}).prepend(a("<span/>",{class:b.cls.countCurrent,text:"0"})).append(a("<span/>",{class:b.cls.countTotal,text:"0"})),a("<div/>",{class:b.cls.next}).append(a("<span/>",{text:b.il8n.next}))))},destroyChildren:function(){var a=this;a.$el.find(a.sel.inner).remove()},onPreInit:function(a,b){b.$inner=b.$el.find(b.sel.innerContainer),b.$current=b.$el.find(b.sel.countCurrent),b.$total=b.$el.find(b.sel.countTotal),b.$prev=b.$el.find(b.sel.prev),b.$next=b.$el.find(b.sel.next)},onInit:function(a,b){b.template.attachFooBox&&b.$el.on("foobox.previous",{self:b},b.onFooBoxPrev).on("foobox.next",{self:b},b.onFooBoxNext),b.$prev.on("click",{self:b},b.onPrevClick),b.$next.on("click",{self:b},b.onNextClick)},onFirstLoad:function(a,b){b.update()},onDestroy:function(a,b){b.template.attachFooBox&&b.$el.off({"foobox.previous":b.onFooBoxPrev,"foobox.next":b.onFooBoxNext}),b.$prev.off("click",b.onPrevClick),b.$next.off("click",b.onNextClick)},onAppendItem:function(a,b,c){a.preventDefault(),b.$inner.append(c.$el),c.fix(),c.isAttached=!0},onAfterPageChange:function(a,b,c,d,e){e||b.update()},onAfterFilterChange:function(a,b){b.update()},update:function(){this.pages&&(this.$current.text(this.pages.current),this.$total.text(this.pages.total))},prev:function(){this.pages&&(this.template.loop&&1===this.pages.current?this.pages.last():this.pages.prev(),this.update())},next:function(){this.pages&&(this.template.loop&&this.pages.current===this.pages.total?this.pages.first():this.pages.next(),this.update())},onFooBoxPrev:function(a){a.data.self.prev()},onFooBoxNext:function(a){a.data.self.next()},onPrevClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.prev()},onNextClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.next()}}),b.template.register("image-viewer",b.ImageViewerTemplate,{template:{attachFooBox:!1,loop:!1}},{container:"foogallery fg-image-viewer",inner:"fiv-inner",innerContainer:"fiv-inner-container",controls:"fiv-ctrls",prev:"fiv-prev",next:"fiv-next",count:"fiv-count",countCurrent:"fiv-count-current",countTotal:"fiv-count-total"},{prev:"Prev",next:"Next",count:"of"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj),function(a,b,c){b.ThumbnailTemplate=b.Template.extend({construct:function(a,b){this._super(c.extend({},a,{filtering:{type:"none"},paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),b)}}),
12
- b.template.register("thumbnail",b.ThumbnailTemplate,null,{container:"foogallery fg-thumbnail"})}(FooGallery.$,FooGallery,FooGallery.utils.obj),function(a,b,c,d,e){b.triggerPostLoad=function(b,c,d,e,f){if("first-load"===b.type||c.initialized&&("after-page-change"===b.type&&!f||"after-filter-change"===b.type))try{if(c.$el.parents(".fbx-item").length>0)return;c.$el.hasClass("fbx-instance")&&window.FOOBOX&&a.fn.foobox?c.$el.foobox(window.FOOBOX.o):a("body").trigger("post-load")}catch(a){console.error(a)}},b.autoDefaults={on:{"first-load.foogallery after-page-change.foogallery after-filter-change.foogallery":b.triggerPostLoad}},b.autoEnabled=!0,b.auto=function(a){b.autoDefaults=d.merge(b.autoDefaults,a)},b.globalsMerged=!1,b.mergeGlobals=function(){if(!0!==b.globalsMerged&&window.FooGallery_il8n&&e.object(window.FooGallery_il8n)){var a=window.FooGallery_il8n;for(var d in a)if(a.hasOwnProperty(d)&&b[d]instanceof c.Factory&&e.object(a[d]))for(var f in a[d])a[d].hasOwnProperty(f)&&b[d].configure(f,null,null,a[d][f]);b.globalsMerged=!0}},b.load=b.reload=function(){a(function(){b.mergeGlobals(),b.autoEnabled&&a('[id^="foogallery-gallery-"]:not(.fg-ready)').foogallery(b.autoDefaults)}),c.ready(function(){b.mergeGlobals(),b.autoEnabled&&a('[id^="foogallery-gallery-"].fg-ready').foogallery(b.autoDefaults)})},b.load()}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj,FooGallery.utils.is);
1
  /*
2
  * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
+ * @version 1.4.13
4
  * @link
5
  * @copyright Steven Usher & Brad Vincent 2015
6
  * @license Released under the GPLv3 license.
7
  */
8
 
9
  !function(){"use strict";function a(a){this.time=a.time,this.target=a.target,this.rootBounds=a.rootBounds,this.boundingClientRect=a.boundingClientRect,this.intersectionRect=a.intersectionRect||i(),this.isIntersecting=!!a.intersectionRect;var b=this.boundingClientRect,c=b.width*b.height,d=this.intersectionRect,e=d.width*d.height;this.intersectionRatio=c?Number((e/c).toFixed(4)):this.isIntersecting?1:0}function b(a,b){var c=b||{};if("function"!=typeof a)throw new Error("callback must be a function");if(c.root&&1!=c.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=d(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=a,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(c.rootMargin),this.thresholds=this._initThresholds(c.threshold),this.root=c.root||null,this.rootMargin=this._rootMarginValues.map(function(a){return a.value+a.unit}).join(" ")}function c(){return window.performance&&performance.now&&performance.now()}function d(a,b){var c=null;return function(){c||(c=setTimeout(function(){a(),c=null},b))}}function e(a,b,c,d){"function"==typeof a.addEventListener?a.addEventListener(b,c,d||!1):"function"==typeof a.attachEvent&&a.attachEvent("on"+b,c)}function f(a,b,c,d){"function"==typeof a.removeEventListener?a.removeEventListener(b,c,d||!1):"function"==typeof a.detatchEvent&&a.detatchEvent("on"+b,c)}function g(a,b){var c=Math.max(a.top,b.top),d=Math.min(a.bottom,b.bottom),e=Math.max(a.left,b.left),f=Math.min(a.right,b.right),g=f-e,h=d-c;return g>=0&&h>=0&&{top:c,bottom:d,left:e,right:f,width:g,height:h}}function h(a){var b;try{b=a.getBoundingClientRect()}catch(a){}return b?(b.width&&b.height||(b={top:b.top,right:b.right,bottom:b.bottom,left:b.left,width:b.right-b.left,height:b.bottom-b.top}),b):i()}function i(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function j(a,b){for(var c=b;c;){if(c==a)return!0;c=k(c)}return!1}function k(a){var b=a.parentNode;return b&&11==b.nodeType&&b.host?b.host:b&&b.assignedSlot?b.assignedSlot.parentNode:b}if("object"==typeof window){if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return void("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}));var l=window.document,m=[];b.prototype.THROTTLE_TIMEOUT=100,b.prototype.POLL_INTERVAL=null,b.prototype.USE_MUTATION_OBSERVER=!0,b.prototype.observe=function(a){if(!this._observationTargets.some(function(b){return b.element==a})){if(!a||1!=a.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:a,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},b.prototype.unobserve=function(a){this._observationTargets=this._observationTargets.filter(function(b){return b.element!=a}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},b.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},b.prototype.takeRecords=function(){var a=this._queuedEntries.slice();return this._queuedEntries=[],a},b.prototype._initThresholds=function(a){var b=a||[0];return Array.isArray(b)||(b=[b]),b.sort().filter(function(a,b,c){if("number"!=typeof a||isNaN(a)||a<0||a>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return a!==c[b-1]})},b.prototype._parseRootMargin=function(a){var b=a||"0px",c=b.split(/\s+/).map(function(a){var b=/^(-?\d*\.?\d+)(px|%)$/.exec(a);if(!b)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(b[1]),unit:b[2]}});return c[1]=c[1]||c[0],c[2]=c[2]||c[0],c[3]=c[3]||c[1],c},b.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(e(window,"resize",this._checkForIntersections,!0),e(l,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(l,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},b.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,f(window,"resize",this._checkForIntersections,!0),f(l,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},b.prototype._checkForIntersections=function(){var b=this._rootIsInDom(),d=b?this._getRootRect():i();this._observationTargets.forEach(function(e){var f=e.element,g=h(f),i=this._rootContainsTarget(f),j=e.entry,k=b&&i&&this._computeTargetAndRootIntersection(f,d),l=e.entry=new a({time:c(),target:f,boundingClientRect:g,rootBounds:d,intersectionRect:k});j?b&&i?this._hasCrossedThreshold(j,l)&&this._queuedEntries.push(l):j&&j.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},b.prototype._computeTargetAndRootIntersection=function(a,b){if("none"!=window.getComputedStyle(a).display){for(var c=h(a),d=c,e=k(a),f=!1;!f;){var i=null,j=1==e.nodeType?window.getComputedStyle(e):{};if("none"==j.display)return;if(e==this.root||e==l?(f=!0,i=b):e!=l.body&&e!=l.documentElement&&"visible"!=j.overflow&&(i=h(e)),i&&!(d=g(i,d)))break;e=k(e)}return d}},b.prototype._getRootRect=function(){var a;if(this.root)a=h(this.root);else{var b=l.documentElement,c=l.body;a={top:0,left:0,right:b.clientWidth||c.clientWidth,width:b.clientWidth||c.clientWidth,bottom:b.clientHeight||c.clientHeight,height:b.clientHeight||c.clientHeight}}return this._expandRectByRootMargin(a)},b.prototype._expandRectByRootMargin=function(a){var b=this._rootMarginValues.map(function(b,c){return"px"==b.unit?b.value:b.value*(c%2?a.width:a.height)/100}),c={top:a.top-b[0],right:a.right+b[1],bottom:a.bottom+b[2],left:a.left-b[3]};return c.width=c.right-c.left,c.height=c.bottom-c.top,c},b.prototype._hasCrossedThreshold=function(a,b){var c=a&&a.isIntersecting?a.intersectionRatio||0:-1,d=b.isIntersecting?b.intersectionRatio||0:-1;if(c!==d)for(var e=0;e<this.thresholds.length;e++){var f=this.thresholds[e];if(f==c||f==d||f<c!=f<d)return!0}},b.prototype._rootIsInDom=function(){return!this.root||j(l,this.root)},b.prototype._rootContainsTarget=function(a){return j(this.root||l,a)},b.prototype._registerInstance=function(){m.indexOf(this)<0&&m.push(this)},b.prototype._unregisterInstance=function(){var a=m.indexOf(this);-1!=a&&m.splice(a,1)},window.IntersectionObserver=b,window.IntersectionObserverEntry=a}}(),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.ResizeObserver=b()}(this,function(){"use strict";function a(a,b){function c(){f&&(f=!1,a()),g&&e()}function d(){n(c)}function e(){var a=Date.now();if(f){if(a-h<o)return;g=!0}else f=!0,g=!1,setTimeout(d,b);h=a}var f=!1,g=!1,h=0;return e}function b(a){return parseFloat(a)||0}function c(a){for(var c=[],d=1;d<arguments.length;d++)c[d-1]=arguments[d];return c.reduce(function(c,d){return c+b(a["border-"+d+"-width"])},0)}function d(a){for(var c=["top","right","bottom","left"],d={},e=0,f=c;e<f.length;e++){var g=f[e],h=a["padding-"+g];d[g]=b(h)}return d}function e(a){var b=a.getBBox();return j(0,0,b.width,b.height)}function f(a){var e=a.clientWidth,f=a.clientHeight;if(!e&&!f)return v;var h=u(a).getComputedStyle(a),i=d(h),k=i.left+i.right,l=i.top+i.bottom,m=b(h.width),n=b(h.height);if("border-box"===h.boxSizing&&(Math.round(m+k)!==e&&(m-=c(h,"left","right")+k),Math.round(n+l)!==f&&(n-=c(h,"top","bottom")+l)),!g(a)){var o=Math.round(m+k)-e,p=Math.round(n+l)-f;1!==Math.abs(o)&&(m-=o),1!==Math.abs(p)&&(n-=p)}return j(i.left,i.top,m,n)}function g(a){return a===u(a).document.documentElement}function h(a){return l?w(a)?e(a):f(a):v}function i(a){var b=a.x,c=a.y,d=a.width,e=a.height,f="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,g=Object.create(f.prototype);return t(g,{x:b,y:c,width:d,height:e,top:c,right:b+d,bottom:e+c,left:b}),g}function j(a,b,c,d){return{x:a,y:b,width:c,height:d}}var k=function(){function a(a,b){var c=-1;return a.some(function(a,d){return a[0]===b&&(c=d,!0)}),c}return"undefined"!=typeof Map?Map:function(){function b(){this.__entries__=[]}return Object.defineProperty(b.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),b.prototype.get=function(b){var c=a(this.__entries__,b),d=this.__entries__[c];return d&&d[1]},b.prototype.set=function(b,c){var d=a(this.__entries__,b);~d?this.__entries__[d][1]=c:this.__entries__.push([b,c])},b.prototype.delete=function(b){var c=this.__entries__,d=a(c,b);~d&&c.splice(d,1)},b.prototype.has=function(b){return!!~a(this.__entries__,b)},b.prototype.clear=function(){this.__entries__.splice(0)},b.prototype.forEach=function(a,b){void 0===b&&(b=null);for(var c=0,d=this.__entries__;c<d.length;c++){var e=d[c];a.call(b,e[1],e[0])}},b}()}(),l="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,m=function(){return"undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),n=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(m):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)}}(),o=2,p=20,q=["top","right","bottom","left","width","height","size","weight"],r="undefined"!=typeof MutationObserver,s=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=a(this.refresh.bind(this),p)}return b.prototype.addObserver=function(a){~this.observers_.indexOf(a)||this.observers_.push(a),this.connected_||this.connect_()},b.prototype.removeObserver=function(a){var b=this.observers_,c=b.indexOf(a);~c&&b.splice(c,1),!b.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var a=this.observers_.filter(function(a){return a.gatherActive(),a.hasActive()});return a.forEach(function(a){return a.broadcastActive()}),a.length>0},b.prototype.connect_=function(){l&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),r?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},b.prototype.disconnect_=function(){l&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(a){var b=a.propertyName,c=void 0===b?"":b;q.some(function(a){return!!~c.indexOf(a)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),t=function(a,b){for(var c=0,d=Object.keys(b);c<d.length;c++){var e=d[c];Object.defineProperty(a,e,{value:b[e],enumerable:!1,writable:!1,configurable:!0})}return a},u=function(a){return a&&a.ownerDocument&&a.ownerDocument.defaultView||m},v=j(0,0,0,0),w=function(){return"undefined"!=typeof SVGGraphicsElement?function(a){return a instanceof u(a).SVGGraphicsElement}:function(a){return a instanceof u(a).SVGElement&&"function"==typeof a.getBBox}}(),x=function(){function a(a){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=j(0,0,0,0),this.target=a}return a.prototype.isActive=function(){var a=h(this.target);return this.contentRect_=a,a.width!==this.broadcastWidth||a.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var a=this.contentRect_;return this.broadcastWidth=a.width,this.broadcastHeight=a.height,a},a}(),y=function(){function a(a,b){var c=i(b);t(this,{target:a,contentRect:c})}return a}(),z=function(){function a(a,b,c){if(this.activeObservations_=[],this.observations_=new k,"function"!=typeof a)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=a,this.controller_=b,this.callbackCtx_=c}return a.prototype.observe=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof u(a).Element))throw new TypeError('parameter 1 is not of type "Element".');var b=this.observations_;b.has(a)||(b.set(a,new x(a)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof u(a).Element))throw new TypeError('parameter 1 is not of type "Element".');var b=this.observations_;b.has(a)&&(b.delete(a),b.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var a=this;this.clearActive(),this.observations_.forEach(function(b){b.isActive()&&a.activeObservations_.push(b)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var a=this.callbackCtx_,b=this.activeObservations_.map(function(a){return new y(a.target,a.broadcastRect())});this.callback_.call(a,b,a),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),A="undefined"!=typeof WeakMap?new WeakMap:new k,B=function(){function a(b){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var c=s.getInstance(),d=new z(b,c,this);A.set(this,d)}return a}();return["observe","unobserve","disconnect"].forEach(function(a){B.prototype[a]=function(){var b;return(b=A.get(this))[a].apply(b,arguments)}}),function(){return void 0!==m.ResizeObserver?m.ResizeObserver:B}()}),function(a,b){b.$=a}(jQuery,window.FooGallery=window.FooGallery||{}),function(a){if(!a)return void console.warn("jQuery must be included in the page prior to the FooGallery.utils library.");var b={$:a,version:"0.1.8"};b.versionCompare=function(a,b){function c(a){for(var b=a.split("."),c=[],d=0,e=b.length;d<e;d++)c[d]=parseInt(b[d]),isNaN(c[d])&&(c[d]=0);return c}if(!/[\d.]/.test(a)||!/[\d.]/.test(b))return NaN;for(var d=c(a),e=c(b);d.length<e.length;)d.push(0);for(;e.length<d.length;)e.push(0);for(var f=0;f<d.length;++f){if(e.length===f)return 1;if(d[f]!==e[f])return d[f]>e[f]?1:-1}return d.length!==e.length?-1:0},!function(){try{return!!window.FooGallery.utils}catch(a){return!1}}()?window.FooGallery.utils=b:b.versionCompare(b.version,window.FooGallery.utils.version)>0?(console.warn("An older version of FooGallery.utils ("+window.FooGallery.utils.version+") already exists in the page, version "+b.version+" will override it."),window.FooGallery.utils=b):console.warn("A newer version of FooGallery.utils ("+window.FooGallery.utils.version+") already exists in the page, version "+b.version+" will not register itself.")}(jQuery),function(a,b){"0.1.8"===b.version&&(b.is={},b.is.array=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b.is.boolean=function(a){return"[object Boolean]"===Object.prototype.toString.call(a)},b.is.element=function(a){return"object"==typeof HTMLElement?a instanceof HTMLElement:!!a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName},b.is.empty=function(a){if(b.is.undef(a)||null===a)return!0;if(b.is.number(a)&&0===a)return!0;if(b.is.boolean(a)&&!1===a)return!0;if(b.is.string(a)&&0===a.length)return!0;if(b.is.array(a)&&0===a.length)return!0;if(b.is.jq(a)&&0===a.length)return!0;if(b.is.hash(a)){for(var c in a)if(a.hasOwnProperty(c))return!1;return!0}return!1},b.is.error=function(a){return"[object Error]"===Object.prototype.toString.call(a)},b.is.fn=function(a){return a===window.alert||"[object Function]"===Object.prototype.toString.call(a)},b.is.hash=function(a){return b.is.object(a)&&a.constructor===Object&&!a.nodeType&&!a.setInterval},b.is.jq=function(c){return!b.is.undef(a)&&c instanceof a},b.is.number=function(a){return"[object Number]"===Object.prototype.toString.call(a)&&!isNaN(a)},b.is.object=function(a){return"[object Object]"===Object.prototype.toString.call(a)&&!b.is.undef(a)&&null!==a},b.is.promise=function(a){return b.is.object(a)&&b.is.fn(a.then)&&b.is.fn(a.promise)},b.is.size=function(a){return!!(b.is.string(a)&&!b.is.empty(a)||b.is.number(a))&&/^(auto|none|(?:[\d.]*)+?(?:%|px|mm|q|cm|in|pt|pc|em|ex|ch|rem|vh|vw|vmin|vmax)?)$/.test(a)},b.is.string=function(a){return"[object String]"===Object.prototype.toString.call(a)},b.is.undef=function(a){return void 0===a})}(FooGallery.utils.$,FooGallery.utils),function(a,b,c){if("0.1.8"===b.version){b.fn={};var d=Function.prototype.toString;b.fn.CONTAINS_SUPER=/xyz/.test(d.call(function(){xyz}))?/\b_super\b/:/.*/,b.fn.addOrOverride=function(a,e,f){if(c.object(a)&&c.string(e)&&!c.empty(e)&&c.fn(f)){var g=a[e],h=c.fn(g)&&b.fn.CONTAINS_SUPER.test(d.call(f));a[e]=h?function(a,b){return function(){var c=this._super;this._super=a;var d=b.apply(this,arguments);return this._super=c,d}}(g,f):f}},b.fn.apply=function(a,b){function d(){return a.apply(this,b)}return b=c.array(b)?b:[],d.prototype=a.prototype,new d},b.fn.arg2arr=function(a){return Array.prototype.slice.call(a)},b.fn.debounce=function(a,c){var d;return function(){var e=this,f=b.fn.arg2arr(arguments);clearTimeout(d),d=setTimeout(function(){a.apply(e,f)},c)}},b.fn.throttle=function(a,c){var d,e;return function(){var f=this,g=b.fn.arg2arr(arguments);d?(clearTimeout(e),e=setTimeout(function(){Date.now()-d>=c&&(a.apply(f,g),d=Date.now())},c-(Date.now()-d))):(a.apply(f,g),d=Date.now())}},b.fn.check=function(d,e,f,g){function h(a){return function(){return a.apply(d,arguments)}}return f=c.fn(f)?f:a.noop,d=c.object(d)?d:window,e=c.string(e)?b.fn.fetch(e,g):e,h(c.fn(e)?e:f)},b.fn.fetch=function(b,d){return!c.string(b)||c.empty(b)?null:(d=c.object(d)?d:window,a.each(b.split("."),function(a,b){if(!d[b])return!1;d=d[b]}),c.fn(d)?d:null)},b.fn.enqueue=function(d,e,f,g){function h(a,b){try{return n.push(a),b.apply(a,i)}catch(a){return j.reject(a,n),j}}var i=b.fn.arg2arr(arguments),j=a.Deferred(),k=a.Deferred(),l=k.promise(),m=[],n=[],o=!0;return d=i.shift(),e=i.shift(),a.each(d,function(a,d){c.fn(d[e])&&(l=l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}return o=!1,h(d,d[e])}))}),l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}o=!1,j.resolve(m)}),l.fail(function(){var a=b.fn.arg2arr(arguments);a.push(n),j.reject.apply(j,a)}),k.resolve(),j.promise()},b.fn.when=function(b){if(!c.array(b)||c.empty(b))return a.when();for(var d=a.Deferred(),e=[],f=b.length,g=0;g<b.length;g++)b[g].then(function(a){e.push(a)}).always(function(){--f||d.resolve(e)});return d.promise()},b.fn.rejectWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.reject.apply(e,f).promise()},b.fn.resolveWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.resolve.apply(e,f).promise()},b.fn.resolved=a.Deferred().resolve().promise(),b.fn.rejected=a.Deferred().reject().promise()}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b){if("0.1.8"===a.version){a.url={};var c=document.createElement("a");a.url.parts=function(a){c.href=a;var b=c.port?c.port:-1!==["http:","https:"].indexOf(c.protocol)?"https:"===c.protocol?"443":"80":"",d=c.hostname+(b?":"+b:""),e=c.origin?c.origin:c.protocol+"//"+d,f="/"===c.pathname.slice(0,1)?c.pathname:"/"+c.pathname;return{hash:c.hash,host:d,hostname:c.hostname,href:c.href,origin:e,pathname:f,port:b,protocol:c.protocol,search:c.search}},a.url.full=function(a){return!b.string(a)||b.empty(a)?null:(c.href=a,c.href)},a.url.param=function(a,c,d){if(!b.string(a)||!b.string(c)||b.empty(c))return a;var e,f,g,h;return b.undef(d)?(e=new RegExp("[?|&]"+c+"=([^&;]+?)(&|#|;|$)"),f=e.exec(a)||["",""],g=f[1].replace(/\+/g,"%20"),b.string(g)&&!b.empty(g)?decodeURIComponent(g):null):(b.empty(d)?(e=new RegExp("^([^#]*?)(([^#]*)&)?"+c+"(=[^&#]*)?(&|#|$)"),g=a.replace(e,"$1$3$5").replace(/^([^#]*)((\?)&|\?(#|$))/,"$1$3$4")):(e=new RegExp("([?&])"+c+"[^&]*"),h=c+"="+encodeURIComponent(d),(g=a.replace(e,"$1"+h))!==a||e.test(g)||(g+=(-1!==g.indexOf("?")?"&":"?")+h)),g)}}}(FooGallery.utils,FooGallery.utils.is),function(a,b,c){"0.1.8"===a.version&&(a.str={},a.str.camel=function(a){return b.empty(a)?a:a.toUpperCase()===a?a.toLowerCase():a.replace(/^([A-Z])|[-\s_]+(\w)/g,function(a,c,d){return b.string(d)?d.toUpperCase():c.toLowerCase()})},a.str.kebab=function(a){return b.empty(a)?a:a.match(/[A-Z]{2,}(?=[A-Z][a-z0-9]*|\b)|[A-Z]?[a-z0-9]*|[A-Z]|[0-9]+/g).filter(Boolean).map(function(a){return a.toLowerCase()}).join("-")},a.str.contains=function(a,c,d){return!(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c))&&(c.length<=a.length&&-1!==(d?a.toUpperCase().indexOf(c.toUpperCase()):a.indexOf(c)))},a.str.containsWord=function(a,c,d){if(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)||a.length<c.length)return!1;for(var e=a.split(/\W/),f=0,g=e.length;f<g;f++)if(d?e[f].toUpperCase()===c.toUpperCase():e[f]===c)return!0;return!1},a.str.endsWith=function(a,c){return!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)?a===c:a.slice(a.length-c.length)===c},a.str.escapeRegExp=function(a){return b.empty(a)?a:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},a.str.fnv1a=function(a){if(!b.string(a)||b.empty(a))return null;var c,d,e=2166136261;for(c=0,d=a.length;c<d;c++)e^=a.charCodeAt(c),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0},a.str.from=function(c,d){return!b.string(c)||b.empty(c)||!b.string(d)||b.empty(d)?null:a.str.contains(c,d)?c.substring(c.indexOf(d)+d.length):null},a.str.join=function(d,e,f){if(!b.string(d)||!b.string(e))return null;var g=c.arg2arr(arguments);d=g.shift();var h,i,j=g.shift();for(h=0,i=g.length;h<i;h++)e=g[h],b.empty(e)||(a.str.endsWith(j,d)&&(j=j.slice(0,j.length-d.length)),a.str.startsWith(e,d)&&(e=e.slice(d.length)),j+=d+e);return j},a.str.startsWith=function(a,c){return!b.empty(a)&&!b.empty(c)&&a.slice(0,c.length)===c},a.str.until=function(c,d){return b.empty(c)||b.empty(d)?c:a.str.contains(c,d)?c.substring(0,c.indexOf(d)):c},a.str.format=function(a,d,e){var f=c.arg2arr(arguments);if(a=f.shift(),b.empty(a)||b.empty(f))return a;1===f.length&&(b.array(f[0])||b.object(f[0]))&&(f=f[0]);for(var g in f)a=a.replace(new RegExp("\\{"+g+"\\}","gi"),f[g]);return a})}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d,e){if("0.1.8"===b.version){b.obj={};var f=function(){};b.obj.create=function(a){if(!c.object(a))throw TypeError("Argument must be an object");f.prototype=a;var b=new f;return f.prototype=null,b},b.obj.extend=function(e,f,g){e=c.object(e)?e:{};var h=d.arg2arr(arguments);return h.shift(),a.each(h,function(a,c){b.obj.merge(e,c)}),e},b.obj.merge=function(a,d){a=c.hash(a)?a:{},d=c.hash(d)?d:{};for(var e in d)d.hasOwnProperty(e)&&(c.hash(d[e])?(a[e]=c.hash(a[e])?a[e]:{},b.obj.merge(a[e],d[e])):c.array(d[e])?a[e]=d[e].slice():a[e]=d[e]);return a},b.obj.mergeValid=function(d,e,f,g){if(!c.hash(f)||!c.hash(e))return d;e=c.hash(e)?e:{},g=c.hash(g)?g:{};var h,i,j;for(h in e)e.hasOwnProperty(h)&&c.fn(e[h])&&(i=c.array(g[h])?g[h]:c.string(g[h])?[g[h]]:[h],a.each(i,function(a,g){if(j=b.obj.prop(f,g),!c.undef(j))return e[h](j)?(b.obj.prop(d,h,j),!1):void 0}));return d},b.obj.prop=function(b,d,f){if(c.object(b)&&!c.empty(d)){var g,h;if(c.undef(f))return e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){if(a===h)f=b[d];else{if(!c.hash(b[d]))return!1;b=b[d]}})):c.undef(b[d])||(f=b[d]),f;e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){a===h?b[d]=f:b=c.hash(b[d])?b[d]:b[d]={}})):c.undef(b[d])||(b[d]=f)}}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){if("0.1.8"===b.version){b.ready=function(a){function c(){try{a.call(window,b.$)}catch(a){console.error(a)}}(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?c():document.addEventListener("DOMContentLoaded",c,!1)};var d=0;b.uniqueId=function(a,b){var e=a.attr("id");return c.empty(e)&&(b=c.string(b)&&!c.empty(b)?b:"uid-",e=b+ ++d,a.attr("id",e).data("__uniqueId__",!0)),e},b.removeUniqueId=function(a){a.data("__uniqueId__")&&a.removeAttr("id").removeData("__uniqueId__")},b.selectify=function(a){if(c.empty(a))return null;if(c.hash(a)){var d,e={};for(var f in a)a.hasOwnProperty(f)&&(d=b.selectify(a[f]))&&(e[f]=d);return e}return c.string(a)||c.array(a)?(c.string(a)&&(a=[a]),a.map(function(a){return c.string(a)?"."+a.split(/\s/g).join("."):null}).join(",")):null},b.src=function(a,b,d,e,f,g,h){if(!c.string(a))return null;if(!c.string(b))return a;var i=b.replace(/(\s[\d.]+[whx]),/g,"$1 @,@ ").split(" @,@ "),j=i.map(function(a){return{url:/^\s*(\S*)/.exec(a)[1],w:parseFloat((/\S\s+(\d+)w/.exec(a)||[0,1/0])[1]),h:parseFloat((/\S\s+(\d+)h/.exec(a)||[0,1/0])[1]),x:parseFloat((/\S\s+([\d.]+)x/.exec(a)||[0,1])[1])}});if(!j.length)return a;j.unshift({url:a,w:j[0].w!==1/0&&j[0].h===1/0?d:1/0,h:j[0].h!==1/0&&j[0].w===1/0?e:1/0,x:1});var k=c.number(h)?h:window.devicePixelRatio||1,l={w:f*k,h:g*k,x:k},m=["w","h","x"];return m.forEach(function(a){var b=Math.max.apply(null,j.map(function(b){return b[a]}));j=j.filter(function(c){return c[a]>=l[a]||c[a]===b})}),m.forEach(function(a){var b=Math.min.apply(null,j.map(function(b){return b[a]}));j=j.filter(function(c){return c[a]===b})}),j[0].url},b.scrollParent=function(b,d,e){b=c.jq(b)?b:a(b),d=c.string(d)&&/^(x|y|xy|yx)$/i.test(d)?d:"xy";var f=a(!!b.length&&b[0].ownerDocument||document);if(e=c.jq(e)?e:f,!b.length)return e;var g=b.css("position"),h="absolute"===g,i=/(auto|scroll)/i,j=/x/i,k=/y/i,l=b.parentsUntil(e).filter(function(b,c){var e=a(this);if(h&&"static"===e.css("position"))return!1;var f=k.test(d)&&c.scrollHeight>c.clientHeight&&i.test(e.css("overflow-y")),g=j.test(d)&&c.scrollWidth>c.clientWidth&&i.test(e.css("overflow-x"));return f||g}).eq(0);return l.is("html")&&(l=f),"fixed"!==g&&l.length?l:e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c){function d(a){return setTimeout(a,1)}function e(a){clearTimeout(a)}if("0.1.8"===b.version){b.animation={},b.animation.requestFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||d).bind(window),b.animation.cancelFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||e).bind(window);var f=document.createElement("div");b.animation.supported=function(a){var b=a.style;return c.string(b.animation)||c.string(b.WebkitAnimation)||c.string(b.MozAnimation)||c.string(b.msAnimation)||c.string(b.OAnimation)}(f),b.animation.end=function(a){var b=a.style;return c.string(b.animation)?"animationend":c.string(b.WebkitAnimation)?"webkitAnimationEnd":c.string(b.MozAnimation)?"animationend":c.string(b.msAnimation)?"msAnimationEnd":c.string(b.OAnimation)?"oAnimationEnd":null}(f),b.animation.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("animation-duration");if(/^([\d.]*)+?(ms|s)$/i.test(d)){var e=d.match(/^([\d.]*)+?(ms|s)$/i),f=parseFloat(e[1]);return"s"===e[2].toLowerCase()&&(f*=1e3),f}return b},b.animation.iterations=function(a,b){if(b=c.number(b)?b:1,!c.jq(a))return b;var d=a.css("animation-iteration-count");return/^(\d+|infinite)$/i.test(d)?"infinite"===d?1/0:parseInt(d):b},b.animation.start=function(d,e,f,g){var h=a.Deferred(),i=h.promise();if(d=d.first(),b.animation.supported){d.prop("offsetTop");var j=d.data("animation_safety");if(c.hash(j)&&c.number(j.timer)&&(clearTimeout(j.timer),d.removeData("animation_safety").off(b.animation.end+".utils"),j.deferred.reject()),!c.number(g)){var k=b.animation.iterations(d);if(k===1/0)return h.reject("No timeout supplied with an infinite animation."),i;g=b.animation.duration(d)*k+50}j={deferred:h,timer:setTimeout(function(){d.removeData("animation_safety").off(b.animation.end+".utils"),h.resolve()},g)},d.data("animation_safety",j),d.on(b.animation.end+".utils",function(a){d.is(a.target)&&(clearTimeout(j.timer),d.removeData("animation_safety").off(b.animation.end+".utils"),h.resolve())})}return b.animation.requestFrame(function(){c.fn(e)?e.apply(d.get(0),[d]):d.toggleClass(e,f),b.animation.supported||h.resolve()}),i}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){if("0.1.8"===b.version){b.transition={};var e=document.createElement("div");b.transition.supported=function(a){var b=a.style;return c.string(b.transition)||c.string(b.WebkitTransition)||c.string(b.MozTransition)||c.string(b.msTransition)||c.string(b.OTransition)}(e),b.transition.end=function(a){var b=a.style;return c.string(b.transition)?"transitionend":c.string(b.WebkitTransition)?"webkitTransitionEnd":c.string(b.MozTransition)?"transitionend":c.string(b.msTransition)?"msTransitionEnd":c.string(b.OTransition)?"oTransitionEnd":null}(e),b.transition.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("transition-duration");if(/^([\d.]*)+?(ms|s)$/i.test(d)){var e=d.match(/^([\d.]*)+?(ms|s)$/i),f=parseFloat(e[1]);return"s"===e[2].toLowerCase()&&(f*=1e3),f}return b},b.transition.start=function(e,f,g,h){var i=a.Deferred(),j=i.promise();if(e=e.first(),b.transition.supported){e.prop("offsetTop");var k=e.data("transition_safety");c.hash(k)&&c.number(k.timer)&&(clearTimeout(k.timer),e.removeData("transition_safety").off(b.transition.end+".utils"),k.deferred.reject()),h=c.number(h)?h:b.transition.duration(e)+50,k={deferred:i,timer:setTimeout(function(){e.removeData("transition_safety").off(b.transition.end+".utils"),i.resolve()},h)},e.data("transition_safety",k),e.on(b.transition.end+".utils",function(a){e.is(a.target)&&(clearTimeout(k.timer),e.removeData("transition_safety").off(b.transition.end+".utils"),i.resolve())})}return d.requestFrame(function(){c.fn(f)?f.apply(e.get(0),[e]):e.toggleClass(f,g),b.transition.supported||i.resolve()}),j}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.animation),function(a,b,c,d,e){"0.1.8"===b.version&&(b.Class=function(){},b.Class.extend=function(a){function f(){if(!c.fn(this.construct))throw new SyntaxError('FooGallery.utils.Class objects must be constructed with the "new" keyword.');this.construct.apply(this,arguments)}a=c.hash(a)?a:{};var g=d.create(this.prototype);for(var h in a)a.hasOwnProperty(h)&&e.addOrOverride(g,h,a[h]);return g.construct=c.fn(g.construct)?g.construct:function(){},f.prototype=g,f.prototype.constructor=c.fn(g.__ctor__)?g.__ctor__:f,f.extend=b.Class.extend,f.override=b.Class.override,f},b.Class.override=function(a,b){e.addOrOverride(this.prototype,a,b)})}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj,FooGallery.utils.fn),function(a,b,c){"0.1.8"===a.version&&(a.Event=a.Class.extend({construct:function(a){
10
+ if(b.empty(a))throw new SyntaxError("FooGallery.utils.Event objects must be supplied a `type`.");var d=c.contains(a,".");this.type=d?c.until(a,"."):a,this.namespace=d?c.from(a,"."):null,this.defaultPrevented=!1,this.target=null},preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented}}),a.EventClass=a.Class.extend({construct:function(){this.__handlers={}},destroy:function(){this.__handlers={}},on:function(a,c,d){var e=this;return b.object(a)?(d=b.undef(c)?this:c,Object.keys(a).forEach(function(b){b.split(" ").forEach(function(c){e.__on(c,a[b],d)})})):b.string(a)&&b.fn(c)&&(d=b.undef(d)?this:d,a.split(" ").forEach(function(a){e.__on(a,c,d)})),e},__on:function(a,d,e){var f=this,g=c.contains(a,"."),h=g?c.until(a,"."):a,i=g?c.from(a,"."):null;b.array(f.__handlers[h])||(f.__handlers[h]=[]),f.__handlers[h].some(function(a){return a.namespace===i&&a.fn===d&&a.thisArg===e})||f.__handlers[h].push({namespace:i,fn:d,thisArg:e})},off:function(a,c,d){var e=this;return b.object(a)?(d=b.undef(c)?this:c,Object.keys(a).forEach(function(c){c.split(" ").forEach(function(f){e.__off(f,b.fn(a[c])?a[c]:null,d)})})):b.string(a)&&(c=b.fn(c)?c:null,d=b.undef(d)?this:d,a.split(" ").forEach(function(a){e.__off(a,c,d)})),e},__off:function(a,d,e){var f=this,g=c.until(a,".")||null,h=c.from(a,".")||null,i=[];b.empty(g)?b.empty(h)||i.push.apply(i,Object.keys(f.__handlers)):i.push(g),i.forEach(function(a){b.array(f.__handlers[a])&&(f.__handlers[a]=f.__handlers[a].filter(function(a){return null!=d?!(a.namespace===h&&a.fn===d&&a.thisArg===e):null!=h&&a.namespace!==h}),0===f.__handlers[a].length&&delete f.__handlers[a])})},trigger:function(c,d){d=b.array(d)?d:[];var e=this,f=[];return c instanceof a.Event?(f.push(c),e.__trigger(c,d)):b.string(c)&&c.split(" ").forEach(function(b){var c=f.push(new a.Event(b))-1;e.__trigger(f[c],d)}),b.empty(f)?null:1===f.length?f[0]:f},__trigger:function(a,c){var d=this;a.target=d,b.array(d.__handlers[a.type])&&d.__handlers[a.type].forEach(function(b){null!=a.namespace&&b.namespace!==a.namespace||b.fn.apply(b.thisArg,[a].concat(c))})}}))}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.str),function(a,b,c){if("0.1.8"===b.version){b.Bounds=b.Class.extend({construct:function(){var a=this;a.top=0,a.right=0,a.bottom=0,a.left=0,a.width=0,a.height=0},inflate:function(a){var b=this;return c.number(a)&&(b.top-=a,b.right+=a,b.bottom+=a,b.left-=a,b.width+=2*a,b.height+=2*a),b},intersects:function(a){var b=this;return b.left<=a.right&&a.left<=b.right&&b.top<=a.bottom&&a.top<=b.bottom}});var d;b.getViewportBounds=function(c){d||(d=a(window));var e=new b.Bounds;return e.top=d.scrollTop(),e.left=d.scrollLeft(),e.width=d.width(),e.height=d.height(),e.right=e.left+e.width,e.bottom=e.top+e.height,e.inflate(c),e},b.getElementBounds=function(d){c.jq(d)||(d=a(d));var e=new b.Bounds;if(0!==d.length){var f=d.offset();e.top=f.top,e.left=f.left,e.width=d.width(),e.height=d.height()}return e.right=e.left+e.width,e.bottom=e.top+e.height,e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e){"0.1.8"===b.version&&(b.Timer=b.EventClass.extend({construct:function(a){this._super(),this.interval=c.number(a)?a:1e3,this.isRunning=!1,this.isPaused=!1,this.canResume=!1,this.canRestart=!1,this.__timeout=null,this.__decrement=!1,this.__time=0,this.__remaining=0,this.__current=0,this.__finish=0,this.__restart=[]},__reset:function(){clearTimeout(this.__timeout),this.__timeout=null,this.__decrement=!1,this.__time=0,this.__remaining=0,this.__current=0,this.__finish=0,this.isRunning=!1,this.isPaused=!1,this.canResume=!1},__eventArgs:function(a){return[this.__current,this.__time,this.__decrement].concat(d.arg2arr(arguments))},__tick:function(){var a=this;a.trigger("tick",a.__eventArgs()),a.__current===a.__finish?(a.trigger("complete",a.__eventArgs()),a.__reset()):(a.__decrement?a.__current--:a.__current++,a.__remaining--,a.canResume=a.__remaining>0,a.__timeout=setTimeout(function(){a.__tick()},a.interval))},start:function(a,b){var d=this;d.isRunning||(b=!!c.boolean(b)&&b,d.__restart=[a,b],d.__decrement=b,d.__time=a,d.__remaining=a,d.__current=b?a:0,d.__finish=b?0:a,d.canRestart=!0,d.isRunning=!0,d.isPaused=!1,d.trigger("start",d.__eventArgs()),d.__tick())},countdown:function(a){this.start(a,!0)},countup:function(a){this.start(a,!1)},restart:function(){this.stop(),this.canRestart&&this.start.apply(this,this.__restart)},stop:function(){(this.isRunning||this.isPaused)&&(this.__reset(),this.trigger("stop",this.__eventArgs()))},pause:function(){var a=this;return null!=a.__timeout&&(clearTimeout(a.__timeout),a.__timeout=null),a.isRunning&&(a.isRunning=!1,a.isPaused=!0,a.trigger("pause",a.__eventArgs())),a.__remaining},resume:function(){var a=this;a.canResume&&(a.isRunning=!0,a.isPaused=!1,a.trigger("resume",a.__eventArgs()),a.__tick())},reset:function(){this.__reset(),this.trigger("reset",this.__eventArgs())}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d){"0.1.8"===b.version&&(b.Factory=b.Class.extend({construct:function(){this.registered={}},contains:function(a){return!c.undef(this.registered[a])},load:function(b,e,f){var g,h,i=this,j=d.arg2arr(arguments),k=[],l=[];b=j.shift()||{};for(g in i.registered)if(i.registered.hasOwnProperty(g)){var m=i.registered[g];b.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&(m={name:g,klass:h,priority:i.registered[g].priority})),k.push(m)}for(g in b)b.hasOwnProperty(g)&&!i.registered.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&k.push({name:g,klass:h,priority:0}));return k.sort(function(a,b){return b.priority-a.priority}),a.each(k,function(a,b){c.fn(b.klass)&&l.push(d.apply(b.klass,j))}),l},make:function(a,b,e){var f,g=this,h=d.arg2arr(arguments);return a=h.shift(),f=g.registered[a],c.hash(f)&&c.fn(f.klass)?d.apply(f.klass,h):null},names:function(b){b=!!c.boolean(b)&&b;var d,e=[];if(b){var f=[];for(d in this.registered)this.registered.hasOwnProperty(d)&&f.push(this.registered[d]);f.sort(function(a,b){return b.priority-a.priority}),a.each(f,function(a,b){e.push(b.name)})}else for(d in this.registered)this.registered.hasOwnProperty(d)&&e.push(d);return e},register:function(a,b,d){if(!c.string(a)||c.empty(a)||!c.fn(b))return!1;d=c.number(d)?d:0;var e=this.registered[a];return this.registered[a]={name:a,klass:b,priority:c.undef(e)?d:e.priority},!0}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c){if("0.1.8"===a.version){var d=!1;try{d=!!window.localStorage}catch(a){d=!1}a.Debugger=a.Class.extend({construct:function(a){this.key=a,this.enabled=!!d&&!!localStorage.getItem(this.key)},enable:function(){d&&(this.enabled=!0,localStorage.setItem(this.key,this.enabled))},disable:function(){d&&(this.enabled=!1,localStorage.removeItem(this.key))},log:function(a,c){this.enabled&&console.log.apply(console,b.arg2arr(arguments))},logf:function(a,d,e){if(this.enabled){var f=b.arg2arr(arguments);a=f.shift(),d=f.shift(),f.unshift(c.format(a,d)),this.log.apply(this,f)}}})}}(FooGallery.utils,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){"0.1.8"===b.version&&(b.FullscreenAPI=b.EventClass.extend({construct:function(){this._super(),this.apis={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}},this.api=this.getAPI(),this.supported=null!=this.api,this.__listen()},destroy:function(){return this.__stopListening(),this._super()},getAPI:function(){for(var a in this.apis)if(this.apis.hasOwnProperty(a)&&this.apis[a].enabled in document)return this.apis[a];return null},element:function(){return this.supported?document[this.api.element]:null},request:function(b){if(this.supported&&b[this.api.request]){var d=b[this.api.request]();return d||a.Deferred(this.__resolver(this.api.request)).promise()}return c.rejected},exit:function(){if(this.supported&&this.element()){var b=document[this.api.exit]();return b||a.Deferred(this.__resolver(this.api.exit)).promise()}return c.rejected},toggle:function(a){return this.element()?this.exit():this.request(a)},__listen:function(){var b=this;b.supported&&a(document).on(b.api.events.change+".utils",function(){b.trigger("change")}).on(b.api.events.error+".utils",function(){b.trigger("error")})},__stopListening:function(){var b=this;b.supported&&a(document).off(b.api.events.change+".utils").off(b.api.events.error+".utils")},__resolver:function(b){var c=this;return function(d){function e(){d.resolve(),a(document).off(c.api.events.change,e).off(c.api.events.error,f)}function f(){d.reject(new TypeError),a(document).off(c.api.events.change,e).off(c.api.events.error,f)}if(b===c.api.exit&&c.element())return void setTimeout(function(){d.reject(new TypeError)},1);a(document).on(c.api.events.change,e).on(c.api.events.error,f)}}}),b.fullscreen=new b.FullscreenAPI)}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.fn),function(a,b,c,d,e){b.debug=new c.Debugger("__FooGallery__"),b.EMPTY_IMAGE="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b.DATA_TEMPLATE="__FooGallery__",b.DATA_ITEM="__FooGalleryItem__",b.get=function(c){return a(c).data(b.DATA_TEMPLATE)},b.init=function(c,e){if(e=d.jq(e)?e:a(e),e.length>0){var f=e.data(b.DATA_TEMPLATE);if(f instanceof b.Template)return f.destroy(!0).then(function(){return b.template.make(c,e).initialize()})}return b.template.make(c,e).initialize()},b.initAll=function(c){return e.when(a(".foogallery").map(function(a,d){return b.init(c,d)}).get())},a.fn.foogallery=function(c,e){return e=d.fn(e)?e:a.noop,this.each(function(f,g){if(d.string(c)){var h=a.data(g,b.DATA_TEMPLATE);if(h instanceof b.Template)switch(c){case"layout":return void h.layout();case"destroy":return void h.destroy()}}else b.init(c,g).then(e)})},b.isCached=function(a){var b=new Image;b.src=a;var c=b.complete;return b.src="",b=null,c},b.supportedExifProperties=["aperture","camera","date","exposure","focalLength","iso","orientation"],d.exif=function(a){if(d.object(a)){var c=Object.keys(a);return c.length>0&&c.some(function(c){return-1!==b.supportedExifProperties.indexOf(c)&&!d.empty(a[c])})}return!1}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c,d,e){var f="__FooGallerySwipe__",g="ontouchstart"in window,h=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!g,i=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!g,j=g||i;b.Swipe=c.Class.extend({construct:function(b,c){var d=this,f=".fgswipe";d.$el=a(b),d.opt=e.extend({threshold:20,allowPageScroll:!1,swipe:a.noop,data:{}},c),d.active=!1,d.startPoint=null,d.endPoint=null,d.events={start:(j?i?h?"MSPointerDown":"pointerdown":"touchstart":"mousedown")+f,move:(j?i?h?"MSPointerMove":"pointermove":"touchmove":"mousemove")+f,end:(j?i?h?"MSPointerUp":"pointerup":"touchend":"mouseup")+f,leave:(j?i?"mouseleave":null:"mouseleave")+f}},init:function(){var a=this;a.$el.on(a.events.start,{self:a},a.onStart),a.$el.on(a.events.move,{self:a},a.onMove),a.$el.on(a.events.end,{self:a},a.onEnd),d.string(a.events.leave)&&a.$el.on(a.events.leave,{self:a},a.onEnd),a.$el.data(f,a)},destroy:function(){var a=this;a.$el.off(a.events.start,a.onStart),a.$el.off(a.events.move,a.onMove),a.$el.off(a.events.end,a.onEnd),d.string(a.events.leave)&&a.$el.off(a.events.leave,a.onEnd),a.$el.removeData(f)},getAngle:function(a,b){var c=Math.atan2(a.x-b.x,a.y-b.y),d=Math.round(180*c/Math.PI);return 360-(d<0?360-Math.abs(d):d)},getDistance:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*=c,d*=d,Math.sqrt(c+d)},getDirection:function(a,b){var c=this,d=c.getAngle(a,b);return d>337.5||d<=22.5?"N":d>22.5&&d<=67.5?"NE":d>67.5&&d<=112.5?"E":d>112.5&&d<=157.5?"SE":d>157.5&&d<=202.5?"S":d>202.5&&d<=247.5?"SW":d>247.5&&d<=292.5?"W":d>292.5&&d<=337.5?"NW":"NONE"},getPoint:function(a){var b;return j&&!d.empty(b=a.originalEvent.touches||a.touches)?{x:b[0].pageX,y:b[0].pageY}:d.number(a.pageX)&&d.number(a.pageY)?{x:a.pageX,y:a.pageY}:null},getOffset:function(a){var b=this,c=b.$el.offset();return{left:a.x-c.left,top:a.y-c.top}},onStart:function(a){var b=a.data.self,c=b.getPoint(a);d.empty(c)||(b.active=!0,b.startPoint=b.endPoint=c)},onMove:function(b){var c=b.data.self,e=c.getPoint(b);if(c.active&&!d.empty(e))if(c.endPoint=e,c.opt.allowPageScroll){if(d.hash(c.opt.allowPageScroll)){var f=c.getDirection(c.startPoint,c.endPoint);c.opt.allowPageScroll.x||-1===a.inArray(f,["NE","E","SE","NW","W","SW"])||b.preventDefault(),c.opt.allowPageScroll.y||-1===a.inArray(f,["NW","N","NE","SW","S","SE"])||b.preventDefault()}}else b.preventDefault()},onEnd:function(a){var b=a.data.self;if(b.active){b.active=!1;var c={startPoint:b.startPoint,endPoint:b.endPoint,startOffset:b.getOffset(b.startPoint),endOffset:b.getOffset(b.endPoint),angle:b.getAngle(b.startPoint,b.endPoint),distance:b.getDistance(b.startPoint,b.endPoint),direction:b.getDirection(b.startPoint,b.endPoint)};if(b.opt.threshold>0&&c.distance<b.opt.threshold)return;b.opt.swipe.apply(this,[c,b.opt.data]),b.startPoint=null,b.endPoint=null}}}),a.fn.fgswipe=function(c){return this.each(function(){var e=a(this),g=e.data(f);if(g instanceof b.Swipe){if(d.string(c)&&d.fn(g[c]))return void g[c]();g.destroy()}d.hash(c)&&(g=new b.Swipe(this,c),g.init())})}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e,f){b.TemplateFactory=c.Factory.extend({construct:function(){this.registered={}},register:function(a,b,c,e,f,g){var h=this,i=h._super(a,b,g);if(i){var j=h.registered;j[a].opt=d.hash(c)?c:{},j[a].cls=d.hash(e)?e:{},j[a].il8n=d.hash(f)?f:{}}return i},make:function(b,c){c=d.jq(c)?c:a(c),b=f.extend({},b,c.data("foogallery"));var e=this,g=e.type(b,c);return e.contains(g)?(b=e.options(g,b),e._super(g,b,c)):null},type:function(b,e){e=d.jq(e)?e:a(e);var f=this,g=d.hash(b)&&d.hash(b)&&d.string(b.type)&&f.contains(b.type)?b.type:"core";if("core"===g&&e.length>0)for(var h=f.registered,i=f.names(!0),j=0,k=i.length;j<k;j++)if(h.hasOwnProperty(i[j])){var l=i[j],m=h[l].cls;if(d.string(m.container)){var n=c.selectify(m.container);if(e.is(n)){g=i[j];break}}}return g},configure:function(a,b,c,d){var e=this;if(e.contains(a)){var g=e.registered;f.extend(g[a].opt,b),f.extend(g[a].cls,c),f.extend(g[a].il8n,d)}},options:function(a,c){c=f.extend({type:a},c);var e=this,g=e.registered,h=g.core.opt,i=g.core.cls,j=g.core.il8n;return d.hash(c.cls)||(c.cls={}),d.hash(c.il8n)||(c.il8n={}),d.undef(b.filtering)||(c=b.filtering.merge(c)),d.undef(b.paging)||(c=b.paging.merge(c)),"core"!==a&&e.contains(a)?(c=f.extend({},h,g[a].opt,c),c.cls=f.extend({},i,g[a].cls,c.cls),c.il8n=f.extend({},j,g[a].il8n,c.il8n)):(c=f.extend({},h,c),c.cls=f.extend({},i,c.cls),c.il8n=f.extend({},j,c.il8n)),c}}),b.template=new b.TemplateFactory}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e){a.PagingFactory=b.Factory.extend({construct:function(){this.registered={}},register:function(a,b,d,e,f,g,h){var i=this,j=i._super(a,b,h);if(j){var k=i.registered;k[a].ctrl=c.fn(d)?d:null,k[a].opt=c.hash(e)?e:{},k[a].cls=c.hash(f)?f:{},k[a].il8n=c.hash(g)?g:{}}return j},type:function(a){var b,d=this;return c.hash(a)&&c.hash(b=a.paging)&&c.string(b.type)&&d.contains(b.type)?b.type:null},merge:function(a){a=e.extend({},a);var b=this,d=b.type(a),f=b.registered,g=f.default.opt,h=f.default.cls,i=f.default.il8n,j=c.hash(a.paging)?a.paging:{},k=c.hash(a.cls)&&c.hash(a.cls.paging)?e.extend({},a.cls.paging):{},l=c.hash(a.il8n)&&c.hash(a.il8n.paging)?e.extend({},a.il8n.paging):{};return c.hash(a.cls)||(a.cls={}),c.hash(a.il8n)||(a.il8n={}),"default"!==d&&b.contains(d)?(a.paging=e.extend({},g,f[d].opt,j,{type:d}),a.cls=e.extend(a.cls,{paging:h},{paging:f[d].cls},{paging:k}),a.il8n=e.extend(a.il8n,{paging:i},{paging:f[d].il8n},{paging:l})):(a.paging=e.extend({},g,j,{type:d}),a.cls=e.extend(a.cls,{paging:h},{paging:k}),a.il8n=e.extend(a.il8n,{paging:i},{paging:l})),a},configure:function(a,b,c,d){var f=this;if(f.contains(a)){var g=f.registered;e.extend(g[a].opt,b),e.extend(g[a].cls,c),e.extend(g[a].il8n,d)}},hasCtrl:function(a){var b=this,d=b.registered[a];return c.hash(d)&&c.fn(d.ctrl)},makeCtrl:function(a,b,d,e){var f=this,g=f.registered[a];return c.hash(g)&&c.fn(g.ctrl)?new g.ctrl(b,d,e):null}}),a.paging=new a.PagingFactory}(FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f){var g=0;b.Template=c.EventClass.extend({construct:function(e,f){var h=this;h._super(),h.namespace=".foogallery-"+ ++g,h.$el=d.jq(f)?f:a(f),h.$scrollParent=null,h.opt=e,h.template=e.template,h.id=h.$el.prop("id")||e.id,h.cls=e.cls,h.il8n=e.il8n,h.sel=c.selectify(h.cls),h.items=b.components.make("items",h),h.pages=d.undef(b.paging)?null:b.paging.make(e.paging.type,h),h.filter=d.undef(b.filtering)?null:b.filtering.make(e.filtering.type,h),h.state=b.components.make("state",h),h._initialize=null,h._checkTimeout=null,h._layoutTimeout=null,h._layoutWidths=[],h.initializing=!1,h.initialized=!1,h.destroying=!1,h.destroyed=!1,h._undo={classes:"",style:"",create:!1,children:!1},h.robserver=new ResizeObserver(function(){h.$el.is(":visible")&&h.layout()})},initialize:function(b){var c=this;return d.promise(c._initialize)?c._initialize:c._initialize=a.Deferred(function(a){c.preInit(b)?c.init().then(function(){c.postInit()?c.firstLoad().then(function(){c.ready(),a.resolve(c)}).fail(a.reject):a.reject("post-init failed")}).fail(a.reject):a.reject("pre-init failed")}).fail(function(a){console.log("initialize failed",c,a),c.destroy()}).promise()},preInit:function(e){var f=this;if(f.destroying)return!1;if(e=d.jq(e)?e:a(e),f.initializing=!0,0===e.length&&0===f.$el.parent().length)return!1;0===f.$el.length&&(f.$el=f.create(),f._undo.create=!0),e.length>0&&f.$el.appendTo(e);var g;d.empty(f.opt.scrollParent)||0===(g=a(f.opt.scrollParent)).length?f.$scrollParent=a(document):f.$scrollParent=g.is("html")?a(document):g,f.$el.data(b.DATA_TEMPLATE,f),d.empty(f.opt.on)||f.$el.on(f.opt.on),f._undo.classes=f.$el.attr("class"),f._undo.style=f.$el.attr("style"),f.$el.is(f.sel.container)||f.$el.addClass(f.cls.container);var h=c.selectify(f.opt.classes);return null==h||f.$el.is(h)||f.$el.addClass(f.opt.classes),f.robserver.observe(f.$el.get(0)),0===f.$el.children().not(f.sel.item.elem).length&&(f.$el.append(f.createChildren()),f._undo.children=!0),!f.raise("pre-init").isDefaultPrevented()},init:function(){var a=this;return a.raise("init").isDefaultPrevented()?e.rejectWith("init default prevented"):a.items.fetch()},postInit:function(){var b=this;return!b.destroying&&(!b.raise("post-init").isDefaultPrevented()&&(b.state.init(),b.$scrollParent.on("scroll"+b.namespace,{self:b},e.throttle(function(){b.loadAvailable()},50)),a(window).on("popstate"+b.namespace,{self:b},b.onWindowPopState),!0))},firstLoad:function(){var a=this;return a.destroying?e.rejected:(a.raise("first-load"),a.loadAvailable())},ready:function(){var a=this;return!a.destroying&&(a.initializing=!1,a.initialized=!0,a._check(1e3),a.raise("ready"),!0)},create:function(){var b=this;return a("<div/>",{id:b.id,class:b.cls.container}).addClass(b.opt.classes)},createChildren:function(){return a()},destroy:function(b){var c=this,f=c._super.bind(c);return c.destroyed?e.resolved:(c.destroying=!0,a.Deferred(function(a){c.initializing&&d.promise(c._initialize)?c._initialize.always(function(){c.destroying=!1,c.doDestroy(b),a.resolve()}):(c.destroying=!1,c.doDestroy(b),a.resolve())}).then(function(){f()}).promise())},doDestroy:function(c){var e=this;e.destroyed||(e.raise("destroy"),e.robserver.disconnect(),e._checkTimeout&&clearTimeout(e._checkTimeout),e.$scrollParent.off(e.namespace),a(window).off(e.namespace),e.state.destroy(c),e.filter&&e.filter.destroy(),e.pages&&e.pages.destroy(),e.items.destroy(),d.empty(e.opt.on)||e.$el.off(e.opt.on),e.raise("destroyed"),e.$el.removeData(b.DATA_TEMPLATE),d.empty(e._undo.classes)?e.$el.removeAttr("class"):e.$el.attr("class",e._undo.classes),d.empty(e._undo.style)?e.$el.removeAttr("style"):e.$el.attr("style",e._undo.style),e._undo.children&&e.destroyChildren(),e._undo.create&&e.$el.remove(),e.$el=e.state=e.items=e.pages=null,e.destroyed=!0,e.initializing=!1,e.initialized=!1)},destroyChildren:function(){},getAvailable:function(){return this.pages?this.pages.available():this.items.available()},loadAvailable:function(){return this.items.load(this.getAvailable())},getItems:function(){return this.pages?this.pages.items():this.items.available()},_check:function(a){a=d.number(a)?a:0;var b=this;return b._checkTimeout&&clearTimeout(b._checkTimeout),b._checkTimeout=setTimeout(function(){b._checkTimeout=null,!b.initialized||b.destroying&&b.destroyed||b.loadAvailable()},a)},raise:function(c,e){if(this.destroying||this.destroyed||!d.string(c)||d.empty(c))return null;e=d.array(e)?e:[];var g=this,h=c.split(".")[0],i=f.camel("on-"+h),j=a.Event(h+".foogallery");return e.unshift(g),g.trigger(h,e).defaultPrevented&&j.preventDefault(),g.$el.trigger(j,e),b.debug.logf("{id}|{name}:",{id:g.id,name:h},e),d.fn(g[i])&&(e.unshift(j),g[i].apply(g.$el.get(0),e)),j},layout:function(){var a=this,b=a.getContainerWidth();null===a._initialize||a._checkWidth(b)||a.raise("layout",[b])},_checkWidth:function(a){var b,c=this;return(b=-1!==c._layoutWidths.indexOf(a))||(c._layoutWidths.unshift(a),c._layoutWidths.splice(2,c._layoutWidths.length-2),null!=c._layoutTimeout&&clearTimeout(c._layoutTimeout),c._layoutTimeout=setTimeout(function(){c._layoutWidths.splice(0,c._layoutWidths.length)},100)),b},getContainerWidth:function(){var a=this;return a.$el.is(":visible")?a.$el.width():a.$el.parents(":visible:first").innerWidth()},getCSSClass:function(a,b){b=d.empty(b)?"":b;var c=a instanceof RegExp?a:d.string(a)&&this.opt.regex.hasOwnProperty(a)?this.opt.regex[a]:null,e=this.$el.prop("className")||"",f=null!=c?e.match(c):null;return null!=f&&f.length>=2?f[1]:b},onWindowPopState:function(a){var b=a.data.self,c=a.originalEvent.state;d.empty(c)||c.id!==b.id||(b.state.set(c),b.loadAvailable())}}),b.template.register("core",b.Template,{id:null,type:"core",classes:"",on:{},lazy:!0,viewport:200,items:[],fixLayout:!0,scrollParent:null,delay:0,throttle:50,timeout:6e4,srcset:"data-srcset-fg",src:"data-src-fg",template:{},regex:{theme:/(?:\s|^)(fg-(?:light|dark|custom))(?:\s|$)/,loadingIcon:/(?:\s|^)(fg-loading-(?:default|bars|dots|partial|pulse|trail))(?:\s|$)/,hoverIcon:/(?:\s|^)(fg-hover-(?:zoom|zoom2|zoom3|plus|circle-plus|eye|external|tint))(?:\s|$)/,videoIcon:/(?:\s|^)(fg-video-(?:default|1|2|3|4))(?:\s|$)/,hoverColor:/(?:\s|^)(fg-hover-(?:colorize|grayscale))(?:\s|$)/,hoverScale:/(?:\s|^)(fg-hover-scale)(?:\s|$)/,stickyVideoIcon:/(?:\s|^)(fg-video-sticky)(?:\s|$)/,insetShadow:/(?:\s|^)(fg-shadow-inset-(?:small|medium|large))(?:\s|$)/,filter:/(?:\s|^)(fg-filter-(?:1977|amaro|brannan|clarendon|earlybird|lofi|poprocket|reyes|toaster|walden|xpro2|xtreme))(?:\s|$)/}},{container:"foogallery"},{},-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){a.Component=b.Class.extend({construct:function(a){this.tmpl=a},destroy:function(){this.tmpl=null}}),a.EventComponent=b.EventClass.extend({construct:function(a,b){this._super(a),this.tmpl=a,this.tmplEventPrefix=b},destroy:function(){this._super(),this.tmpl=null},trigger:function(a,d){var e,f,g=this,h=g._super(a,d);return null!=g.tmpl&&(h instanceof b.Event&&!h.isDefaultPrevented()?(e=null!=h.namespace?[h.type,h.namespace].join("."):h.type,(f=g.tmpl.raise(g.tmplEventPrefix+e,d))&&f.isDefaultPrevented()&&h.preventDefault()):c.array(h)&&h.forEach(function(a){a.isDefaultPrevented()||(e=null!=a.namespace?[a.type,a.namespace].join("."):a.type,(f=g.tmpl.raise(g.tmplEventPrefix+e,d))&&f.isDefaultPrevented()&&a.preventDefault())})),c.empty(h)?null:1===h.length?h[0]:h}}),a.components=new b.Factory}(FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e){b.State=b.Component.extend({construct:function(a){var b=this;b._super(a),b.apiEnabled=!!window.history&&!!history.replaceState,b.opt=b.tmpl.opt.state,b.enabled=b.opt.enabled,b.current={filter:[],page:0,item:null},b.pushOrReplace=b.isPushOrReplace(b.opt.pushOrReplace)?b.opt.pushOrReplace:"replace",b.defaultMask="foogallery-gallery-{id}";var c=d.escapeRegExp(b.tmpl.id),e=d.escapeRegExp(b.getMasked()),f=d.escapeRegExp(b.opt.values),g=d.escapeRegExp(b.opt.pair);b.regex={exists:new RegExp("^#"+c+"\\"+f+".+?"),masked:new RegExp("^#"+e+"\\"+f+".+?"),values:new RegExp("(\\w+)"+g+"([^"+f+"]+)","g")}},destroy:function(a){var b=this;a||b.clear(),b.opt=b.regex={},b._super()},init:function(){this.set(this.initial())},getIdNumber:function(){return this.tmpl.id.match(/\d+/g)[0]},getMasked:function(){var a=this,b=d.contains(a.opt.mask,"{id}")?a.opt.mask:a.defaultMask;return d.format(b,{id:a.getIdNumber()})},isPushOrReplace:function(b){return-1!==a.inArray(b,["push","replace"])},exists:function(){return this.regex.values.lastIndex=0,(this.regex.exists.test(location.hash)||this.regex.masked.test(location.hash))&&this.regex.values.test(location.hash)},parse:function(){var b=this,c=b.tmpl,d={};if(b.exists())if(b.enabled){d.id=b.tmpl.id,b.regex.values.lastIndex=0;var e=location.hash.match(b.regex.values);a.each(e,function(a,e){var f,g=e.split(b.opt.pair);if(2===g.length)switch(g[0]){case b.opt.itemKey:f=c.items.fromHash(g[1]),null!==f&&(d.item=f);break;case b.opt.pageKey:c.pages&&null!==(f=c.pages.fromHash(g[1]))&&(d.page=f);break;case b.opt.filterKey:c.filter&&null!==(f=c.filter.fromHash(g[1]))&&(d.filter=f)}})}else b.apiEnabled?history.replaceState(null,"",location.pathname+location.search):location.hash="#";return d},hashify:function(a){var b=this,d=b.tmpl;if(c.hash(a)){var e=[],f=d.items.toHash(a.item);return null!==f&&e.push(b.opt.itemKey+b.opt.pair+f),d.filter&&null!==(f=d.filter.toHash(a.filter))&&e.push(b.opt.filterKey+b.opt.pair+f),d.pages&&null!==(f=d.pages.toHash(a.page))&&e.push(b.opt.pageKey+b.opt.pair+f),e.length>0&&e.unshift("#"+b.getMasked()),e.join(b.opt.values)}return""},replace:function(a){var d=this;if(d.enabled&&d.apiEnabled){a.id=d.tmpl.id;var f=d.hashify(a),g=c.empty(f),h=e.extend({},a,{item:a.item instanceof b.Item?a.item.id:a.item});history.replaceState(g?null:h,"",g?location.pathname+location.search:f)}},push:function(a){var d=this;if(d.enabled&&d.apiEnabled){a.id=d.tmpl.id;var f=d.hashify(a),g=c.empty(f),h=e.extend({},a,{item:a.item instanceof b.Item?a.item.id:a.item});history.pushState(g?null:h,"",g?location.pathname+location.search:f)}},update:function(a,b){var c=this;c.enabled&&c.apiEnabled&&(b=c.isPushOrReplace(b)?b:c.pushOrReplace,c[b](a))},clear:function(){this.exists()&&this.replace({})},initial:function(){var a=this,b=a.parse();return c.empty(b)?a.get():e.extend({filter:[],page:1,item:null},b)},get:function(a){var c,d=this,f=d.tmpl,g={};return a instanceof b.Item&&(g.item=a),f.filter&&null!==(c=f.filter.getState())&&(g.filter=c),f.pages&&null!==(c=f.pages.getState())&&(g.page=c),e.extend({filter:[],page:1,item:null},g)},set:function(a){var b=this,d=b.tmpl;if(c.hash(a)){var f=e.extend({filter:[],page:1,item:null},a);d.items.reset();d.raise("before-state",[f]).isDefaultPrevented()||(d.filter&&d.filter.setState(f),d.pages?d.pages.setState(f):(d.items.detach(d.items.all()),d.items.create(d.items.available(),!0)),f.item&&(b.opt.scrollTo&&f.item.scrollTo(),c.empty(a.item)||(a.item=null,b.replace(a))),b.current=f,d.raise("after-state",[f]))}}}),b.template.configure("core",{state:{enabled:!1,scrollTo:!0,pushOrReplace:"replace",mask:"foogallery-gallery-{id}",values:"/",pair:":",array:"+",arraySeparator:",",itemKey:"i",filterKey:"f",pageKey:"p"}}),b.components.register("state",b.State)}(FooGallery.$,FooGallery,FooGallery.utils.is,FooGallery.utils.str,FooGallery.utils.obj),function(a,b,c,d,e,f){b.Items=b.Component.extend({construct:function(a){var b=this;b.ALLOW_CREATE=!0,b.ALLOW_APPEND=!0,b.ALLOW_LOAD=!0,b._super(a),b.maps={},b._fetched=null,b._arr=[],b._available=[];var d=b.tmpl.cls.item.caption;b.tmpl.sel.item.caption.all=c.selectify([d.elem,d.inner,d.title,d.description])},fromHash:function(a){return this.get(a)},toHash:function(a){return a instanceof b.Item?a.id:null},destroy:function(){var b=this,c=b.all(),d=[];c.length>0&&(b.tmpl.raise("destroy-items",[c]),d=a.map(c,function(a){return a.destroy()?a:null}),d.length>0&&b.tmpl.raise("destroyed-items",[d])),b.maps={},b._fetched=null,b._arr=[],b._available=[],b._super()},fetch:function(b){var c=this;if(!b&&d.promise(c._fetched))return c._fetched;var e=c.tmpl,f=e.sel,g=e.opt.items,h=a.Deferred(),i=c.make(e.$el.find(f.item.elem));return d.empty(g)?(i.push.apply(i,c.make(window[e.id+"-items"])),h.resolve(i)):d.array(g)?(i.push.apply(i,c.make(g)),h.resolve(i)):d.string(g)?a.get(g).then(function(a){i.push.apply(i,c.make(a)),h.resolve(i)},function(a,b,c){console.log("FooGallery: GET items error.",g,a,b,c),h.resolve(i)}):h.resolve(i),h.then(function(a){c.setAll(a)}),c._fetched=h.promise()},toJSON:function(a){return(a?this.all():this.available()).map(function(a){return a.toJSON()})},all:function(){return this._arr.slice()},count:function(a){return a?this.all().length:this.available().length},available:function(a){return d.fn(a)?this._available.filter(a,this):this._available.slice()},get:function(a){var b=d.number(a)?"index":"id";return this.maps[b][a]?this.maps[b][a]:null},setAll:function(a){this._arr=d.array(a)?a:[],this.maps=this.createMaps(this._arr),this._available=this.all()},setAvailable:function(a){this.maps=this.createMaps(this._arr),this._available=d.array(a)?a:[]},reset:function(){this.setAvailable(this.all())},find:function(a,b){if(b=d.fn(b)?b:function(){return!0},d.array(a))for(var c=0,e=a.length;c<e;c++)if(!0===b.call(this,a[c]))return a[c];return null},first:function(a){return this.find(this._available,a)},last:function(a){return this.find(this._available.slice().reverse(),a)},next:function(a,c,e){if(!(a instanceof b.Item))return null;e=!!d.boolean(e)&&e;var f=this._available.slice(),g=f.indexOf(a);if(-1!==g){var h=f.slice(0,g);return f=f.slice(g+1),e&&(f=f.concat(h)),this.find(f,c)}return null},prev:function(a,c,e){if(!(a instanceof b.Item))return null;e=!!d.boolean(e)&&e;var f=this._available.slice().reverse(),g=f.indexOf(a);if(-1!==g){var h=f.slice(0,g);return f=f.slice(g+1),e&&(f=f.concat(h)),this.find(f,c)}return null},createMaps:function(b){b=d.array(b)?b:[];var c={id:{},index:{}};return a.each(b,function(a,b){d.empty(b.id)&&(b.id=""+(a+1)),b.index=a,c.id[b.id]=b,c.index[b.index]=b}),c},loadable:function(b){var e,f=this,g=f.tmpl.opt;return g.lazy&&(e=c.getViewportBounds(g.viewport)),f.ALLOW_LOAD&&d.array(b)?a.map(b,function(a){return a.isCreated&&a.isAttached&&!a.isLoading&&!a.isLoaded&&!a.isError&&(!g.lazy||g.lazy&&a.intersects(e))?a:null}):[]},creatable:function(c){return this.ALLOW_CREATE&&d.array(c)?a.map(c,function(a){return a instanceof b.Item&&!a.isCreated?a:null}):[]},appendable:function(c){return this.ALLOW_APPEND&&d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&!a.isAttached?a:null}):[]},detachable:function(c){return d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&a.isAttached?a:null}):[]},jquerify:function(b){return a(a.map(b,function(a){
11
+ return a.$el.get()}))},make:function(c){var e=this,g=[];if(d.jq(c)||d.array(c)){var h=[],i=a.makeArray(c);if(0===i.length)return g;e.tmpl.raise("make-items",[i]).isDefaultPrevented()||(g=a.map(i,function(a){var c=e.type(a),g=f.extend(d.hash(a)?a:{},{type:c}),i=b.components.make(c,e.tmpl,g);return d.element(a)?i.parse(a)?(h.push(i),e.ALLOW_APPEND||i.detach(),i):null:i})),g.length>0&&e.tmpl.raise("made-items",[g]),h.length>0&&e.tmpl.raise("parsed-items",[h])}return g},type:function(c){var e;if(d.hash(c))e=c.type;else if(d.element(c)){var f=a(c),g=this.tmpl.sel.item;e=f.find(g.anchor).data("type")}return d.string(e)&&b.components.contains(e)?e:"image"},create:function(b,c){var e=this,f=[],g=e.creatable(b);if(g.length>0){e.tmpl.raise("create-items",[g]).isDefaultPrevented()||(f=a.map(g,function(a){return a.create()?a:null})),f.length>0&&e.tmpl.raise("created-items",[f])}return d.boolean(c)&&c?e.append(b):f},append:function(b){var c=this,d=[],e=c.appendable(b);if(e.length>0){c.tmpl.raise("append-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.append()?a:null})),d.length>0&&c.tmpl.raise("appended-items",[d])}return d},detach:function(b){var c=this,d=[],e=c.detachable(b);if(e.length>0){c.tmpl.raise("detach-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.detach()?a:null})),d.length>0&&c.tmpl.raise("detached-items",[d])}return d},load:function(b){var c=this;if(b=c.loadable(b),b.length>0){if(!c.tmpl.raise("load-items",[b]).isDefaultPrevented()){var d=a.map(b,function(a){return a.load()});return e.when(d).done(function(a){c.tmpl.raise("loaded-items",[a])})}}return e.resolveWith([])}}),b.components.register("items",b.Items)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f,g){b.Item=b.Component.extend({construct:function(a,b){var c=this;c._super(a),c.cls=a.cls.item,c.il8n=a.il8n.item,c.sel=a.sel.item,c.opt=f.extend({},a.opt.item,b),c.isAttached=!1,c.isCreated=!1,c.isDestroyed=!1,c.isLoading=!1,c.isLoaded=!1,c.isError=!1,c.isParsed=!1,c.$el=null,c.$inner=null,c.$anchor=null,c.$overlay=null,c.$wrap=null,c.$image=null,c.$caption=null,c.fixLayout=c.tmpl.opt.fixLayout,c.index=-1,c.type=c.opt.type,c.id=c.opt.id,c.productId=c.opt.productId,c.href=c.opt.href,c.src=c.opt.src,c.srcset=c.opt.srcset,c.width=c.opt.width,c.height=c.opt.height,c.title=c.opt.title,c.alt=c.opt.alt,c.caption=d.empty(c.opt.caption)?c.title:c.opt.caption,c.description=d.empty(c.opt.description)?c.alt:c.opt.description,c.attr=c.opt.attr,c.tags=c.opt.tags,c.maxWidth=c.opt.maxWidth,c.maxCaptionLength=c.opt.maxCaptionLength,c.maxDescriptionLength=c.opt.maxDescriptionLength,c.showCaptionTitle=c.opt.showCaptionTitle,c.showCaptionDescription=c.opt.showCaptionDescription,c.noLightbox=c.opt.noLightbox,c.panelHide=c.opt.panelHide,c.exif=c.opt.exif,c.hasExif=d.exif(c.exif),c._thumbUrl=null,c._load=null,c._undo={classes:"",style:"",loader:!1,wrap:!1,overlay:!1,placeholder:!1}},destroy:function(){var a=this;return a.tmpl.raise("destroy-item",[a]).isDefaultPrevented()||(a.isDestroyed=a.doDestroyItem()),a.isDestroyed&&(a.tmpl.raise("destroyed-item",[a]),a._super()),a.isDestroyed},doDestroyItem:function(){var a=this;return a.isParsed?(a.$anchor.add(a.$caption).off("click.foogallery"),a.append(),d.empty(a._undo.classes)?a.$el.removeAttr("class"):a.$el.attr("class",a._undo.classes),d.empty(a._undo.style)?a.$el.removeAttr("style"):a.$el.attr("style",a._undo.style),a._undo.overlay&&a.$overlay.remove(),a._undo.wrap&&(a.$anchor.append(a.$image),a.$wrap.remove()),a._undo.loader&&a.$el.find(a.sel.loader).remove(),a._undo.placeholder&&a.$image.prop("src")===b.EMPTY_IMAGE&&a.$image.removeAttr("src")):a.isCreated&&(a.detach(),a.$el.remove()),!0},parse:function(b){var c=this,d=a(b);return!c.tmpl.raise("parse-item",[c,d]).isDefaultPrevented()&&(c.isCreated=d.is(c.sel.elem))&&(c.isParsed=c.doParseItem(d),c.fixLayout&&c.fix()),c.isParsed&&c.tmpl.raise("parsed-item",[c]),c.isParsed},doParseItem:function(c){var e=this,g=e.tmpl.opt,h=e.cls,i=e.sel;if(e._undo.classes=c.attr("class")||"",e._undo.style=c.attr("style")||"",e.$el=c.data(b.DATA_ITEM,e),e.$inner=e.$el.children(i.inner),e.$anchor=e.$inner.children(i.anchor).on("click.foogallery",{self:e},e.onAnchorClick),e.$image=e.$anchor.find(i.image),e.$caption=e.$inner.children(i.caption.elem).on("click.foogallery",{self:e},e.onCaptionClick),!(e.$el.length&&e.$inner.length&&e.$anchor.length&&e.$image.length))return console.error("FooGallery Error: Invalid HTML markup. Check the item markup for additional elements or malformed HTML in the title or description.",e),e.isError=!0,e.tmpl.raise("error-item",[e]),0!==e.$el.length&&e.$el.remove(),!1;e.isAttached=e.$el.parent().length>0,e.isLoading=e.$el.is(i.loading),e.isLoaded=e.$el.is(i.loaded),e.isError=e.$el.is(i.error);var j=e.$anchor.attr("data-type",e.type).data();e.id=j.id||e.id,e.productId=j.productId||e.productId,e.tags=j.tags||e.tags,e.href=j.href||e.$anchor.attr("href")||e.href,e.src=e.$image.attr(g.src)||e.src,e.srcset=e.$image.attr(g.srcset)||e.srcset,e.width=parseInt(e.$image.attr("width"))||e.width,e.height=parseInt(e.$image.attr("height"))||e.height,e.title=e.$image.attr("title")||e.title,e.alt=e.$image.attr("alt")||e.alt,e.caption=j.title||j.captionTitle||e.caption||e.title,e.description=j.description||j.captionDesc||e.description||e.alt,e.noLightbox=e.$anchor.hasClass(h.noLightbox),e.panelHide=e.$anchor.hasClass(h.panelHide),d.exif(j.exif)&&(e.exif=f.extend(e.exif,j.exif),e.hasExif=!0),d.empty(e.caption)&&(e.caption=a.trim(e.$caption.find(i.caption.title).html())),d.empty(e.description)&&(e.description=a.trim(e.$caption.find(i.caption.description).html())),d.number(e.maxCaptionLength)&&e.maxCaptionLength>0&&!d.empty(e.caption)&&d.string(e.caption)&&e.caption.length>e.maxCaptionLength&&e.$caption.find(i.caption.title).html(e.caption.substr(0,e.maxCaptionLength)+"&hellip;"),d.number(e.maxDescriptionLength)&&e.maxDescriptionLength>0&&!d.empty(e.description)&&d.string(e.description)&&e.description.length>e.maxDescriptionLength&&e.$caption.find(i.caption.description).html(e.description.substr(0,e.maxDescriptionLength)+"&hellip;"),e.$overlay=e.$anchor.children(i.overlay),0===e.$overlay.length&&(e.$overlay=a("<span/>",{class:h.overlay}),e.$anchor.append(e.$overlay),e._undo.overlay=!0),e.$wrap=e.$anchor.children(i.wrap),0===e.$wrap.length&&(e.$wrap=a("<span/>",{class:h.wrap}),e.$anchor.append(e.$wrap.append(e.$image)),e._undo.wrap=!0),0===e.$el.children(i.loader).length&&(e.$el.append(a("<div/>",{class:h.loader})),e._undo.loader=!0);var k=e.$image.get(0);return d.empty(k.src)&&(k.src=b.EMPTY_IMAGE,e._undo.placeholder=!0),e.$el.addClass(e.getTypeClass()),e.hasExif&&e.$el.addClass(h.exif),!e.isCreated||!e.isAttached||e.isLoading||e.isLoaded||e.isError||e.$el.addClass(h.idle),!0},create:function(){var a=this;if(!a.isCreated&&d.string(a.href)&&d.string(a.src)&&d.number(a.width)&&d.number(a.height)){a.tmpl.raise("create-item",[a]).isDefaultPrevented()||(a.isCreated=a.doCreateItem()),a.isCreated&&a.tmpl.raise("created-item",[a])}return a.isCreated},doCreateItem:function(){var c=this,e=c.tmpl.opt,f=c.cls,g=c.attr,h=c.getTypeClass(),i=c.hasExif?f.exif:"";g.elem.class=[f.elem,h,i,f.idle].join(" "),g.inner.class=f.inner;var j=[f.anchor];c.noLightbox&&j.push(f.noLightbox),c.panelHide&&j.push(f.panelHide),g.anchor.class=j.join(" "),g.anchor.href=c.href,g.anchor["data-type"]=c.type,g.anchor["data-id"]=c.id,g.anchor["data-title"]=c.caption,g.anchor["data-description"]=c.description,d.empty(c.tags)||(g.anchor["data-tags"]=JSON.stringify(c.tags)),d.empty(c.productId)||(g.anchor["data-product-id"]=c.productId),g.image.class=f.image,g.image[e.src]=c.src,g.image[e.srcset]=c.srcset,g.image.width=c.width,g.image.height=c.height,g.image.title=c.title,g.image.alt=c.alt,c.$el=a("<div/>").attr(g.elem).data(b.DATA_ITEM,c),c.$inner=a("<figure/>").attr(g.inner).appendTo(c.$el),c.$anchor=a("<a/>").attr(g.anchor).appendTo(c.$inner).on("click.foogallery",{self:c},c.onAnchorClick),c.$overlay=a("<span/>",{class:f.overlay}).appendTo(c.$anchor),c.$wrap=a("<span/>",{class:f.wrap}).appendTo(c.$anchor),c.$image=a("<img/>").attr(g.image).appendTo(c.$wrap),f=c.cls.caption,g=c.attr.caption,g.elem.class=f.elem,c.$caption=a("<figcaption/>").attr(g.elem).on("click.foogallery",{self:c},c.onCaptionClick),g.inner.class=f.inner;var k=a("<div/>").attr(g.inner).appendTo(c.$caption),l=c.showCaptionTitle&&!d.empty(c.caption),m=c.showCaptionDescription&&!d.empty(c.description);if(l||m){if(g.title.class=f.title,g.description.class=f.description,l){var n=a("<div/>").attr(g.title),o=c.caption;d.number(c.maxCaptionLength)&&c.maxCaptionLength>0&&d.string(c.caption)&&c.caption.length>c.maxCaptionLength&&(o=c.caption.substr(0,c.maxCaptionLength)+"&hellip;"),n.get(0).innerHTML=o,k.append(n)}if(m){var p=a("<div/>").attr(g.description),q=c.description;d.number(c.maxDescriptionLength)&&c.maxDescriptionLength>0&&d.string(c.description)&&c.description.length>c.maxDescriptionLength&&(q=c.description.substr(0,c.maxDescriptionLength)+"&hellip;"),p.get(0).innerHTML=q,k.append(p)}}return c.$caption.appendTo(c.$inner),0===c.$el.find(c.sel.loader).length&&c.$el.append(a("<div/>",{class:c.cls.loader})),!0},append:function(){var a=this;if(a.isCreated&&!a.isAttached){a.tmpl.raise("append-item",[a]).isDefaultPrevented()||(a.tmpl.$el.append(a.$el),!a.fixLayout&&a.isParsed||a.fix(),a.isAttached=!0),a.isAttached&&a.tmpl.raise("appended-item",[a])}return a.isAttached},detach:function(){var a=this;if(a.isCreated&&a.isAttached){a.tmpl.raise("detach-item",[a]).isDefaultPrevented()||(a.$el.detach(),!a.fixLayout&&a.isParsed||a.unfix(),a.isAttached=!1),a.isAttached||a.tmpl.raise("detached-item",[a])}return!a.isAttached},load:function(){var b=this;if(d.promise(b._load))return b._load;if(!b.isCreated||!b.isAttached)return e.rejectWith("not created or attached");if(b.tmpl.raise("load-item",[b]).isDefaultPrevented())return e.rejectWith("default prevented");var c=b.cls,f=b.$image.get(0),g=f.src;return b.isLoading=!0,b.$el.removeClass(c.idle).removeClass(c.loaded).removeClass(c.error).addClass(c.loading),b._load=a.Deferred(function(a){f.onload=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isLoaded=!0,b.$el.removeClass(c.loading).addClass(c.loaded),!b.fixLayout&&b.isParsed||b.unfix(),b.tmpl.raise("loaded-item",[b]),a.resolve(b)},f.onerror=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isError=!0,b.$el.removeClass(c.loading).addClass(c.error),d.string(g)&&b.$image.prop("src",g),b.tmpl.raise("error-item",[b]),a.reject(b)},f.src=b.getThumbUrl(),f.complete&&f.onload()}).promise()},fix:function(){var a=this;if(null==a.tmpl)return a;if(a.isCreated&&!a.isLoading&&!a.isLoaded&&!a.isError){var b=a.width,c=a.height,e=a.$image.get(0);if(!isNaN(b)&&!isNaN(c)&&e){var f=d.fn(a.maxWidth)?a.maxWidth(a):a.$image.width();f<=0&&(f=b);var g=f/b,h=c*g;a.$image.css({width:f,height:h})}}return a},unfix:function(){var a=this;return null==a.tmpl?a:(a.isCreated&&a.$image.css({width:"",height:""}),a)},getThumbSrc:function(a,b){return c.src(this.src,this.srcset,this.width,this.height,a,b)},getThumbUrl:function(a){a=!!d.boolean(a)&&a;var b=this;return!a&&d.string(b._thumbUrl)?b._thumbUrl:b._thumbUrl=b.getThumbSrc(b.$anchor.innerWidth(),b.$anchor.innerHeight())},getTypeClass:function(){return this.cls.types.hasOwnProperty(this.type)?this.cls.types[this.type]:""},scrollTo:function(a){var b=this;if(b.isAttached){var d=b.bounds(),e=c.getViewportBounds();switch(a){case"top":d.left+=d.width/2-e.width/2,d.top-=e.height/5;break;default:d.left+=d.width/2-e.width/2,d.top+=d.height/2-e.height/2}window.scrollTo(d.left,d.top)}return b},bounds:function(){return this.isAttached?c.getElementBounds(this.$el):null},intersects:function(a){return!!this.isAttached&&this.bounds().intersects(a)},updateState:function(){this.tmpl.state.update(this.tmpl.state.get(this))},toJSON:function(){return{type:this.type,id:this.id,productId:this.productId,href:this.href,src:this.src,srcset:this.srcset,width:this.width,height:this.height,alt:this.alt,title:this.title,caption:this.caption,description:this.description,tags:this.tags.slice(),maxCaptionLength:this.maxCaptionLength,maxDescriptionLength:this.maxDescriptionLength,showCaptionTitle:this.showCaptionTitle,showCaptionDescription:this.showCaptionDescription,noLightbox:this.noLightbox,panelHide:this.panelHide,attr:f.extend({},this.attr)}},onAnchorClick:function(a){var b=a.data.self;b.tmpl.raise("anchor-click-item",[b]).isDefaultPrevented()?a.preventDefault():b.updateState()},onCaptionClick:function(b){var c=b.data.self;!c.tmpl.raise("caption-click-item",[c]).isDefaultPrevented()&&c.$anchor.length>0&&!a(b.target).is("a,:input")&&c.$anchor.get(0).click()}}),b.template.configure("core",{item:{type:"item",id:"",href:"",src:"",srcset:"",width:0,height:0,title:"",alt:"",caption:"",description:"",tags:[],maxWidth:null,maxCaptionLength:0,maxDescriptionLength:0,showCaptionTitle:!0,showCaptionDescription:!0,noLightbox:!1,panelHide:!1,exif:{aperture:null,camera:null,date:null,exposure:null,focalLength:null,iso:null,orientation:null},attr:{elem:{},inner:{},anchor:{},image:{},caption:{elem:{},inner:{},title:{},description:{}}}}},{item:{elem:"fg-item",inner:"fg-item-inner",exif:"fg-item-exif",anchor:"fg-thumb",overlay:"fg-image-overlay",wrap:"fg-image-wrap",image:"fg-image",loader:"fg-loader",idle:"fg-idle",loading:"fg-loading",loaded:"fg-loaded",error:"fg-error",noLightbox:"fg-no-lightbox",panelHide:"fg-panel-hide",types:{item:"fg-type-unknown"},caption:{elem:"fg-caption",inner:"fg-caption-inner",title:"fg-caption-title",description:"fg-caption-desc"}}},{item:{exif:{aperture:"Aperture",camera:"Camera",date:"Date",exposure:"Exposure",focalLength:"Focal Length",iso:"ISO",orientation:"Orientation"}}}),b.components.register("item",b.Item)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj,FooGallery.utils.str),function(a,b,c,d){b.Image=b.Item.extend({}),b.template.configure("core",null,{item:{types:{image:"fg-type-image"}}}),b.components.register("image",b.Image)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Paging=b.Component.extend({construct:function(a){var b=this;b._super(a),b.opt=b.tmpl.opt.paging,b.cls=b.tmpl.cls.paging,b.il8n=b.tmpl.il8n.paging,b.sel=b.tmpl.sel.paging,b.pushOrReplace=b.opt.pushOrReplace,b.type=b.opt.type,b.theme=b.opt.theme,b.size=b.opt.size,b.position=b.opt.position,b.scrollToTop=b.opt.scrollToTop,b.current=0,b.total=0,b.ctrls=[],b._arr=[]},fromHash:function(a){var b=parseInt(a);return isNaN(b)?null:b},toHash:function(a){return d.number(a)&&a>0?a.toString():null},getState:function(){return this.isValid(this.current)?this.current:null},setState:function(a){this.rebuild(),a.item&&!this.contains(a.page,a.item)&&(a.page=this.find(a.item),a.page=0!==a.page?a.page:1),this.set(a.page,!1,!1,!0)},destroy:function(){var b=this;b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b._super()},build:function(){var a=this,c=a.tmpl.items.available();a.total=a.size>0&&c.length>0?Math.ceil(c.length/a.size):1;for(var d=0;d<a.total;d++)a._arr.push(c.splice(0,a.size));if(a.total>1&&b.paging.hasCtrl(a.type)){var e,f,g=a.position;"both"!==g&&"top"!==g||(e=b.paging.makeCtrl(a.type,a.tmpl,a,"top"),e.create()&&(e.append(),a.ctrls.push(e))),"both"!==g&&"bottom"!==g||(f=b.paging.makeCtrl(a.type,a.tmpl,a,"bottom"),f.create()&&(f.append(),a.ctrls.push(f)))}},rebuild:function(){var b=this;b.current=0,b.total=0,b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b.build()},all:function(){return this._arr.slice()},available:function(){return this.get(this.current)},items:function(){return this.get(this.current)},controls:function(b){var c=this;c.isValid(b)&&a.each(c.ctrls,function(a,c){c.update(b)})},isValid:function(a){return d.number(a)&&a>0&&a<=this.total},number:function(a){return this.isValid(a)?a:0===this.current?1:this.current},create:function(a,b){var c=this;a=c.number(a);var d=a-1;c.tmpl.items.detach(c.tmpl.items.all()),c.current=a,c.tmpl.items.create(c._arr[d],!0)},get:function(a){var b=this;return b.isValid(a)?(a=b.number(a),b._arr[a-1]):[]},set:function(a,b,c,e){var f=this;if(f.isValid(a)){var g,h=f.number(a);if(h!==f.current){var i=f.current,j=function(){if(c=!d.boolean(c)||c,e=!!d.boolean(e)&&e,c&&1===f.current&&!f.tmpl.state.exists()&&(g=f.tmpl.state.get(),f.tmpl.state.update(g,f.pushOrReplace)),f.controls(a),f.create(h,e),c&&(g=f.tmpl.state.get(),f.tmpl.state.update(g,f.pushOrReplace)),f.scrollToTop&&d.boolean(b)&&b){var j=f.get(f.current);j.length>0&&j[0].scrollTo("top")}f.tmpl.raise("after-page-change",[f.current,i,e])};return!f.tmpl.raise("before-page-change",[f.current,h,j,e]).isDefaultPrevented()&&(j(),!0)}}return!1},find:function(b){for(var c=this,d=0,e=c._arr.length;d<e;d++)if(-1!==a.inArray(b,c._arr[d]))return d+1;return 0},contains:function(b,c){var d=this.get(b);return-1!==a.inArray(c,d)},first:function(){this.goto(1)},last:function(){this.goto(this._arr.length)},prev:function(){this.goto(this.current-1)},next:function(){this.goto(this.current+1)},goto:function(a){var b=this;b.set(a,!0)&&b.tmpl.loadAvailable()}}),b.PagingControl=b.Component.extend({construct:function(a,b,c){var d=this;d._super(a),d.pages=b,d.position=c,d.$container=null},create:function(){var b=this;return b.$container=a("<nav/>",{class:b.pages.cls.container}).addClass(b.pages.theme),!0},destroy:function(){var a=this;a.$container.remove(),a.$container=null},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},update:function(a){}}),b.paging.register("default",b.Paging,null,{type:"none",theme:"fg-light",size:30,pushOrReplace:"push",position:"none",scrollToTop:!0},{container:"fg-paging-container"},null,-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Dots=b.Paging.extend({}),b.DotsControl=b.PagingControl.extend({construct:function(b,c,d){this._super(b,c,d),this.$container=a(),this.$list=a(),this.$items=a()},create:function(){for(var b,c=this,d=c.pages.cls,e=c.pages.il8n,f=[],g=a("<ul/>",{class:d.list}),h=0,i=c.pages.total;h<i;h++)f.push(b=c.createItem(h+1,e.page)),g.append(b);return c.$list=g,c.$container=a("<nav/>",{class:d.container}).addClass(c.pages.theme).append(g),c.$items=a(a.map(f,function(a){return a.get()})),!0},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},destroy:function(){var b=this,c=b.pages.sel;b.$list.find(c.link).off("click.foogallery",b.onLinkClick),b.$container.remove(),b.$container=a(),b.$list=a(),b.$items=a()},update:function(a){this.setSelected(a-1)},setSelected:function(b){var c=this,e=c.pages.cls,f=c.pages.il8n,g=c.pages.sel;c.$items.filter(g.selected).removeClass(e.selected).each(function(b,c){var e=a(c),f=e.data("label"),h=e.find(g.reader);d.string(f)&&0!==h.length&&h.html(f)}),c.$items.eq(b).addClass(e.selected).each(function(b,c){var e=a(c),h=e.find(g.reader),i=h.html();d.string(i)&&0!==h.length&&(e.data("label",i),h.html(f.current))})},createItem:function(b,c,e,f,g){e=d.string(e)?e:b,c=d.string(c)?c:"";var h=this,i=h.pages.opt,j=h.pages.cls,k=a("<a/>",{class:j.link,href:"#page-"+b}).html(e).on("click.foogallery",{self:h,page:b},h.onLinkClick);d.empty(c)||k.attr("title",c.replace(/\{PAGE}/g,b).replace(/\{LIMIT}/g,i.limit+"")),g=d.string(g)?g:c,d.empty(g)||k.prepend(a("<span/>",{class:j.reader,text:g.replace(/\{PAGE}/g,"").replace(/\{LIMIT}/g,i.limit+"")}));var l=a("<li/>",{class:j.item}).append(k);return f=d.string(f)?f:"",d.empty(f)||l.addClass(f),l},onLinkClick:function(b){b.preventDefault();var c=b.data.self,d=b.data.page,e=c.pages.sel;a(this).closest(e.item).is(e.disabled)||(c.pages.set(d,!0),c.tmpl.loadAvailable())}}),b.paging.register("dots",b.Dots,b.DotsControl,{type:"dots",position:"both",pushOrReplace:"push"},{list:"fg-dots",item:"fg-dot-item",link:"fg-dot-link",disabled:"fg-disabled",selected:"fg-selected",visible:"fg-visible",reader:"fg-sr-only"},{current:"Current page",page:"Page {PAGE}"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.DefaultTemplate=b.Template.extend({}),b.template.register("default",b.DefaultTemplate,null,{container:"foogallery fg-default"})}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d){b.MasonryTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.masonry=null,this.style=null,this.$columnWidth=null},getStylesheet:function(){var a=this;return null===a.style&&(a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style)),a.style.sheet},delayedLayout:function(){var a=this;a._delayedLayout&&clearTimeout(a._delayedLayout),a._delayedLayout=setTimeout(function(){a._delayedLayout=null,a.masonry.layout()},20)},onPreInit:function(b,c){var e=c.sel,f=c.cls;f.layouts=a.map(f.layout,function(a){return a}).join(" ");for(var g=a.map(f.layout,function(a,b){return{key:b,value:a}}),h=0,i=g.length;h<i;h++)if(c.$el.hasClass(g[h].value)){c.template.layout=g[h].key;break}d.string(f.layout[c.template.layout])||(c.template.layout="col4");var j,k,l="fixed"===c.template.layout;if(c.template.isFitWidth=l,c.template.percentPosition=!l,c.template.transitionDuration=0,c.template.itemSelector=e.item.elem,c.$el.removeClass(f.layouts).addClass(f.layout[c.template.layout]),l||(0===c.$el.find(e.gutterWidth).length&&c.$el.prepend(a("<div/>").addClass(f.gutterWidth)),c.template.gutter=e.gutterWidth),0===c.$el.find(e.columnWidth).length&&c.$el.prepend(a("<div/>").addClass(f.columnWidth)),l&&d.number(c.template.columnWidth)){var m=c.$el.find(e.columnWidth).width(c.template.columnWidth);j=c.getStylesheet(),k="#"+c.id+e.container+" "+e.item.elem+" { width: "+m.outerWidth()+"px; }",j.insertRule(k,0)}c.template.columnWidth=e.columnWidth,l&&d.number(c.template.gutter)&&(j=c.getStylesheet(),k="#"+c.id+e.container+" "+e.item.elem+" { margin-bottom: "+c.template.gutter+"px; }",j.insertRule(k,0)),c.masonry=new Masonry(c.$el.get(0),c.template)},onPostInit:function(a,b){b.masonry.layout()},onFirstLoad:function(a,b){b.masonry.layout()},onReady:function(a,b){b.delayedLayout()},onDestroy:function(a,b){b._delayedLayout&&clearTimeout(b._delayedLayout),b.$el.find(b.sel.columnWidth).remove(),b.$el.find(b.sel.gutterWidth).remove(),b.style&&b.style.parentNode&&b.style.parentNode.removeChild(b.style)},onDestroyed:function(a,b){b.masonry instanceof Masonry&&b.masonry.destroy()},onLayout:function(a,b){b.masonry.layout()},onParsedItems:function(a,b,c){b.masonry.layout()},onAppendedItems:function(a,b,c){c=b.items.jquerify(c),c=b.masonry.addItems(c),b.masonry.layoutItems(c,!0)},onDetachItem:function(a,b,c){a.isDefaultPrevented()||(a.preventDefault(),b.masonry.remove(c.$el),c.isAttached=!1,c.unfix())},onDetachedItems:function(a,b,c){b.masonry.layout()},onLoadedItems:function(a,b,c){b.masonry.layout()}}),b.template.register("masonry",b.MasonryTemplate,{fixLayout:!0,template:{initLayout:!1,isInitLayout:!1,layout:"col4"}},{container:"foogallery fg-masonry",columnWidth:"fg-column-width",gutterWidth:"fg-gutter-width",layout:{fixed:"fg-masonry-fixed",col2:"fg-masonry-2col",col3:"fg-masonry-3col",col4:"fg-masonry-4col",col5:"fg-masonry-5col"}})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Justified=c.Class.extend({construct:function(c,d){this.tmpl=c,this.$el=c.$el,this.options=a.extend(!0,{},b.Justified.defaults,d),this._items=[]},init:function(){var a=this;d.string(a.options.maxRowHeight)&&(a.options.maxRowHeight.indexOf("%")?a.options.maxRowHeight=a.options.rowHeight*(parseInt(a.options.maxRowHeight)/100):a.options.maxRowHeight=parseInt(a.options.maxRowHeight))},destroy:function(){this.$el.removeAttr("style")},parse:function(){var b=this;return b._items=a.map(b.tmpl.getItems(),function(a,b){return{index:b,width:a.width,height:a.height,top:0,left:0,$item:a.$el}})},getMaxRowHeight:function(){var a=this;return d.string(a.options.maxRowHeight)&&(a.options.maxRowHeight.indexOf("%")?a.options.maxRowHeight=a.options.rowHeight*(parseInt(a.options.maxRowHeight)/100):a.options.maxRowHeight=parseInt(a.options.maxRowHeight)),d.number(a.options.maxRowHeight)?a.options.maxRowHeight:a.options.rowHeight},getContainerWidth:function(){var a=this;return a.$el.is(":visible")?a.$el.width():a.$el.parents(":visible:first").innerWidth()},layout:function(){this.parse();var b=this,c=0,d=b.getContainerWidth(),e=b.getMaxRowHeight(),f=b.rows(d,e);a.each(f,function(a,d){d.visible&&(a>0&&(c+=b.options.margins),c+=d.height),b.render(d)}),b.$el.height(c)},render:function(a){for(var b,c=0,d=a.items.length;c<d;c++)b=a.items[c],a.visible?b.$item.css({width:b.width,height:b.height,top:b.top,left:b.left,display:"",maxHeight:this.options.maxRowHeight>0?this.options.maxRowHeight:""}).addClass("fg-positioned"):b.$item.css("display","none")},justify:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f,h=g/a.width;a.width=a.width*h,a.height=a.height*h,a.top=b,a.height>d&&(a.height=d),a.left=0,a.width<g&&(a.left=(g-a.width)/2),a.width+=f;for(var i,j=a.left,k=0,l=a.items.length;k<l;k++)k>0&&(j+=e.options.margins),i=a.items[k],i.left=j,i.top=b,i.width=i.width*h,i.height=i.height*h,i.height>d&&(i.height=d),j+=i.width;return a.height},position:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f;if(a.top=b,a.left=0,a.width<g)switch(d){case"center":a.left=(g-a.width)/2;break;case"right":a.left=g-a.width}a.width+=f;for(var h,i=a.left,j=0,k=a.items.length;j<k;j++)j>0&&(i+=e.options.margins),h=a.items[j],h.left=i,h.top=b,i+=h.width;return a.height},lastRow:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f,h=a.width/g>e.options.justifyThreshold;switch(e.options.lastRow){case"hide":h?e.justify(a,b,c,d):a.visible=!1;break;case"justify":e.justify(a,b,c,d);break;case"nojustify":h?e.justify(a,b,c,d):e.position(a,b,c,"left");break;case"left":case"center":case"right":h?e.justify(a,b,c,d):e.position(a,b,c,e.options.lastRow)}},items:function(){return a.map(this._items,function(a){return{index:a.index,width:a.width,height:a.height,$item:a.$item,top:a.top,left:a.left}})},rows:function(a,b){function c(){var a={index:++h,visible:!0,width:0,height:e.options.rowHeight,top:0,left:0,items:[]};return g.push(a),a}for(var d,e=this,f=e.items(),g=[],h=-1,i=c(),j=0,k=0,l=0,m=f.length;l<m;l++){if(d=f[l],d.height!=e.options.rowHeight){var n=e.options.rowHeight/d.height;d.height=d.height*n,d.width=d.width*n}k+d.width>a&&l>0&&(g.length>1&&(j+=e.options.margins),j+=e.justify(i,j,a,b),i=c(),k=0),i.items.length>0&&(k+=e.options.margins),k+=d.width,i.width+=d.width,i.items.push(d)}return g.length>1&&(j+=e.options.margins),e.lastRow(i,j,a,b),g}}),b.Justified.defaults={itemSelector:".fg-item",rowHeight:150,maxRowHeight:"200%",margins:0,lastRow:"center",justifyThreshold:1,refreshInterval:250}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.JustifiedTemplate=b.Template.extend({onPreInit:function(a,c){c.justified=new b.Justified(c,c.template)},onInit:function(a,b){b.justified.init()},onFirstLoad:function(a,b){b.justified.layout()},onReady:function(a,b){b.justified.layout()},onDestroy:function(a,b){b.justified.destroy()},onLayout:function(a,b){b.justified.layout()},onAfterPageChange:function(a,b,c,d,e){e||b.justified.layout()},onAfterFilterChange:function(a,b){b.justified.layout()}}),b.template.register("justified",b.JustifiedTemplate,null,{container:"foogallery fg-justified"})}(FooGallery.$,FooGallery,FooGallery.utils.is),function(a,b,c,d,e){b.PortfolioTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.style=null,this.fullWidth=!1},getStylesheet:function(){var a=this;return null===a.style&&(a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style)),a.style.sheet},onPreInit:function(a,b){b.appendCSS()},onPostInit:function(a,b){b.checkCSS()},onDestroy:function(a,b){b.removeCSS()},onLayout:function(a,b){b.checkCSS()},checkCSS:function(){var a=this,b=a.getContainerWidth();b<a.template.columnWidth!==a.fullWidth&&a.appendCSS(b)},appendCSS:function(a){var b=this;a=d.number(a)?a:b.getContainerWidth(),b.removeCSS();var c,e=b.getStylesheet(),f="#"+b.id+b.sel.container,g=f+" "+b.sel.item.elem,h=b.template.columnWidth,i=Math.ceil(b.template.gutter/2);switch(b.template.align){case"center":c=f+" { justify-content: center; }",e.insertRule(c,0);break;case"left":c=f+" { justify-content: flex-start; }",e.insertRule(c,0);break;case"right":c=f+" { justify-content: flex-end; }",e.insertRule(c,0)}b.fullWidth=a<h,b.fullWidth?(c=g+" { max-width: 100%; margin: "+i+"px; }",e.insertRule(c,0)):(c=g+" { max-width: "+h+"px; min-width: "+h+"px; margin: "+i+"px; }",e.insertRule(c,0))},removeCSS:function(){var a=this;a.style&&a.style.parentNode&&(a.style.parentNode.removeChild(a.style),a.style=null,a.fullWidth=!1)}}),b.template.register("simple_portfolio",b.PortfolioTemplate,{template:{gutter:40,align:"center",columnWidth:250}},{container:"foogallery fg-simple_portfolio"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d){b.ImageViewerTemplate=b.Template.extend({construct:function(b,c){this._super(d.extend({},b,{paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),c),this.$inner=a(),this.$current=a(),this.$total=a(),this.$prev=a(),this.$next=a()},createChildren:function(){var b=this;return a("<div/>",{class:b.cls.inner}).append(a("<div/>",{class:b.cls.innerContainer}),a("<div/>",{class:b.cls.controls}).append(a("<div/>",{class:b.cls.prev}).append(a("<span/>",{text:b.il8n.prev})),a("<label/>",{class:b.cls.count,text:b.il8n.count}).prepend(a("<span/>",{class:b.cls.countCurrent,text:"0"})).append(a("<span/>",{class:b.cls.countTotal,text:"0"})),a("<div/>",{class:b.cls.next}).append(a("<span/>",{text:b.il8n.next}))))},destroyChildren:function(){var a=this;a.$el.find(a.sel.inner).remove()},onPreInit:function(a,b){b.$inner=b.$el.find(b.sel.innerContainer),b.$current=b.$el.find(b.sel.countCurrent),b.$total=b.$el.find(b.sel.countTotal),b.$prev=b.$el.find(b.sel.prev),b.$next=b.$el.find(b.sel.next)},onInit:function(a,b){b.template.attachFooBox&&b.$el.on("foobox.previous",{self:b},b.onFooBoxPrev).on("foobox.next",{self:b},b.onFooBoxNext),b.$prev.on("click",{self:b},b.onPrevClick),b.$next.on("click",{self:b},b.onNextClick)},onFirstLoad:function(a,b){b.update()},onDestroy:function(a,b){b.template.attachFooBox&&b.$el.off({"foobox.previous":b.onFooBoxPrev,"foobox.next":b.onFooBoxNext}),b.$prev.off("click",b.onPrevClick),b.$next.off("click",b.onNextClick)},onAppendItem:function(a,b,c){a.preventDefault(),b.$inner.append(c.$el),c.fix(),c.isAttached=!0},onAfterPageChange:function(a,b,c,d,e){e||b.update()},onAfterFilterChange:function(a,b){b.update()},update:function(){this.pages&&(this.$current.text(this.pages.current),this.$total.text(this.pages.total))},prev:function(){this.pages&&(this.template.loop&&1===this.pages.current?this.pages.last():this.pages.prev(),this.update())},next:function(){this.pages&&(this.template.loop&&this.pages.current===this.pages.total?this.pages.first():this.pages.next(),this.update())},onFooBoxPrev:function(a){a.data.self.prev()},onFooBoxNext:function(a){a.data.self.next()},onPrevClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.prev()},onNextClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.next()}}),b.template.register("image-viewer",b.ImageViewerTemplate,{template:{attachFooBox:!1,loop:!1}},{container:"foogallery fg-image-viewer",inner:"fiv-inner",innerContainer:"fiv-inner-container",controls:"fiv-ctrls",prev:"fiv-prev",next:"fiv-next",count:"fiv-count",countCurrent:"fiv-count-current",countTotal:"fiv-count-total"},{prev:"Prev",next:"Next",
12
+ count:"of"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj),function(a,b,c){b.ThumbnailTemplate=b.Template.extend({construct:function(a,b){this._super(c.extend({},a,{filtering:{type:"none"},paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),b)}}),b.template.register("thumbnail",b.ThumbnailTemplate,null,{container:"foogallery fg-thumbnail"})}(FooGallery.$,FooGallery,FooGallery.utils.obj),function(a,b,c,d,e){b.triggerPostLoad=function(b,c,d,e,f){if("first-load"===b.type||c.initialized&&("after-page-change"===b.type&&!f||"after-filter-change"===b.type))try{if(c.$el.parents(".fbx-item").length>0)return;c.$el.hasClass("fbx-instance")&&window.FOOBOX&&a.fn.foobox?c.$el.foobox(window.FOOBOX.o):a("body").trigger("post-load")}catch(a){console.error(a)}},b.autoDefaults={on:{"first-load.foogallery after-page-change.foogallery after-filter-change.foogallery":b.triggerPostLoad}},b.autoEnabled=!0,b.auto=function(a){b.autoDefaults=d.merge(b.autoDefaults,a)},b.globalsMerged=!1,b.mergeGlobals=function(){if(!0!==b.globalsMerged&&window.FooGallery_il8n&&e.object(window.FooGallery_il8n)){var a=window.FooGallery_il8n;for(var d in a)if(a.hasOwnProperty(d)&&b[d]instanceof c.Factory&&e.object(a[d]))for(var f in a[d])a[d].hasOwnProperty(f)&&b[d].configure(f,null,null,a[d][f]);b.globalsMerged=!0}},b.load=b.reload=function(){a(function(){b.mergeGlobals(),b.autoEnabled&&a('[id^="foogallery-gallery-"]:not(.fg-ready)').foogallery(b.autoDefaults)}),c.ready(function(){b.mergeGlobals(),b.autoEnabled&&a('[id^="foogallery-gallery-"].fg-ready').foogallery(b.autoDefaults)})},b.load()}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj,FooGallery.utils.is);
foogallery.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: FooGallery
5
  Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
6
- Version: 1.9.24
7
  Author: FooPlugins
8
  Plugin URI: http://fooplugins.com/foogallery/
9
  Author URI: http://fooplugins.com
@@ -25,7 +25,7 @@ if ( function_exists( 'foogallery_fs' ) ) {
25
  define( 'FOOGALLERY_PATH', plugin_dir_path( __FILE__ ) );
26
  define( 'FOOGALLERY_URL', plugin_dir_url( __FILE__ ) );
27
  define( 'FOOGALLERY_FILE', __FILE__ );
28
- define( 'FOOGALLERY_VERSION', '1.9.24' );
29
  define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
30
  require_once FOOGALLERY_PATH . 'includes/constants.php';
31
  // Create a helper function for easy SDK access.
@@ -101,6 +101,8 @@ if ( function_exists( 'foogallery_fs' ) ) {
101
  FOOGALLERY_VERSION,
102
  'FooGallery'
103
  );
 
 
104
  //setup gallery post type
105
  new FooGallery_PostTypes();
106
  //load any extensions
3
  /*
4
  Plugin Name: FooGallery
5
  Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
6
+ Version: 1.9.25
7
  Author: FooPlugins
8
  Plugin URI: http://fooplugins.com/foogallery/
9
  Author URI: http://fooplugins.com
25
  define( 'FOOGALLERY_PATH', plugin_dir_path( __FILE__ ) );
26
  define( 'FOOGALLERY_URL', plugin_dir_url( __FILE__ ) );
27
  define( 'FOOGALLERY_FILE', __FILE__ );
28
+ define( 'FOOGALLERY_VERSION', '1.9.25' );
29
  define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
30
  require_once FOOGALLERY_PATH . 'includes/constants.php';
31
  // Create a helper function for easy SDK access.
101
  FOOGALLERY_VERSION,
102
  'FooGallery'
103
  );
104
+ //load text domain
105
+ $this->load_plugin_textdomain();
106
  //setup gallery post type
107
  new FooGallery_PostTypes();
108
  //load any extensions
js/foogallery.admin.min.js CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
- * @version 1.4.12
4
  * @link
5
  * @copyright Steven Usher & Brad Vincent 2015
6
  * @license Released under the GPLv3 license.
1
  /*
2
  * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
+ * @version 1.4.13
4
  * @link
5
  * @copyright Steven Usher & Brad Vincent 2015
6
  * @license Released under the GPLv3 license.