Unlimited Elements For Elementor (Free Widgets, Addons, Templates) - Version 1.5.10

Version Description

Download this release

Release Info

Developer valiano
Plugin Icon 128x128 Unlimited Elements For Elementor (Free Widgets, Addons, Templates)
Version 1.5.10
Comparing to
See all releases

Code changes from version 1.5.3 to 1.5.10

Files changed (46) hide show
  1. assets_libraries/filters/ue_filters.js +104 -21
  2. assets_libraries/owl-carousel-new/owl.carousel.js +3545 -3505
  3. assets_libraries/owl-carousel-new/owl.carousel.min.js +2 -3
  4. assets_libraries/remote/ue-remote-controls.js +2 -3
  5. assets_libraries/unitegallery/js/unitegallery.js +32 -12
  6. assets_libraries/unitegallery/js/unitegallery.min.js +2 -2
  7. images/gallery1.jpg +0 -0
  8. images/gallery2.jpg +0 -0
  9. images/gallery3.jpg +0 -0
  10. images/gallery4.jpg +0 -0
  11. images/gallery5.jpg +0 -0
  12. images/gallery6.jpg +0 -0
  13. inc_php/framework/functions.class.php +2 -1
  14. inc_php/unitecreator_addon.class.php +14 -31
  15. inc_php/unitecreator_addon_validator.class.php +2 -0
  16. inc_php/unitecreator_dialog_param.class.php +82 -4
  17. inc_php/unitecreator_filters_process.class.php +73 -110
  18. inc_php/unitecreator_helper.class.php +3 -1
  19. inc_php/unitecreator_helperhtml.class.php +34 -0
  20. inc_php/unitecreator_operations.class.php +48 -0
  21. inc_php/unitecreator_output.class.php +35 -8
  22. inc_php/unitecreator_params_processor.class.php +2 -2
  23. inc_php/unitecreator_settings.class.php +19 -12
  24. inc_php/unitecreator_template_engine.class.php +38 -55
  25. inc_php/unitecreator_unitegallery.class.php +0 -1
  26. includes.php +1 -1
  27. js/admin.js +1 -3
  28. js/select2/select2.sortable.css +54 -0
  29. js/select2/select2.sortable.js +234 -0
  30. js/unitecreator_admin.js +28 -15
  31. js/unitecreator_params_dialog.js +21 -4
  32. js/unitecreator_params_editor.js +19 -4
  33. provider/core/plugins/unlimited_elements/dialog_param_elementor.class.php +5 -0
  34. provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js +13 -4
  35. provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php +14 -7
  36. provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php +44 -9
  37. provider/core/plugins/unlimited_elements/elementor/pagination.class.php +27 -17
  38. provider/functions_wordpress.class.php +14 -6
  39. provider/provider_helper.class.php +19 -0
  40. provider/provider_params_processor.class.php +345 -60
  41. provider/provider_settings.class.php +317 -213
  42. provider/woocommerce_integrate.class.php +68 -0
  43. readme.txt +125 -75
  44. release_log.txt +66 -0
  45. unlimited_elements.php +3 -3
  46. views/objects/addon_view_childparams.class.php +19 -2
assets_libraries/filters/ue_filters.js CHANGED
@@ -16,7 +16,12 @@ function UEDynamicFilters(){
16
  CLASS_GRID:"uc-filterable-grid",
17
  handleTrashold:null,
18
  DEBUG_AJAX_OPTIONS: false,
19
- CLASS_CLICKED:"uc-clicked"
 
 
 
 
 
20
  };
21
 
22
  var g_options = {
@@ -408,28 +413,49 @@ function UEDynamicFilters(){
408
  return(null);
409
  }
410
 
 
411
  /**
412
  * clear non main grid filters
 
413
  */
414
- function clearGridFilters(objGrid){
415
-
416
  var objFilters = objGrid.data("filters");
417
 
418
  if(!objFilters)
419
  return(false);
420
-
421
  if(objFilters.length == 0)
422
  return(false);
423
 
 
 
424
  jQuery.each(objFilters, function(index, filter){
425
 
426
  var objFilter = jQuery(filter);
 
427
 
428
- var isMainFilter = objFilter.data("ismain");
 
 
 
429
 
430
- if(isMainFilter == true)
431
  return(true);
432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  clearFilter(objFilter);
434
 
435
  });
@@ -447,6 +473,10 @@ function UEDynamicFilters(){
447
  case g_types.TERMS_LIST:
448
  var objSelectedItems = objFilter.find(".ue_taxonomy_item.uc-selected");
449
  objSelectedItems.removeClass("uc-selected");
 
 
 
 
450
  break;
451
  }
452
 
@@ -680,10 +710,16 @@ function UEDynamicFilters(){
680
  throw new Error("Grid not found");
681
 
682
  //if main filter - clear other filters
683
- var isMainFilter = objTermsFilter.data("ismain");
 
 
684
 
685
- if(isMainFilter == true)
686
- clearGridFilters(objGrid);
 
 
 
 
687
 
688
  //refresh grid
689
  refreshAjaxGrid(objGrid);
@@ -967,8 +1003,9 @@ function UEDynamicFilters(){
967
 
968
  if(objGrid.length == 0)
969
  return(false);
970
-
971
- objItemsWrapper = getGridItemsWrapper(objGrid);
 
972
 
973
  operateAjax_setHtmlDebug(response, objGrid);
974
 
@@ -980,12 +1017,44 @@ function UEDynamicFilters(){
980
 
981
  var htmlItems = getVal(response, "html_items");
982
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
983
  if(isLoadMore === true){
984
 
985
  objItemsWrapper.append(htmlItems);
986
 
 
 
 
987
  }else{
988
  objItemsWrapper.html(htmlItems);
 
 
 
 
989
  }
990
 
991
 
@@ -1026,8 +1095,8 @@ function UEDynamicFilters(){
1026
 
1027
  var htmlInner = objHtml.html();
1028
 
1029
- objFilter.removeClass("uc-filter-initing");
1030
- objFilter.removeClass("uc-ajax-refresh-soon");
1031
 
1032
  objFilter.html(htmlInner);
1033
 
@@ -1087,7 +1156,7 @@ function UEDynamicFilters(){
1087
 
1088
  operateAjax_setHtmlWidgets(response, objFilters);
1089
 
1090
- objGrid.trigger("uc_ajax_refreshed");
1091
 
1092
  //scroll to top
1093
  if(isLoadMore == false){
@@ -1326,16 +1395,24 @@ function UEDynamicFilters(){
1326
  /**
1327
  * get grid items wrapper
1328
  */
1329
- function getGridItemsWrapper(objGrid){
 
 
 
 
 
1330
 
1331
- if(objGrid.hasClass("uc-items-wrapper"))
1332
  return(objGrid);
1333
 
1334
- var objItemsWrapper = objGrid.find(".uc-items-wrapper");
1335
 
1336
- if(objItemsWrapper.length == 0)
1337
  throw new Error("Missing items wrapper - with class: uc-items-wrapper");
1338
 
 
 
 
1339
  return(objItemsWrapper);
1340
  }
1341
 
@@ -1575,9 +1652,16 @@ function UEDynamicFilters(){
1575
  isNoRefresh = true;
1576
  }
1577
 
 
 
 
 
 
1578
  objFilter.data("uc_norefresh",false);
1579
 
1580
- var isMainFilter = objFilter.data("ismain");
 
 
1581
 
1582
  //add to refresh filter if it's qualify
1583
  var isRefresh = true;
@@ -1588,7 +1672,6 @@ function UEDynamicFilters(){
1588
  if(isNoRefresh === true)
1589
  isRefresh = false;
1590
 
1591
-
1592
  if(isRefresh == true){
1593
 
1594
  var filterWidgetID = getElementWidgetID(objFilter);
@@ -1753,7 +1836,7 @@ function UEDynamicFilters(){
1753
 
1754
  var objGrid = getClosestGrid(objFilter);
1755
 
1756
- var error = "Filter Parent not found! Please put the posts element on the page, and turn on 'Enable Ajax' option on it";
1757
 
1758
  if(!objGrid){
1759
  showElementError(objFilter, error);
16
  CLASS_GRID:"uc-filterable-grid",
17
  handleTrashold:null,
18
  DEBUG_AJAX_OPTIONS: false,
19
+ CLASS_CLICKED:"uc-clicked",
20
+ CLASS_HIDDEN: "uc-filter-hidden",
21
+ CLASS_INITING: "uc-filter-initing",
22
+ CLASS_REFRESH_SOON: "uc-ajax-refresh-soon",
23
+ EVENT_SET_HTML_ITEMS: "uc_ajax_sethtml",
24
+ EVENT_AJAX_REFRESHED: "uc_ajax_refreshed" //on grid
25
  };
26
 
27
  var g_options = {
413
  return(null);
414
  }
415
 
416
+
417
  /**
418
  * clear non main grid filters
419
+ * hide children and just clear the main filters
420
  */
421
+ function clearChildFilters(objGrid, objCurrentFilter, isHideChildren){
422
+
423
  var objFilters = objGrid.data("filters");
424
 
425
  if(!objFilters)
426
  return(false);
427
+
428
  if(objFilters.length == 0)
429
  return(false);
430
 
431
+ var currentFilterID = objCurrentFilter.attr("id");
432
+
433
  jQuery.each(objFilters, function(index, filter){
434
 
435
  var objFilter = jQuery(filter);
436
+ var filterID = objFilter.attr("id");
437
 
438
+ if(filterID == currentFilterID)
439
+ return(true);
440
+
441
+ var role = objFilter.data("role");
442
 
443
+ if(role != "child" && role != "main")
444
  return(true);
445
 
446
+ switch(role){
447
+ case "child":
448
+ if(isHideChildren == true)
449
+ objFilter.addClass(g_vars.CLASS_HIDDEN);
450
+ else
451
+ objFilter.removeClass(g_vars.CLASS_HIDDEN);
452
+
453
+ //put initing class
454
+ objFilter.addClass(g_vars.CLASS_INITING);
455
+
456
+ break;
457
+ }
458
+
459
  clearFilter(objFilter);
460
 
461
  });
473
  case g_types.TERMS_LIST:
474
  var objSelectedItems = objFilter.find(".ue_taxonomy_item.uc-selected");
475
  objSelectedItems.removeClass("uc-selected");
476
+
477
+ var objAll = objFilter.find(".ue_taxonomy_item.uc-item-all");
478
+ objAll.addClass("uc-selected");
479
+
480
  break;
481
  }
482
 
710
  throw new Error("Grid not found");
711
 
712
  //if main filter - clear other filters
713
+ var filterRole = objTermsFilter.data("role");
714
+
715
+ var termID = objLink.data("id");
716
 
717
+ var isHideChildren = false;
718
+ if(!termID)
719
+ isHideChildren = true;
720
+
721
+ if(filterRole == "main")
722
+ clearChildFilters(objGrid, objTermsFilter, isHideChildren);
723
 
724
  //refresh grid
725
  refreshAjaxGrid(objGrid);
1003
 
1004
  if(objGrid.length == 0)
1005
  return(false);
1006
+
1007
+ var objItemsWrapper = getGridItemsWrapper(objGrid);
1008
+ var objItemsWrapper2 = getGridItemsWrapper(objGrid, true);
1009
 
1010
  operateAjax_setHtmlDebug(response, objGrid);
1011
 
1017
 
1018
  var htmlItems = getVal(response, "html_items");
1019
 
1020
+ var htmlItems2 = null;
1021
+
1022
+ if(objItemsWrapper2)
1023
+ htmlItems2 = getVal(response, "html_items2");
1024
+
1025
+ //replace widget id
1026
+ var gridID = objGrid.attr("id");
1027
+
1028
+ htmlItems = replaceAll(htmlItems, "%uc_widget_id%", gridID);
1029
+
1030
+ if(htmlItems2)
1031
+ htmlItems2 = replaceAll(htmlItems2, "%uc_widget_id%", gridID);
1032
+
1033
+ var isCustomRefresh = objGrid.data("custom-sethtml");
1034
+
1035
+ //if custom refresh - just save the new html in data
1036
+ if(isCustomRefresh == true){
1037
+
1038
+ objGrid.trigger(g_vars.EVENT_SET_HTML_ITEMS,[htmlItems, isLoadMore, htmlItems2]);
1039
+ return(false);
1040
+ }
1041
+
1042
+ if(!htmlItems2)
1043
+ htmlItems2 = "";
1044
+
1045
  if(isLoadMore === true){
1046
 
1047
  objItemsWrapper.append(htmlItems);
1048
 
1049
+ if(objItemsWrapper)
1050
+ objItemsWrapper.append(htmlItems2);
1051
+
1052
  }else{
1053
  objItemsWrapper.html(htmlItems);
1054
+
1055
+ if(objItemsWrapper2)
1056
+ objItemsWrapper2.html(htmlItems2);
1057
+
1058
  }
1059
 
1060
 
1095
 
1096
  var htmlInner = objHtml.html();
1097
 
1098
+ objFilter.removeClass(g_vars.CLASS_INITING);
1099
+ objFilter.removeClass(g_vars.CLASS_REFRESH_SOON);
1100
 
1101
  objFilter.html(htmlInner);
1102
 
1156
 
1157
  operateAjax_setHtmlWidgets(response, objFilters);
1158
 
1159
+ objGrid.trigger(g_vars.EVENT_AJAX_REFRESHED);
1160
 
1161
  //scroll to top
1162
  if(isLoadMore == false){
1395
  /**
1396
  * get grid items wrapper
1397
  */
1398
+ function getGridItemsWrapper(objGrid, isSecond){
1399
+
1400
+ var classItems = "uc-items-wrapper";
1401
+
1402
+ if(isSecond == true)
1403
+ classItems = "uc-items-wrapper2";
1404
 
1405
+ if(objGrid.hasClass(classItems))
1406
  return(objGrid);
1407
 
1408
+ var objItemsWrapper = objGrid.find("."+classItems);
1409
 
1410
+ if(objItemsWrapper.length == 0 && isSecond == false)
1411
  throw new Error("Missing items wrapper - with class: uc-items-wrapper");
1412
 
1413
+ if(objItemsWrapper.length == 0)
1414
+ return(null);
1415
+
1416
  return(objItemsWrapper);
1417
  }
1418
 
1652
  isNoRefresh = true;
1653
  }
1654
 
1655
+ //if hidden - no refresh
1656
+ var isFilterHidden = objFilter.hasClass(g_vars.CLASS_HIDDEN);
1657
+ if(isFilterHidden == true)
1658
+ isNoRefresh = true;
1659
+
1660
  objFilter.data("uc_norefresh",false);
1661
 
1662
+ var filterRole = objFilter.data("role");
1663
+
1664
+ var isMainFilter = (filterRole == "main");
1665
 
1666
  //add to refresh filter if it's qualify
1667
  var isRefresh = true;
1672
  if(isNoRefresh === true)
1673
  isRefresh = false;
1674
 
 
1675
  if(isRefresh == true){
1676
 
1677
  var filterWidgetID = getElementWidgetID(objFilter);
1836
 
1837
  var objGrid = getClosestGrid(objFilter);
1838
 
1839
+ var error = "Filter Parent not found! Please put the posts element on the page, and turn on 'Enable Post Filtering' option on it";
1840
 
1841
  if(!objGrid){
1842
  showElementError(objFilter, error);
assets_libraries/owl-carousel-new/owl.carousel.js CHANGED
@@ -1,3506 +1,3546 @@
1
- /**
2
- * Owl Carousel v2.3.6 - UE4
3
- * Copyright 2013-2018 David Deutsch
4
- * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
5
- */
6
- /**
7
- * Owl carousel
8
- * @version 2.3.5
9
- * @author Bartosz Wojciechowski
10
- * @author David Deutsch
11
- * @license The MIT License (MIT)
12
- * @todo Lazy Load Icon
13
- * @todo prevent animationend bubling
14
- * @todo itemsScaleUp
15
- * @todo Test Zepto
16
- * @todo stagePadding calculate wrong active classes
17
- */
18
- ;(function($, window, document, undefined) {
19
-
20
- /**
21
- * Creates a carousel.
22
- * @class The Owl Carousel.
23
- * @public
24
- * @param {HTMLElement|jQuery} element - The element to create the carousel for.
25
- * @param {Object} [options] - The options
26
- */
27
- function Owl(element, options) {
28
-
29
- /**
30
- * Current settings for the carousel.
31
- * @public
32
- */
33
- this.settings = null;
34
-
35
- /**
36
- * Current options set by the caller including defaults.
37
- * @public
38
- */
39
- this.options = $.extend({}, Owl.Defaults, options);
40
-
41
- /**
42
- * Plugin element.
43
- * @public
44
- */
45
- this.$element = $(element);
46
-
47
- /**
48
- * Proxied event handlers.
49
- * @protected
50
- */
51
- this._handlers = {};
52
-
53
- /**
54
- * References to the running plugins of this carousel.
55
- * @protected
56
- */
57
- this._plugins = {};
58
-
59
- /**
60
- * Currently suppressed events to prevent them from being retriggered.
61
- * @protected
62
- */
63
- this._supress = {};
64
-
65
- /**
66
- * Absolute current position.
67
- * @protected
68
- */
69
- this._current = null;
70
-
71
- /**
72
- * Animation speed in milliseconds.
73
- * @protected
74
- */
75
- this._speed = null;
76
-
77
- /**
78
- * Coordinates of all items in pixel.
79
- * @todo The name of this member is missleading.
80
- * @protected
81
- */
82
- this._coordinates = [];
83
-
84
- /**
85
- * Current breakpoint.
86
- * @todo Real media queries would be nice.
87
- * @protected
88
- */
89
- this._breakpoint = null;
90
-
91
- /**
92
- * Current width of the plugin element.
93
- */
94
- this._width = null;
95
-
96
- /**
97
- * All real items.
98
- * @protected
99
- */
100
- this._items = [];
101
-
102
- /**
103
- * All cloned items.
104
- * @protected
105
- */
106
- this._clones = [];
107
-
108
- /**
109
- * Merge values of all items.
110
- * @todo Maybe this could be part of a plugin.
111
- * @protected
112
- */
113
- this._mergers = [];
114
-
115
- /**
116
- * Widths of all items.
117
- */
118
- this._widths = [];
119
-
120
- /**
121
- * Invalidated parts within the update process.
122
- * @protected
123
- */
124
- this._invalidated = {};
125
-
126
- /**
127
- * Ordered list of workers for the update process.
128
- * @protected
129
- */
130
- this._pipe = [];
131
-
132
- /**
133
- * Current state information for the drag operation.
134
- * @todo #261
135
- * @protected
136
- */
137
- this._drag = {
138
- time: null,
139
- target: null,
140
- pointer: null,
141
- stage: {
142
- start: null,
143
- current: null
144
- },
145
- direction: null
146
- };
147
-
148
- /**
149
- * Current state information and their tags.
150
- * @type {Object}
151
- * @protected
152
- */
153
- this._states = {
154
- current: {},
155
- tags: {
156
- 'initializing': [ 'busy' ],
157
- 'animating': [ 'busy' ],
158
- 'dragging': [ 'interacting' ]
159
- }
160
- };
161
-
162
- $.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) {
163
- this._handlers[handler] = $.proxy(this[handler], this);
164
- }, this));
165
-
166
- $.each(Owl.Plugins, $.proxy(function(key, plugin) {
167
- this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
168
- = new plugin(this);
169
- }, this));
170
-
171
- $.each(Owl.Workers, $.proxy(function(priority, worker) {
172
- this._pipe.push({
173
- 'filter': worker.filter,
174
- 'run': $.proxy(worker.run, this)
175
- });
176
- }, this));
177
-
178
- this.setup();
179
- this.initialize();
180
- }
181
-
182
- /**
183
- * Default options for the carousel.
184
- * @public
185
- */
186
- Owl.Defaults = {
187
- items: 3,
188
- loop: false,
189
- center: false,
190
- rewind: false,
191
- checkVisibility: true,
192
- setActiveClass: true,
193
- setActiveClassOnMobile: true,
194
-
195
- mouseDrag: true,
196
- touchDrag: true,
197
- pullDrag: true,
198
- freeDrag: false,
199
-
200
- margin: 0,
201
- stagePadding: 0,
202
-
203
- merge: false,
204
- mergeFit: true,
205
- autoWidth: false,
206
-
207
- startPosition: 0,
208
- rtl: false,
209
-
210
- smartSpeed: 250,
211
- fluidSpeed: false,
212
- dragEndSpeed: false,
213
-
214
- responsive: {},
215
- responsiveRefreshRate: 200,
216
- responsiveBaseElement: window,
217
-
218
- fallbackEasing: 'swing',
219
- slideTransition: '',
220
-
221
- info: false,
222
-
223
- nestedItemSelector: false,
224
- itemElement: 'div',
225
- stageElement: 'div',
226
-
227
- refreshClass: 'owl-refresh',
228
- loadedClass: 'owl-loaded',
229
- loadingClass: 'owl-loading',
230
- rtlClass: 'owl-rtl',
231
- responsiveClass: 'owl-responsive',
232
- dragClass: 'owl-drag',
233
- itemClass: 'owl-item',
234
- stageClass: 'owl-stage',
235
- stageOuterClass: 'owl-stage-outer',
236
- grabClass: 'owl-grab',
237
- shuffle: false
238
- };
239
-
240
- /**
241
- * Enumeration for width.
242
- * @public
243
- * @readonly
244
- * @enum {String}
245
- */
246
- Owl.Width = {
247
- Default: 'default',
248
- Inner: 'inner',
249
- Outer: 'outer'
250
- };
251
-
252
- /**
253
- * Enumeration for types.
254
- * @public
255
- * @readonly
256
- * @enum {String}
257
- */
258
- Owl.Type = {
259
- Event: 'event',
260
- State: 'state'
261
- };
262
-
263
- /**
264
- * Contains all registered plugins.
265
- * @public
266
- */
267
- Owl.Plugins = {};
268
-
269
- /**
270
- * List of workers involved in the update process.
271
- */
272
- Owl.Workers = [ {
273
- filter: [ 'width', 'settings' ],
274
- run: function() {
275
- this._width = this.$element.width();
276
- }
277
- }, {
278
- filter: [ 'width', 'items', 'settings' ],
279
- run: function(cache) {
280
- cache.current = this._items && this._items[this.relative(this._current)];
281
- }
282
- }, {
283
- filter: [ 'items', 'settings' ],
284
- run: function() {
285
- this.$stage.children('.cloned').remove();
286
- }
287
- }, {
288
- filter: [ 'width', 'items', 'settings' ],
289
- run: function(cache) {
290
- var margin = this.settings.margin || '',
291
- grid = !this.settings.autoWidth,
292
- rtl = this.settings.rtl,
293
- css = {
294
- 'width': 'auto',
295
- 'margin-left': rtl ? margin : '',
296
- 'margin-right': rtl ? '' : margin
297
- };
298
-
299
- !grid && this.$stage.children().css(css);
300
-
301
- cache.css = css;
302
- }
303
- }, {
304
- filter: [ 'width', 'items', 'settings' ],
305
- run: function(cache) {
306
- var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
307
- merge = null,
308
- iterator = this._items.length,
309
- grid = !this.settings.autoWidth,
310
- widths = [];
311
-
312
- cache.items = {
313
- merge: false,
314
- width: width
315
- };
316
-
317
- while (iterator--) {
318
- merge = this._mergers[iterator];
319
- merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge;
320
-
321
- cache.items.merge = merge > 1 || cache.items.merge;
322
-
323
- widths[iterator] = !grid ? this._items[iterator].width() : width * merge;
324
- }
325
-
326
- this._widths = widths;
327
- }
328
- }, {
329
- filter: [ 'items', 'settings' ],
330
- run: function() {
331
- var clones = [],
332
- items = this._items,
333
- settings = this.settings,
334
- // TODO: Should be computed from number of min width items in stage
335
- view = Math.max(settings.items * 2, 4),
336
- size = Math.ceil(items.length / 2) * 2,
337
- repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0,
338
- append = '',
339
- prepend = '';
340
-
341
- repeat /= 2;
342
-
343
- while (repeat > 0) {
344
- // Switch to only using appended clones
345
- clones.push(this.normalize(clones.length / 2, true));
346
- append = append + items[clones[clones.length - 1]][0].outerHTML;
347
- clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
348
- prepend = items[clones[clones.length - 1]][0].outerHTML + prepend;
349
- repeat -= 1;
350
- }
351
-
352
- this._clones = clones;
353
-
354
- $(append).addClass('cloned').appendTo(this.$stage);
355
- $(prepend).addClass('cloned').prependTo(this.$stage);
356
- }
357
- }, {
358
- filter: [ 'width', 'items', 'settings' ],
359
- run: function() {
360
- var rtl = this.settings.rtl ? 1 : -1,
361
- size = this._clones.length + this._items.length,
362
- iterator = -1,
363
- previous = 0,
364
- current = 0,
365
- coordinates = [];
366
-
367
- while (++iterator < size) {
368
- previous = coordinates[iterator - 1] || 0;
369
- current = this._widths[this.relative(iterator)] + this.settings.margin;
370
- coordinates.push(previous + current * rtl);
371
- }
372
-
373
- this._coordinates = coordinates;
374
- }
375
- }, {
376
- filter: [ 'width', 'items', 'settings' ],
377
- run: function() {
378
- var padding = this.settings.stagePadding,
379
- coordinates = this._coordinates,
380
- css = {
381
- 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
382
- 'padding-left': padding || '',
383
- 'padding-right': padding || ''
384
- };
385
-
386
- this.$stage.css(css);
387
- }
388
- }, {
389
- filter: [ 'width', 'items', 'settings' ],
390
- run: function(cache) {
391
- var iterator = this._coordinates.length,
392
- grid = !this.settings.autoWidth,
393
- items = this.$stage.children();
394
-
395
- if (grid && cache.items.merge) {
396
- while (iterator--) {
397
- cache.css.width = this._widths[this.relative(iterator)];
398
- items.eq(iterator).css(cache.css);
399
- }
400
- } else if (grid) {
401
- cache.css.width = cache.items.width;
402
- items.css(cache.css);
403
- }
404
- }
405
- }, {
406
- filter: [ 'items' ],
407
- run: function() {
408
- this._coordinates.length < 1 && this.$stage.removeAttr('style');
409
- }
410
- }, {
411
- filter: [ 'width', 'items', 'settings' ],
412
- run: function(cache) {
413
- cache.current = cache.current ? this.$stage.children().index(cache.current) : 0;
414
- cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
415
- this.reset(cache.current);
416
- }
417
- }, {
418
- filter: [ 'position' ],
419
- run: function() {
420
- this.animate(this.coordinates(this._current));
421
- }
422
- }, {
423
- filter: [ 'width', 'position', 'items', 'settings' ],
424
- run: function() {
425
- var rtl = this.settings.rtl ? 1 : -1,
426
- padding = this.settings.stagePadding * 2,
427
- begin = this.coordinates(this.current()) + padding,
428
- end = begin + this.width() * rtl,
429
- inner, outer, matches = [], i, n;
430
-
431
- for (i = 0, n = this._coordinates.length; i < n; i++) {
432
- inner = this._coordinates[i - 1] || 0;
433
- outer = Math.abs(this._coordinates[i]) + padding * rtl;
434
-
435
- if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
436
- || (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
437
- matches.push(i);
438
- }
439
- }
440
-
441
- this.$stage.children('.active').removeClass('active');
442
- this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
443
-
444
- this.$stage.children('.center').removeClass('center');
445
- if (this.settings.center) {
446
- this.$stage.children().eq(this.current()).addClass('center');
447
- }
448
- }
449
- }, {
450
- filter: [ 'width', 'position', 'items', 'settings' ],
451
- run: function() {
452
-
453
- if(!this.settings.setActiveClass){
454
- return;
455
- }
456
-
457
- if (this.settings.setActiveClass) {
458
- var $setClass = true;
459
-
460
- if (this.settings.setActiveClassOnMobile) {
461
- if(this.$stage.children(".active").length == 1){
462
- $setClass = true;
463
- }
464
- }else if(!this.settings.setActiveClassOnMobile){
465
- if(this.$stage.children(".active").length == 1){
466
- $setClass = false;
467
- }
468
- }
469
-
470
- if($setClass == true){
471
- this.$stage.children().eq(this.current()).addClass("uc-active-item").siblings().removeClass("uc-active-item");
472
- }else if ($setClass == false){
473
- this.$stage.children().removeClass("uc-active-item");
474
- }
475
-
476
- }
477
- }
478
- }];
479
-
480
- /**
481
- * Create the stage DOM element
482
- */
483
- Owl.prototype.initializeStage = function() {
484
- this.$stage = this.$element.find('.' + this.settings.stageClass);
485
-
486
- // if the stage is already in the DOM, grab it and skip stage initialization
487
- if (this.$stage.length) {
488
- return;
489
- }
490
-
491
- this.$element.addClass(this.options.loadingClass);
492
-
493
- // create stage
494
- this.$stage = $('<' + this.settings.stageElement + '>', {
495
- "class": this.settings.stageClass
496
- }).wrap( $( '<div/>', {
497
- "class": this.settings.stageOuterClass
498
- }));
499
-
500
- // append stage
501
- this.$element.append(this.$stage.parent());
502
- };
503
-
504
- /**
505
- * Create item DOM elements
506
- */
507
- Owl.prototype.initializeItems = function() {
508
- var $items = this.$element.find('.owl-item');
509
-
510
- // if the items are already in the DOM, grab them and skip item initialization
511
- if ($items.length) {
512
- this._items = $items.get().map(function(item) {
513
- return $(item);
514
- });
515
-
516
- this._mergers = this._items.map(function() {
517
- return 1;
518
- });
519
-
520
- this.refresh();
521
-
522
- return;
523
- }
524
-
525
- // append content
526
- this.replace(this.$element.children().not(this.$stage.parent()));
527
-
528
- // check visibility
529
- if (this.isVisible()) {
530
- // update view
531
- this.refresh();
532
- } else {
533
- // invalidate width
534
- this.invalidate('width');
535
- }
536
-
537
-
538
- this.$element
539
- .removeClass(this.options.loadingClass)
540
- .addClass(this.options.loadedClass);
541
- };
542
-
543
- /**
544
- * Initializes the carousel.
545
- * @protected
546
- */
547
- Owl.prototype.initialize = function() {
548
- this.enter('initializing');
549
- this.trigger('initialize');
550
-
551
- this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
552
-
553
-
554
- if(this.settings.shuffle){
555
- var carousel = this.$element;
556
- carousel.children().sort(function(){
557
- return Math.round(Math.random()) - 0.5;
558
- }).each(function(){
559
- carousel.append(this);
560
- });
561
- }
562
-
563
- if (this.settings.autoWidth && !this.is('pre-loading')) {
564
- var imgs, nestedSelector, width;
565
- imgs = this.$element.find('img');
566
- nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
567
- width = this.$element.children(nestedSelector).width();
568
-
569
- if (imgs.length && width <= 0) {
570
- this.preloadAutoWidthImages(imgs);
571
- }
572
- }
573
-
574
- this.initializeStage();
575
- this.initializeItems();
576
-
577
- // register event handlers
578
- this.registerEventHandlers();
579
-
580
- this.leave('initializing');
581
- this.trigger('initialized');
582
- };
583
-
584
- /**
585
- * @returns {Boolean} visibility of $element
586
- * if you know the carousel will always be visible you can set `checkVisibility` to `false` to
587
- * prevent the expensive browser layout forced reflow the $element.is(':visible') does
588
- */
589
- Owl.prototype.isVisible = function() {
590
- return this.settings.checkVisibility
591
- ? this.$element.is(':visible')
592
- : true;
593
- };
594
-
595
- /**
596
- * Setups the current settings.
597
- * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
598
- * @todo Support for media queries by using `matchMedia` would be nice.
599
- * @public
600
- */
601
- Owl.prototype.setup = function() {
602
- var viewport = this.viewport(),
603
- overwrites = this.options.responsive,
604
- match = -1,
605
- settings = null;
606
-
607
- if (!overwrites) {
608
- settings = $.extend({}, this.options);
609
- } else {
610
- $.each(overwrites, function(breakpoint) {
611
- if (breakpoint <= viewport && breakpoint > match) {
612
- match = Number(breakpoint);
613
- }
614
- });
615
-
616
- settings = $.extend({}, this.options, overwrites[match]);
617
- if (typeof settings.stagePadding === 'function') {
618
- settings.stagePadding = settings.stagePadding();
619
- }
620
- delete settings.responsive;
621
-
622
- // responsive class
623
- if (settings.responsiveClass) {
624
- this.$element.attr('class',
625
- this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
626
- );
627
- }
628
- }
629
-
630
- this.trigger('change', { property: { name: 'settings', value: settings } });
631
- this._breakpoint = match;
632
- this.settings = settings;
633
- this.invalidate('settings');
634
- this.trigger('changed', { property: { name: 'settings', value: this.settings } });
635
- };
636
-
637
- /**
638
- * Updates option logic if necessery.
639
- * @protected
640
- */
641
- Owl.prototype.optionsLogic = function() {
642
- if (this.settings.autoWidth) {
643
- this.settings.stagePadding = false;
644
- this.settings.merge = false;
645
- }
646
- };
647
-
648
- /**
649
- * Prepares an item before add.
650
- * @todo Rename event parameter `content` to `item`.
651
- * @protected
652
- * @returns {jQuery|HTMLElement} - The item container.
653
- */
654
- Owl.prototype.prepare = function(item) {
655
- var event = this.trigger('prepare', { content: item });
656
-
657
- if (!event.data) {
658
- event.data = $('<' + this.settings.itemElement + '/>')
659
- .addClass(this.options.itemClass).append(item)
660
- }
661
-
662
- this.trigger('prepared', { content: event.data });
663
-
664
- return event.data;
665
- };
666
-
667
- /**
668
- * Updates the view.
669
- * @public
670
- */
671
- Owl.prototype.update = function() {
672
- var i = 0,
673
- n = this._pipe.length,
674
- filter = $.proxy(function(p) { return this[p] }, this._invalidated),
675
- cache = {};
676
-
677
- while (i < n) {
678
- if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
679
- this._pipe[i].run(cache);
680
- }
681
- i++;
682
- }
683
-
684
- this._invalidated = {};
685
-
686
- !this.is('valid') && this.enter('valid');
687
- };
688
-
689
- /**
690
- * Gets the width of the view.
691
- * @public
692
- * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
693
- * @returns {Number} - The width of the view in pixel.
694
- */
695
- Owl.prototype.width = function(dimension) {
696
- dimension = dimension || Owl.Width.Default;
697
- switch (dimension) {
698
- case Owl.Width.Inner:
699
- case Owl.Width.Outer:
700
- return this._width;
701
- default:
702
- return this._width - this.settings.stagePadding * 2 + this.settings.margin;
703
- }
704
- };
705
-
706
- /**
707
- * Refreshes the carousel primarily for adaptive purposes.
708
- * @public
709
- */
710
- Owl.prototype.refresh = function() {
711
- this.enter('refreshing');
712
- this.trigger('refresh');
713
-
714
- this.setup();
715
-
716
- this.optionsLogic();
717
-
718
- this.$element.addClass(this.options.refreshClass);
719
-
720
- this.update();
721
-
722
- this.$element.removeClass(this.options.refreshClass);
723
-
724
- this.leave('refreshing');
725
- this.trigger('refreshed');
726
- };
727
-
728
- /**
729
- * Checks window `resize` event.
730
- * @protected
731
- */
732
- Owl.prototype.onThrottledResize = function() {
733
- window.clearTimeout(this.resizeTimer);
734
- this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
735
- };
736
-
737
- /**
738
- * Checks window `resize` event.
739
- * @protected
740
- */
741
- Owl.prototype.onResize = function() {
742
- if (!this._items.length) {
743
- return false;
744
- }
745
-
746
- if (this._width === this.$element.width()) {
747
- return false;
748
- }
749
-
750
- if (!this.isVisible()) {
751
- return false;
752
- }
753
-
754
- this.enter('resizing');
755
-
756
- if (this.trigger('resize').isDefaultPrevented()) {
757
- this.leave('resizing');
758
- return false;
759
- }
760
-
761
- this.invalidate('width');
762
-
763
- this.refresh();
764
-
765
- this.leave('resizing');
766
- this.trigger('resized');
767
- };
768
-
769
- /**
770
- * Registers event handlers.
771
- * @todo Check `msPointerEnabled`
772
- * @todo #261
773
- * @protected
774
- */
775
- Owl.prototype.registerEventHandlers = function() {
776
- if ($.support.transition) {
777
- this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
778
- }
779
-
780
- if (this.settings.responsive !== false) {
781
- this.on(window, 'resize', this._handlers.onThrottledResize);
782
- }
783
-
784
- if (this.settings.mouseDrag) {
785
- this.$element.addClass(this.options.dragClass);
786
- this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
787
- this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false });
788
- }
789
-
790
- if (this.settings.touchDrag){
791
- this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
792
- this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
793
- }
794
- };
795
-
796
- /**
797
- * Handles `touchstart` and `mousedown` events.
798
- * @todo Horizontal swipe threshold as option
799
- * @todo #261
800
- * @protected
801
- * @param {Event} event - The event arguments.
802
- */
803
- Owl.prototype.onDragStart = function(event) {
804
- var stage = null;
805
-
806
- if (event.which === 3) {
807
- return;
808
- }
809
-
810
- if ($.support.transform) {
811
- stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
812
- stage = {
813
- x: stage[stage.length === 16 ? 12 : 4],
814
- y: stage[stage.length === 16 ? 13 : 5]
815
- };
816
- } else {
817
- stage = this.$stage.position();
818
- stage = {
819
- x: this.settings.rtl ?
820
- stage.left + this.$stage.width() - this.width() + this.settings.margin :
821
- stage.left,
822
- y: stage.top
823
- };
824
- }
825
-
826
- if (this.is('animating')) {
827
- $.support.transform ? this.animate(stage.x) : this.$stage.stop()
828
- this.invalidate('position');
829
- }
830
-
831
- this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown');
832
-
833
- this.speed(0);
834
-
835
- this._drag.time = new Date().getTime();
836
- this._drag.target = $(event.target);
837
- this._drag.stage.start = stage;
838
- this._drag.stage.current = stage;
839
- this._drag.pointer = this.pointer(event);
840
-
841
- $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
842
-
843
- $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) {
844
- var delta = this.difference(this._drag.pointer, this.pointer(event));
845
-
846
- $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
847
-
848
- if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) {
849
- return;
850
- }
851
-
852
- event.preventDefault();
853
-
854
- this.enter('dragging');
855
- this.trigger('drag');
856
- }, this));
857
- };
858
-
859
- /**
860
- * Handles the `touchmove` and `mousemove` events.
861
- * @todo #261
862
- * @protected
863
- * @param {Event} event - The event arguments.
864
- */
865
- Owl.prototype.onDragMove = function(event) {
866
- var minimum = null,
867
- maximum = null,
868
- pull = null,
869
- delta = this.difference(this._drag.pointer, this.pointer(event)),
870
- stage = this.difference(this._drag.stage.start, delta);
871
-
872
- if (!this.is('dragging')) {
873
- return;
874
- }
875
-
876
- event.preventDefault();
877
-
878
- if (this.settings.loop) {
879
- minimum = this.coordinates(this.minimum());
880
- maximum = this.coordinates(this.maximum() + 1) - minimum;
881
- stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
882
- } else {
883
- minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
884
- maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
885
- pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0;
886
- stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
887
- }
888
-
889
- this._drag.stage.current = stage;
890
-
891
- this.animate(stage.x);
892
- };
893
-
894
- /**
895
- * Handles the `touchend` and `mouseup` events.
896
- * @todo #261
897
- * @todo Threshold for click event
898
- * @protected
899
- * @param {Event} event - The event arguments.
900
- */
901
- Owl.prototype.onDragEnd = function(event) {
902
- var delta = this.difference(this._drag.pointer, this.pointer(event)),
903
- stage = this._drag.stage.current,
904
- direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right';
905
-
906
- $(document).off('.owl.core');
907
-
908
- this.$element.removeClass(this.options.grabClass);
909
-
910
- if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) {
911
- this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
912
- this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction));
913
- this.invalidate('position');
914
- this.update();
915
-
916
- this._drag.direction = direction;
917
-
918
- if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) {
919
- this._drag.target.one('click.owl.core', function() { return false; });
920
- }
921
- }
922
-
923
- if (!this.is('dragging')) {
924
- return;
925
- }
926
-
927
- this.leave('dragging');
928
- this.trigger('dragged');
929
- };
930
-
931
- /**
932
- * Gets absolute position of the closest item for a coordinate.
933
- * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
934
- * @protected
935
- * @param {Number} coordinate - The coordinate in pixel.
936
- * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`.
937
- * @return {Number} - The absolute position of the closest item.
938
- */
939
- Owl.prototype.closest = function(coordinate, direction) {
940
- var position = -1,
941
- pull = 30,
942
- width = this.width(),
943
- coordinates = this.coordinates();
944
-
945
- if (!this.settings.freeDrag) {
946
- // check closest item
947
- $.each(coordinates, $.proxy(function(index, value) {
948
- // on a left pull, check on current index
949
- if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) {
950
- position = index;
951
- // on a right pull, check on previous index
952
- // to do so, subtract width from value and set position = index + 1
953
- } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) {
954
- position = index + 1;
955
- } else if (this.op(coordinate, '<', value)
956
- && this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) {
957
- position = direction === 'left' ? index + 1 : index;
958
- }
959
- return position === -1;
960
- }, this));
961
- }
962
-
963
- if (!this.settings.loop) {
964
- // non loop boundries
965
- if (this.op(coordinate, '>', coordinates[this.minimum()])) {
966
- position = coordinate = this.minimum();
967
- } else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
968
- position = coordinate = this.maximum();
969
- }
970
- }
971
-
972
- return position;
973
- };
974
-
975
- /**
976
- * Animates the stage.
977
- * @todo #270
978
- * @public
979
- * @param {Number} coordinate - The coordinate in pixels.
980
- */
981
- Owl.prototype.animate = function(coordinate) {
982
- var animate = this.speed() > 0;
983
-
984
- this.is('animating') && this.onTransitionEnd();
985
-
986
- if (animate) {
987
- this.enter('animating');
988
- this.trigger('translate');
989
- }
990
-
991
- if ($.support.transform3d && $.support.transition) {
992
- this.$stage.css({
993
- transform: 'translate3d(' + (coordinate-1) + 'px,0px,0px)', // this line is modified (added '-1') in order to fix "one pixel problem"
994
- transition: (this.speed() / 1000) + 's' + (
995
- this.settings.slideTransition ? ' ' + this.settings.slideTransition : ''
996
- )
997
- });
998
- } else if (animate) {
999
- this.$stage.animate({
1000
- left: coordinate + 'px'
1001
- }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
1002
- } else {
1003
- this.$stage.css({
1004
- left: coordinate + 'px'
1005
- });
1006
- }
1007
- };
1008
-
1009
- /**
1010
- * Checks whether the carousel is in a specific state or not.
1011
- * @param {String} state - The state to check.
1012
- * @returns {Boolean} - The flag which indicates if the carousel is busy.
1013
- */
1014
- Owl.prototype.is = function(state) {
1015
- return this._states.current[state] && this._states.current[state] > 0;
1016
- };
1017
-
1018
- /**
1019
- * Sets the absolute position of the current item.
1020
- * @public
1021
- * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
1022
- * @returns {Number} - The absolute position of the current item.
1023
- */
1024
- Owl.prototype.current = function(position) {
1025
- if (position === undefined) {
1026
- return this._current;
1027
- }
1028
-
1029
- if (this._items.length === 0) {
1030
- return undefined;
1031
- }
1032
-
1033
- position = this.normalize(position);
1034
-
1035
- if (this._current !== position) {
1036
- var event = this.trigger('change', { property: { name: 'position', value: position } });
1037
-
1038
- if (event.data !== undefined) {
1039
- position = this.normalize(event.data);
1040
- }
1041
-
1042
- this._current = position;
1043
-
1044
- this.invalidate('position');
1045
-
1046
- this.trigger('changed', { property: { name: 'position', value: this._current } });
1047
- }
1048
-
1049
- return this._current;
1050
- };
1051
-
1052
- /**
1053
- * Invalidates the given part of the update routine.
1054
- * @param {String} [part] - The part to invalidate.
1055
- * @returns {Array.<String>} - The invalidated parts.
1056
- */
1057
- Owl.prototype.invalidate = function(part) {
1058
- if ($.type(part) === 'string') {
1059
- this._invalidated[part] = true;
1060
- this.is('valid') && this.leave('valid');
1061
- }
1062
- return $.map(this._invalidated, function(v, i) { return i });
1063
- };
1064
-
1065
- /**
1066
- * Resets the absolute position of the current item.
1067
- * @public
1068
- * @param {Number} position - The absolute position of the new item.
1069
- */
1070
- Owl.prototype.reset = function(position) {
1071
- position = this.normalize(position);
1072
-
1073
- if (position === undefined) {
1074
- return;
1075
- }
1076
-
1077
- this._speed = 0;
1078
- this._current = position;
1079
-
1080
- this.suppress([ 'translate', 'translated' ]);
1081
-
1082
- this.animate(this.coordinates(position));
1083
-
1084
- this.release([ 'translate', 'translated' ]);
1085
- };
1086
-
1087
- /**
1088
- * Normalizes an absolute or a relative position of an item.
1089
- * @public
1090
- * @param {Number} position - The absolute or relative position to normalize.
1091
- * @param {Boolean} [relative=false] - Whether the given position is relative or not.
1092
- * @returns {Number} - The normalized position.
1093
- */
1094
- Owl.prototype.normalize = function(position, relative) {
1095
- var n = this._items.length,
1096
- m = relative ? 0 : this._clones.length;
1097
-
1098
- if (!this.isNumeric(position) || n < 1) {
1099
- position = undefined;
1100
- } else if (position < 0 || position >= n + m) {
1101
- position = ((position - m / 2) % n + n) % n + m / 2;
1102
- }
1103
-
1104
- return position;
1105
- };
1106
-
1107
- /**
1108
- * Converts an absolute position of an item into a relative one.
1109
- * @public
1110
- * @param {Number} position - The absolute position to convert.
1111
- * @returns {Number} - The converted position.
1112
- */
1113
- Owl.prototype.relative = function(position) {
1114
- position -= this._clones.length / 2;
1115
- return this.normalize(position, true);
1116
- };
1117
-
1118
- /**
1119
- * Gets the maximum position for the current item.
1120
- * @public
1121
- * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1122
- * @returns {Number}
1123
- */
1124
- Owl.prototype.maximum = function(relative) {
1125
- var settings = this.settings,
1126
- maximum = this._coordinates.length,
1127
- iterator,
1128
- reciprocalItemsWidth,
1129
- elementWidth;
1130
-
1131
- if (settings.loop) {
1132
- maximum = this._clones.length / 2 + this._items.length - 1;
1133
- } else if (settings.autoWidth || settings.merge) {
1134
- iterator = this._items.length;
1135
- if (iterator) {
1136
- reciprocalItemsWidth = this._items[--iterator].width();
1137
- elementWidth = this.$element.width();
1138
- while (iterator--) {
1139
- reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin;
1140
- if (reciprocalItemsWidth > elementWidth) {
1141
- break;
1142
- }
1143
- }
1144
- }
1145
- maximum = iterator + 1;
1146
- } else if (settings.center) {
1147
- maximum = this._items.length - 1;
1148
- } else {
1149
- maximum = this._items.length - settings.items;
1150
- }
1151
-
1152
- if (relative) {
1153
- maximum -= this._clones.length / 2;
1154
- }
1155
-
1156
- return Math.max(maximum, 0);
1157
- };
1158
-
1159
- /**
1160
- * Gets the minimum position for the current item.
1161
- * @public
1162
- * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1163
- * @returns {Number}
1164
- */
1165
- Owl.prototype.minimum = function(relative) {
1166
- return relative ? 0 : this._clones.length / 2;
1167
- };
1168
-
1169
- /**
1170
- * Gets an item at the specified relative position.
1171
- * @public
1172
- * @param {Number} [position] - The relative position of the item.
1173
- * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1174
- */
1175
- Owl.prototype.items = function(position) {
1176
- if (position === undefined) {
1177
- return this._items.slice();
1178
- }
1179
-
1180
- position = this.normalize(position, true);
1181
- return this._items[position];
1182
- };
1183
-
1184
- /**
1185
- * Gets an item at the specified relative position.
1186
- * @public
1187
- * @param {Number} [position] - The relative position of the item.
1188
- * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1189
- */
1190
- Owl.prototype.mergers = function(position) {
1191
- if (position === undefined) {
1192
- return this._mergers.slice();
1193
- }
1194
-
1195
- position = this.normalize(position, true);
1196
- return this._mergers[position];
1197
- };
1198
-
1199
- /**
1200
- * Gets the absolute positions of clones for an item.
1201
- * @public
1202
- * @param {Number} [position] - The relative position of the item.
1203
- * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
1204
- */
1205
- Owl.prototype.clones = function(position) {
1206
- var odd = this._clones.length / 2,
1207
- even = odd + this._items.length,
1208
- map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 };
1209
-
1210
- if (position === undefined) {
1211
- return $.map(this._clones, function(v, i) { return map(i) });
1212
- }
1213
-
1214
- return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
1215
- };
1216
-
1217
- /**
1218
- * Sets the current animation speed.
1219
- * @public
1220
- * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
1221
- * @returns {Number} - The current animation speed in milliseconds.
1222
- */
1223
- Owl.prototype.speed = function(speed) {
1224
- if (speed !== undefined) {
1225
- this._speed = speed;
1226
- }
1227
-
1228
- return this._speed;
1229
- };
1230
-
1231
- /**
1232
- * Gets the coordinate of an item.
1233
- * @todo The name of this method is missleanding.
1234
- * @public
1235
- * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
1236
- * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
1237
- */
1238
- Owl.prototype.coordinates = function(position) {
1239
- var multiplier = 1,
1240
- newPosition = position - 1,
1241
- coordinate;
1242
-
1243
- if (position === undefined) {
1244
- return $.map(this._coordinates, $.proxy(function(coordinate, index) {
1245
- return this.coordinates(index);
1246
- }, this));
1247
- }
1248
-
1249
- if (this.settings.center) {
1250
- if (this.settings.rtl) {
1251
- multiplier = -1;
1252
- newPosition = position + 1;
1253
- }
1254
-
1255
- coordinate = this._coordinates[position];
1256
- coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier;
1257
- } else {
1258
- coordinate = this._coordinates[newPosition] || 0;
1259
- }
1260
-
1261
- coordinate = Math.ceil(coordinate);
1262
-
1263
- return coordinate;
1264
- };
1265
-
1266
- /**
1267
- * Calculates the speed for a translation.
1268
- * @protected
1269
- * @param {Number} from - The absolute position of the start item.
1270
- * @param {Number} to - The absolute position of the target item.
1271
- * @param {Number} [factor=undefined] - The time factor in milliseconds.
1272
- * @returns {Number} - The time in milliseconds for the translation.
1273
- */
1274
- Owl.prototype.duration = function(from, to, factor) {
1275
- if (factor === 0) {
1276
- return 0;
1277
- }
1278
-
1279
- return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
1280
- };
1281
-
1282
- /**
1283
- * Slides to the specified item.
1284
- * @public
1285
- * @param {Number} position - The position of the item.
1286
- * @param {Number} [speed] - The time in milliseconds for the transition.
1287
- */
1288
- Owl.prototype.to = function(position, speed) {
1289
- var current = this.current(),
1290
- revert = null,
1291
- distance = position - this.relative(current),
1292
- direction = (distance > 0) - (distance < 0),
1293
- items = this._items.length,
1294
- minimum = this.minimum(),
1295
- maximum = this.maximum();
1296
-
1297
- if (this.settings.loop) {
1298
- if (!this.settings.rewind && Math.abs(distance) > items / 2) {
1299
- distance += direction * -1 * items;
1300
- }
1301
-
1302
- position = current + distance;
1303
- revert = ((position - minimum) % items + items) % items + minimum;
1304
-
1305
- if (revert !== position && revert - distance <= maximum && revert - distance > 0) {
1306
- current = revert - distance;
1307
- position = revert;
1308
- this.reset(current);
1309
- }
1310
- } else if (this.settings.rewind) {
1311
- maximum += 1;
1312
- position = (position % maximum + maximum) % maximum;
1313
- } else {
1314
- position = Math.max(minimum, Math.min(maximum, position));
1315
- }
1316
-
1317
- this.speed(this.duration(current, position, speed));
1318
- this.current(position);
1319
-
1320
- if (this.isVisible()) {
1321
- this.update();
1322
- }
1323
- };
1324
-
1325
- /**
1326
- * Slides to the next item.
1327
- * @public
1328
- * @param {Number} [speed] - The time in milliseconds for the transition.
1329
- */
1330
- Owl.prototype.next = function(speed) {
1331
- speed = speed || false;
1332
- this.to(this.relative(this.current()) + 1, speed);
1333
- };
1334
-
1335
- /**
1336
- * Slides to the previous item.
1337
- * @public
1338
- * @param {Number} [speed] - The time in milliseconds for the transition.
1339
- */
1340
- Owl.prototype.prev = function(speed) {
1341
- speed = speed || false;
1342
- this.to(this.relative(this.current()) - 1, speed);
1343
- };
1344
-
1345
- /**
1346
- * Handles the end of an animation.
1347
- * @protected
1348
- * @param {Event} event - The event arguments.
1349
- */
1350
- Owl.prototype.onTransitionEnd = function(event) {
1351
-
1352
- // if css2 animation then event object is undefined
1353
- if (event !== undefined) {
1354
- event.stopPropagation();
1355
-
1356
- // Catch only owl-stage transitionEnd event
1357
- if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
1358
- return false;
1359
- }
1360
- }
1361
-
1362
- this.leave('animating');
1363
- this.trigger('translated');
1364
- };
1365
-
1366
- /**
1367
- * Gets viewport width.
1368
- * @protected
1369
- * @return {Number} - The width in pixel.
1370
- */
1371
- Owl.prototype.viewport = function() {
1372
- var width;
1373
- if (this.options.responsiveBaseElement !== window) {
1374
- width = $(this.options.responsiveBaseElement).width();
1375
- } else if (window.innerWidth) {
1376
- width = window.innerWidth;
1377
- } else if (document.documentElement && document.documentElement.clientWidth) {
1378
- width = document.documentElement.clientWidth;
1379
- } else {
1380
- console.warn('Can not detect viewport width.');
1381
- }
1382
- return width;
1383
- };
1384
-
1385
- /**
1386
- * Replaces the current content.
1387
- * @public
1388
- * @param {HTMLElement|jQuery|String} content - The new content.
1389
- */
1390
- Owl.prototype.replace = function(content) {
1391
- this.$stage.empty();
1392
- this._items = [];
1393
-
1394
- if (content) {
1395
- content = (content instanceof jQuery) ? content : $(content);
1396
- }
1397
-
1398
- if (this.settings.nestedItemSelector) {
1399
- content = content.find('.' + this.settings.nestedItemSelector);
1400
- }
1401
-
1402
- content.filter(function() {
1403
- return this.nodeType === 1;
1404
- }).each($.proxy(function(index, item) {
1405
- item = this.prepare(item);
1406
- this.$stage.append(item);
1407
- this._items.push(item);
1408
- this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1409
- }, this));
1410
-
1411
- this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
1412
-
1413
- this.invalidate('items');
1414
- };
1415
-
1416
- /**
1417
- * Adds an item.
1418
- * @todo Use `item` instead of `content` for the event arguments.
1419
- * @public
1420
- * @param {HTMLElement|jQuery|String} content - The item content to add.
1421
- * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
1422
- */
1423
- Owl.prototype.add = function(content, position) {
1424
- var current = this.relative(this._current);
1425
-
1426
- position = position === undefined ? this._items.length : this.normalize(position, true);
1427
- content = content instanceof jQuery ? content : $(content);
1428
-
1429
- this.trigger('add', { content: content, position: position });
1430
-
1431
- content = this.prepare(content);
1432
-
1433
- if (this._items.length === 0 || position === this._items.length) {
1434
- this._items.length === 0 && this.$stage.append(content);
1435
- this._items.length !== 0 && this._items[position - 1].after(content);
1436
- this._items.push(content);
1437
- this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1438
- } else {
1439
- this._items[position].before(content);
1440
- this._items.splice(position, 0, content);
1441
- this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1442
- }
1443
-
1444
- this._items[current] && this.reset(this._items[current].index());
1445
-
1446
- this.invalidate('items');
1447
-
1448
- this.trigger('added', { content: content, position: position });
1449
- };
1450
-
1451
- /**
1452
- * Removes an item by its position.
1453
- * @todo Use `item` instead of `content` for the event arguments.
1454
- * @public
1455
- * @param {Number} position - The relative position of the item to remove.
1456
- */
1457
- Owl.prototype.remove = function(position) {
1458
- position = this.normalize(position, true);
1459
-
1460
- if (position === undefined) {
1461
- return;
1462
- }
1463
-
1464
- this.trigger('remove', { content: this._items[position], position: position });
1465
-
1466
- this._items[position].remove();
1467
- this._items.splice(position, 1);
1468
- this._mergers.splice(position, 1);
1469
-
1470
- this.invalidate('items');
1471
-
1472
- this.trigger('removed', { content: null, position: position });
1473
- };
1474
-
1475
- /**
1476
- * Preloads images with auto width.
1477
- * @todo Replace by a more generic approach
1478
- * @protected
1479
- */
1480
- Owl.prototype.preloadAutoWidthImages = function(images) {
1481
- images.each($.proxy(function(i, element) {
1482
- this.enter('pre-loading');
1483
- element = $(element);
1484
- $(new Image()).one('load', $.proxy(function(e) {
1485
- element.attr('src', e.target.src);
1486
- element.css('opacity', 1);
1487
- this.leave('pre-loading');
1488
- !this.is('pre-loading') && !this.is('initializing') && this.refresh();
1489
- }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina'));
1490
- }, this));
1491
- };
1492
-
1493
- /**
1494
- * Destroys the carousel.
1495
- * @public
1496
- */
1497
- Owl.prototype.destroy = function() {
1498
-
1499
- this.$element.off('.owl.core');
1500
- this.$stage.off('.owl.core');
1501
- $(document).off('.owl.core');
1502
-
1503
- if (this.settings.responsive !== false) {
1504
- window.clearTimeout(this.resizeTimer);
1505
- this.off(window, 'resize', this._handlers.onThrottledResize);
1506
- }
1507
-
1508
- for (var i in this._plugins) {
1509
- this._plugins[i].destroy();
1510
- }
1511
-
1512
- this.$stage.children('.cloned').remove();
1513
-
1514
- this.$stage.unwrap();
1515
- this.$stage.children().contents().unwrap();
1516
- this.$stage.children().unwrap();
1517
- this.$stage.remove();
1518
- this.$element
1519
- .removeClass(this.options.refreshClass)
1520
- .removeClass(this.options.loadingClass)
1521
- .removeClass(this.options.loadedClass)
1522
- .removeClass(this.options.rtlClass)
1523
- .removeClass(this.options.dragClass)
1524
- .removeClass(this.options.grabClass)
1525
- .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
1526
- .removeData('owl.carousel');
1527
- };
1528
-
1529
- /**
1530
- * Operators to calculate right-to-left and left-to-right.
1531
- * @protected
1532
- * @param {Number} [a] - The left side operand.
1533
- * @param {String} [o] - The operator.
1534
- * @param {Number} [b] - The right side operand.
1535
- */
1536
- Owl.prototype.op = function(a, o, b) {
1537
- var rtl = this.settings.rtl;
1538
- switch (o) {
1539
- case '<':
1540
- return rtl ? a > b : a < b;
1541
- case '>':
1542
- return rtl ? a < b : a > b;
1543
- case '>=':
1544
- return rtl ? a <= b : a >= b;
1545
- case '<=':
1546
- return rtl ? a >= b : a <= b;
1547
- default:
1548
- break;
1549
- }
1550
- };
1551
-
1552
- /**
1553
- * Attaches to an internal event.
1554
- * @protected
1555
- * @param {HTMLElement} element - The event source.
1556
- * @param {String} event - The event name.
1557
- * @param {Function} listener - The event handler to attach.
1558
- * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
1559
- */
1560
- Owl.prototype.on = function(element, event, listener, capture) {
1561
- if (element.addEventListener) {
1562
- element.addEventListener(event, listener, capture);
1563
- } else if (element.attachEvent) {
1564
- element.attachEvent('on' + event, listener);
1565
- }
1566
- };
1567
-
1568
- /**
1569
- * Detaches from an internal event.
1570
- * @protected
1571
- * @param {HTMLElement} element - The event source.
1572
- * @param {String} event - The event name.
1573
- * @param {Function} listener - The attached event handler to detach.
1574
- * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
1575
- */
1576
- Owl.prototype.off = function(element, event, listener, capture) {
1577
- if (element.removeEventListener) {
1578
- element.removeEventListener(event, listener, capture);
1579
- } else if (element.detachEvent) {
1580
- element.detachEvent('on' + event, listener);
1581
- }
1582
- };
1583
-
1584
- /**
1585
- * Triggers a public event.
1586
- * @todo Remove `status`, `relatedTarget` should be used instead.
1587
- * @protected
1588
- * @param {String} name - The event name.
1589
- * @param {*} [data=null] - The event data.
1590
- * @param {String} [namespace=carousel] - The event namespace.
1591
- * @param {String} [state] - The state which is associated with the event.
1592
- * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not.
1593
- * @returns {Event} - The event arguments.
1594
- */
1595
- Owl.prototype.trigger = function(name, data, namespace, state, enter) {
1596
- var status = {
1597
- item: { count: this._items.length, index: this.current() }
1598
- }, handler = $.camelCase(
1599
- $.grep([ 'on', name, namespace ], function(v) { return v })
1600
- .join('-').toLowerCase()
1601
- ), event = $.Event(
1602
- [ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
1603
- $.extend({ relatedTarget: this }, status, data)
1604
- );
1605
-
1606
- if (!this._supress[name]) {
1607
- $.each(this._plugins, function(name, plugin) {
1608
- if (plugin.onTrigger) {
1609
- plugin.onTrigger(event);
1610
- }
1611
- });
1612
-
1613
- this.register({ type: Owl.Type.Event, name: name });
1614
- this.$element.trigger(event);
1615
-
1616
- if (this.settings && typeof this.settings[handler] === 'function') {
1617
- this.settings[handler].call(this, event);
1618
- }
1619
- }
1620
-
1621
- return event;
1622
- };
1623
-
1624
- /**
1625
- * Enters a state.
1626
- * @param name - The state name.
1627
- */
1628
- Owl.prototype.enter = function(name) {
1629
- $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1630
- if (this._states.current[name] === undefined) {
1631
- this._states.current[name] = 0;
1632
- }
1633
-
1634
- this._states.current[name]++;
1635
- }, this));
1636
- };
1637
-
1638
- /**
1639
- * Leaves a state.
1640
- * @param name - The state name.
1641
- */
1642
- Owl.prototype.leave = function(name) {
1643
- $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1644
- this._states.current[name]--;
1645
- }, this));
1646
- };
1647
-
1648
- /**
1649
- * Registers an event or state.
1650
- * @public
1651
- * @param {Object} object - The event or state to register.
1652
- */
1653
- Owl.prototype.register = function(object) {
1654
- if (object.type === Owl.Type.Event) {
1655
- if (!$.event.special[object.name]) {
1656
- $.event.special[object.name] = {};
1657
- }
1658
-
1659
- if (!$.event.special[object.name].owl) {
1660
- var _default = $.event.special[object.name]._default;
1661
- $.event.special[object.name]._default = function(e) {
1662
- if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) {
1663
- return _default.apply(this, arguments);
1664
- }
1665
- return e.namespace && e.namespace.indexOf('owl') > -1;
1666
- };
1667
- $.event.special[object.name].owl = true;
1668
- }
1669
- } else if (object.type === Owl.Type.State) {
1670
- if (!this._states.tags[object.name]) {
1671
- this._states.tags[object.name] = object.tags;
1672
- } else {
1673
- this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags);
1674
- }
1675
-
1676
- this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) {
1677
- return $.inArray(tag, this._states.tags[object.name]) === i;
1678
- }, this));
1679
- }
1680
- };
1681
-
1682
- /**
1683
- * Suppresses events.
1684
- * @protected
1685
- * @param {Array.<String>} events - The events to suppress.
1686
- */
1687
- Owl.prototype.suppress = function(events) {
1688
- $.each(events, $.proxy(function(index, event) {
1689
- this._supress[event] = true;
1690
- }, this));
1691
- };
1692
-
1693
- /**
1694
- * Releases suppressed events.
1695
- * @protected
1696
- * @param {Array.<String>} events - The events to release.
1697
- */
1698
- Owl.prototype.release = function(events) {
1699
- $.each(events, $.proxy(function(index, event) {
1700
- delete this._supress[event];
1701
- }, this));
1702
- };
1703
-
1704
- /**
1705
- * Gets unified pointer coordinates from event.
1706
- * @todo #261
1707
- * @protected
1708
- * @param {Event} - The `mousedown` or `touchstart` event.
1709
- * @returns {Object} - Contains `x` and `y` coordinates of current pointer position.
1710
- */
1711
- Owl.prototype.pointer = function(event) {
1712
- var result = { x: null, y: null };
1713
-
1714
- event = event.originalEvent || event || window.event;
1715
-
1716
- event = event.touches && event.touches.length ?
1717
- event.touches[0] : event.changedTouches && event.changedTouches.length ?
1718
- event.changedTouches[0] : event;
1719
-
1720
- if (event.pageX) {
1721
- result.x = event.pageX;
1722
- result.y = event.pageY;
1723
- } else {
1724
- result.x = event.clientX;
1725
- result.y = event.clientY;
1726
- }
1727
-
1728
- return result;
1729
- };
1730
-
1731
- /**
1732
- * Determines if the input is a Number or something that can be coerced to a Number
1733
- * @protected
1734
- * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested
1735
- * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number
1736
- */
1737
- Owl.prototype.isNumeric = function(number) {
1738
- return !isNaN(parseFloat(number));
1739
- };
1740
-
1741
- /**
1742
- * Gets the difference of two vectors.
1743
- * @todo #261
1744
- * @protected
1745
- * @param {Object} - The first vector.
1746
- * @param {Object} - The second vector.
1747
- * @returns {Object} - The difference.
1748
- */
1749
- Owl.prototype.difference = function(first, second) {
1750
- return {
1751
- x: first.x - second.x,
1752
- y: first.y - second.y
1753
- };
1754
- };
1755
-
1756
- /**
1757
- * The jQuery Plugin for the Owl Carousel
1758
- * @todo Navigation plugin `next` and `prev`
1759
- * @public
1760
- */
1761
- $.fn.owlCarousel = function(option) {
1762
- var args = Array.prototype.slice.call(arguments, 1);
1763
-
1764
- return this.each(function() {
1765
- var $this = $(this),
1766
- data = $this.data('owl.carousel');
1767
-
1768
- if (!data) {
1769
- data = new Owl(this, typeof option == 'object' && option);
1770
- $this.data('owl.carousel', data);
1771
-
1772
- $.each([
1773
- 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
1774
- ], function(i, event) {
1775
- data.register({ type: Owl.Type.Event, name: event });
1776
- data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) {
1777
- if (e.namespace && e.relatedTarget !== this) {
1778
- this.suppress([ event ]);
1779
- data[event].apply(this, [].slice.call(arguments, 1));
1780
- this.release([ event ]);
1781
- }
1782
- }, data));
1783
- });
1784
- }
1785
-
1786
- if (typeof option == 'string' && option.charAt(0) !== '_') {
1787
- data[option].apply(data, args);
1788
- }
1789
- });
1790
- };
1791
-
1792
- /**
1793
- * The constructor for the jQuery Plugin
1794
- * @public
1795
- */
1796
- $.fn.owlCarousel.Constructor = Owl;
1797
-
1798
- })(window.Zepto || window.jQuery, window, document);
1799
-
1800
- /**
1801
- * AutoRefresh Plugin
1802
- * @version 2.3.4
1803
- * @author Artus Kolanowski
1804
- * @author David Deutsch
1805
- * @license The MIT License (MIT)
1806
- */
1807
- ;(function($, window, document, undefined) {
1808
-
1809
- /**
1810
- * Creates the auto refresh plugin.
1811
- * @class The Auto Refresh Plugin
1812
- * @param {Owl} carousel - The Owl Carousel
1813
- */
1814
- var AutoRefresh = function(carousel) {
1815
- /**
1816
- * Reference to the core.
1817
- * @protected
1818
- * @type {Owl}
1819
- */
1820
- this._core = carousel;
1821
-
1822
- /**
1823
- * Refresh interval.
1824
- * @protected
1825
- * @type {number}
1826
- */
1827
- this._interval = null;
1828
-
1829
- /**
1830
- * Whether the element is currently visible or not.
1831
- * @protected
1832
- * @type {Boolean}
1833
- */
1834
- this._visible = null;
1835
-
1836
- /**
1837
- * All event handlers.
1838
- * @protected
1839
- * @type {Object}
1840
- */
1841
- this._handlers = {
1842
- 'initialized.owl.carousel': $.proxy(function(e) {
1843
- if (e.namespace && this._core.settings.autoRefresh) {
1844
- this.watch();
1845
- }
1846
- }, this)
1847
- };
1848
-
1849
- // set default options
1850
- this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
1851
-
1852
- // register event handlers
1853
- this._core.$element.on(this._handlers);
1854
- };
1855
-
1856
- /**
1857
- * Default options.
1858
- * @public
1859
- */
1860
- AutoRefresh.Defaults = {
1861
- autoRefresh: true,
1862
- autoRefreshInterval: 500
1863
- };
1864
-
1865
- /**
1866
- * Watches the element.
1867
- */
1868
- AutoRefresh.prototype.watch = function() {
1869
- if (this._interval) {
1870
- return;
1871
- }
1872
-
1873
- this._visible = this._core.isVisible();
1874
- this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
1875
- };
1876
-
1877
- /**
1878
- * Refreshes the element.
1879
- */
1880
- AutoRefresh.prototype.refresh = function() {
1881
- if (this._core.isVisible() === this._visible) {
1882
- return;
1883
- }
1884
-
1885
- this._visible = !this._visible;
1886
-
1887
- this._core.$element.toggleClass('owl-hidden', !this._visible);
1888
-
1889
- this._visible && (this._core.invalidate('width') && this._core.refresh());
1890
- };
1891
-
1892
- /**
1893
- * Destroys the plugin.
1894
- */
1895
- AutoRefresh.prototype.destroy = function() {
1896
- var handler, property;
1897
-
1898
- window.clearInterval(this._interval);
1899
-
1900
- for (handler in this._handlers) {
1901
- this._core.$element.off(handler, this._handlers[handler]);
1902
- }
1903
- for (property in Object.getOwnPropertyNames(this)) {
1904
- typeof this[property] != 'function' && (this[property] = null);
1905
- }
1906
- };
1907
-
1908
- $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
1909
-
1910
- })(window.Zepto || window.jQuery, window, document);
1911
-
1912
- /**
1913
- * Lazy Plugin
1914
- * @version 2.3.4
1915
- * @author Bartosz Wojciechowski
1916
- * @author David Deutsch
1917
- * @license The MIT License (MIT)
1918
- */
1919
- ;(function($, window, document, undefined) {
1920
-
1921
- /**
1922
- * Creates the lazy plugin.
1923
- * @class The Lazy Plugin
1924
- * @param {Owl} carousel - The Owl Carousel
1925
- */
1926
- var Lazy = function(carousel) {
1927
-
1928
- /**
1929
- * Reference to the core.
1930
- * @protected
1931
- * @type {Owl}
1932
- */
1933
- this._core = carousel;
1934
-
1935
- /**
1936
- * Already loaded items.
1937
- * @protected
1938
- * @type {Array.<jQuery>}
1939
- */
1940
- this._loaded = [];
1941
-
1942
- /**
1943
- * Event handlers.
1944
- * @protected
1945
- * @type {Object}
1946
- */
1947
- this._handlers = {
1948
- 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
1949
- if (!e.namespace) {
1950
- return;
1951
- }
1952
-
1953
- if (!this._core.settings || !this._core.settings.lazyLoad) {
1954
- return;
1955
- }
1956
-
1957
- if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
1958
- var settings = this._core.settings,
1959
- n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
1960
- i = ((settings.center && n * -1) || 0),
1961
- position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
1962
- clones = this._core.clones().length,
1963
- load = $.proxy(function(i, v) { this.load(v) }, this);
1964
- //TODO: Need documentation for this new option
1965
- if (settings.lazyLoadEager > 0) {
1966
- n += settings.lazyLoadEager;
1967
- // If the carousel is looping also preload images that are to the "left"
1968
- if (settings.loop) {
1969
- position -= settings.lazyLoadEager;
1970
- n++;
1971
- }
1972
- }
1973
-
1974
- while (i++ < n) {
1975
- this.load(clones / 2 + this._core.relative(position));
1976
- clones && $.each(this._core.clones(this._core.relative(position)), load);
1977
- position++;
1978
- }
1979
- }
1980
- }, this)
1981
- };
1982
-
1983
- // set the default options
1984
- this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
1985
-
1986
- // register event handler
1987
- this._core.$element.on(this._handlers);
1988
- };
1989
-
1990
- /**
1991
- * Default options.
1992
- * @public
1993
- */
1994
- Lazy.Defaults = {
1995
- lazyLoad: false,
1996
- lazyLoadEager: 0
1997
- };
1998
-
1999
- /**
2000
- * Loads all resources of an item at the specified position.
2001
- * @param {Number} position - The absolute position of the item.
2002
- * @protected
2003
- */
2004
- Lazy.prototype.load = function(position) {
2005
- var $item = this._core.$stage.children().eq(position),
2006
- $elements = $item && $item.find('.owl-lazy');
2007
-
2008
- if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
2009
- return;
2010
- }
2011
-
2012
- $elements.each($.proxy(function(index, element) {
2013
- var $element = $(element), image,
2014
- url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
2015
-
2016
- this._core.trigger('load', { element: $element, url: url }, 'lazy');
2017
-
2018
- if ($element.is('img')) {
2019
- $element.one('load.owl.lazy', $.proxy(function() {
2020
- $element.css('opacity', 1);
2021
- this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2022
- }, this)).attr('src', url);
2023
- } else if ($element.is('source')) {
2024
- $element.one('load.owl.lazy', $.proxy(function() {
2025
- this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2026
- }, this)).attr('srcset', url);
2027
- } else {
2028
- image = new Image();
2029
- image.onload = $.proxy(function() {
2030
- $element.css({
2031
- 'background-image': 'url("' + url + '")',
2032
- 'opacity': '1'
2033
- });
2034
- this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2035
- }, this);
2036
- image.src = url;
2037
- }
2038
- }, this));
2039
-
2040
- this._loaded.push($item.get(0));
2041
- };
2042
-
2043
- /**
2044
- * Destroys the plugin.
2045
- * @public
2046
- */
2047
- Lazy.prototype.destroy = function() {
2048
- var handler, property;
2049
-
2050
- for (handler in this.handlers) {
2051
- this._core.$element.off(handler, this.handlers[handler]);
2052
- }
2053
- for (property in Object.getOwnPropertyNames(this)) {
2054
- typeof this[property] != 'function' && (this[property] = null);
2055
- }
2056
- };
2057
-
2058
- $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
2059
-
2060
- })(window.Zepto || window.jQuery, window, document);
2061
-
2062
- /**
2063
- * AutoHeight Plugin
2064
- * @version 2.3.4
2065
- * @author Bartosz Wojciechowski
2066
- * @author David Deutsch
2067
- * @license The MIT License (MIT)
2068
- */
2069
- ;(function($, window, document, undefined) {
2070
-
2071
- /**
2072
- * Creates the auto height plugin.
2073
- * @class The Auto Height Plugin
2074
- * @param {Owl} carousel - The Owl Carousel
2075
- */
2076
- var AutoHeight = function(carousel) {
2077
- /**
2078
- * Reference to the core.
2079
- * @protected
2080
- * @type {Owl}
2081
- */
2082
- this._core = carousel;
2083
-
2084
- this._previousHeight = null;
2085
-
2086
- /**
2087
- * All event handlers.
2088
- * @protected
2089
- * @type {Object}
2090
- */
2091
- this._handlers = {
2092
- 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
2093
- if (e.namespace && this._core.settings.autoHeight) {
2094
- this.update();
2095
- }
2096
- }, this),
2097
- 'changed.owl.carousel': $.proxy(function(e) {
2098
- if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){
2099
- this.update();
2100
- }
2101
- }, this),
2102
- 'loaded.owl.lazy': $.proxy(function(e) {
2103
- if (e.namespace && this._core.settings.autoHeight
2104
- && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
2105
- this.update();
2106
- }
2107
- }, this)
2108
- };
2109
-
2110
- // set default options
2111
- this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
2112
-
2113
- // register event handlers
2114
- this._core.$element.on(this._handlers);
2115
- this._intervalId = null;
2116
- var refThis = this;
2117
-
2118
- // These changes have been taken from a PR by gavrochelegnou proposed in #1575
2119
- // and have been made compatible with the latest jQuery version
2120
- $(window).on('load', function() {
2121
- if (refThis._core.settings.autoHeight) {
2122
- refThis.update();
2123
- }
2124
- });
2125
-
2126
- // Autoresize the height of the carousel when window is resized
2127
- // When carousel has images, the height is dependent on the width
2128
- // and should also change on resize
2129
- $(window).resize(function() {
2130
- if (refThis._core.settings.autoHeight) {
2131
- if (refThis._intervalId != null) {
2132
- clearTimeout(refThis._intervalId);
2133
- }
2134
-
2135
- refThis._intervalId = setTimeout(function() {
2136
- refThis.update();
2137
- }, 250);
2138
- }
2139
- });
2140
-
2141
- };
2142
-
2143
- /**
2144
- * Default options.
2145
- * @public
2146
- */
2147
- AutoHeight.Defaults = {
2148
- autoHeight: false,
2149
- autoHeightClass: 'owl-height'
2150
- };
2151
-
2152
- /**
2153
- * Updates the view.
2154
- */
2155
- AutoHeight.prototype.update = function() {
2156
- var start = this._core._current,
2157
- end = start + this._core.settings.items,
2158
- lazyLoadEnabled = this._core.settings.lazyLoad,
2159
- visible = this._core.$stage.children().toArray().slice(start, end),
2160
- heights = [],
2161
- maxheight = 0;
2162
-
2163
- $.each(visible, function(index, item) {
2164
- heights.push($(item).height());
2165
- });
2166
-
2167
- maxheight = Math.max.apply(null, heights);
2168
-
2169
- if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) {
2170
- maxheight = this._previousHeight;
2171
- }
2172
-
2173
- this._previousHeight = maxheight;
2174
-
2175
- this._core.$stage.parent()
2176
- .height(maxheight)
2177
- .addClass(this._core.settings.autoHeightClass);
2178
- };
2179
-
2180
- AutoHeight.prototype.destroy = function() {
2181
- var handler, property;
2182
-
2183
- for (handler in this._handlers) {
2184
- this._core.$element.off(handler, this._handlers[handler]);
2185
- }
2186
- for (property in Object.getOwnPropertyNames(this)) {
2187
- typeof this[property] !== 'function' && (this[property] = null);
2188
- }
2189
- };
2190
-
2191
- $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
2192
-
2193
- })(window.Zepto || window.jQuery, window, document);
2194
-
2195
- /**
2196
- * Video Plugin
2197
- * @version 2.3.4
2198
- * @author Bartosz Wojciechowski
2199
- * @author David Deutsch
2200
- * @license The MIT License (MIT)
2201
- */
2202
- ;(function($, window, document, undefined) {
2203
-
2204
- /**
2205
- * Creates the video plugin.
2206
- * @class The Video Plugin
2207
- * @param {Owl} carousel - The Owl Carousel
2208
- */
2209
- var Video = function(carousel) {
2210
- /**
2211
- * Reference to the core.
2212
- * @protected
2213
- * @type {Owl}
2214
- */
2215
- this._core = carousel;
2216
-
2217
- /**
2218
- * Cache all video URLs.
2219
- * @protected
2220
- * @type {Object}
2221
- */
2222
- this._videos = {};
2223
-
2224
- /**
2225
- * Current playing item.
2226
- * @protected
2227
- * @type {jQuery}
2228
- */
2229
- this._playing = null;
2230
-
2231
- /**
2232
- * All event handlers.
2233
- * @todo The cloned content removale is too late
2234
- * @protected
2235
- * @type {Object}
2236
- */
2237
- this._handlers = {
2238
- 'initialized.owl.carousel': $.proxy(function(e) {
2239
- if (e.namespace) {
2240
- this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
2241
- }
2242
- }, this),
2243
- 'resize.owl.carousel': $.proxy(function(e) {
2244
- if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
2245
- e.preventDefault();
2246
- }
2247
- }, this),
2248
- 'refreshed.owl.carousel': $.proxy(function(e) {
2249
- if (e.namespace && this._core.is('resizing')) {
2250
- this._core.$stage.find('.cloned .owl-video-frame').remove();
2251
- }
2252
- }, this),
2253
- 'changed.owl.carousel': $.proxy(function(e) {
2254
- if (e.namespace && e.property.name === 'position' && this._playing) {
2255
- this.stop();
2256
- }
2257
- }, this),
2258
- 'prepared.owl.carousel': $.proxy(function(e) {
2259
- if (!e.namespace) {
2260
- return;
2261
- }
2262
-
2263
- var $element = $(e.content).find('.owl-video');
2264
-
2265
- if ($element.length) {
2266
- $element.css('display', 'none');
2267
- this.fetch($element, $(e.content));
2268
- }
2269
- }, this)
2270
- };
2271
-
2272
- // set default options
2273
- this._core.options = $.extend({}, Video.Defaults, this._core.options);
2274
-
2275
- // register event handlers
2276
- this._core.$element.on(this._handlers);
2277
-
2278
- this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
2279
- this.play(e);
2280
- }, this));
2281
- };
2282
-
2283
- /**
2284
- * Default options.
2285
- * @public
2286
- */
2287
- Video.Defaults = {
2288
- video: false,
2289
- videoHeight: false,
2290
- videoWidth: false
2291
- };
2292
-
2293
- /**
2294
- * Gets the video ID and the type (YouTube/Vimeo/vzaar only).
2295
- * @protected
2296
- * @param {jQuery} target - The target containing the video data.
2297
- * @param {jQuery} item - The item containing the video.
2298
- */
2299
- Video.prototype.fetch = function(target, item) {
2300
- var type = (function() {
2301
- if (target.attr('data-vimeo-id')) {
2302
- return 'vimeo';
2303
- } else if (target.attr('data-vzaar-id')) {
2304
- return 'vzaar'
2305
- } else {
2306
- return 'youtube';
2307
- }
2308
- })(),
2309
- id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
2310
- width = target.attr('data-width') || this._core.settings.videoWidth,
2311
- height = target.attr('data-height') || this._core.settings.videoHeight,
2312
- url = target.attr('href');
2313
-
2314
- if (url) {
2315
-
2316
- /*
2317
- Parses the id's out of the following urls (and probably more):
2318
- https://www.youtube.com/watch?v=:id
2319
- https://youtu.be/:id
2320
- https://vimeo.com/:id
2321
- https://vimeo.com/channels/:channel/:id
2322
- https://vimeo.com/groups/:group/videos/:id
2323
- https://app.vzaar.com/videos/:id
2324
-
2325
- Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F
2326
- */
2327
-
2328
- id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
2329
-
2330
- if (id[3].indexOf('youtu') > -1) {
2331
- type = 'youtube';
2332
- } else if (id[3].indexOf('vimeo') > -1) {
2333
- type = 'vimeo';
2334
- } else if (id[3].indexOf('vzaar') > -1) {
2335
- type = 'vzaar';
2336
- } else {
2337
- throw new Error('Video URL not supported.');
2338
- }
2339
- id = id[6];
2340
- } else {
2341
- throw new Error('Missing video URL.');
2342
- }
2343
-
2344
- this._videos[url] = {
2345
- type: type,
2346
- id: id,
2347
- width: width,
2348
- height: height
2349
- };
2350
-
2351
- item.attr('data-video', url);
2352
-
2353
- this.thumbnail(target, this._videos[url]);
2354
- };
2355
-
2356
- /**
2357
- * Creates video thumbnail.
2358
- * @protected
2359
- * @param {jQuery} target - The target containing the video data.
2360
- * @param {Object} info - The video info object.
2361
- * @see `fetch`
2362
- */
2363
- Video.prototype.thumbnail = function(target, video) {
2364
- var tnLink,
2365
- icon,
2366
- path,
2367
- dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '',
2368
- customTn = target.find('img'),
2369
- srcType = 'src',
2370
- lazyClass = '',
2371
- settings = this._core.settings,
2372
- create = function(path) {
2373
- icon = '<div class="owl-video-play-icon"></div>';
2374
-
2375
- if (settings.lazyLoad) {
2376
- tnLink = $('<div/>',{
2377
- "class": 'owl-video-tn ' + lazyClass,
2378
- "srcType": path
2379
- });
2380
- } else {
2381
- tnLink = $( '<div/>', {
2382
- "class": "owl-video-tn",
2383
- "style": 'opacity:1;background-image:url(' + path + ')'
2384
- });
2385
- }
2386
- target.after(tnLink);
2387
- target.after(icon);
2388
- };
2389
-
2390
- // wrap video content into owl-video-wrapper div
2391
- target.wrap( $( '<div/>', {
2392
- "class": "owl-video-wrapper",
2393
- "style": dimensions
2394
- }));
2395
-
2396
- if (this._core.settings.lazyLoad) {
2397
- srcType = 'data-src';
2398
- lazyClass = 'owl-lazy';
2399
- }
2400
-
2401
- // custom thumbnail
2402
- if (customTn.length) {
2403
- create(customTn.attr(srcType));
2404
- customTn.remove();
2405
- return false;
2406
- }
2407
-
2408
- if (video.type === 'youtube') {
2409
- path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
2410
- create(path);
2411
- } else if (video.type === 'vimeo') {
2412
- $.ajax({
2413
- type: 'GET',
2414
- url: '//vimeo.com/api/v2/video/' + video.id + '.json',
2415
- jsonp: 'callback',
2416
- dataType: 'jsonp',
2417
- success: function(data) {
2418
- path = data[0].thumbnail_large;
2419
- create(path);
2420
- }
2421
- });
2422
- } else if (video.type === 'vzaar') {
2423
- $.ajax({
2424
- type: 'GET',
2425
- url: '//vzaar.com/api/videos/' + video.id + '.json',
2426
- jsonp: 'callback',
2427
- dataType: 'jsonp',
2428
- success: function(data) {
2429
- path = data.framegrab_url;
2430
- create(path);
2431
- }
2432
- });
2433
- }
2434
- };
2435
-
2436
- /**
2437
- * Stops the current video.
2438
- * @public
2439
- */
2440
- Video.prototype.stop = function() {
2441
- this._core.trigger('stop', null, 'video');
2442
- this._playing.find('.owl-video-frame').remove();
2443
- this._playing.removeClass('owl-video-playing');
2444
- this._playing = null;
2445
- this._core.leave('playing');
2446
- this._core.trigger('stopped', null, 'video');
2447
- };
2448
-
2449
- /**
2450
- * Starts the current video.
2451
- * @public
2452
- * @param {Event} event - The event arguments.
2453
- */
2454
- Video.prototype.play = function(event) {
2455
- var target = $(event.target),
2456
- item = target.closest('.' + this._core.settings.itemClass),
2457
- video = this._videos[item.attr('data-video')],
2458
- width = video.width || '100%',
2459
- height = video.height || this._core.$stage.height(),
2460
- html,
2461
- iframe;
2462
-
2463
- if (this._playing) {
2464
- return;
2465
- }
2466
-
2467
- this._core.enter('playing');
2468
- this._core.trigger('play', null, 'video');
2469
-
2470
- item = this._core.items(this._core.relative(item.index()));
2471
-
2472
- this._core.reset(item.index());
2473
-
2474
- html = $( '<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>' );
2475
- html.attr( 'height', height );
2476
- html.attr( 'width', width );
2477
- if (video.type === 'youtube') {
2478
- html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id );
2479
- } else if (video.type === 'vimeo') {
2480
- html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' );
2481
- } else if (video.type === 'vzaar') {
2482
- html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' );
2483
- }
2484
-
2485
- iframe = $(html).wrap( '<div class="owl-video-frame" />' ).insertAfter(item.find('.owl-video'));
2486
-
2487
- this._playing = item.addClass('owl-video-playing');
2488
- };
2489
-
2490
- /**
2491
- * Checks whether an video is currently in full screen mode or not.
2492
- * @todo Bad style because looks like a readonly method but changes members.
2493
- * @protected
2494
- * @returns {Boolean}
2495
- */
2496
- Video.prototype.isInFullScreen = function() {
2497
- var element = document.fullscreenElement || document.mozFullScreenElement ||
2498
- document.webkitFullscreenElement;
2499
-
2500
- return element && $(element).parent().hasClass('owl-video-frame');
2501
- };
2502
-
2503
- /**
2504
- * Destroys the plugin.
2505
- */
2506
- Video.prototype.destroy = function() {
2507
- var handler, property;
2508
-
2509
- this._core.$element.off('click.owl.video');
2510
-
2511
- for (handler in this._handlers) {
2512
- this._core.$element.off(handler, this._handlers[handler]);
2513
- }
2514
- for (property in Object.getOwnPropertyNames(this)) {
2515
- typeof this[property] != 'function' && (this[property] = null);
2516
- }
2517
- };
2518
-
2519
- $.fn.owlCarousel.Constructor.Plugins.Video = Video;
2520
-
2521
- })(window.Zepto || window.jQuery, window, document);
2522
-
2523
- /**
2524
- * Animate Plugin
2525
- * @version 2.3.4
2526
- * @author Bartosz Wojciechowski
2527
- * @author David Deutsch
2528
- * @license The MIT License (MIT)
2529
- */
2530
- ;(function($, window, document, undefined) {
2531
-
2532
- /**
2533
- * Creates the animate plugin.
2534
- * @class The Navigation Plugin
2535
- * @param {Owl} scope - The Owl Carousel
2536
- */
2537
- var Animate = function(scope) {
2538
- this.core = scope;
2539
- this.core.options = $.extend({}, Animate.Defaults, this.core.options);
2540
- this.swapping = true;
2541
- this.previous = undefined;
2542
- this.next = undefined;
2543
-
2544
- this.handlers = {
2545
- 'change.owl.carousel': $.proxy(function(e) {
2546
- if (e.namespace && e.property.name == 'position') {
2547
- this.previous = this.core.current();
2548
- this.next = e.property.value;
2549
- }
2550
- }, this),
2551
- 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
2552
- if (e.namespace) {
2553
- this.swapping = e.type == 'translated';
2554
- }
2555
- }, this),
2556
- 'translate.owl.carousel': $.proxy(function(e) {
2557
- if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
2558
- this.swap();
2559
- }
2560
- }, this)
2561
- };
2562
-
2563
- this.core.$element.on(this.handlers);
2564
- };
2565
-
2566
- /**
2567
- * Default options.
2568
- * @public
2569
- */
2570
- Animate.Defaults = {
2571
- animateOut: false,
2572
- animateIn: false
2573
- };
2574
-
2575
- /**
2576
- * Toggles the animation classes whenever an translations starts.
2577
- * @protected
2578
- * @returns {Boolean|undefined}
2579
- */
2580
- Animate.prototype.swap = function() {
2581
-
2582
- if (this.core.settings.items !== 1) {
2583
- return;
2584
- }
2585
-
2586
- if (!$.support.animation || !$.support.transition) {
2587
- return;
2588
- }
2589
-
2590
- this.core.speed(0);
2591
-
2592
- var left,
2593
- clear = $.proxy(this.clear, this),
2594
- previous = this.core.$stage.children().eq(this.previous),
2595
- next = this.core.$stage.children().eq(this.next),
2596
- incoming = this.core.settings.animateIn,
2597
- outgoing = this.core.settings.animateOut;
2598
-
2599
- if (this.core.current() === this.previous) {
2600
- return;
2601
- }
2602
-
2603
- if (outgoing) {
2604
- left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
2605
- previous.one($.support.animation.end, clear)
2606
- .css( { 'left': left + 'px' } )
2607
- .addClass('animated owl-animated-out')
2608
- .addClass(outgoing);
2609
- }
2610
-
2611
- if (incoming) {
2612
- next.one($.support.animation.end, clear)
2613
- .addClass('animated owl-animated-in')
2614
- .addClass(incoming);
2615
- }
2616
- };
2617
-
2618
- Animate.prototype.clear = function(e) {
2619
- $(e.target).css( { 'left': '' } )
2620
- .removeClass('animated owl-animated-out owl-animated-in')
2621
- .removeClass(this.core.settings.animateIn)
2622
- .removeClass(this.core.settings.animateOut);
2623
- this.core.onTransitionEnd();
2624
- };
2625
-
2626
- /**
2627
- * Destroys the plugin.
2628
- * @public
2629
- */
2630
- Animate.prototype.destroy = function() {
2631
- var handler, property;
2632
-
2633
- for (handler in this.handlers) {
2634
- this.core.$element.off(handler, this.handlers[handler]);
2635
- }
2636
- for (property in Object.getOwnPropertyNames(this)) {
2637
- typeof this[property] != 'function' && (this[property] = null);
2638
- }
2639
- };
2640
-
2641
- $.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
2642
-
2643
- })(window.Zepto || window.jQuery, window, document);
2644
-
2645
- /**
2646
- * Autoplay Plugin
2647
- * @version 2.3.4
2648
- * @author Bartosz Wojciechowski
2649
- * @author Artus Kolanowski
2650
- * @author David Deutsch
2651
- * @author Tom De CaluwГ©
2652
- * @license The MIT License (MIT)
2653
- */
2654
- ;(function($, window, document, undefined) {
2655
-
2656
- /**
2657
- * Creates the autoplay plugin.
2658
- * @class The Autoplay Plugin
2659
- * @param {Owl} scope - The Owl Carousel
2660
- */
2661
- var Autoplay = function(carousel) {
2662
- /**
2663
- * Reference to the core.
2664
- * @protected
2665
- * @type {Owl}
2666
- */
2667
- this._core = carousel;
2668
-
2669
- /**
2670
- * The autoplay timeout id.
2671
- * @type {Number}
2672
- */
2673
- this._call = null;
2674
-
2675
- /**
2676
- * Depending on the state of the plugin, this variable contains either
2677
- * the start time of the timer or the current timer value if it's
2678
- * paused. Since we start in a paused state we initialize the timer
2679
- * value.
2680
- * @type {Number}
2681
- */
2682
- this._time = 0;
2683
-
2684
- /**
2685
- * Stores the timeout currently used.
2686
- * @type {Number}
2687
- */
2688
- this._timeout = 0;
2689
-
2690
- /**
2691
- * Indicates whenever the autoplay is paused.
2692
- * @type {Boolean}
2693
- */
2694
- this._paused = true;
2695
-
2696
- /**
2697
- * All event handlers.
2698
- * @protected
2699
- * @type {Object}
2700
- */
2701
- this._handlers = {
2702
- 'changed.owl.carousel': $.proxy(function(e) {
2703
- if (e.namespace && e.property.name === 'settings') {
2704
- if (this._core.settings.autoplay) {
2705
- this.play();
2706
- } else {
2707
- this.stop();
2708
- }
2709
- } else if (e.namespace && e.property.name === 'position' && this._paused) {
2710
- // Reset the timer. This code is triggered when the position
2711
- // of the carousel was changed through user interaction.
2712
- this._time = 0;
2713
- }
2714
- }, this),
2715
- 'initialized.owl.carousel': $.proxy(function(e) {
2716
- if (e.namespace && this._core.settings.autoplay) {
2717
- this.play();
2718
- }
2719
- }, this),
2720
- 'play.owl.autoplay': $.proxy(function(e, t, s) {
2721
- if (e.namespace) {
2722
- this.play(t, s);
2723
- }
2724
- }, this),
2725
- 'stop.owl.autoplay': $.proxy(function(e) {
2726
- if (e.namespace) {
2727
- this.stop();
2728
- }
2729
- }, this),
2730
- 'mouseover.owl.autoplay': $.proxy(function() {
2731
- if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2732
- this.pause();
2733
- }
2734
- }, this),
2735
- 'mouseleave.owl.autoplay': $.proxy(function() {
2736
- if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2737
- this.play();
2738
- }
2739
- }, this),
2740
- 'touchstart.owl.core': $.proxy(function() {
2741
- if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2742
- this.pause();
2743
- }
2744
- }, this),
2745
- 'touchend.owl.core': $.proxy(function() {
2746
- if (this._core.settings.autoplayHoverPause) {
2747
- this.play();
2748
- }
2749
- }, this)
2750
- };
2751
-
2752
- // register event handlers
2753
- this._core.$element.on(this._handlers);
2754
-
2755
- // set default options
2756
- this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
2757
- };
2758
-
2759
- /**
2760
- * Default options.
2761
- * @public
2762
- */
2763
- Autoplay.Defaults = {
2764
- autoplay: false,
2765
- autoplayTimeout: 5000,
2766
- autoplayHoverPause: false,
2767
- autoplaySpeed: false
2768
- };
2769
-
2770
- /**
2771
- * Transition to the next slide and set a timeout for the next transition.
2772
- * @private
2773
- * @param {Number} [speed] - The animation speed for the animations.
2774
- */
2775
- Autoplay.prototype._next = function(speed) {
2776
- this._call = window.setTimeout(
2777
- $.proxy(this._next, this, speed),
2778
- this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
2779
- );
2780
-
2781
- if (this._core.is('interacting') || document.hidden) {
2782
- return;
2783
- }
2784
- this._core.next(speed || this._core.settings.autoplaySpeed);
2785
- }
2786
-
2787
- /**
2788
- * Reads the current timer value when the timer is playing.
2789
- * @public
2790
- */
2791
- Autoplay.prototype.read = function() {
2792
- return new Date().getTime() - this._time;
2793
- };
2794
-
2795
- /**
2796
- * Starts the autoplay.
2797
- * @public
2798
- * @param {Number} [timeout] - The interval before the next animation starts.
2799
- * @param {Number} [speed] - The animation speed for the animations.
2800
- */
2801
- Autoplay.prototype.play = function(timeout, speed) {
2802
- var elapsed;
2803
-
2804
- if (!this._core.is('rotating')) {
2805
- this._core.enter('rotating');
2806
- }
2807
-
2808
- timeout = timeout || this._core.settings.autoplayTimeout;
2809
-
2810
- // Calculate the elapsed time since the last transition. If the carousel
2811
- // wasn't playing this calculation will yield zero.
2812
- elapsed = Math.min(this._time % (this._timeout || timeout), timeout);
2813
-
2814
- if (this._paused) {
2815
- // Start the clock.
2816
- this._time = this.read();
2817
- this._paused = false;
2818
- } else {
2819
- // Clear the active timeout to allow replacement.
2820
- window.clearTimeout(this._call);
2821
- }
2822
-
2823
- // Adjust the origin of the timer to match the new timeout value.
2824
- this._time += this.read() % timeout - elapsed;
2825
-
2826
- this._timeout = timeout;
2827
- this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
2828
- };
2829
-
2830
- /**
2831
- * Stops the autoplay.
2832
- * @public
2833
- */
2834
- Autoplay.prototype.stop = function() {
2835
- if (this._core.is('rotating')) {
2836
- // Reset the clock.
2837
- this._time = 0;
2838
- this._paused = true;
2839
-
2840
- window.clearTimeout(this._call);
2841
- this._core.leave('rotating');
2842
- }
2843
- };
2844
-
2845
- /**
2846
- * Pauses the autoplay.
2847
- * @public
2848
- */
2849
- Autoplay.prototype.pause = function() {
2850
- if (this._core.is('rotating') && !this._paused) {
2851
- // Pause the clock.
2852
- this._time = this.read();
2853
- this._paused = true;
2854
-
2855
- window.clearTimeout(this._call);
2856
- }
2857
- };
2858
-
2859
- /**
2860
- * Destroys the plugin.
2861
- */
2862
- Autoplay.prototype.destroy = function() {
2863
- var handler, property;
2864
-
2865
- this.stop();
2866
-
2867
- for (handler in this._handlers) {
2868
- this._core.$element.off(handler, this._handlers[handler]);
2869
- }
2870
- for (property in Object.getOwnPropertyNames(this)) {
2871
- typeof this[property] != 'function' && (this[property] = null);
2872
- }
2873
- };
2874
-
2875
- $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
2876
-
2877
- })(window.Zepto || window.jQuery, window, document);
2878
-
2879
- /**
2880
- * Navigation Plugin
2881
- * @version 2.3.4
2882
- * @author Artus Kolanowski
2883
- * @author David Deutsch
2884
- * @license The MIT License (MIT)
2885
- */
2886
- ;(function($, window, document, undefined) {
2887
- 'use strict';
2888
-
2889
- /**
2890
- * Creates the navigation plugin.
2891
- * @class The Navigation Plugin
2892
- * @param {Owl} carousel - The Owl Carousel.
2893
- */
2894
- var Navigation = function(carousel) {
2895
- /**
2896
- * Reference to the core.
2897
- * @protected
2898
- * @type {Owl}
2899
- */
2900
- this._core = carousel;
2901
-
2902
- /**
2903
- * Indicates whether the plugin is initialized or not.
2904
- * @protected
2905
- * @type {Boolean}
2906
- */
2907
- this._initialized = false;
2908
-
2909
- /**
2910
- * The current paging indexes.
2911
- * @protected
2912
- * @type {Array}
2913
- */
2914
- this._pages = [];
2915
-
2916
- /**
2917
- * All DOM elements of the user interface.
2918
- * @protected
2919
- * @type {Object}
2920
- */
2921
- this._controls = {};
2922
-
2923
- /**
2924
- * Markup for an indicator.
2925
- * @protected
2926
- * @type {Array.<String>}
2927
- */
2928
- this._templates = [];
2929
-
2930
- /**
2931
- * The carousel element.
2932
- * @type {jQuery}
2933
- */
2934
- this.$element = this._core.$element;
2935
-
2936
- /**
2937
- * Overridden methods of the carousel.
2938
- * @protected
2939
- * @type {Object}
2940
- */
2941
- this._overrides = {
2942
- next: this._core.next,
2943
- prev: this._core.prev,
2944
- to: this._core.to
2945
- };
2946
-
2947
- /**
2948
- * All event handlers.
2949
- * @protected
2950
- * @type {Object}
2951
- */
2952
- this._handlers = {
2953
- 'prepared.owl.carousel': $.proxy(function(e) {
2954
- if (e.namespace && this._core.settings.dotsData) {
2955
- this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
2956
- $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
2957
- }
2958
- }, this),
2959
- 'added.owl.carousel': $.proxy(function(e) {
2960
- if (e.namespace && this._core.settings.dotsData) {
2961
- this._templates.splice(e.position, 0, this._templates.pop());
2962
- }
2963
- }, this),
2964
- 'remove.owl.carousel': $.proxy(function(e) {
2965
- if (e.namespace && this._core.settings.dotsData) {
2966
- this._templates.splice(e.position, 1);
2967
- }
2968
- }, this),
2969
- 'changed.owl.carousel': $.proxy(function(e) {
2970
- if (e.namespace && e.property.name == 'position') {
2971
- this.draw();
2972
- }
2973
- }, this),
2974
- 'initialized.owl.carousel': $.proxy(function(e) {
2975
- if (e.namespace && !this._initialized) {
2976
- this._core.trigger('initialize', null, 'navigation');
2977
- this.initialize();
2978
- this.update();
2979
- this.draw();
2980
- this._initialized = true;
2981
- this._core.trigger('initialized', null, 'navigation');
2982
- }
2983
- }, this),
2984
- 'refreshed.owl.carousel': $.proxy(function(e) {
2985
- if (e.namespace && this._initialized) {
2986
- this._core.trigger('refresh', null, 'navigation');
2987
- this.update();
2988
- this.draw();
2989
- this._core.trigger('refreshed', null, 'navigation');
2990
- }
2991
- }, this)
2992
- };
2993
-
2994
- // set default options
2995
- this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
2996
-
2997
- // register event handlers
2998
- this.$element.on(this._handlers);
2999
- };
3000
-
3001
- /**
3002
- * Default options.
3003
- * @public
3004
- * @todo Rename `slideBy` to `navBy`
3005
- */
3006
- Navigation.Defaults = {
3007
- nav: false,
3008
- navText: [
3009
- '<span aria-label="' + 'Previous' + '">&#x2039;</span>',
3010
- '<span aria-label="' + 'Next' + '">&#x203a;</span>'
3011
- ],
3012
- navSpeed: false,
3013
- navElement: 'button type="button" role="presentation"',
3014
- navContainer: false,
3015
- navContainerClass: 'owl-nav',
3016
- navClass: [
3017
- 'owl-prev',
3018
- 'owl-next'
3019
- ],
3020
- slideBy: 1,
3021
- changeItemOnClick:false,
3022
- dotClass: 'owl-dot',
3023
- dotsClass: 'owl-dots',
3024
- dots: true,
3025
- dotsEach: false,
3026
- dotsData: false,
3027
- dotsSpeed: false,
3028
- dotsContainer: false
3029
- };
3030
-
3031
- /**
3032
- * Initializes the layout of the plugin and extends the carousel.
3033
- * @protected
3034
- */
3035
- Navigation.prototype.initialize = function() {
3036
- var override,
3037
- settings = this._core.settings;
3038
-
3039
- // create DOM structure for relative navigation
3040
- this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
3041
- : $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
3042
-
3043
- this._controls.$previous = $('<' + settings.navElement + ' value="previous item" title="previous item">')
3044
- .addClass(settings.navClass[0])
3045
- .html(settings.navText[0])
3046
- .prependTo(this._controls.$relative)
3047
- .on('click', $.proxy(function(e) {
3048
- this.prev(settings.navSpeed);
3049
- }, this));
3050
- this._controls.$next = $('<' + settings.navElement + ' value="next item" title="next item">')
3051
- .addClass(settings.navClass[1])
3052
- .html(settings.navText[1])
3053
- .appendTo(this._controls.$relative)
3054
- .on('click', $.proxy(function(e) {
3055
- this.next(settings.navSpeed);
3056
- }, this));
3057
-
3058
- // scroll on item-click function
3059
- if(settings.changeItemOnClick){
3060
- var owlItem = this._core.$stage.children();
3061
- var clonedItems = this._core.clones().length / 2;
3062
-
3063
- owlItem.on('click', $.proxy(function(e){
3064
- var index = $(e.currentTarget).index();
3065
- this.to(index - clonedItems, settings.navSpeed, true);
3066
- }, this));
3067
- }
3068
-
3069
-
3070
-
3071
- // create DOM structure for absolute navigation
3072
- if (!settings.dotsData) {
3073
- this._templates = [ $('<button role="button">')
3074
- .addClass(settings.dotClass)
3075
- .append($('<span>'))
3076
- .prop('outerHTML') ];
3077
- }
3078
-
3079
- this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
3080
- : $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
3081
-
3082
- this._controls.$absolute.on('click', 'button', $.proxy(function(e) {
3083
- var index = $(e.target).parent().is(this._controls.$absolute)
3084
- ? $(e.target).index() : $(e.target).parent().index();
3085
- console.log($(e.target).index());
3086
- e.preventDefault();
3087
-
3088
- this.to(index, settings.dotsSpeed);
3089
- }, this));
3090
-
3091
- /*$el.on('focusin', function() {
3092
- $(document).off(".carousel");
3093
-
3094
- $(document).on('keydown.carousel', function(e) {
3095
- if(e.keyCode == 37) {
3096
- $el.trigger('prev.owl')
3097
- }
3098
- if(e.keyCode == 39) {
3099
- $el.trigger('next.owl')
3100
- }
3101
- });
3102
- });*/
3103
-
3104
- // override public methods of the carousel
3105
- for (override in this._overrides) {
3106
- this._core[override] = $.proxy(this[override], this);
3107
- }
3108
- };
3109
-
3110
- /**
3111
- * Destroys the plugin.
3112
- * @protected
3113
- */
3114
- Navigation.prototype.destroy = function() {
3115
- var handler, control, property, override, settings;
3116
- settings = this._core.settings;
3117
-
3118
- for (handler in this._handlers) {
3119
- this.$element.off(handler, this._handlers[handler]);
3120
- }
3121
- for (control in this._controls) {
3122
- if (control === '$relative' && settings.navContainer) {
3123
- this._controls[control].html('');
3124
- } else {
3125
- this._controls[control].remove();
3126
- }
3127
- }
3128
- for (override in this.overides) {
3129
- this._core[override] = this._overrides[override];
3130
- }
3131
- for (property in Object.getOwnPropertyNames(this)) {
3132
- typeof this[property] != 'function' && (this[property] = null);
3133
- }
3134
- };
3135
-
3136
- /**
3137
- * Updates the internal state.
3138
- * @protected
3139
- */
3140
- Navigation.prototype.update = function() {
3141
- var i, j, k,
3142
- lower = this._core.clones().length / 2,
3143
- upper = lower + this._core.items().length,
3144
- maximum = this._core.maximum(true),
3145
- settings = this._core.settings,
3146
- size = settings.center || settings.autoWidth || settings.dotsData
3147
- ? 1 : settings.dotsEach || settings.items;
3148
-
3149
- if (settings.slideBy !== 'page') {
3150
- settings.slideBy = Math.min(settings.slideBy, settings.items);
3151
- }
3152
-
3153
- if (settings.dots || settings.slideBy == 'page') {
3154
- this._pages = [];
3155
-
3156
- for (i = lower, j = 0, k = 0; i < upper; i++) {
3157
- if (j >= size || j === 0) {
3158
- this._pages.push({
3159
- start: Math.min(maximum, i - lower),
3160
- end: i - lower + size - 1
3161
- });
3162
- if (Math.min(maximum, i - lower) === maximum) {
3163
- break;
3164
- }
3165
- j = 0, ++k;
3166
- }
3167
- j += this._core.mergers(this._core.relative(i));
3168
- }
3169
- }
3170
- };
3171
-
3172
- /**
3173
- * Draws the user interface.
3174
- * @todo The option `dotsData` wont work.
3175
- * @protected
3176
- */
3177
- Navigation.prototype.draw = function() {
3178
- var difference,
3179
- settings = this._core.settings,
3180
- disabled = this._core.items().length <= settings.items,
3181
- index = this._core.relative(this._core.current()),
3182
- loop = settings.loop || settings.rewind;
3183
-
3184
- this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
3185
-
3186
- if (settings.nav) {
3187
- this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
3188
- this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
3189
- }
3190
-
3191
- this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
3192
-
3193
- if (settings.dots) {
3194
- difference = this._pages.length - this._controls.$absolute.children().length;
3195
-
3196
- if (settings.dotsData && difference !== 0) {
3197
- this._controls.$absolute.html(this._templates.join(''));
3198
- } else if (difference > 0) {
3199
- this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
3200
- } else if (difference < 0) {
3201
- this._controls.$absolute.children().slice(difference).remove();
3202
- }
3203
-
3204
- this._controls.$absolute.find('.active').removeClass('active');
3205
- this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
3206
- }
3207
- };
3208
-
3209
- /**
3210
- * Extends event data.
3211
- * @protected
3212
- * @param {Event} event - The event object which gets thrown.
3213
- */
3214
- Navigation.prototype.onTrigger = function(event) {
3215
- var settings = this._core.settings;
3216
-
3217
- event.page = {
3218
- index: $.inArray(this.current(), this._pages),
3219
- count: this._pages.length,
3220
- size: settings && (settings.center || settings.autoWidth || settings.dotsData
3221
- ? 1 : settings.dotsEach || settings.items)
3222
- };
3223
- };
3224
-
3225
- /**
3226
- * Gets the current page position of the carousel.
3227
- * @protected
3228
- * @returns {Number}
3229
- */
3230
- Navigation.prototype.current = function() {
3231
- var current = this._core.relative(this._core.current());
3232
- return $.grep(this._pages, $.proxy(function(page, index) {
3233
- return page.start <= current && page.end >= current;
3234
- }, this)).pop();
3235
- };
3236
-
3237
- /**
3238
- * Gets the current succesor/predecessor position.
3239
- * @protected
3240
- * @returns {Number}
3241
- */
3242
- Navigation.prototype.getPosition = function(successor) {
3243
- var position, length,
3244
- settings = this._core.settings;
3245
-
3246
- if (settings.slideBy == 'page') {
3247
- position = $.inArray(this.current(), this._pages);
3248
- length = this._pages.length;
3249
- successor ? ++position : --position;
3250
- position = this._pages[((position % length) + length) % length].start;
3251
- } else {
3252
- position = this._core.relative(this._core.current());
3253
- length = this._core.items().length;
3254
- successor ? position += settings.slideBy : position -= settings.slideBy;
3255
- }
3256
-
3257
- return position;
3258
- };
3259
-
3260
- /**
3261
- * Slides to the next item or page.
3262
- * @public
3263
- * @param {Number} [speed=false] - The time in milliseconds for the transition.
3264
- */
3265
- Navigation.prototype.next = function(speed) {
3266
- $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
3267
- };
3268
-
3269
- /**
3270
- * Slides to the previous item or page.
3271
- * @public
3272
- * @param {Number} [speed=false] - The time in milliseconds for the transition.
3273
- */
3274
- Navigation.prototype.prev = function(speed) {
3275
- $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
3276
- };
3277
-
3278
- /**
3279
- * Slides to the specified item or page.
3280
- * @public
3281
- * @param {Number} position - The position of the item or page.
3282
- * @param {Number} [speed] - The time in milliseconds for the transition.
3283
- * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
3284
- */
3285
- Navigation.prototype.to = function(position, speed, standard) {
3286
- var length;
3287
-
3288
- if (!standard && this._pages.length) {
3289
- length = this._pages.length;
3290
- $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
3291
- } else {
3292
- $.proxy(this._overrides.to, this._core)(position, speed);
3293
- }
3294
- };
3295
-
3296
- $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3297
-
3298
- })(window.Zepto || window.jQuery, window, document);
3299
-
3300
- /**
3301
- * Hash Plugin
3302
- * @version 2.3.4
3303
- * @author Artus Kolanowski
3304
- * @author David Deutsch
3305
- * @license The MIT License (MIT)
3306
- */
3307
- ;(function($, window, document, undefined) {
3308
- 'use strict';
3309
-
3310
- /**
3311
- * Creates the hash plugin.
3312
- * @class The Hash Plugin
3313
- * @param {Owl} carousel - The Owl Carousel
3314
- */
3315
- var Hash = function(carousel) {
3316
- /**
3317
- * Reference to the core.
3318
- * @protected
3319
- * @type {Owl}
3320
- */
3321
- this._core = carousel;
3322
-
3323
- /**
3324
- * Hash index for the items.
3325
- * @protected
3326
- * @type {Object}
3327
- */
3328
- this._hashes = {};
3329
-
3330
- /**
3331
- * The carousel element.
3332
- * @type {jQuery}
3333
- */
3334
- this.$element = this._core.$element;
3335
-
3336
- /**
3337
- * All event handlers.
3338
- * @protected
3339
- * @type {Object}
3340
- */
3341
- this._handlers = {
3342
- 'initialized.owl.carousel': $.proxy(function(e) {
3343
- if (e.namespace && this._core.settings.startPosition === 'URLHash') {
3344
- $(window).trigger('hashchange.owl.navigation');
3345
- }
3346
- }, this),
3347
- 'prepared.owl.carousel': $.proxy(function(e) {
3348
- if (e.namespace) {
3349
- var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
3350
-
3351
- if (!hash) {
3352
- return;
3353
- }
3354
-
3355
- this._hashes[hash] = e.content;
3356
- }
3357
- }, this),
3358
- 'changed.owl.carousel': $.proxy(function(e) {
3359
- if (e.namespace && e.property.name === 'position') {
3360
- var current = this._core.items(this._core.relative(this._core.current())),
3361
- hash = $.map(this._hashes, function(item, hash) {
3362
- return item === current ? hash : null;
3363
- }).join();
3364
-
3365
- if (!hash || window.location.hash.slice(1) === hash) {
3366
- return;
3367
- }
3368
-
3369
- window.location.hash = hash;
3370
- }
3371
- }, this)
3372
- };
3373
-
3374
- // set default options
3375
- this._core.options = $.extend({}, Hash.Defaults, this._core.options);
3376
-
3377
- // register the event handlers
3378
- this.$element.on(this._handlers);
3379
-
3380
- // register event listener for hash navigation
3381
- $(window).on('hashchange.owl.navigation', $.proxy(function(e) {
3382
- var hash = window.location.hash.substring(1),
3383
- items = this._core.$stage.children(),
3384
- position = this._hashes[hash] && items.index(this._hashes[hash]);
3385
-
3386
- if (position === undefined || position === this._core.current()) {
3387
- return;
3388
- }
3389
-
3390
- this._core.to(this._core.relative(position), false, true);
3391
- }, this));
3392
- };
3393
-
3394
- /**
3395
- * Default options.
3396
- * @public
3397
- */
3398
- Hash.Defaults = {
3399
- URLhashListener: false
3400
- };
3401
-
3402
- /**
3403
- * Destroys the plugin.
3404
- * @public
3405
- */
3406
- Hash.prototype.destroy = function() {
3407
- var handler, property;
3408
-
3409
- $(window).off('hashchange.owl.navigation');
3410
-
3411
- for (handler in this._handlers) {
3412
- this._core.$element.off(handler, this._handlers[handler]);
3413
- }
3414
- for (property in Object.getOwnPropertyNames(this)) {
3415
- typeof this[property] != 'function' && (this[property] = null);
3416
- }
3417
- };
3418
-
3419
- $.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3420
-
3421
- })(window.Zepto || window.jQuery, window, document);
3422
-
3423
- /**
3424
- * Support Plugin
3425
- *
3426
- * @version 2.3.4
3427
- * @author Vivid Planet Software GmbH
3428
- * @author Artus Kolanowski
3429
- * @author David Deutsch
3430
- * @license The MIT License (MIT)
3431
- */
3432
- ;(function($, window, document, undefined) {
3433
-
3434
- var style = $('<support>').get(0).style,
3435
- prefixes = 'Webkit Moz O ms'.split(' '),
3436
- events = {
3437
- transition: {
3438
- end: {
3439
- WebkitTransition: 'webkitTransitionEnd',
3440
- MozTransition: 'transitionend',
3441
- OTransition: 'oTransitionEnd',
3442
- transition: 'transitionend'
3443
- }
3444
- },
3445
- animation: {
3446
- end: {
3447
- WebkitAnimation: 'webkitAnimationEnd',
3448
- MozAnimation: 'animationend',
3449
- OAnimation: 'oAnimationEnd',
3450
- animation: 'animationend'
3451
- }
3452
- }
3453
- },
3454
- tests = {
3455
- csstransforms: function() {
3456
- return !!test('transform');
3457
- },
3458
- csstransforms3d: function() {
3459
- return !!test('perspective');
3460
- },
3461
- csstransitions: function() {
3462
- return !!test('transition');
3463
- },
3464
- cssanimations: function() {
3465
- return !!test('animation');
3466
- }
3467
- };
3468
-
3469
- function test(property, prefixed) {
3470
- var result = false,
3471
- upper = property.charAt(0).toUpperCase() + property.slice(1);
3472
-
3473
- $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
3474
- if (style[property] !== undefined) {
3475
- result = prefixed ? property : true;
3476
- return false;
3477
- }
3478
- });
3479
-
3480
- return result;
3481
- }
3482
-
3483
- function prefixed(property) {
3484
- return test(property, true);
3485
- }
3486
-
3487
- if (tests.csstransitions()) {
3488
- /* jshint -W053 */
3489
- $.support.transition = new String(prefixed('transition'))
3490
- $.support.transition.end = events.transition.end[ $.support.transition ];
3491
- }
3492
-
3493
- if (tests.cssanimations()) {
3494
- /* jshint -W053 */
3495
- $.support.animation = new String(prefixed('animation'))
3496
- $.support.animation.end = events.animation.end[ $.support.animation ];
3497
- }
3498
-
3499
- if (tests.csstransforms()) {
3500
- /* jshint -W053 */
3501
- $.support.transform = new String(prefixed('transform'));
3502
- $.support.transform3d = tests.csstransforms3d();
3503
- }
3504
-
3505
- })(window.Zepto || window.jQuery, window, document);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3506
 
1
+ /**
2
+ * Owl Carousel v2.3.6 - UE5
3
+ * Copyright 2013-2018 David Deutsch
4
+ * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
5
+ */
6
+ /**
7
+ * Owl carousel
8
+ * @version 2.3.5
9
+ * @author Bartosz Wojciechowski
10
+ * @author David Deutsch
11
+ * @license The MIT License (MIT)
12
+ * @todo Lazy Load Icon
13
+ * @todo prevent animationend bubling
14
+ * @todo itemsScaleUp
15
+ * @todo Test Zepto
16
+ * @todo stagePadding calculate wrong active classes
17
+ */
18
+ ;(function($, window, document, undefined) {
19
+
20
+ /**
21
+ * Creates a carousel.
22
+ * @class The Owl Carousel.
23
+ * @public
24
+ * @param {HTMLElement|jQuery} element - The element to create the carousel for.
25
+ * @param {Object} [options] - The options
26
+ */
27
+ function Owl(element, options) {
28
+
29
+ /**
30
+ * Current settings for the carousel.
31
+ * @public
32
+ */
33
+ this.settings = null;
34
+
35
+ /**
36
+ * Current options set by the caller including defaults.
37
+ * @public
38
+ */
39
+ this.options = $.extend({}, Owl.Defaults, options);
40
+
41
+ /**
42
+ * Plugin element.
43
+ * @public
44
+ */
45
+ this.$element = $(element);
46
+
47
+ /**
48
+ * Proxied event handlers.
49
+ * @protected
50
+ */
51
+ this._handlers = {};
52
+
53
+ /**
54
+ * References to the running plugins of this carousel.
55
+ * @protected
56
+ */
57
+ this._plugins = {};
58
+
59
+ /**
60
+ * Currently suppressed events to prevent them from being retriggered.
61
+ * @protected
62
+ */
63
+ this._supress = {};
64
+
65
+ /**
66
+ * Absolute current position.
67
+ * @protected
68
+ */
69
+ this._current = null;
70
+
71
+ /**
72
+ * Animation speed in milliseconds.
73
+ * @protected
74
+ */
75
+ this._speed = null;
76
+
77
+ /**
78
+ * Coordinates of all items in pixel.
79
+ * @todo The name of this member is missleading.
80
+ * @protected
81
+ */
82
+ this._coordinates = [];
83
+
84
+ /**
85
+ * Current breakpoint.
86
+ * @todo Real media queries would be nice.
87
+ * @protected
88
+ */
89
+ this._breakpoint = null;
90
+
91
+ /**
92
+ * Current width of the plugin element.
93
+ */
94
+ this._width = null;
95
+
96
+ /**
97
+ * All real items.
98
+ * @protected
99
+ */
100
+ this._items = [];
101
+
102
+ /**
103
+ * All cloned items.
104
+ * @protected
105
+ */
106
+ this._clones = [];
107
+
108
+ /**
109
+ * Merge values of all items.
110
+ * @todo Maybe this could be part of a plugin.
111
+ * @protected
112
+ */
113
+ this._mergers = [];
114
+
115
+ /**
116
+ * Widths of all items.
117
+ */
118
+ this._widths = [];
119
+
120
+ /**
121
+ * Invalidated parts within the update process.
122
+ * @protected
123
+ */
124
+ this._invalidated = {};
125
+
126
+ /**
127
+ * Ordered list of workers for the update process.
128
+ * @protected
129
+ */
130
+ this._pipe = [];
131
+
132
+ /**
133
+ * Current state information for the drag operation.
134
+ * @todo #261
135
+ * @protected
136
+ */
137
+ this._drag = {
138
+ time: null,
139
+ target: null,
140
+ pointer: null,
141
+ stage: {
142
+ start: null,
143
+ current: null
144
+ },
145
+ direction: null
146
+ };
147
+
148
+ /**
149
+ * Current state information and their tags.
150
+ * @type {Object}
151
+ * @protected
152
+ */
153
+ this._states = {
154
+ current: {},
155
+ tags: {
156
+ 'initializing': [ 'busy' ],
157
+ 'animating': [ 'busy' ],
158
+ 'dragging': [ 'interacting' ]
159
+ }
160
+ };
161
+
162
+ $.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) {
163
+ this._handlers[handler] = $.proxy(this[handler], this);
164
+ }, this));
165
+
166
+ $.each(Owl.Plugins, $.proxy(function(key, plugin) {
167
+ this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
168
+ = new plugin(this);
169
+ }, this));
170
+
171
+ $.each(Owl.Workers, $.proxy(function(priority, worker) {
172
+ this._pipe.push({
173
+ 'filter': worker.filter,
174
+ 'run': $.proxy(worker.run, this)
175
+ });
176
+ }, this));
177
+
178
+ this.setup();
179
+ this.initialize();
180
+ }
181
+
182
+ /**
183
+ * Default options for the carousel.
184
+ * @public
185
+ */
186
+ Owl.Defaults = {
187
+ items: 3,
188
+ loop: false,
189
+ center: false,
190
+ rewind: false,
191
+ checkVisibility: true,
192
+ setActiveClass: true,
193
+ setActiveClassOnMobile: true,
194
+
195
+ mouseDrag: true,
196
+ touchDrag: true,
197
+ pullDrag: true,
198
+ freeDrag: false,
199
+
200
+ margin: 0,
201
+ paddingType: 'none',
202
+ stagePadding: 0,
203
+
204
+ merge: false,
205
+ mergeFit: true,
206
+ autoWidth: false,
207
+
208
+ startPosition: 0,
209
+ rtl: false,
210
+
211
+ smartSpeed: 250,
212
+ fluidSpeed: false,
213
+ dragEndSpeed: false,
214
+
215
+ responsive: {},
216
+ responsiveRefreshRate: 200,
217
+ responsiveBaseElement: window,
218
+
219
+ fallbackEasing: 'swing',
220
+ slideTransition: '',
221
+
222
+ info: false,
223
+
224
+ nestedItemSelector: false,
225
+ itemElement: 'div',
226
+ stageElement: 'div',
227
+
228
+ refreshClass: 'owl-refresh',
229
+ loadedClass: 'owl-loaded',
230
+ loadingClass: 'owl-loading',
231
+ rtlClass: 'owl-rtl',
232
+ responsiveClass: 'owl-responsive',
233
+ dragClass: 'owl-drag',
234
+ itemClass: 'owl-item',
235
+ stageClass: 'owl-stage',
236
+ stageOuterClass: 'owl-stage-outer',
237
+ grabClass: 'owl-grab',
238
+ shuffle: false
239
+ };
240
+
241
+ /**
242
+ * Enumeration for width.
243
+ * @public
244
+ * @readonly
245
+ * @enum {String}
246
+ */
247
+ Owl.Width = {
248
+ Default: 'default',
249
+ Inner: 'inner',
250
+ Outer: 'outer'
251
+ };
252
+
253
+ /**
254
+ * Enumeration for types.
255
+ * @public
256
+ * @readonly
257
+ * @enum {String}
258
+ */
259
+ Owl.Type = {
260
+ Event: 'event',
261
+ State: 'state'
262
+ };
263
+
264
+ /**
265
+ * Contains all registered plugins.
266
+ * @public
267
+ */
268
+ Owl.Plugins = {};
269
+
270
+ /**
271
+ * List of workers involved in the update process.
272
+ */
273
+ Owl.Workers = [ {
274
+ filter: [ 'width', 'settings' ],
275
+ run: function() {
276
+ this._width = this.$element.width();
277
+ }
278
+ }, {
279
+ filter: [ 'width', 'items', 'settings' ],
280
+ run: function(cache) {
281
+ cache.current = this._items && this._items[this.relative(this._current)];
282
+ }
283
+ }, {
284
+ filter: [ 'items', 'settings' ],
285
+ run: function() {
286
+ this.$stage.children('.cloned').remove();
287
+ }
288
+ }, {
289
+ filter: [ 'width', 'items', 'settings' ],
290
+ run: function(cache) {
291
+ var margin = this.settings.margin || '',
292
+ grid = !this.settings.autoWidth,
293
+ rtl = this.settings.rtl,
294
+ css = {
295
+ 'width': 'auto',
296
+ 'margin-left': rtl ? margin : '',
297
+ 'margin-right': rtl ? '' : margin
298
+ };
299
+
300
+ !grid && this.$stage.children().css(css);
301
+
302
+ cache.css = css;
303
+ }
304
+ }, {
305
+ filter: [ 'width', 'items', 'settings' ],
306
+ run: function(cache) {
307
+ var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
308
+ merge = null,
309
+ iterator = this._items.length,
310
+ grid = !this.settings.autoWidth,
311
+ widths = [];
312
+
313
+ cache.items = {
314
+ merge: false,
315
+ width: width
316
+ };
317
+
318
+ while (iterator--) {
319
+ merge = this._mergers[iterator];
320
+ merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge;
321
+
322
+ cache.items.merge = merge > 1 || cache.items.merge;
323
+
324
+ widths[iterator] = !grid ? this._items[iterator].width() : width * merge;
325
+ }
326
+
327
+ this._widths = widths;
328
+ }
329
+ }, {
330
+ filter: [ 'items', 'settings' ],
331
+ run: function() {
332
+ var clones = [],
333
+ items = this._items,
334
+ settings = this.settings,
335
+ // TODO: Should be computed from number of min width items in stage
336
+ view = Math.max(settings.items * 2, 4),
337
+ size = Math.ceil(items.length / 2) * 2,
338
+ repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0,
339
+ append = '',
340
+ prepend = '';
341
+
342
+ repeat /= 2;
343
+
344
+ while (repeat > 0) {
345
+ // Switch to only using appended clones
346
+ clones.push(this.normalize(clones.length / 2, true));
347
+ append = append + items[clones[clones.length - 1]][0].outerHTML;
348
+ clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
349
+ prepend = items[clones[clones.length - 1]][0].outerHTML + prepend;
350
+ repeat -= 1;
351
+ }
352
+
353
+ this._clones = clones;
354
+
355
+ $(append).addClass('cloned').appendTo(this.$stage);
356
+ $(prepend).addClass('cloned').prependTo(this.$stage);
357
+ }
358
+ }, {
359
+ filter: [ 'width', 'items', 'settings' ],
360
+ run: function() {
361
+ var rtl = this.settings.rtl ? 1 : -1,
362
+ size = this._clones.length + this._items.length,
363
+ iterator = -1,
364
+ previous = 0,
365
+ current = 0,
366
+ coordinates = [];
367
+
368
+ while (++iterator < size) {
369
+ previous = coordinates[iterator - 1] || 0;
370
+ current = this._widths[this.relative(iterator)] + this.settings.margin;
371
+ coordinates.push(previous + current * rtl);
372
+ }
373
+
374
+ this._coordinates = coordinates;
375
+ }
376
+ }, {
377
+ filter: [ 'width', 'items', 'settings' ],
378
+ run: function() {
379
+ var padding = this.settings.stagePadding,
380
+ coordinates = this._coordinates,
381
+
382
+ none = {
383
+ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])),
384
+ 'padding-left': '',
385
+ 'padding-right': ''
386
+ },
387
+ both = {
388
+ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
389
+ 'padding-left': padding || '',
390
+ 'padding-right': padding || ''
391
+ },
392
+ left = {
393
+ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding,
394
+ 'padding-left': padding || '',
395
+ 'padding-right': ''
396
+ },
397
+ right = {
398
+ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding,
399
+ 'padding-left': '',
400
+ 'padding-right': padding || ''
401
+ };
402
+
403
+ var paddingType = this.settings.paddingType;
404
+
405
+ if(!paddingType)
406
+ paddingType = "none";
407
+
408
+ if(paddingType == 'none'){
409
+ this.$stage.css(none);
410
+ }else if(paddingType == 'both'){
411
+ this.$stage.css(both);
412
+ }else if(paddingType == 'left'){
413
+ this.$stage.css(left);
414
+ }else if(paddingType == 'right'){
415
+ this.$stage.css(right);
416
+ }
417
+
418
+ }
419
+ }, {
420
+ filter: [ 'width', 'items', 'settings' ],
421
+ run: function(cache) {
422
+ var iterator = this._coordinates.length,
423
+ grid = !this.settings.autoWidth,
424
+ items = this.$stage.children();
425
+
426
+ if (grid && cache.items.merge) {
427
+ while (iterator--) {
428
+ cache.css.width = this._widths[this.relative(iterator)];
429
+ items.eq(iterator).css(cache.css);
430
+ }
431
+ } else if (grid) {
432
+ cache.css.width = cache.items.width;
433
+ items.css(cache.css);
434
+ }
435
+ }
436
+ }, {
437
+ filter: [ 'items' ],
438
+ run: function() {
439
+ this._coordinates.length < 1 && this.$stage.removeAttr('style');
440
+ }
441
+ }, {
442
+ filter: [ 'width', 'items', 'settings' ],
443
+ run: function(cache) {
444
+ cache.current = cache.current ? this.$stage.children().index(cache.current) : 0;
445
+ cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
446
+ this.reset(cache.current);
447
+ }
448
+ }, {
449
+ filter: [ 'position' ],
450
+ run: function() {
451
+ this.animate(this.coordinates(this._current));
452
+ }
453
+ }, {
454
+ filter: [ 'width', 'position', 'items', 'settings' ],
455
+ run: function() {
456
+ var rtl = this.settings.rtl ? 1 : -1,
457
+ padding = this.settings.stagePadding * 2,
458
+ begin = this.coordinates(this.current()) + padding,
459
+ end = begin + this.width() * rtl,
460
+ inner, outer, matches = [], i, n;
461
+
462
+ if(this.settings.paddingType == 'left' || this.settings.paddingType == 'right'){
463
+ padding = this.settings.stagePadding;
464
+ }
465
+
466
+ for (i = 0, n = this._coordinates.length; i < n; i++) {
467
+ inner = this._coordinates[i - 1] || 0;
468
+ outer = Math.abs(this._coordinates[i]) + padding * rtl;
469
+
470
+ if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
471
+ || (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
472
+ matches.push(i);
473
+ }
474
+ }
475
+
476
+ this.$stage.children('.active').removeClass('active');
477
+ this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
478
+
479
+ this.$stage.children('.center').removeClass('center');
480
+ if (this.settings.center) {
481
+ this.$stage.children().eq(this.current()).addClass('center');
482
+ }
483
+ }
484
+ }, {
485
+ filter: [ 'width', 'position', 'items', 'settings' ],
486
+ run: function() {
487
+
488
+ if(!this.settings.setActiveClass){
489
+ return;
490
+ }
491
+
492
+ if (this.settings.setActiveClass) {
493
+ var $setClass = true;
494
+
495
+ if (this.settings.setActiveClassOnMobile) {
496
+ if(this.$stage.children(".active").length == 1){
497
+ $setClass = true;
498
+ }
499
+ }else if(!this.settings.setActiveClassOnMobile){
500
+ if(this.$stage.children(".active").length == 1){
501
+ $setClass = false;
502
+ }
503
+ }
504
+
505
+ if($setClass == true){
506
+ this.$stage.children().eq(this.current()).addClass("uc-active-item").siblings().removeClass("uc-active-item");
507
+ }else if ($setClass == false){
508
+ this.$stage.children().removeClass("uc-active-item");
509
+ }
510
+
511
+ }
512
+ }
513
+ }];
514
+
515
+ /**
516
+ * Create the stage DOM element
517
+ */
518
+ Owl.prototype.initializeStage = function() {
519
+ this.$stage = this.$element.find('.' + this.settings.stageClass);
520
+
521
+ // if the stage is already in the DOM, grab it and skip stage initialization
522
+ if (this.$stage.length) {
523
+ return;
524
+ }
525
+
526
+ this.$element.addClass(this.options.loadingClass);
527
+
528
+ // create stage
529
+ this.$stage = $('<' + this.settings.stageElement + '>', {
530
+ "class": this.settings.stageClass
531
+ }).wrap( $( '<div/>', {
532
+ "class": this.settings.stageOuterClass
533
+ }));
534
+
535
+ // append stage
536
+ this.$element.append(this.$stage.parent());
537
+ };
538
+
539
+ /**
540
+ * Create item DOM elements
541
+ */
542
+ Owl.prototype.initializeItems = function() {
543
+ var $items = this.$element.find('.owl-item');
544
+
545
+ // if the items are already in the DOM, grab them and skip item initialization
546
+ if ($items.length) {
547
+ this._items = $items.get().map(function(item) {
548
+ return $(item);
549
+ });
550
+
551
+ this._mergers = this._items.map(function() {
552
+ return 1;
553
+ });
554
+
555
+ this.refresh();
556
+
557
+ return;
558
+ }
559
+
560
+ // append content
561
+ this.replace(this.$element.children().not(this.$stage.parent()));
562
+
563
+ // check visibility
564
+ if (this.isVisible()) {
565
+ // update view
566
+ this.refresh();
567
+ } else {
568
+ // invalidate width
569
+ this.invalidate('width');
570
+ }
571
+
572
+
573
+ this.$element
574
+ .removeClass(this.options.loadingClass)
575
+ .addClass(this.options.loadedClass);
576
+ };
577
+
578
+ /**
579
+ * Initializes the carousel.
580
+ * @protected
581
+ */
582
+ Owl.prototype.initialize = function() {
583
+ this.enter('initializing');
584
+ this.trigger('initialize');
585
+
586
+ this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
587
+
588
+
589
+ if(this.settings.shuffle){
590
+ var carousel = this.$element;
591
+ carousel.children().sort(function(){
592
+ return Math.round(Math.random()) - 0.5;
593
+ }).each(function(){
594
+ carousel.append(this);
595
+ });
596
+ }
597
+
598
+ if (this.settings.autoWidth && !this.is('pre-loading')) {
599
+ var imgs, nestedSelector, width;
600
+ imgs = this.$element.find('img');
601
+ nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
602
+ width = this.$element.children(nestedSelector).width();
603
+
604
+ if (imgs.length && width <= 0) {
605
+ this.preloadAutoWidthImages(imgs);
606
+ }
607
+ }
608
+
609
+ this.initializeStage();
610
+ this.initializeItems();
611
+
612
+ // register event handlers
613
+ this.registerEventHandlers();
614
+
615
+ this.leave('initializing');
616
+ this.trigger('initialized');
617
+ };
618
+
619
+ /**
620
+ * @returns {Boolean} visibility of $element
621
+ * if you know the carousel will always be visible you can set `checkVisibility` to `false` to
622
+ * prevent the expensive browser layout forced reflow the $element.is(':visible') does
623
+ */
624
+ Owl.prototype.isVisible = function() {
625
+ return this.settings.checkVisibility
626
+ ? this.$element.is(':visible')
627
+ : true;
628
+ };
629
+
630
+ /**
631
+ * Setups the current settings.
632
+ * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
633
+ * @todo Support for media queries by using `matchMedia` would be nice.
634
+ * @public
635
+ */
636
+ Owl.prototype.setup = function() {
637
+ var viewport = this.viewport(),
638
+ overwrites = this.options.responsive,
639
+ match = -1,
640
+ settings = null;
641
+
642
+ if (!overwrites) {
643
+ settings = $.extend({}, this.options);
644
+ } else {
645
+ $.each(overwrites, function(breakpoint) {
646
+ if (breakpoint <= viewport && breakpoint > match) {
647
+ match = Number(breakpoint);
648
+ }
649
+ });
650
+
651
+ settings = $.extend({}, this.options, overwrites[match]);
652
+ if (typeof settings.stagePadding === 'function') {
653
+ settings.stagePadding = settings.stagePadding();
654
+ }
655
+ delete settings.responsive;
656
+
657
+ // responsive class
658
+ if (settings.responsiveClass) {
659
+ this.$element.attr('class',
660
+ this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
661
+ );
662
+ }
663
+ }
664
+
665
+ this.trigger('change', { property: { name: 'settings', value: settings } });
666
+ this._breakpoint = match;
667
+ this.settings = settings;
668
+ this.invalidate('settings');
669
+ this.trigger('changed', { property: { name: 'settings', value: this.settings } });
670
+ };
671
+
672
+ /**
673
+ * Updates option logic if necessery.
674
+ * @protected
675
+ */
676
+ Owl.prototype.optionsLogic = function() {
677
+ if (this.settings.autoWidth) {
678
+ this.settings.stagePadding = false;
679
+ this.settings.merge = false;
680
+ }
681
+ };
682
+
683
+ /**
684
+ * Prepares an item before add.
685
+ * @todo Rename event parameter `content` to `item`.
686
+ * @protected
687
+ * @returns {jQuery|HTMLElement} - The item container.
688
+ */
689
+ Owl.prototype.prepare = function(item) {
690
+ var event = this.trigger('prepare', { content: item });
691
+
692
+ if (!event.data) {
693
+ event.data = $('<' + this.settings.itemElement + '/>')
694
+ .addClass(this.options.itemClass).append(item)
695
+ }
696
+
697
+ this.trigger('prepared', { content: event.data });
698
+
699
+ return event.data;
700
+ };
701
+
702
+ /**
703
+ * Updates the view.
704
+ * @public
705
+ */
706
+ Owl.prototype.update = function() {
707
+ var i = 0,
708
+ n = this._pipe.length,
709
+ filter = $.proxy(function(p) { return this[p] }, this._invalidated),
710
+ cache = {};
711
+
712
+ while (i < n) {
713
+ if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
714
+ this._pipe[i].run(cache);
715
+ }
716
+ i++;
717
+ }
718
+
719
+ this._invalidated = {};
720
+
721
+ !this.is('valid') && this.enter('valid');
722
+ };
723
+
724
+ /**
725
+ * Gets the width of the view.
726
+ * @public
727
+ * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
728
+ * @returns {Number} - The width of the view in pixel.
729
+ */
730
+ Owl.prototype.width = function(dimension) {
731
+ dimension = dimension || Owl.Width.Default;
732
+ switch (dimension) {
733
+ case Owl.Width.Inner:
734
+ case Owl.Width.Outer:
735
+ return this._width;
736
+ default:
737
+ if(this.settings.paddingType == 'left' || this.settings.paddingType == 'right'){
738
+ return this._width - this.settings.stagePadding + this.settings.margin;
739
+ }else{
740
+ return this._width - this.settings.stagePadding * 2 + this.settings.margin;
741
+ }
742
+
743
+ }
744
+ };
745
+
746
+ /**
747
+ * Refreshes the carousel primarily for adaptive purposes.
748
+ * @public
749
+ */
750
+ Owl.prototype.refresh = function() {
751
+ this.enter('refreshing');
752
+ this.trigger('refresh');
753
+
754
+ this.setup();
755
+
756
+ this.optionsLogic();
757
+
758
+ this.$element.addClass(this.options.refreshClass);
759
+
760
+ this.update();
761
+
762
+ this.$element.removeClass(this.options.refreshClass);
763
+
764
+ this.leave('refreshing');
765
+ this.trigger('refreshed');
766
+ };
767
+
768
+ /**
769
+ * Checks window `resize` event.
770
+ * @protected
771
+ */
772
+ Owl.prototype.onThrottledResize = function() {
773
+ window.clearTimeout(this.resizeTimer);
774
+ this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
775
+ };
776
+
777
+ /**
778
+ * Checks window `resize` event.
779
+ * @protected
780
+ */
781
+ Owl.prototype.onResize = function() {
782
+ if (!this._items.length) {
783
+ return false;
784
+ }
785
+
786
+ if (this._width === this.$element.width()) {
787
+ return false;
788
+ }
789
+
790
+ if (!this.isVisible()) {
791
+ return false;
792
+ }
793
+
794
+ this.enter('resizing');
795
+
796
+ if (this.trigger('resize').isDefaultPrevented()) {
797
+ this.leave('resizing');
798
+ return false;
799
+ }
800
+
801
+ this.invalidate('width');
802
+
803
+ this.refresh();
804
+
805
+ this.leave('resizing');
806
+ this.trigger('resized');
807
+ };
808
+
809
+ /**
810
+ * Registers event handlers.
811
+ * @todo Check `msPointerEnabled`
812
+ * @todo #261
813
+ * @protected
814
+ */
815
+ Owl.prototype.registerEventHandlers = function() {
816
+ if ($.support.transition) {
817
+ this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
818
+ }
819
+
820
+ if (this.settings.responsive !== false) {
821
+ this.on(window, 'resize', this._handlers.onThrottledResize);
822
+ }
823
+
824
+ if (this.settings.mouseDrag) {
825
+ this.$element.addClass(this.options.dragClass);
826
+ this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
827
+ this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false });
828
+ }
829
+
830
+ if (this.settings.touchDrag){
831
+ this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
832
+ this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
833
+ }
834
+ };
835
+
836
+ /**
837
+ * Handles `touchstart` and `mousedown` events.
838
+ * @todo Horizontal swipe threshold as option
839
+ * @todo #261
840
+ * @protected
841
+ * @param {Event} event - The event arguments.
842
+ */
843
+ Owl.prototype.onDragStart = function(event) {
844
+ var stage = null;
845
+
846
+ if (event.which === 3) {
847
+ return;
848
+ }
849
+
850
+ if ($.support.transform) {
851
+ stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
852
+ stage = {
853
+ x: stage[stage.length === 16 ? 12 : 4],
854
+ y: stage[stage.length === 16 ? 13 : 5]
855
+ };
856
+ } else {
857
+ stage = this.$stage.position();
858
+ stage = {
859
+ x: this.settings.rtl ?
860
+ stage.left + this.$stage.width() - this.width() + this.settings.margin :
861
+ stage.left,
862
+ y: stage.top
863
+ };
864
+ }
865
+
866
+ if (this.is('animating')) {
867
+ $.support.transform ? this.animate(stage.x) : this.$stage.stop()
868
+ this.invalidate('position');
869
+ }
870
+
871
+ this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown');
872
+
873
+ this.speed(0);
874
+
875
+ this._drag.time = new Date().getTime();
876
+ this._drag.target = $(event.target);
877
+ this._drag.stage.start = stage;
878
+ this._drag.stage.current = stage;
879
+ this._drag.pointer = this.pointer(event);
880
+
881
+ $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
882
+
883
+ $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) {
884
+ var delta = this.difference(this._drag.pointer, this.pointer(event));
885
+
886
+ $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
887
+
888
+ if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) {
889
+ return;
890
+ }
891
+
892
+ event.preventDefault();
893
+
894
+ this.enter('dragging');
895
+ this.trigger('drag');
896
+ }, this));
897
+ };
898
+
899
+ /**
900
+ * Handles the `touchmove` and `mousemove` events.
901
+ * @todo #261
902
+ * @protected
903
+ * @param {Event} event - The event arguments.
904
+ */
905
+ Owl.prototype.onDragMove = function(event) {
906
+ var minimum = null,
907
+ maximum = null,
908
+ pull = null,
909
+ delta = this.difference(this._drag.pointer, this.pointer(event)),
910
+ stage = this.difference(this._drag.stage.start, delta);
911
+
912
+ if (!this.is('dragging')) {
913
+ return;
914
+ }
915
+
916
+ event.preventDefault();
917
+
918
+ if (this.settings.loop) {
919
+ minimum = this.coordinates(this.minimum());
920
+ maximum = this.coordinates(this.maximum() + 1) - minimum;
921
+ stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
922
+ } else {
923
+ minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
924
+ maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
925
+ pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0;
926
+ stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
927
+ }
928
+
929
+ this._drag.stage.current = stage;
930
+
931
+ this.animate(stage.x);
932
+ };
933
+
934
+ /**
935
+ * Handles the `touchend` and `mouseup` events.
936
+ * @todo #261
937
+ * @todo Threshold for click event
938
+ * @protected
939
+ * @param {Event} event - The event arguments.
940
+ */
941
+ Owl.prototype.onDragEnd = function(event) {
942
+ var delta = this.difference(this._drag.pointer, this.pointer(event)),
943
+ stage = this._drag.stage.current,
944
+ direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right';
945
+
946
+ $(document).off('.owl.core');
947
+
948
+ this.$element.removeClass(this.options.grabClass);
949
+
950
+ if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) {
951
+ this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
952
+ this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction));
953
+ this.invalidate('position');
954
+ this.update();
955
+
956
+ this._drag.direction = direction;
957
+
958
+ if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) {
959
+ this._drag.target.one('click.owl.core', function() { return false; });
960
+ }
961
+ }
962
+
963
+ if (!this.is('dragging')) {
964
+ return;
965
+ }
966
+
967
+ this.leave('dragging');
968
+ this.trigger('dragged');
969
+ };
970
+
971
+ /**
972
+ * Gets absolute position of the closest item for a coordinate.
973
+ * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
974
+ * @protected
975
+ * @param {Number} coordinate - The coordinate in pixel.
976
+ * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`.
977
+ * @return {Number} - The absolute position of the closest item.
978
+ */
979
+ Owl.prototype.closest = function(coordinate, direction) {
980
+ var position = -1,
981
+ pull = 30,
982
+ width = this.width(),
983
+ coordinates = this.coordinates();
984
+
985
+ if (!this.settings.freeDrag) {
986
+ // check closest item
987
+ $.each(coordinates, $.proxy(function(index, value) {
988
+ // on a left pull, check on current index
989
+ if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) {
990
+ position = index;
991
+ // on a right pull, check on previous index
992
+ // to do so, subtract width from value and set position = index + 1
993
+ } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) {
994
+ position = index + 1;
995
+ } else if (this.op(coordinate, '<', value)
996
+ && this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) {
997
+ position = direction === 'left' ? index + 1 : index;
998
+ }
999
+ return position === -1;
1000
+ }, this));
1001
+ }
1002
+
1003
+ if (!this.settings.loop) {
1004
+ // non loop boundries
1005
+ if (this.op(coordinate, '>', coordinates[this.minimum()])) {
1006
+ position = coordinate = this.minimum();
1007
+ } else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
1008
+ position = coordinate = this.maximum();
1009
+ }
1010
+ }
1011
+
1012
+ return position;
1013
+ };
1014
+
1015
+ /**
1016
+ * Animates the stage.
1017
+ * @todo #270
1018
+ * @public
1019
+ * @param {Number} coordinate - The coordinate in pixels.
1020
+ */
1021
+ Owl.prototype.animate = function(coordinate) {
1022
+ var animate = this.speed() > 0;
1023
+
1024
+ this.is('animating') && this.onTransitionEnd();
1025
+
1026
+ if (animate) {
1027
+ this.enter('animating');
1028
+ this.trigger('translate');
1029
+ }
1030
+
1031
+ if ($.support.transform3d && $.support.transition) {
1032
+ this.$stage.css({
1033
+ transform: 'translate3d(' + (coordinate-1) + 'px,0px,0px)', // this line is modified (added '-1') in order to fix "one pixel problem"
1034
+ transition: (this.speed() / 1000) + 's' + (
1035
+ this.settings.slideTransition ? ' ' + this.settings.slideTransition : ''
1036
+ )
1037
+ });
1038
+ } else if (animate) {
1039
+ this.$stage.animate({
1040
+ left: coordinate + 'px'
1041
+ }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
1042
+ } else {
1043
+ this.$stage.css({
1044
+ left: coordinate + 'px'
1045
+ });
1046
+ }
1047
+ };
1048
+
1049
+ /**
1050
+ * Checks whether the carousel is in a specific state or not.
1051
+ * @param {String} state - The state to check.
1052
+ * @returns {Boolean} - The flag which indicates if the carousel is busy.
1053
+ */
1054
+ Owl.prototype.is = function(state) {
1055
+ return this._states.current[state] && this._states.current[state] > 0;
1056
+ };
1057
+
1058
+ /**
1059
+ * Sets the absolute position of the current item.
1060
+ * @public
1061
+ * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
1062
+ * @returns {Number} - The absolute position of the current item.
1063
+ */
1064
+ Owl.prototype.current = function(position) {
1065
+ if (position === undefined) {
1066
+ return this._current;
1067
+ }
1068
+
1069
+ if (this._items.length === 0) {
1070
+ return undefined;
1071
+ }
1072
+
1073
+ position = this.normalize(position);
1074
+
1075
+ if (this._current !== position) {
1076
+ var event = this.trigger('change', { property: { name: 'position', value: position } });
1077
+
1078
+ if (event.data !== undefined) {
1079
+ position = this.normalize(event.data);
1080
+ }
1081
+
1082
+ this._current = position;
1083
+
1084
+ this.invalidate('position');
1085
+
1086
+ this.trigger('changed', { property: { name: 'position', value: this._current } });
1087
+ }
1088
+
1089
+ return this._current;
1090
+ };
1091
+
1092
+ /**
1093
+ * Invalidates the given part of the update routine.
1094
+ * @param {String} [part] - The part to invalidate.
1095
+ * @returns {Array.<String>} - The invalidated parts.
1096
+ */
1097
+ Owl.prototype.invalidate = function(part) {
1098
+ if ($.type(part) === 'string') {
1099
+ this._invalidated[part] = true;
1100
+ this.is('valid') && this.leave('valid');
1101
+ }
1102
+ return $.map(this._invalidated, function(v, i) { return i });
1103
+ };
1104
+
1105
+ /**
1106
+ * Resets the absolute position of the current item.
1107
+ * @public
1108
+ * @param {Number} position - The absolute position of the new item.
1109
+ */
1110
+ Owl.prototype.reset = function(position) {
1111
+ position = this.normalize(position);
1112
+
1113
+ if (position === undefined) {
1114
+ return;
1115
+ }
1116
+
1117
+ this._speed = 0;
1118
+ this._current = position;
1119
+
1120
+ this.suppress([ 'translate', 'translated' ]);
1121
+
1122
+ this.animate(this.coordinates(position));
1123
+
1124
+ this.release([ 'translate', 'translated' ]);
1125
+ };
1126
+
1127
+ /**
1128
+ * Normalizes an absolute or a relative position of an item.
1129
+ * @public
1130
+ * @param {Number} position - The absolute or relative position to normalize.
1131
+ * @param {Boolean} [relative=false] - Whether the given position is relative or not.
1132
+ * @returns {Number} - The normalized position.
1133
+ */
1134
+ Owl.prototype.normalize = function(position, relative) {
1135
+ var n = this._items.length,
1136
+ m = relative ? 0 : this._clones.length;
1137
+
1138
+ if (!this.isNumeric(position) || n < 1) {
1139
+ position = undefined;
1140
+ } else if (position < 0 || position >= n + m) {
1141
+ position = ((position - m / 2) % n + n) % n + m / 2;
1142
+ }
1143
+
1144
+ return position;
1145
+ };
1146
+
1147
+ /**
1148
+ * Converts an absolute position of an item into a relative one.
1149
+ * @public
1150
+ * @param {Number} position - The absolute position to convert.
1151
+ * @returns {Number} - The converted position.
1152
+ */
1153
+ Owl.prototype.relative = function(position) {
1154
+ position -= this._clones.length / 2;
1155
+ return this.normalize(position, true);
1156
+ };
1157
+
1158
+ /**
1159
+ * Gets the maximum position for the current item.
1160
+ * @public
1161
+ * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1162
+ * @returns {Number}
1163
+ */
1164
+ Owl.prototype.maximum = function(relative) {
1165
+ var settings = this.settings,
1166
+ maximum = this._coordinates.length,
1167
+ iterator,
1168
+ reciprocalItemsWidth,
1169
+ elementWidth;
1170
+
1171
+ if (settings.loop) {
1172
+ maximum = this._clones.length / 2 + this._items.length - 1;
1173
+ } else if (settings.autoWidth || settings.merge) {
1174
+ iterator = this._items.length;
1175
+ if (iterator) {
1176
+ reciprocalItemsWidth = this._items[--iterator].width();
1177
+ elementWidth = this.$element.width();
1178
+ while (iterator--) {
1179
+ reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin;
1180
+ if (reciprocalItemsWidth > elementWidth) {
1181
+ break;
1182
+ }
1183
+ }
1184
+ }
1185
+ maximum = iterator + 1;
1186
+ } else if (settings.center) {
1187
+ maximum = this._items.length - 1;
1188
+ } else {
1189
+ maximum = this._items.length - settings.items;
1190
+ }
1191
+
1192
+ if (relative) {
1193
+ maximum -= this._clones.length / 2;
1194
+ }
1195
+
1196
+ return Math.max(maximum, 0);
1197
+ };
1198
+
1199
+ /**
1200
+ * Gets the minimum position for the current item.
1201
+ * @public
1202
+ * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1203
+ * @returns {Number}
1204
+ */
1205
+ Owl.prototype.minimum = function(relative) {
1206
+ return relative ? 0 : this._clones.length / 2;
1207
+ };
1208
+
1209
+ /**
1210
+ * Gets an item at the specified relative position.
1211
+ * @public
1212
+ * @param {Number} [position] - The relative position of the item.
1213
+ * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1214
+ */
1215
+ Owl.prototype.items = function(position) {
1216
+ if (position === undefined) {
1217
+ return this._items.slice();
1218
+ }
1219
+
1220
+ position = this.normalize(position, true);
1221
+ return this._items[position];
1222
+ };
1223
+
1224
+ /**
1225
+ * Gets an item at the specified relative position.
1226
+ * @public
1227
+ * @param {Number} [position] - The relative position of the item.
1228
+ * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1229
+ */
1230
+ Owl.prototype.mergers = function(position) {
1231
+ if (position === undefined) {
1232
+ return this._mergers.slice();
1233
+ }
1234
+
1235
+ position = this.normalize(position, true);
1236
+ return this._mergers[position];
1237
+ };
1238
+
1239
+ /**
1240
+ * Gets the absolute positions of clones for an item.
1241
+ * @public
1242
+ * @param {Number} [position] - The relative position of the item.
1243
+ * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
1244
+ */
1245
+ Owl.prototype.clones = function(position) {
1246
+ var odd = this._clones.length / 2,
1247
+ even = odd + this._items.length,
1248
+ map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 };
1249
+
1250
+ if (position === undefined) {
1251
+ return $.map(this._clones, function(v, i) { return map(i) });
1252
+ }
1253
+
1254
+ return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
1255
+ };
1256
+
1257
+ /**
1258
+ * Sets the current animation speed.
1259
+ * @public
1260
+ * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
1261
+ * @returns {Number} - The current animation speed in milliseconds.
1262
+ */
1263
+ Owl.prototype.speed = function(speed) {
1264
+ if (speed !== undefined) {
1265
+ this._speed = speed;
1266
+ }
1267
+
1268
+ return this._speed;
1269
+ };
1270
+
1271
+ /**
1272
+ * Gets the coordinate of an item.
1273
+ * @todo The name of this method is missleanding.
1274
+ * @public
1275
+ * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
1276
+ * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
1277
+ */
1278
+ Owl.prototype.coordinates = function(position) {
1279
+ var multiplier = 1,
1280
+ newPosition = position - 1,
1281
+ coordinate;
1282
+
1283
+ if (position === undefined) {
1284
+ return $.map(this._coordinates, $.proxy(function(coordinate, index) {
1285
+ return this.coordinates(index);
1286
+ }, this));
1287
+ }
1288
+
1289
+ if (this.settings.center) {
1290
+ if (this.settings.rtl) {
1291
+ multiplier = -1;
1292
+ newPosition = position + 1;
1293
+ }
1294
+
1295
+ coordinate = this._coordinates[position];
1296
+ coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier;
1297
+ } else {
1298
+ coordinate = this._coordinates[newPosition] || 0;
1299
+ }
1300
+
1301
+ coordinate = Math.ceil(coordinate);
1302
+
1303
+ return coordinate;
1304
+ };
1305
+
1306
+ /**
1307
+ * Calculates the speed for a translation.
1308
+ * @protected
1309
+ * @param {Number} from - The absolute position of the start item.
1310
+ * @param {Number} to - The absolute position of the target item.
1311
+ * @param {Number} [factor=undefined] - The time factor in milliseconds.
1312
+ * @returns {Number} - The time in milliseconds for the translation.
1313
+ */
1314
+ Owl.prototype.duration = function(from, to, factor) {
1315
+ if (factor === 0) {
1316
+ return 0;
1317
+ }
1318
+
1319
+ return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
1320
+ };
1321
+
1322
+ /**
1323
+ * Slides to the specified item.
1324
+ * @public
1325
+ * @param {Number} position - The position of the item.
1326
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1327
+ */
1328
+ Owl.prototype.to = function(position, speed) {
1329
+ var current = this.current(),
1330
+ revert = null,
1331
+ distance = position - this.relative(current),
1332
+ direction = (distance > 0) - (distance < 0),
1333
+ items = this._items.length,
1334
+ minimum = this.minimum(),
1335
+ maximum = this.maximum();
1336
+
1337
+ if (this.settings.loop) {
1338
+ if (!this.settings.rewind && Math.abs(distance) > items / 2) {
1339
+ distance += direction * -1 * items;
1340
+ }
1341
+
1342
+ position = current + distance;
1343
+ revert = ((position - minimum) % items + items) % items + minimum;
1344
+
1345
+ if (revert !== position && revert - distance <= maximum && revert - distance > 0) {
1346
+ current = revert - distance;
1347
+ position = revert;
1348
+ this.reset(current);
1349
+ }
1350
+ } else if (this.settings.rewind) {
1351
+ maximum += 1;
1352
+ position = (position % maximum + maximum) % maximum;
1353
+ } else {
1354
+ position = Math.max(minimum, Math.min(maximum, position));
1355
+ }
1356
+
1357
+ this.speed(this.duration(current, position, speed));
1358
+ this.current(position);
1359
+
1360
+ if (this.isVisible()) {
1361
+ this.update();
1362
+ }
1363
+ };
1364
+
1365
+ /**
1366
+ * Slides to the next item.
1367
+ * @public
1368
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1369
+ */
1370
+ Owl.prototype.next = function(speed) {
1371
+ speed = speed || false;
1372
+ this.to(this.relative(this.current()) + 1, speed);
1373
+ };
1374
+
1375
+ /**
1376
+ * Slides to the previous item.
1377
+ * @public
1378
+ * @param {Number} [speed] - The time in milliseconds for the transition.
1379
+ */
1380
+ Owl.prototype.prev = function(speed) {
1381
+ speed = speed || false;
1382
+ this.to(this.relative(this.current()) - 1, speed);
1383
+ };
1384
+
1385
+ /**
1386
+ * Handles the end of an animation.
1387
+ * @protected
1388
+ * @param {Event} event - The event arguments.
1389
+ */
1390
+ Owl.prototype.onTransitionEnd = function(event) {
1391
+
1392
+ // if css2 animation then event object is undefined
1393
+ if (event !== undefined) {
1394
+ event.stopPropagation();
1395
+
1396
+ // Catch only owl-stage transitionEnd event
1397
+ if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
1398
+ return false;
1399
+ }
1400
+ }
1401
+
1402
+ this.leave('animating');
1403
+ this.trigger('translated');
1404
+ };
1405
+
1406
+ /**
1407
+ * Gets viewport width.
1408
+ * @protected
1409
+ * @return {Number} - The width in pixel.
1410
+ */
1411
+ Owl.prototype.viewport = function() {
1412
+ var width;
1413
+ if (this.options.responsiveBaseElement !== window) {
1414
+ width = $(this.options.responsiveBaseElement).width();
1415
+ } else if (window.innerWidth) {
1416
+ width = window.innerWidth;
1417
+ } else if (document.documentElement && document.documentElement.clientWidth) {
1418
+ width = document.documentElement.clientWidth;
1419
+ } else {
1420
+ console.warn('Can not detect viewport width.');
1421
+ }
1422
+ return width;
1423
+ };
1424
+
1425
+ /**
1426
+ * Replaces the current content.
1427
+ * @public
1428
+ * @param {HTMLElement|jQuery|String} content - The new content.
1429
+ */
1430
+ Owl.prototype.replace = function(content) {
1431
+ this.$stage.empty();
1432
+ this._items = [];
1433
+
1434
+ if (content) {
1435
+ content = (content instanceof jQuery) ? content : $(content);
1436
+ }
1437
+
1438
+ if (this.settings.nestedItemSelector) {
1439
+ content = content.find('.' + this.settings.nestedItemSelector);
1440
+ }
1441
+
1442
+ content.filter(function() {
1443
+ return this.nodeType === 1;
1444
+ }).each($.proxy(function(index, item) {
1445
+ item = this.prepare(item);
1446
+ this.$stage.append(item);
1447
+ this._items.push(item);
1448
+ this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1449
+ }, this));
1450
+
1451
+ this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
1452
+
1453
+ this.invalidate('items');
1454
+ };
1455
+
1456
+ /**
1457
+ * Adds an item.
1458
+ * @todo Use `item` instead of `content` for the event arguments.
1459
+ * @public
1460
+ * @param {HTMLElement|jQuery|String} content - The item content to add.
1461
+ * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
1462
+ */
1463
+ Owl.prototype.add = function(content, position) {
1464
+ var current = this.relative(this._current);
1465
+
1466
+ position = position === undefined ? this._items.length : this.normalize(position, true);
1467
+ content = content instanceof jQuery ? content : $(content);
1468
+
1469
+ this.trigger('add', { content: content, position: position });
1470
+
1471
+ content = this.prepare(content);
1472
+
1473
+ if (this._items.length === 0 || position === this._items.length) {
1474
+ this._items.length === 0 && this.$stage.append(content);
1475
+ this._items.length !== 0 && this._items[position - 1].after(content);
1476
+ this._items.push(content);
1477
+ this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1478
+ } else {
1479
+ this._items[position].before(content);
1480
+ this._items.splice(position, 0, content);
1481
+ this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1482
+ }
1483
+
1484
+ this._items[current] && this.reset(this._items[current].index());
1485
+
1486
+ this.invalidate('items');
1487
+
1488
+ this.trigger('added', { content: content, position: position });
1489
+ };
1490
+
1491
+ /**
1492
+ * Removes an item by its position.
1493
+ * @todo Use `item` instead of `content` for the event arguments.
1494
+ * @public
1495
+ * @param {Number} position - The relative position of the item to remove.
1496
+ */
1497
+ Owl.prototype.remove = function(position) {
1498
+ position = this.normalize(position, true);
1499
+
1500
+ if (position === undefined) {
1501
+ return;
1502
+ }
1503
+
1504
+ this.trigger('remove', { content: this._items[position], position: position });
1505
+
1506
+ this._items[position].remove();
1507
+ this._items.splice(position, 1);
1508
+ this._mergers.splice(position, 1);
1509
+
1510
+ this.invalidate('items');
1511
+
1512
+ this.trigger('removed', { content: null, position: position });
1513
+ };
1514
+
1515
+ /**
1516
+ * Preloads images with auto width.
1517
+ * @todo Replace by a more generic approach
1518
+ * @protected
1519
+ */
1520
+ Owl.prototype.preloadAutoWidthImages = function(images) {
1521
+ images.each($.proxy(function(i, element) {
1522
+ this.enter('pre-loading');
1523
+ element = $(element);
1524
+ $(new Image()).one('load', $.proxy(function(e) {
1525
+ element.attr('src', e.target.src);
1526
+ element.css('opacity', 1);
1527
+ this.leave('pre-loading');
1528
+ !this.is('pre-loading') && !this.is('initializing') && this.refresh();
1529
+ }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina'));
1530
+ }, this));
1531
+ };
1532
+
1533
+ /**
1534
+ * Destroys the carousel.
1535
+ * @public
1536
+ */
1537
+ Owl.prototype.destroy = function() {
1538
+
1539
+ this.$element.off('.owl.core');
1540
+ this.$stage.off('.owl.core');
1541
+ $(document).off('.owl.core');
1542
+
1543
+ if (this.settings.responsive !== false) {
1544
+ window.clearTimeout(this.resizeTimer);
1545
+ this.off(window, 'resize', this._handlers.onThrottledResize);
1546
+ }
1547
+
1548
+ for (var i in this._plugins) {
1549
+ this._plugins[i].destroy();
1550
+ }
1551
+
1552
+ this.$stage.children('.cloned').remove();
1553
+
1554
+ this.$stage.unwrap();
1555
+ this.$stage.children().contents().unwrap();
1556
+ this.$stage.children().unwrap();
1557
+ this.$stage.remove();
1558
+ this.$element
1559
+ .removeClass(this.options.refreshClass)
1560
+ .removeClass(this.options.loadingClass)
1561
+ .removeClass(this.options.loadedClass)
1562
+ .removeClass(this.options.rtlClass)
1563
+ .removeClass(this.options.dragClass)
1564
+ .removeClass(this.options.grabClass)
1565
+ .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
1566
+ .removeData('owl.carousel');
1567
+ };
1568
+
1569
+ /**
1570
+ * Operators to calculate right-to-left and left-to-right.
1571
+ * @protected
1572
+ * @param {Number} [a] - The left side operand.
1573
+ * @param {String} [o] - The operator.
1574
+ * @param {Number} [b] - The right side operand.
1575
+ */
1576
+ Owl.prototype.op = function(a, o, b) {
1577
+ var rtl = this.settings.rtl;
1578
+ switch (o) {
1579
+ case '<':
1580
+ return rtl ? a > b : a < b;
1581
+ case '>':
1582
+ return rtl ? a < b : a > b;
1583
+ case '>=':
1584
+ return rtl ? a <= b : a >= b;
1585
+ case '<=':
1586
+ return rtl ? a >= b : a <= b;
1587
+ default:
1588
+ break;
1589
+ }
1590
+ };
1591
+
1592
+ /**
1593
+ * Attaches to an internal event.
1594
+ * @protected
1595
+ * @param {HTMLElement} element - The event source.
1596
+ * @param {String} event - The event name.
1597
+ * @param {Function} listener - The event handler to attach.
1598
+ * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
1599
+ */
1600
+ Owl.prototype.on = function(element, event, listener, capture) {
1601
+ if (element.addEventListener) {
1602
+ element.addEventListener(event, listener, capture);
1603
+ } else if (element.attachEvent) {
1604
+ element.attachEvent('on' + event, listener);
1605
+ }
1606
+ };
1607
+
1608
+ /**
1609
+ * Detaches from an internal event.
1610
+ * @protected
1611
+ * @param {HTMLElement} element - The event source.
1612
+ * @param {String} event - The event name.
1613
+ * @param {Function} listener - The attached event handler to detach.
1614
+ * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
1615
+ */
1616
+ Owl.prototype.off = function(element, event, listener, capture) {
1617
+ if (element.removeEventListener) {
1618
+ element.removeEventListener(event, listener, capture);
1619
+ } else if (element.detachEvent) {
1620
+ element.detachEvent('on' + event, listener);
1621
+ }
1622
+ };
1623
+
1624
+ /**
1625
+ * Triggers a public event.
1626
+ * @todo Remove `status`, `relatedTarget` should be used instead.
1627
+ * @protected
1628
+ * @param {String} name - The event name.
1629
+ * @param {*} [data=null] - The event data.
1630
+ * @param {String} [namespace=carousel] - The event namespace.
1631
+ * @param {String} [state] - The state which is associated with the event.
1632
+ * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not.
1633
+ * @returns {Event} - The event arguments.
1634
+ */
1635
+ Owl.prototype.trigger = function(name, data, namespace, state, enter) {
1636
+ var status = {
1637
+ item: { count: this._items.length, index: this.current() }
1638
+ }, handler = $.camelCase(
1639
+ $.grep([ 'on', name, namespace ], function(v) { return v })
1640
+ .join('-').toLowerCase()
1641
+ ), event = $.Event(
1642
+ [ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
1643
+ $.extend({ relatedTarget: this }, status, data)
1644
+ );
1645
+
1646
+ if (!this._supress[name]) {
1647
+ $.each(this._plugins, function(name, plugin) {
1648
+ if (plugin.onTrigger) {
1649
+ plugin.onTrigger(event);
1650
+ }
1651
+ });
1652
+
1653
+ this.register({ type: Owl.Type.Event, name: name });
1654
+ this.$element.trigger(event);
1655
+
1656
+ if (this.settings && typeof this.settings[handler] === 'function') {
1657
+ this.settings[handler].call(this, event);
1658
+ }
1659
+ }
1660
+
1661
+ return event;
1662
+ };
1663
+
1664
+ /**
1665
+ * Enters a state.
1666
+ * @param name - The state name.
1667
+ */
1668
+ Owl.prototype.enter = function(name) {
1669
+ $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1670
+ if (this._states.current[name] === undefined) {
1671
+ this._states.current[name] = 0;
1672
+ }
1673
+
1674
+ this._states.current[name]++;
1675
+ }, this));
1676
+ };
1677
+
1678
+ /**
1679
+ * Leaves a state.
1680
+ * @param name - The state name.
1681
+ */
1682
+ Owl.prototype.leave = function(name) {
1683
+ $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1684
+ this._states.current[name]--;
1685
+ }, this));
1686
+ };
1687
+
1688
+ /**
1689
+ * Registers an event or state.
1690
+ * @public
1691
+ * @param {Object} object - The event or state to register.
1692
+ */
1693
+ Owl.prototype.register = function(object) {
1694
+ if (object.type === Owl.Type.Event) {
1695
+ if (!$.event.special[object.name]) {
1696
+ $.event.special[object.name] = {};
1697
+ }
1698
+
1699
+ if (!$.event.special[object.name].owl) {
1700
+ var _default = $.event.special[object.name]._default;
1701
+ $.event.special[object.name]._default = function(e) {
1702
+ if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) {
1703
+ return _default.apply(this, arguments);
1704
+ }
1705
+ return e.namespace && e.namespace.indexOf('owl') > -1;
1706
+ };
1707
+ $.event.special[object.name].owl = true;
1708
+ }
1709
+ } else if (object.type === Owl.Type.State) {
1710
+ if (!this._states.tags[object.name]) {
1711
+ this._states.tags[object.name] = object.tags;
1712
+ } else {
1713
+ this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags);
1714
+ }
1715
+
1716
+ this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) {
1717
+ return $.inArray(tag, this._states.tags[object.name]) === i;
1718
+ }, this));
1719
+ }
1720
+ };
1721
+
1722
+ /**
1723
+ * Suppresses events.
1724
+ * @protected
1725
+ * @param {Array.<String>} events - The events to suppress.
1726
+ */
1727
+ Owl.prototype.suppress = function(events) {
1728
+ $.each(events, $.proxy(function(index, event) {
1729
+ this._supress[event] = true;
1730
+ }, this));
1731
+ };
1732
+
1733
+ /**
1734
+ * Releases suppressed events.
1735
+ * @protected
1736
+ * @param {Array.<String>} events - The events to release.
1737
+ */
1738
+ Owl.prototype.release = function(events) {
1739
+ $.each(events, $.proxy(function(index, event) {
1740
+ delete this._supress[event];
1741
+ }, this));
1742
+ };
1743
+
1744
+ /**
1745
+ * Gets unified pointer coordinates from event.
1746
+ * @todo #261
1747
+ * @protected
1748
+ * @param {Event} - The `mousedown` or `touchstart` event.
1749
+ * @returns {Object} - Contains `x` and `y` coordinates of current pointer position.
1750
+ */
1751
+ Owl.prototype.pointer = function(event) {
1752
+ var result = { x: null, y: null };
1753
+
1754
+ event = event.originalEvent || event || window.event;
1755
+
1756
+ event = event.touches && event.touches.length ?
1757
+ event.touches[0] : event.changedTouches && event.changedTouches.length ?
1758
+ event.changedTouches[0] : event;
1759
+
1760
+ if (event.pageX) {
1761
+ result.x = event.pageX;
1762
+ result.y = event.pageY;
1763
+ } else {
1764
+ result.x = event.clientX;
1765
+ result.y = event.clientY;
1766
+ }
1767
+
1768
+ return result;
1769
+ };
1770
+
1771
+ /**
1772
+ * Determines if the input is a Number or something that can be coerced to a Number
1773
+ * @protected
1774
+ * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested
1775
+ * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number
1776
+ */
1777
+ Owl.prototype.isNumeric = function(number) {
1778
+ return !isNaN(parseFloat(number));
1779
+ };
1780
+
1781
+ /**
1782
+ * Gets the difference of two vectors.
1783
+ * @todo #261
1784
+ * @protected
1785
+ * @param {Object} - The first vector.
1786
+ * @param {Object} - The second vector.
1787
+ * @returns {Object} - The difference.
1788
+ */
1789
+ Owl.prototype.difference = function(first, second) {
1790
+ return {
1791
+ x: first.x - second.x,
1792
+ y: first.y - second.y
1793
+ };
1794
+ };
1795
+
1796
+ /**
1797
+ * The jQuery Plugin for the Owl Carousel
1798
+ * @todo Navigation plugin `next` and `prev`
1799
+ * @public
1800
+ */
1801
+ $.fn.owlCarousel = function(option) {
1802
+ var args = Array.prototype.slice.call(arguments, 1);
1803
+
1804
+ return this.each(function() {
1805
+ var $this = $(this),
1806
+ data = $this.data('owl.carousel');
1807
+
1808
+ if (!data) {
1809
+ data = new Owl(this, typeof option == 'object' && option);
1810
+ $this.data('owl.carousel', data);
1811
+
1812
+ $.each([
1813
+ 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
1814
+ ], function(i, event) {
1815
+ data.register({ type: Owl.Type.Event, name: event });
1816
+ data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) {
1817
+ if (e.namespace && e.relatedTarget !== this) {
1818
+ this.suppress([ event ]);
1819
+ data[event].apply(this, [].slice.call(arguments, 1));
1820
+ this.release([ event ]);
1821
+ }
1822
+ }, data));
1823
+ });
1824
+ }
1825
+
1826
+ if (typeof option == 'string' && option.charAt(0) !== '_') {
1827
+ data[option].apply(data, args);
1828
+ }
1829
+ });
1830
+ };
1831
+
1832
+ /**
1833
+ * The constructor for the jQuery Plugin
1834
+ * @public
1835
+ */
1836
+ $.fn.owlCarousel.Constructor = Owl;
1837
+
1838
+ })(window.Zepto || window.jQuery, window, document);
1839
+
1840
+ /**
1841
+ * AutoRefresh Plugin
1842
+ * @version 2.3.4
1843
+ * @author Artus Kolanowski
1844
+ * @author David Deutsch
1845
+ * @license The MIT License (MIT)
1846
+ */
1847
+ ;(function($, window, document, undefined) {
1848
+
1849
+ /**
1850
+ * Creates the auto refresh plugin.
1851
+ * @class The Auto Refresh Plugin
1852
+ * @param {Owl} carousel - The Owl Carousel
1853
+ */
1854
+ var AutoRefresh = function(carousel) {
1855
+ /**
1856
+ * Reference to the core.
1857
+ * @protected
1858
+ * @type {Owl}
1859
+ */
1860
+ this._core = carousel;
1861
+
1862
+ /**
1863
+ * Refresh interval.
1864
+ * @protected
1865
+ * @type {number}
1866
+ */
1867
+ this._interval = null;
1868
+
1869
+ /**
1870
+ * Whether the element is currently visible or not.
1871
+ * @protected
1872
+ * @type {Boolean}
1873
+ */
1874
+ this._visible = null;
1875
+
1876
+ /**
1877
+ * All event handlers.
1878
+ * @protected
1879
+ * @type {Object}
1880
+ */
1881
+ this._handlers = {
1882
+ 'initialized.owl.carousel': $.proxy(function(e) {
1883
+ if (e.namespace && this._core.settings.autoRefresh) {
1884
+ this.watch();
1885
+ }
1886
+ }, this)
1887
+ };
1888
+
1889
+ // set default options
1890
+ this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
1891
+
1892
+ // register event handlers
1893
+ this._core.$element.on(this._handlers);
1894
+ };
1895
+
1896
+ /**
1897
+ * Default options.
1898
+ * @public
1899
+ */
1900
+ AutoRefresh.Defaults = {
1901
+ autoRefresh: true,
1902
+ autoRefreshInterval: 500
1903
+ };
1904
+
1905
+ /**
1906
+ * Watches the element.
1907
+ */
1908
+ AutoRefresh.prototype.watch = function() {
1909
+ if (this._interval) {
1910
+ return;
1911
+ }
1912
+
1913
+ this._visible = this._core.isVisible();
1914
+ this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
1915
+ };
1916
+
1917
+ /**
1918
+ * Refreshes the element.
1919
+ */
1920
+ AutoRefresh.prototype.refresh = function() {
1921
+ if (this._core.isVisible() === this._visible) {
1922
+ return;
1923
+ }
1924
+
1925
+ this._visible = !this._visible;
1926
+
1927
+ this._core.$element.toggleClass('owl-hidden', !this._visible);
1928
+
1929
+ this._visible && (this._core.invalidate('width') && this._core.refresh());
1930
+ };
1931
+
1932
+ /**
1933
+ * Destroys the plugin.
1934
+ */
1935
+ AutoRefresh.prototype.destroy = function() {
1936
+ var handler, property;
1937
+
1938
+ window.clearInterval(this._interval);
1939
+
1940
+ for (handler in this._handlers) {
1941
+ this._core.$element.off(handler, this._handlers[handler]);
1942
+ }
1943
+ for (property in Object.getOwnPropertyNames(this)) {
1944
+ typeof this[property] != 'function' && (this[property] = null);
1945
+ }
1946
+ };
1947
+
1948
+ $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
1949
+
1950
+ })(window.Zepto || window.jQuery, window, document);
1951
+
1952
+ /**
1953
+ * Lazy Plugin
1954
+ * @version 2.3.4
1955
+ * @author Bartosz Wojciechowski
1956
+ * @author David Deutsch
1957
+ * @license The MIT License (MIT)
1958
+ */
1959
+ ;(function($, window, document, undefined) {
1960
+
1961
+ /**
1962
+ * Creates the lazy plugin.
1963
+ * @class The Lazy Plugin
1964
+ * @param {Owl} carousel - The Owl Carousel
1965
+ */
1966
+ var Lazy = function(carousel) {
1967
+
1968
+ /**
1969
+ * Reference to the core.
1970
+ * @protected
1971
+ * @type {Owl}
1972
+ */
1973
+ this._core = carousel;
1974
+
1975
+ /**
1976
+ * Already loaded items.
1977
+ * @protected
1978
+ * @type {Array.<jQuery>}
1979
+ */
1980
+ this._loaded = [];
1981
+
1982
+ /**
1983
+ * Event handlers.
1984
+ * @protected
1985
+ * @type {Object}
1986
+ */
1987
+ this._handlers = {
1988
+ 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
1989
+ if (!e.namespace) {
1990
+ return;
1991
+ }
1992
+
1993
+ if (!this._core.settings || !this._core.settings.lazyLoad) {
1994
+ return;
1995
+ }
1996
+
1997
+ if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
1998
+ var settings = this._core.settings,
1999
+ n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
2000
+ i = ((settings.center && n * -1) || 0),
2001
+ position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
2002
+ clones = this._core.clones().length,
2003
+ load = $.proxy(function(i, v) { this.load(v) }, this);
2004
+ //TODO: Need documentation for this new option
2005
+ if (settings.lazyLoadEager > 0) {
2006
+ n += settings.lazyLoadEager;
2007
+ // If the carousel is looping also preload images that are to the "left"
2008
+ if (settings.loop) {
2009
+ position -= settings.lazyLoadEager;
2010
+ n++;
2011
+ }
2012
+ }
2013
+
2014
+ while (i++ < n) {
2015
+ this.load(clones / 2 + this._core.relative(position));
2016
+ clones && $.each(this._core.clones(this._core.relative(position)), load);
2017
+ position++;
2018
+ }
2019
+ }
2020
+ }, this)
2021
+ };
2022
+
2023
+ // set the default options
2024
+ this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
2025
+
2026
+ // register event handler
2027
+ this._core.$element.on(this._handlers);
2028
+ };
2029
+
2030
+ /**
2031
+ * Default options.
2032
+ * @public
2033
+ */
2034
+ Lazy.Defaults = {
2035
+ lazyLoad: false,
2036
+ lazyLoadEager: 0
2037
+ };
2038
+
2039
+ /**
2040
+ * Loads all resources of an item at the specified position.
2041
+ * @param {Number} position - The absolute position of the item.
2042
+ * @protected
2043
+ */
2044
+ Lazy.prototype.load = function(position) {
2045
+ var $item = this._core.$stage.children().eq(position),
2046
+ $elements = $item && $item.find('.owl-lazy');
2047
+
2048
+ if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
2049
+ return;
2050
+ }
2051
+
2052
+ $elements.each($.proxy(function(index, element) {
2053
+ var $element = $(element), image,
2054
+ url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
2055
+
2056
+ this._core.trigger('load', { element: $element, url: url }, 'lazy');
2057
+
2058
+ if ($element.is('img')) {
2059
+ $element.one('load.owl.lazy', $.proxy(function() {
2060
+ $element.css('opacity', 1);
2061
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2062
+ }, this)).attr('src', url);
2063
+ } else if ($element.is('source')) {
2064
+ $element.one('load.owl.lazy', $.proxy(function() {
2065
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2066
+ }, this)).attr('srcset', url);
2067
+ } else {
2068
+ image = new Image();
2069
+ image.onload = $.proxy(function() {
2070
+ $element.css({
2071
+ 'background-image': 'url("' + url + '")',
2072
+ 'opacity': '1'
2073
+ });
2074
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2075
+ }, this);
2076
+ image.src = url;
2077
+ }
2078
+ }, this));
2079
+
2080
+ this._loaded.push($item.get(0));
2081
+ };
2082
+
2083
+ /**
2084
+ * Destroys the plugin.
2085
+ * @public
2086
+ */
2087
+ Lazy.prototype.destroy = function() {
2088
+ var handler, property;
2089
+
2090
+ for (handler in this.handlers) {
2091
+ this._core.$element.off(handler, this.handlers[handler]);
2092
+ }
2093
+ for (property in Object.getOwnPropertyNames(this)) {
2094
+ typeof this[property] != 'function' && (this[property] = null);
2095
+ }
2096
+ };
2097
+
2098
+ $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
2099
+
2100
+ })(window.Zepto || window.jQuery, window, document);
2101
+
2102
+ /**
2103
+ * AutoHeight Plugin
2104
+ * @version 2.3.4
2105
+ * @author Bartosz Wojciechowski
2106
+ * @author David Deutsch
2107
+ * @license The MIT License (MIT)
2108
+ */
2109
+ ;(function($, window, document, undefined) {
2110
+
2111
+ /**
2112
+ * Creates the auto height plugin.
2113
+ * @class The Auto Height Plugin
2114
+ * @param {Owl} carousel - The Owl Carousel
2115
+ */
2116
+ var AutoHeight = function(carousel) {
2117
+ /**
2118
+ * Reference to the core.
2119
+ * @protected
2120
+ * @type {Owl}
2121
+ */
2122
+ this._core = carousel;
2123
+
2124
+ this._previousHeight = null;
2125
+
2126
+ /**
2127
+ * All event handlers.
2128
+ * @protected
2129
+ * @type {Object}
2130
+ */
2131
+ this._handlers = {
2132
+ 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
2133
+ if (e.namespace && this._core.settings.autoHeight) {
2134
+ this.update();
2135
+ }
2136
+ }, this),
2137
+ 'changed.owl.carousel': $.proxy(function(e) {
2138
+ if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){
2139
+ this.update();
2140
+ }
2141
+ }, this),
2142
+ 'loaded.owl.lazy': $.proxy(function(e) {
2143
+ if (e.namespace && this._core.settings.autoHeight
2144
+ && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
2145
+ this.update();
2146
+ }
2147
+ }, this)
2148
+ };
2149
+
2150
+ // set default options
2151
+ this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
2152
+
2153
+ // register event handlers
2154
+ this._core.$element.on(this._handlers);
2155
+ this._intervalId = null;
2156
+ var refThis = this;
2157
+
2158
+ // These changes have been taken from a PR by gavrochelegnou proposed in #1575
2159
+ // and have been made compatible with the latest jQuery version
2160
+ $(window).on('load', function() {
2161
+ if (refThis._core.settings.autoHeight) {
2162
+ refThis.update();
2163
+ }
2164
+ });
2165
+
2166
+ // Autoresize the height of the carousel when window is resized
2167
+ // When carousel has images, the height is dependent on the width
2168
+ // and should also change on resize
2169
+ $(window).resize(function() {
2170
+ if (refThis._core.settings.autoHeight) {
2171
+ if (refThis._intervalId != null) {
2172
+ clearTimeout(refThis._intervalId);
2173
+ }
2174
+
2175
+ refThis._intervalId = setTimeout(function() {
2176
+ refThis.update();
2177
+ }, 250);
2178
+ }
2179
+ });
2180
+
2181
+ };
2182
+
2183
+ /**
2184
+ * Default options.
2185
+ * @public
2186
+ */
2187
+ AutoHeight.Defaults = {
2188
+ autoHeight: false,
2189
+ autoHeightClass: 'owl-height'
2190
+ };
2191
+
2192
+ /**
2193
+ * Updates the view.
2194
+ */
2195
+ AutoHeight.prototype.update = function() {
2196
+ var start = this._core._current,
2197
+ end = start + this._core.settings.items,
2198
+ lazyLoadEnabled = this._core.settings.lazyLoad,
2199
+ visible = this._core.$stage.children().toArray().slice(start, end),
2200
+ heights = [],
2201
+ maxheight = 0;
2202
+
2203
+ $.each(visible, function(index, item) {
2204
+ heights.push($(item).height());
2205
+ });
2206
+
2207
+ maxheight = Math.max.apply(null, heights);
2208
+
2209
+ if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) {
2210
+ maxheight = this._previousHeight;
2211
+ }
2212
+
2213
+ this._previousHeight = maxheight;
2214
+
2215
+ this._core.$stage.parent()
2216
+ .height(maxheight)
2217
+ .addClass(this._core.settings.autoHeightClass);
2218
+ };
2219
+
2220
+ AutoHeight.prototype.destroy = function() {
2221
+ var handler, property;
2222
+
2223
+ for (handler in this._handlers) {
2224
+ this._core.$element.off(handler, this._handlers[handler]);
2225
+ }
2226
+ for (property in Object.getOwnPropertyNames(this)) {
2227
+ typeof this[property] !== 'function' && (this[property] = null);
2228
+ }
2229
+ };
2230
+
2231
+ $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
2232
+
2233
+ })(window.Zepto || window.jQuery, window, document);
2234
+
2235
+ /**
2236
+ * Video Plugin
2237
+ * @version 2.3.4
2238
+ * @author Bartosz Wojciechowski
2239
+ * @author David Deutsch
2240
+ * @license The MIT License (MIT)
2241
+ */
2242
+ ;(function($, window, document, undefined) {
2243
+
2244
+ /**
2245
+ * Creates the video plugin.
2246
+ * @class The Video Plugin
2247
+ * @param {Owl} carousel - The Owl Carousel
2248
+ */
2249
+ var Video = function(carousel) {
2250
+ /**
2251
+ * Reference to the core.
2252
+ * @protected
2253
+ * @type {Owl}
2254
+ */
2255
+ this._core = carousel;
2256
+
2257
+ /**
2258
+ * Cache all video URLs.
2259
+ * @protected
2260
+ * @type {Object}
2261
+ */
2262
+ this._videos = {};
2263
+
2264
+ /**
2265
+ * Current playing item.
2266
+ * @protected
2267
+ * @type {jQuery}
2268
+ */
2269
+ this._playing = null;
2270
+
2271
+ /**
2272
+ * All event handlers.
2273
+ * @todo The cloned content removale is too late
2274
+ * @protected
2275
+ * @type {Object}
2276
+ */
2277
+ this._handlers = {
2278
+ 'initialized.owl.carousel': $.proxy(function(e) {
2279
+ if (e.namespace) {
2280
+ this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
2281
+ }
2282
+ }, this),
2283
+ 'resize.owl.carousel': $.proxy(function(e) {
2284
+ if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
2285
+ e.preventDefault();
2286
+ }
2287
+ }, this),
2288
+ 'refreshed.owl.carousel': $.proxy(function(e) {
2289
+ if (e.namespace && this._core.is('resizing')) {
2290
+ this._core.$stage.find('.cloned .owl-video-frame').remove();
2291
+ }
2292
+ }, this),
2293
+ 'changed.owl.carousel': $.proxy(function(e) {
2294
+ if (e.namespace && e.property.name === 'position' && this._playing) {
2295
+ this.stop();
2296
+ }
2297
+ }, this),
2298
+ 'prepared.owl.carousel': $.proxy(function(e) {
2299
+ if (!e.namespace) {
2300
+ return;
2301
+ }
2302
+
2303
+ var $element = $(e.content).find('.owl-video');
2304
+
2305
+ if ($element.length) {
2306
+ $element.css('display', 'none');
2307
+ this.fetch($element, $(e.content));
2308
+ }
2309
+ }, this)
2310
+ };
2311
+
2312
+ // set default options
2313
+ this._core.options = $.extend({}, Video.Defaults, this._core.options);
2314
+
2315
+ // register event handlers
2316
+ this._core.$element.on(this._handlers);
2317
+
2318
+ this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
2319
+ this.play(e);
2320
+ }, this));
2321
+ };
2322
+
2323
+ /**
2324
+ * Default options.
2325
+ * @public
2326
+ */
2327
+ Video.Defaults = {
2328
+ video: false,
2329
+ videoHeight: false,
2330
+ videoWidth: false
2331
+ };
2332
+
2333
+ /**
2334
+ * Gets the video ID and the type (YouTube/Vimeo/vzaar only).
2335
+ * @protected
2336
+ * @param {jQuery} target - The target containing the video data.
2337
+ * @param {jQuery} item - The item containing the video.
2338
+ */
2339
+ Video.prototype.fetch = function(target, item) {
2340
+ var type = (function() {
2341
+ if (target.attr('data-vimeo-id')) {
2342
+ return 'vimeo';
2343
+ } else if (target.attr('data-vzaar-id')) {
2344
+ return 'vzaar'
2345
+ } else {
2346
+ return 'youtube';
2347
+ }
2348
+ })(),
2349
+ id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
2350
+ width = target.attr('data-width') || this._core.settings.videoWidth,
2351
+ height = target.attr('data-height') || this._core.settings.videoHeight,
2352
+ url = target.attr('href');
2353
+
2354
+ if (url) {
2355
+
2356
+ /*
2357
+ Parses the id's out of the following urls (and probably more):
2358
+ https://www.youtube.com/watch?v=:id
2359
+ https://youtu.be/:id
2360
+ https://vimeo.com/:id
2361
+ https://vimeo.com/channels/:channel/:id
2362
+ https://vimeo.com/groups/:group/videos/:id
2363
+ https://app.vzaar.com/videos/:id
2364
+
2365
+ Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F
2366
+ */
2367
+
2368
+ id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
2369
+
2370
+ if (id[3].indexOf('youtu') > -1) {
2371
+ type = 'youtube';
2372
+ } else if (id[3].indexOf('vimeo') > -1) {
2373
+ type = 'vimeo';
2374
+ } else if (id[3].indexOf('vzaar') > -1) {
2375
+ type = 'vzaar';
2376
+ } else {
2377
+ throw new Error('Video URL not supported.');
2378
+ }
2379
+ id = id[6];
2380
+ } else {
2381
+ throw new Error('Missing video URL.');
2382
+ }
2383
+
2384
+ this._videos[url] = {
2385
+ type: type,
2386
+ id: id,
2387
+ width: width,
2388
+ height: height
2389
+ };
2390
+
2391
+ item.attr('data-video', url);
2392
+
2393
+ this.thumbnail(target, this._videos[url]);
2394
+ };
2395
+
2396
+ /**
2397
+ * Creates video thumbnail.
2398
+ * @protected
2399
+ * @param {jQuery} target - The target containing the video data.
2400
+ * @param {Object} info - The video info object.
2401
+ * @see `fetch`
2402
+ */
2403
+ Video.prototype.thumbnail = function(target, video) {
2404
+ var tnLink,
2405
+ icon,
2406
+ path,
2407
+ dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '',
2408
+ customTn = target.find('img'),
2409
+ srcType = 'src',
2410
+ lazyClass = '',
2411
+ settings = this._core.settings,
2412
+ create = function(path) {
2413
+ icon = '<div class="owl-video-play-icon"></div>';
2414
+
2415
+ if (settings.lazyLoad) {
2416
+ tnLink = $('<div/>',{
2417
+ "class": 'owl-video-tn ' + lazyClass,
2418
+ "srcType": path
2419
+ });
2420
+ } else {
2421
+ tnLink = $( '<div/>', {
2422
+ "class": "owl-video-tn",
2423
+ "style": 'opacity:1;background-image:url(' + path + ')'
2424
+ });
2425
+ }
2426
+ target.after(tnLink);
2427
+ target.after(icon);
2428
+ };
2429
+
2430
+ // wrap video content into owl-video-wrapper div
2431
+ target.wrap( $( '<div/>', {
2432
+ "class": "owl-video-wrapper",
2433
+ "style": dimensions
2434
+ }));
2435
+
2436
+ if (this._core.settings.lazyLoad) {
2437
+ srcType = 'data-src';
2438
+ lazyClass = 'owl-lazy';
2439
+ }
2440
+
2441
+ // custom thumbnail
2442
+ if (customTn.length) {
2443
+ create(customTn.attr(srcType));
2444
+ customTn.remove();
2445
+ return false;
2446
+ }
2447
+
2448
+ if (video.type === 'youtube') {
2449
+ path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
2450
+ create(path);
2451
+ } else if (video.type === 'vimeo') {
2452
+ $.ajax({
2453
+ type: 'GET',
2454
+ url: '//vimeo.com/api/v2/video/' + video.id + '.json',
2455
+ jsonp: 'callback',
2456
+ dataType: 'jsonp',
2457
+ success: function(data) {
2458
+ path = data[0].thumbnail_large;
2459
+ create(path);
2460
+ }
2461
+ });
2462
+ } else if (video.type === 'vzaar') {
2463
+ $.ajax({
2464
+ type: 'GET',
2465
+ url: '//vzaar.com/api/videos/' + video.id + '.json',
2466
+ jsonp: 'callback',
2467
+ dataType: 'jsonp',
2468
+ success: function(data) {
2469
+ path = data.framegrab_url;
2470
+ create(path);
2471
+ }
2472
+ });
2473
+ }
2474
+ };
2475
+
2476
+ /**
2477
+ * Stops the current video.
2478
+ * @public
2479
+ */
2480
+ Video.prototype.stop = function() {
2481
+ this._core.trigger('stop', null, 'video');
2482
+ this._playing.find('.owl-video-frame').remove();
2483
+ this._playing.removeClass('owl-video-playing');
2484
+ this._playing = null;
2485
+ this._core.leave('playing');
2486
+ this._core.trigger('stopped', null, 'video');
2487
+ };
2488
+
2489
+ /**
2490
+ * Starts the current video.
2491
+ * @public
2492
+ * @param {Event} event - The event arguments.
2493
+ */
2494
+ Video.prototype.play = function(event) {
2495
+ var target = $(event.target),
2496
+ item = target.closest('.' + this._core.settings.itemClass),
2497
+ video = this._videos[item.attr('data-video')],
2498
+ width = video.width || '100%',
2499
+ height = video.height || this._core.$stage.height(),
2500
+ html,
2501
+ iframe;
2502
+
2503
+ if (this._playing) {
2504
+ return;
2505
+ }
2506
+
2507
+ this._core.enter('playing');
2508
+ this._core.trigger('play', null, 'video');
2509
+
2510
+ item = this._core.items(this._core.relative(item.index()));
2511
+
2512
+ this._core.reset(item.index());
2513
+
2514
+ html = $( '<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>' );
2515
+ html.attr( 'height', height );
2516
+ html.attr( 'width', width );
2517
+ if (video.type === 'youtube') {
2518
+ html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id );
2519
+ } else if (video.type === 'vimeo') {
2520
+ html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' );
2521
+ } else if (video.type === 'vzaar') {
2522
+ html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' );
2523
+ }
2524
+
2525
+ iframe = $(html).wrap( '<div class="owl-video-frame" />' ).insertAfter(item.find('.owl-video'));
2526
+
2527
+ this._playing = item.addClass('owl-video-playing');
2528
+ };
2529
+
2530
+ /**
2531
+ * Checks whether an video is currently in full screen mode or not.
2532
+ * @todo Bad style because looks like a readonly method but changes members.
2533
+ * @protected
2534
+ * @returns {Boolean}
2535
+ */
2536
+ Video.prototype.isInFullScreen = function() {
2537
+ var element = document.fullscreenElement || document.mozFullScreenElement ||
2538
+ document.webkitFullscreenElement;
2539
+
2540
+ return element && $(element).parent().hasClass('owl-video-frame');
2541
+ };
2542
+
2543
+ /**
2544
+ * Destroys the plugin.
2545
+ */
2546
+ Video.prototype.destroy = function() {
2547
+ var handler, property;
2548
+
2549
+ this._core.$element.off('click.owl.video');
2550
+
2551
+ for (handler in this._handlers) {
2552
+ this._core.$element.off(handler, this._handlers[handler]);
2553
+ }
2554
+ for (property in Object.getOwnPropertyNames(this)) {
2555
+ typeof this[property] != 'function' && (this[property] = null);
2556
+ }
2557
+ };
2558
+
2559
+ $.fn.owlCarousel.Constructor.Plugins.Video = Video;
2560
+
2561
+ })(window.Zepto || window.jQuery, window, document);
2562
+
2563
+ /**
2564
+ * Animate Plugin
2565
+ * @version 2.3.4
2566
+ * @author Bartosz Wojciechowski
2567
+ * @author David Deutsch
2568
+ * @license The MIT License (MIT)
2569
+ */
2570
+ ;(function($, window, document, undefined) {
2571
+
2572
+ /**
2573
+ * Creates the animate plugin.
2574
+ * @class The Navigation Plugin
2575
+ * @param {Owl} scope - The Owl Carousel
2576
+ */
2577
+ var Animate = function(scope) {
2578
+ this.core = scope;
2579
+ this.core.options = $.extend({}, Animate.Defaults, this.core.options);
2580
+ this.swapping = true;
2581
+ this.previous = undefined;
2582
+ this.next = undefined;
2583
+
2584
+ this.handlers = {
2585
+ 'change.owl.carousel': $.proxy(function(e) {
2586
+ if (e.namespace && e.property.name == 'position') {
2587
+ this.previous = this.core.current();
2588
+ this.next = e.property.value;
2589
+ }
2590
+ }, this),
2591
+ 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
2592
+ if (e.namespace) {
2593
+ this.swapping = e.type == 'translated';
2594
+ }
2595
+ }, this),
2596
+ 'translate.owl.carousel': $.proxy(function(e) {
2597
+ if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
2598
+ this.swap();
2599
+ }
2600
+ }, this)
2601
+ };
2602
+
2603
+ this.core.$element.on(this.handlers);
2604
+ };
2605
+
2606
+ /**
2607
+ * Default options.
2608
+ * @public
2609
+ */
2610
+ Animate.Defaults = {
2611
+ animateOut: false,
2612
+ animateIn: false
2613
+ };
2614
+
2615
+ /**
2616
+ * Toggles the animation classes whenever an translations starts.
2617
+ * @protected
2618
+ * @returns {Boolean|undefined}
2619
+ */
2620
+ Animate.prototype.swap = function() {
2621
+
2622
+ if (this.core.settings.items !== 1) {
2623
+ return;
2624
+ }
2625
+
2626
+ if (!$.support.animation || !$.support.transition) {
2627
+ return;
2628
+ }
2629
+
2630
+ this.core.speed(0);
2631
+
2632
+ var left,
2633
+ clear = $.proxy(this.clear, this),
2634
+ previous = this.core.$stage.children().eq(this.previous),
2635
+ next = this.core.$stage.children().eq(this.next),
2636
+ incoming = this.core.settings.animateIn,
2637
+ outgoing = this.core.settings.animateOut;
2638
+
2639
+ if (this.core.current() === this.previous) {
2640
+ return;
2641
+ }
2642
+
2643
+ if (outgoing) {
2644
+ left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
2645
+ previous.one($.support.animation.end, clear)
2646
+ .css( { 'left': left + 'px' } )
2647
+ .addClass('animated owl-animated-out')
2648
+ .addClass(outgoing);
2649
+ }
2650
+
2651
+ if (incoming) {
2652
+ next.one($.support.animation.end, clear)
2653
+ .addClass('animated owl-animated-in')
2654
+ .addClass(incoming);
2655
+ }
2656
+ };
2657
+
2658
+ Animate.prototype.clear = function(e) {
2659
+ $(e.target).css( { 'left': '' } )
2660
+ .removeClass('animated owl-animated-out owl-animated-in')
2661
+ .removeClass(this.core.settings.animateIn)
2662
+ .removeClass(this.core.settings.animateOut);
2663
+ this.core.onTransitionEnd();
2664
+ };
2665
+
2666
+ /**
2667
+ * Destroys the plugin.
2668
+ * @public
2669
+ */
2670
+ Animate.prototype.destroy = function() {
2671
+ var handler, property;
2672
+
2673
+ for (handler in this.handlers) {
2674
+ this.core.$element.off(handler, this.handlers[handler]);
2675
+ }
2676
+ for (property in Object.getOwnPropertyNames(this)) {
2677
+ typeof this[property] != 'function' && (this[property] = null);
2678
+ }
2679
+ };
2680
+
2681
+ $.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
2682
+
2683
+ })(window.Zepto || window.jQuery, window, document);
2684
+
2685
+ /**
2686
+ * Autoplay Plugin
2687
+ * @version 2.3.4
2688
+ * @author Bartosz Wojciechowski
2689
+ * @author Artus Kolanowski
2690
+ * @author David Deutsch
2691
+ * @author Tom De CaluwГ©
2692
+ * @license The MIT License (MIT)
2693
+ */
2694
+ ;(function($, window, document, undefined) {
2695
+
2696
+ /**
2697
+ * Creates the autoplay plugin.
2698
+ * @class The Autoplay Plugin
2699
+ * @param {Owl} scope - The Owl Carousel
2700
+ */
2701
+ var Autoplay = function(carousel) {
2702
+ /**
2703
+ * Reference to the core.
2704
+ * @protected
2705
+ * @type {Owl}
2706
+ */
2707
+ this._core = carousel;
2708
+
2709
+ /**
2710
+ * The autoplay timeout id.
2711
+ * @type {Number}
2712
+ */
2713
+ this._call = null;
2714
+
2715
+ /**
2716
+ * Depending on the state of the plugin, this variable contains either
2717
+ * the start time of the timer or the current timer value if it's
2718
+ * paused. Since we start in a paused state we initialize the timer
2719
+ * value.
2720
+ * @type {Number}
2721
+ */
2722
+ this._time = 0;
2723
+
2724
+ /**
2725
+ * Stores the timeout currently used.
2726
+ * @type {Number}
2727
+ */
2728
+ this._timeout = 0;
2729
+
2730
+ /**
2731
+ * Indicates whenever the autoplay is paused.
2732
+ * @type {Boolean}
2733
+ */
2734
+ this._paused = true;
2735
+
2736
+ /**
2737
+ * All event handlers.
2738
+ * @protected
2739
+ * @type {Object}
2740
+ */
2741
+ this._handlers = {
2742
+ 'changed.owl.carousel': $.proxy(function(e) {
2743
+ if (e.namespace && e.property.name === 'settings') {
2744
+ if (this._core.settings.autoplay) {
2745
+ this.play();
2746
+ } else {
2747
+ this.stop();
2748
+ }
2749
+ } else if (e.namespace && e.property.name === 'position' && this._paused) {
2750
+ // Reset the timer. This code is triggered when the position
2751
+ // of the carousel was changed through user interaction.
2752
+ this._time = 0;
2753
+ }
2754
+ }, this),
2755
+ 'initialized.owl.carousel': $.proxy(function(e) {
2756
+ if (e.namespace && this._core.settings.autoplay) {
2757
+ this.play();
2758
+ }
2759
+ }, this),
2760
+ 'play.owl.autoplay': $.proxy(function(e, t, s) {
2761
+ if (e.namespace) {
2762
+ this.play(t, s);
2763
+ }
2764
+ }, this),
2765
+ 'stop.owl.autoplay': $.proxy(function(e) {
2766
+ if (e.namespace) {
2767
+ this.stop();
2768
+ }
2769
+ }, this),
2770
+ 'mouseover.owl.autoplay': $.proxy(function() {
2771
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2772
+ this.pause();
2773
+ }
2774
+ }, this),
2775
+ 'mouseleave.owl.autoplay': $.proxy(function() {
2776
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2777
+ this.play();
2778
+ }
2779
+ }, this),
2780
+ 'touchstart.owl.core': $.proxy(function() {
2781
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2782
+ this.pause();
2783
+ }
2784
+ }, this),
2785
+ 'touchend.owl.core': $.proxy(function() {
2786
+ if (this._core.settings.autoplayHoverPause) {
2787
+ this.play();
2788
+ }
2789
+ }, this)
2790
+ };
2791
+
2792
+ // register event handlers
2793
+ this._core.$element.on(this._handlers);
2794
+
2795
+ // set default options
2796
+ this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
2797
+ };
2798
+
2799
+ /**
2800
+ * Default options.
2801
+ * @public
2802
+ */
2803
+ Autoplay.Defaults = {
2804
+ autoplay: false,
2805
+ autoplayTimeout: 5000,
2806
+ autoplayHoverPause: false,
2807
+ autoplaySpeed: false
2808
+ };
2809
+
2810
+ /**
2811
+ * Transition to the next slide and set a timeout for the next transition.
2812
+ * @private
2813
+ * @param {Number} [speed] - The animation speed for the animations.
2814
+ */
2815
+ Autoplay.prototype._next = function(speed) {
2816
+ this._call = window.setTimeout(
2817
+ $.proxy(this._next, this, speed),
2818
+ this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
2819
+ );
2820
+
2821
+ if (this._core.is('interacting') || document.hidden) {
2822
+ return;
2823
+ }
2824
+ this._core.next(speed || this._core.settings.autoplaySpeed);
2825
+ }
2826
+
2827
+ /**
2828
+ * Reads the current timer value when the timer is playing.
2829
+ * @public
2830
+ */
2831
+ Autoplay.prototype.read = function() {
2832
+ return new Date().getTime() - this._time;
2833
+ };
2834
+
2835
+ /**
2836
+ * Starts the autoplay.
2837
+ * @public
2838
+ * @param {Number} [timeout] - The interval before the next animation starts.
2839
+ * @param {Number} [speed] - The animation speed for the animations.
2840
+ */
2841
+ Autoplay.prototype.play = function(timeout, speed) {
2842
+ var elapsed;
2843
+
2844
+ if (!this._core.is('rotating')) {
2845
+ this._core.enter('rotating');
2846
+ }
2847
+
2848
+ timeout = timeout || this._core.settings.autoplayTimeout;
2849
+
2850
+ // Calculate the elapsed time since the last transition. If the carousel
2851
+ // wasn't playing this calculation will yield zero.
2852
+ elapsed = Math.min(this._time % (this._timeout || timeout), timeout);
2853
+
2854
+ if (this._paused) {
2855
+ // Start the clock.
2856
+ this._time = this.read();
2857
+ this._paused = false;
2858
+ } else {
2859
+ // Clear the active timeout to allow replacement.
2860
+ window.clearTimeout(this._call);
2861
+ }
2862
+
2863
+ // Adjust the origin of the timer to match the new timeout value.
2864
+ this._time += this.read() % timeout - elapsed;
2865
+
2866
+ this._timeout = timeout;
2867
+ this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
2868
+ };
2869
+
2870
+ /**
2871
+ * Stops the autoplay.
2872
+ * @public
2873
+ */
2874
+ Autoplay.prototype.stop = function() {
2875
+ if (this._core.is('rotating')) {
2876
+ // Reset the clock.
2877
+ this._time = 0;
2878
+ this._paused = true;
2879
+
2880
+ window.clearTimeout(this._call);
2881
+ this._core.leave('rotating');
2882
+ }
2883
+ };
2884
+
2885
+ /**
2886
+ * Pauses the autoplay.
2887
+ * @public
2888
+ */
2889
+ Autoplay.prototype.pause = function() {
2890
+ if (this._core.is('rotating') && !this._paused) {
2891
+ // Pause the clock.
2892
+ this._time = this.read();
2893
+ this._paused = true;
2894
+
2895
+ window.clearTimeout(this._call);
2896
+ }
2897
+ };
2898
+
2899
+ /**
2900
+ * Destroys the plugin.
2901
+ */
2902
+ Autoplay.prototype.destroy = function() {
2903
+ var handler, property;
2904
+
2905
+ this.stop();
2906
+
2907
+ for (handler in this._handlers) {
2908
+ this._core.$element.off(handler, this._handlers[handler]);
2909
+ }
2910
+ for (property in Object.getOwnPropertyNames(this)) {
2911
+ typeof this[property] != 'function' && (this[property] = null);
2912
+ }
2913
+ };
2914
+
2915
+ $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
2916
+
2917
+ })(window.Zepto || window.jQuery, window, document);
2918
+
2919
+ /**
2920
+ * Navigation Plugin
2921
+ * @version 2.3.4
2922
+ * @author Artus Kolanowski
2923
+ * @author David Deutsch
2924
+ * @license The MIT License (MIT)
2925
+ */
2926
+ ;(function($, window, document, undefined) {
2927
+ 'use strict';
2928
+
2929
+ /**
2930
+ * Creates the navigation plugin.
2931
+ * @class The Navigation Plugin
2932
+ * @param {Owl} carousel - The Owl Carousel.
2933
+ */
2934
+ var Navigation = function(carousel) {
2935
+ /**
2936
+ * Reference to the core.
2937
+ * @protected
2938
+ * @type {Owl}
2939
+ */
2940
+ this._core = carousel;
2941
+
2942
+ /**
2943
+ * Indicates whether the plugin is initialized or not.
2944
+ * @protected
2945
+ * @type {Boolean}
2946
+ */
2947
+ this._initialized = false;
2948
+
2949
+ /**
2950
+ * The current paging indexes.
2951
+ * @protected
2952
+ * @type {Array}
2953
+ */
2954
+ this._pages = [];
2955
+
2956
+ /**
2957
+ * All DOM elements of the user interface.
2958
+ * @protected
2959
+ * @type {Object}
2960
+ */
2961
+ this._controls = {};
2962
+
2963
+ /**
2964
+ * Markup for an indicator.
2965
+ * @protected
2966
+ * @type {Array.<String>}
2967
+ */
2968
+ this._templates = [];
2969
+
2970
+ /**
2971
+ * The carousel element.
2972
+ * @type {jQuery}
2973
+ */
2974
+ this.$element = this._core.$element;
2975
+
2976
+ /**
2977
+ * Overridden methods of the carousel.
2978
+ * @protected
2979
+ * @type {Object}
2980
+ */
2981
+ this._overrides = {
2982
+ next: this._core.next,
2983
+ prev: this._core.prev,
2984
+ to: this._core.to
2985
+ };
2986
+
2987
+ /**
2988
+ * All event handlers.
2989
+ * @protected
2990
+ * @type {Object}
2991
+ */
2992
+ this._handlers = {
2993
+ 'prepared.owl.carousel': $.proxy(function(e) {
2994
+ if (e.namespace && this._core.settings.dotsData) {
2995
+ this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
2996
+ $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
2997
+ }
2998
+ }, this),
2999
+ 'added.owl.carousel': $.proxy(function(e) {
3000
+ if (e.namespace && this._core.settings.dotsData) {
3001
+ this._templates.splice(e.position, 0, this._templates.pop());
3002
+ }
3003
+ }, this),
3004
+ 'remove.owl.carousel': $.proxy(function(e) {
3005
+ if (e.namespace && this._core.settings.dotsData) {
3006
+ this._templates.splice(e.position, 1);
3007
+ }
3008
+ }, this),
3009
+ 'changed.owl.carousel': $.proxy(function(e) {
3010
+ if (e.namespace && e.property.name == 'position') {
3011
+ this.draw();
3012
+ }
3013
+ }, this),
3014
+ 'initialized.owl.carousel': $.proxy(function(e) {
3015
+ if (e.namespace && !this._initialized) {
3016
+ this._core.trigger('initialize', null, 'navigation');
3017
+ this.initialize();
3018
+ this.update();
3019
+ this.draw();
3020
+ this._initialized = true;
3021
+ this._core.trigger('initialized', null, 'navigation');
3022
+ }
3023
+ }, this),
3024
+ 'refreshed.owl.carousel': $.proxy(function(e) {
3025
+ if (e.namespace && this._initialized) {
3026
+ this._core.trigger('refresh', null, 'navigation');
3027
+ this.update();
3028
+ this.draw();
3029
+ this._core.trigger('refreshed', null, 'navigation');
3030
+ }
3031
+ }, this)
3032
+ };
3033
+
3034
+ // set default options
3035
+ this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
3036
+
3037
+ // register event handlers
3038
+ this.$element.on(this._handlers);
3039
+ };
3040
+
3041
+ /**
3042
+ * Default options.
3043
+ * @public
3044
+ * @todo Rename `slideBy` to `navBy`
3045
+ */
3046
+ Navigation.Defaults = {
3047
+ nav: false,
3048
+ navText: [
3049
+ '<span aria-label="' + 'Previous' + '">&#x2039;</span>',
3050
+ '<span aria-label="' + 'Next' + '">&#x203a;</span>'
3051
+ ],
3052
+ navSpeed: false,
3053
+ navElement: 'button type="button" role="presentation"',
3054
+ navContainer: false,
3055
+ navContainerClass: 'owl-nav',
3056
+ navClass: [
3057
+ 'owl-prev',
3058
+ 'owl-next'
3059
+ ],
3060
+ slideBy: 1,
3061
+ changeItemOnClick:false,
3062
+ dotClass: 'owl-dot',
3063
+ dotsClass: 'owl-dots',
3064
+ dots: true,
3065
+ dotsEach: false,
3066
+ dotsData: false,
3067
+ dotsSpeed: false,
3068
+ dotsContainer: false
3069
+ };
3070
+
3071
+ /**
3072
+ * Initializes the layout of the plugin and extends the carousel.
3073
+ * @protected
3074
+ */
3075
+ Navigation.prototype.initialize = function() {
3076
+ var override,
3077
+ settings = this._core.settings;
3078
+
3079
+ // create DOM structure for relative navigation
3080
+ this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
3081
+ : $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
3082
+
3083
+ this._controls.$previous = $('<' + settings.navElement + ' value="previous item" title="previous item">')
3084
+ .addClass(settings.navClass[0])
3085
+ .html(settings.navText[0])
3086
+ .prependTo(this._controls.$relative)
3087
+ .on('click', $.proxy(function(e) {
3088
+ this.prev(settings.navSpeed);
3089
+ }, this));
3090
+ this._controls.$next = $('<' + settings.navElement + ' value="next item" title="next item">')
3091
+ .addClass(settings.navClass[1])
3092
+ .html(settings.navText[1])
3093
+ .appendTo(this._controls.$relative)
3094
+ .on('click', $.proxy(function(e) {
3095
+ this.next(settings.navSpeed);
3096
+ }, this));
3097
+
3098
+ // scroll on item-click function
3099
+ if(settings.changeItemOnClick){
3100
+ var owlItem = this._core.$stage.children();
3101
+ var clonedItems = this._core.clones().length / 2;
3102
+
3103
+ owlItem.on('click', $.proxy(function(e){
3104
+ var index = $(e.currentTarget).index();
3105
+ this.to(index - clonedItems, settings.navSpeed, true);
3106
+ }, this));
3107
+ }
3108
+
3109
+
3110
+
3111
+ // create DOM structure for absolute navigation
3112
+ if (!settings.dotsData) {
3113
+ this._templates = [ $('<button role="button">')
3114
+ .addClass(settings.dotClass)
3115
+ .append($('<span>'))
3116
+ .prop('outerHTML') ];
3117
+ }
3118
+
3119
+ this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
3120
+ : $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
3121
+
3122
+ this._controls.$absolute.on('click', 'button', $.proxy(function(e) {
3123
+ var index = $(e.target).parent().is(this._controls.$absolute)
3124
+ ? $(e.target).index() : $(e.target).parent().index();
3125
+ console.log($(e.target).index());
3126
+ e.preventDefault();
3127
+
3128
+ this.to(index, settings.dotsSpeed);
3129
+ }, this));
3130
+
3131
+ /*$el.on('focusin', function() {
3132
+ $(document).off(".carousel");
3133
+
3134
+ $(document).on('keydown.carousel', function(e) {
3135
+ if(e.keyCode == 37) {
3136
+ $el.trigger('prev.owl')
3137
+ }
3138
+ if(e.keyCode == 39) {
3139
+ $el.trigger('next.owl')
3140
+ }
3141
+ });
3142
+ });*/
3143
+
3144
+ // override public methods of the carousel
3145
+ for (override in this._overrides) {
3146
+ this._core[override] = $.proxy(this[override], this);
3147
+ }
3148
+ };
3149
+
3150
+ /**
3151
+ * Destroys the plugin.
3152
+ * @protected
3153
+ */
3154
+ Navigation.prototype.destroy = function() {
3155
+ var handler, control, property, override, settings;
3156
+ settings = this._core.settings;
3157
+
3158
+ for (handler in this._handlers) {
3159
+ this.$element.off(handler, this._handlers[handler]);
3160
+ }
3161
+ for (control in this._controls) {
3162
+ if (control === '$relative' && settings.navContainer) {
3163
+ this._controls[control].html('');
3164
+ } else {
3165
+ this._controls[control].remove();
3166
+ }
3167
+ }
3168
+ for (override in this.overides) {
3169
+ this._core[override] = this._overrides[override];
3170
+ }
3171
+ for (property in Object.getOwnPropertyNames(this)) {
3172
+ typeof this[property] != 'function' && (this[property] = null);
3173
+ }
3174
+ };
3175
+
3176
+ /**
3177
+ * Updates the internal state.
3178
+ * @protected
3179
+ */
3180
+ Navigation.prototype.update = function() {
3181
+ var i, j, k,
3182
+ lower = this._core.clones().length / 2,
3183
+ upper = lower + this._core.items().length,
3184
+ maximum = this._core.maximum(true),
3185
+ settings = this._core.settings,
3186
+ size = settings.center || settings.autoWidth || settings.dotsData
3187
+ ? 1 : settings.dotsEach || settings.items;
3188
+
3189
+ if (settings.slideBy !== 'page') {
3190
+ settings.slideBy = Math.min(settings.slideBy, settings.items);
3191
+ }
3192
+
3193
+ if (settings.dots || settings.slideBy == 'page') {
3194
+ this._pages = [];
3195
+
3196
+ for (i = lower, j = 0, k = 0; i < upper; i++) {
3197
+ if (j >= size || j === 0) {
3198
+ this._pages.push({
3199
+ start: Math.min(maximum, i - lower),
3200
+ end: i - lower + size - 1
3201
+ });
3202
+ if (Math.min(maximum, i - lower) === maximum) {
3203
+ break;
3204
+ }
3205
+ j = 0, ++k;
3206
+ }
3207
+ j += this._core.mergers(this._core.relative(i));
3208
+ }
3209
+ }
3210
+ };
3211
+
3212
+ /**
3213
+ * Draws the user interface.
3214
+ * @todo The option `dotsData` wont work.
3215
+ * @protected
3216
+ */
3217
+ Navigation.prototype.draw = function() {
3218
+ var difference,
3219
+ settings = this._core.settings,
3220
+ disabled = this._core.items().length <= settings.items,
3221
+ index = this._core.relative(this._core.current()),
3222
+ loop = settings.loop || settings.rewind;
3223
+
3224
+ this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
3225
+
3226
+ if (settings.nav) {
3227
+ this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
3228
+ this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
3229
+ }
3230
+
3231
+ this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
3232
+
3233
+ if (settings.dots) {
3234
+ difference = this._pages.length - this._controls.$absolute.children().length;
3235
+
3236
+ if (settings.dotsData && difference !== 0) {
3237
+ this._controls.$absolute.html(this._templates.join(''));
3238
+ } else if (difference > 0) {
3239
+ this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
3240
+ } else if (difference < 0) {
3241
+ this._controls.$absolute.children().slice(difference).remove();
3242
+ }
3243
+
3244
+ this._controls.$absolute.find('.active').removeClass('active');
3245
+ this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
3246
+ }
3247
+ };
3248
+
3249
+ /**
3250
+ * Extends event data.
3251
+ * @protected
3252
+ * @param {Event} event - The event object which gets thrown.
3253
+ */
3254
+ Navigation.prototype.onTrigger = function(event) {
3255
+ var settings = this._core.settings;
3256
+
3257
+ event.page = {
3258
+ index: $.inArray(this.current(), this._pages),
3259
+ count: this._pages.length,
3260
+ size: settings && (settings.center || settings.autoWidth || settings.dotsData
3261
+ ? 1 : settings.dotsEach || settings.items)
3262
+ };
3263
+ };
3264
+
3265
+ /**
3266
+ * Gets the current page position of the carousel.
3267
+ * @protected
3268
+ * @returns {Number}
3269
+ */
3270
+ Navigation.prototype.current = function() {
3271
+ var current = this._core.relative(this._core.current());
3272
+ return $.grep(this._pages, $.proxy(function(page, index) {
3273
+ return page.start <= current && page.end >= current;
3274
+ }, this)).pop();
3275
+ };
3276
+
3277
+ /**
3278
+ * Gets the current succesor/predecessor position.
3279
+ * @protected
3280
+ * @returns {Number}
3281
+ */
3282
+ Navigation.prototype.getPosition = function(successor) {
3283
+ var position, length,
3284
+ settings = this._core.settings;
3285
+
3286
+ if (settings.slideBy == 'page') {
3287
+ position = $.inArray(this.current(), this._pages);
3288
+ length = this._pages.length;
3289
+ successor ? ++position : --position;
3290
+ position = this._pages[((position % length) + length) % length].start;
3291
+ } else {
3292
+ position = this._core.relative(this._core.current());
3293
+ length = this._core.items().length;
3294
+ successor ? position += settings.slideBy : position -= settings.slideBy;
3295
+ }
3296
+
3297
+ return position;
3298
+ };
3299
+
3300
+ /**
3301
+ * Slides to the next item or page.
3302
+ * @public
3303
+ * @param {Number} [speed=false] - The time in milliseconds for the transition.
3304
+ */
3305
+ Navigation.prototype.next = function(speed) {
3306
+ $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
3307
+ };
3308
+
3309
+ /**
3310
+ * Slides to the previous item or page.
3311
+ * @public
3312
+ * @param {Number} [speed=false] - The time in milliseconds for the transition.
3313
+ */
3314
+ Navigation.prototype.prev = function(speed) {
3315
+ $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
3316
+ };
3317
+
3318
+ /**
3319
+ * Slides to the specified item or page.
3320
+ * @public
3321
+ * @param {Number} position - The position of the item or page.
3322
+ * @param {Number} [speed] - The time in milliseconds for the transition.
3323
+ * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
3324
+ */
3325
+ Navigation.prototype.to = function(position, speed, standard) {
3326
+ var length;
3327
+
3328
+ if (!standard && this._pages.length) {
3329
+ length = this._pages.length;
3330
+ $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
3331
+ } else {
3332
+ $.proxy(this._overrides.to, this._core)(position, speed);
3333
+ }
3334
+ };
3335
+
3336
+ $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3337
+
3338
+ })(window.Zepto || window.jQuery, window, document);
3339
+
3340
+ /**
3341
+ * Hash Plugin
3342
+ * @version 2.3.4
3343
+ * @author Artus Kolanowski
3344
+ * @author David Deutsch
3345
+ * @license The MIT License (MIT)
3346
+ */
3347
+ ;(function($, window, document, undefined) {
3348
+ 'use strict';
3349
+
3350
+ /**
3351
+ * Creates the hash plugin.
3352
+ * @class The Hash Plugin
3353
+ * @param {Owl} carousel - The Owl Carousel
3354
+ */
3355
+ var Hash = function(carousel) {
3356
+ /**
3357
+ * Reference to the core.
3358
+ * @protected
3359
+ * @type {Owl}
3360
+ */
3361
+ this._core = carousel;
3362
+
3363
+ /**
3364
+ * Hash index for the items.
3365
+ * @protected
3366
+ * @type {Object}
3367
+ */
3368
+ this._hashes = {};
3369
+
3370
+ /**
3371
+ * The carousel element.
3372
+ * @type {jQuery}
3373
+ */
3374
+ this.$element = this._core.$element;
3375
+
3376
+ /**
3377
+ * All event handlers.
3378
+ * @protected
3379
+ * @type {Object}
3380
+ */
3381
+ this._handlers = {
3382
+ 'initialized.owl.carousel': $.proxy(function(e) {
3383
+ if (e.namespace && this._core.settings.startPosition === 'URLHash') {
3384
+ $(window).trigger('hashchange.owl.navigation');
3385
+ }
3386
+ }, this),
3387
+ 'prepared.owl.carousel': $.proxy(function(e) {
3388
+ if (e.namespace) {
3389
+ var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
3390
+
3391
+ if (!hash) {
3392
+ return;
3393
+ }
3394
+
3395
+ this._hashes[hash] = e.content;
3396
+ }
3397
+ }, this),
3398
+ 'changed.owl.carousel': $.proxy(function(e) {
3399
+ if (e.namespace && e.property.name === 'position') {
3400
+ var current = this._core.items(this._core.relative(this._core.current())),
3401
+ hash = $.map(this._hashes, function(item, hash) {
3402
+ return item === current ? hash : null;
3403
+ }).join();
3404
+
3405
+ if (!hash || window.location.hash.slice(1) === hash) {
3406
+ return;
3407
+ }
3408
+
3409
+ window.location.hash = hash;
3410
+ }
3411
+ }, this)
3412
+ };
3413
+
3414
+ // set default options
3415
+ this._core.options = $.extend({}, Hash.Defaults, this._core.options);
3416
+
3417
+ // register the event handlers
3418
+ this.$element.on(this._handlers);
3419
+
3420
+ // register event listener for hash navigation
3421
+ $(window).on('hashchange.owl.navigation', $.proxy(function(e) {
3422
+ var hash = window.location.hash.substring(1),
3423
+ items = this._core.$stage.children(),
3424
+ position = this._hashes[hash] && items.index(this._hashes[hash]);
3425
+
3426
+ if (position === undefined || position === this._core.current()) {
3427
+ return;
3428
+ }
3429
+
3430
+ this._core.to(this._core.relative(position), false, true);
3431
+ }, this));
3432
+ };
3433
+
3434
+ /**
3435
+ * Default options.
3436
+ * @public
3437
+ */
3438
+ Hash.Defaults = {
3439
+ URLhashListener: false
3440
+ };
3441
+
3442
+ /**
3443
+ * Destroys the plugin.
3444
+ * @public
3445
+ */
3446
+ Hash.prototype.destroy = function() {
3447
+ var handler, property;
3448
+
3449
+ $(window).off('hashchange.owl.navigation');
3450
+
3451
+ for (handler in this._handlers) {
3452
+ this._core.$element.off(handler, this._handlers[handler]);
3453
+ }
3454
+ for (property in Object.getOwnPropertyNames(this)) {
3455
+ typeof this[property] != 'function' && (this[property] = null);
3456
+ }
3457
+ };
3458
+
3459
+ $.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3460
+
3461
+ })(window.Zepto || window.jQuery, window, document);
3462
+
3463
+ /**
3464
+ * Support Plugin
3465
+ *
3466
+ * @version 2.3.4
3467
+ * @author Vivid Planet Software GmbH
3468
+ * @author Artus Kolanowski
3469
+ * @author David Deutsch
3470
+ * @license The MIT License (MIT)
3471
+ */
3472
+ ;(function($, window, document, undefined) {
3473
+
3474
+ var style = $('<support>').get(0).style,
3475
+ prefixes = 'Webkit Moz O ms'.split(' '),
3476
+ events = {
3477
+ transition: {
3478
+ end: {
3479
+ WebkitTransition: 'webkitTransitionEnd',
3480
+ MozTransition: 'transitionend',
3481
+ OTransition: 'oTransitionEnd',
3482
+ transition: 'transitionend'
3483
+ }
3484
+ },
3485
+ animation: {
3486
+ end: {
3487
+ WebkitAnimation: 'webkitAnimationEnd',
3488
+ MozAnimation: 'animationend',
3489
+ OAnimation: 'oAnimationEnd',
3490
+ animation: 'animationend'
3491
+ }
3492
+ }
3493
+ },
3494
+ tests = {
3495
+ csstransforms: function() {
3496
+ return !!test('transform');
3497
+ },
3498
+ csstransforms3d: function() {
3499
+ return !!test('perspective');
3500
+ },
3501
+ csstransitions: function() {
3502
+ return !!test('transition');
3503
+ },
3504
+ cssanimations: function() {
3505
+ return !!test('animation');
3506
+ }
3507
+ };
3508
+
3509
+ function test(property, prefixed) {
3510
+ var result = false,
3511
+ upper = property.charAt(0).toUpperCase() + property.slice(1);
3512
+
3513
+ $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
3514
+ if (style[property] !== undefined) {
3515
+ result = prefixed ? property : true;
3516
+ return false;
3517
+ }
3518
+ });
3519
+
3520
+ return result;
3521
+ }
3522
+
3523
+ function prefixed(property) {
3524
+ return test(property, true);
3525
+ }
3526
+
3527
+ if (tests.csstransitions()) {
3528
+ /* jshint -W053 */
3529
+ $.support.transition = new String(prefixed('transition'))
3530
+ $.support.transition.end = events.transition.end[ $.support.transition ];
3531
+ }
3532
+
3533
+ if (tests.cssanimations()) {
3534
+ /* jshint -W053 */
3535
+ $.support.animation = new String(prefixed('animation'))
3536
+ $.support.animation.end = events.animation.end[ $.support.animation ];
3537
+ }
3538
+
3539
+ if (tests.csstransforms()) {
3540
+ /* jshint -W053 */
3541
+ $.support.transform = new String(prefixed('transform'));
3542
+ $.support.transform3d = tests.csstransforms3d();
3543
+ }
3544
+
3545
+ })(window.Zepto || window.jQuery, window, document);
3546
 
assets_libraries/owl-carousel-new/owl.carousel.min.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * Owl Carousel v2.3.6 - UE4
3
  * Copyright 2013-2018 David Deutsch
4
  * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
5
  */
@@ -15,5 +15,4 @@
15
  * @todo Test Zepto
16
  * @todo stagePadding calculate wrong active classes
17
  */
18
-
19
- !function(t,e,i,s){function n(e,i){this.settings=null,this.options=t.extend({},n.Defaults,i),this.$element=t(e),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},t.each(["onResize","onThrottledResize"],t.proxy(function(e,i){this._handlers[i]=t.proxy(this[i],this)},this)),t.each(n.Plugins,t.proxy(function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)},this)),t.each(n.Workers,t.proxy(function(e,i){this._pipe.push({filter:i.filter,run:t.proxy(i.run,this)})},this)),this.setup(),this.initialize()}n.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,setActiveClass:!0,setActiveClassOnMobile:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:e,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab",shuffle:!1},n.Width={Default:"default",Inner:"inner",Outer:"outer"},n.Type={Event:"event",State:"state"},n.Plugins={},n.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,s=this.settings.rtl,n={width:"auto","margin-left":s?e:"","margin-right":s?"":e};!i&&this.$stage.children().css(n),t.css=n}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,s=this._items.length,n=!this.settings.autoWidth,o=[];for(t.items={merge:!1,width:e};s--;)i=this._mergers[s],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=i>1||t.items.merge,o[s]=n?e*i:this._items[s].width();this._widths=o}},{filter:["items","settings"],run:function(){var e=[],i=this._items,s=this.settings,n=Math.max(2*s.items,4),o=2*Math.ceil(i.length/2),r=s.loop&&i.length?s.rewind?n:Math.max(n,o):0,a="",h="";for(r/=2;r>0;)e.push(this.normalize(e.length/2,!0)),a+=i[e[e.length-1]][0].outerHTML,e.push(this.normalize(i.length-1-(e.length-1)/2,!0)),h=i[e[e.length-1]][0].outerHTML+h,r-=1;this._clones=e,t(a).addClass("cloned").appendTo(this.$stage),t(h).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,s=0,n=0,o=[];++i<e;)s=o[i-1]||0,n=this._widths[this.relative(i)]+this.settings.margin,o.push(s+n*t);this._coordinates=o}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""};this.$stage.css(i)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,s=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],s.eq(e).css(t.css);else i&&(t.css.width=t.items.width,s.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,s,n=this.settings.rtl?1:-1,o=2*this.settings.stagePadding,r=this.coordinates(this.current())+o,a=r+this.width()*n,h=[];for(i=0,s=this._coordinates.length;i<s;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+o*n,(this.op(t,"<=",r)&&this.op(t,">",a)||this.op(e,"<",r)&&this.op(e,">",a))&&h.push(i);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+h.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}},{filter:["width","position","items","settings"],run:function(){if(this.settings.setActiveClass&&this.settings.setActiveClass){var t=!0;this.settings.setActiveClassOnMobile?1==this.$stage.children(".active").length&&(t=!0):this.settings.setActiveClassOnMobile||1==this.$stage.children(".active").length&&(t=!1),1==t?this.$stage.children().eq(this.current()).addClass("uc-active-item").siblings().removeClass("uc-active-item"):0==t&&this.$stage.children().removeClass("uc-active-item")}}}],n.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=t("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(t("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},n.prototype.initializeItems=function(){var e=this.$element.find(".owl-item");if(e.length)return this._items=e.get().map(function(e){return t(e)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},n.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.shuffle){var t=this.$element;t.children().sort(function(){return Math.round(Math.random())-.5}).each(function(){t.append(this)})}var e,i,s;this.settings.autoWidth&&!this.is("pre-loading")&&(e=this.$element.find("img"),i=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:void 0,s=this.$element.children(i).width(),e.length&&s<=0&&this.preloadAutoWidthImages(e));this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},n.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},n.prototype.setup=function(){var e=this.viewport(),i=this.options.responsive,s=-1,n=null;i?(t.each(i,function(t){t<=e&&t>s&&(s=Number(t))}),"function"==typeof(n=t.extend({},this.options,i[s])).stagePadding&&(n.stagePadding=n.stagePadding()),delete n.responsive,n.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+s))):n=t.extend({},this.options),this.trigger("change",{property:{name:"settings",value:n}}),this._breakpoint=s,this.settings=n,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},n.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},n.prototype.prepare=function(e){var i=this.trigger("prepare",{content:e});return i.data||(i.data=t("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(e)),this.trigger("prepared",{content:i.data}),i.data},n.prototype.update=function(){for(var e=0,i=this._pipe.length,s=t.proxy(function(t){return this[t]},this._invalidated),n={};e<i;)(this._invalidated.all||t.grep(this._pipe[e].filter,s).length>0)&&this._pipe[e].run(n),e++;this._invalidated={},!this.is("valid")&&this.enter("valid")},n.prototype.width=function(t){switch(t=t||n.Width.Default){case n.Width.Inner:case n.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},n.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},n.prototype.onThrottledResize=function(){e.clearTimeout(this.resizeTimer),this.resizeTimer=e.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},n.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},n.prototype.registerEventHandlers=function(){t.support.transition&&this.$stage.on(t.support.transition.end+".owl.core",t.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(e,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",t.proxy(this.onDragEnd,this)))},n.prototype.onDragStart=function(e){var s=null;3!==e.which&&(t.support.transform?s={x:(s=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===s.length?12:4],y:s[16===s.length?13:5]}:(s=this.$stage.position(),s={x:this.settings.rtl?s.left+this.$stage.width()-this.width()+this.settings.margin:s.left,y:s.top}),this.is("animating")&&(t.support.transform?this.animate(s.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===e.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=t(e.target),this._drag.stage.start=s,this._drag.stage.current=s,this._drag.pointer=this.pointer(e),t(i).on("mouseup.owl.core touchend.owl.core",t.proxy(this.onDragEnd,this)),t(i).one("mousemove.owl.core touchmove.owl.core",t.proxy(function(e){var s=this.difference(this._drag.pointer,this.pointer(e));t(i).on("mousemove.owl.core touchmove.owl.core",t.proxy(this.onDragMove,this)),Math.abs(s.x)<Math.abs(s.y)&&this.is("valid")||(e.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},n.prototype.onDragMove=function(t){var e=null,i=null,s=null,n=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,n);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(e=this.coordinates(this.minimum()),i=this.coordinates(this.maximum()+1)-e,o.x=((o.x-e)%i+i)%i+e):(e=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),i=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),s=this.settings.pullDrag?-1*n.x/5:0,o.x=Math.max(Math.min(o.x,e+s),i+s)),this._drag.stage.current=o,this.animate(o.x))},n.prototype.onDragEnd=function(e){var s=this.difference(this._drag.pointer,this.pointer(e)),n=this._drag.stage.current,o=s.x>0^this.settings.rtl?"left":"right";t(i).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==s.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(n.x,0!==s.x?o:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=o,(Math.abs(s.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},n.prototype.closest=function(e,i){var s=-1,n=this.width(),o=this.coordinates();return this.settings.freeDrag||t.each(o,t.proxy(function(t,r){return"left"===i&&e>r-30&&e<r+30?s=t:"right"===i&&e>r-n-30&&e<r-n+30?s=t+1:this.op(e,"<",r)&&this.op(e,">",void 0!==o[t+1]?o[t+1]:r-n)&&(s="left"===i?t+1:t),-1===s},this)),this.settings.loop||(this.op(e,">",o[this.minimum()])?s=e=this.minimum():this.op(e,"<",o[this.maximum()])&&(s=e=this.maximum())),s},n.prototype.animate=function(e){var i=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),i&&(this.enter("animating"),this.trigger("translate")),t.support.transform3d&&t.support.transition?this.$stage.css({transform:"translate3d("+e+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):i?this.$stage.animate({left:e+"px"},this.speed(),this.settings.fallbackEasing,t.proxy(this.onTransitionEnd,this)):this.$stage.css({left:e+"px"})},n.prototype.is=function(t){return this._states.current[t]&&this._states.current[t]>0},n.prototype.current=function(t){if(void 0===t)return this._current;if(0!==this._items.length){if(t=this.normalize(t),this._current!==t){var e=this.trigger("change",{property:{name:"position",value:t}});void 0!==e.data&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current}},n.prototype.invalidate=function(e){return"string"===t.type(e)&&(this._invalidated[e]=!0,this.is("valid")&&this.leave("valid")),t.map(this._invalidated,function(t,e){return e})},n.prototype.reset=function(t){void 0!==(t=this.normalize(t))&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},n.prototype.normalize=function(t,e){var i=this._items.length,s=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=void 0:(t<0||t>=i+s)&&(t=((t-s/2)%i+i)%i+s/2),t},n.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},n.prototype.maximum=function(t){var e,i,s,n=this.settings,o=this._coordinates.length;if(n.loop)o=this._clones.length/2+this._items.length-1;else if(n.autoWidth||n.merge){if(e=this._items.length)for(i=this._items[--e].width(),s=this.$element.width();e--&&!((i+=this._items[e].width()+this.settings.margin)>s););o=e+1}else o=n.center?this._items.length-1:this._items.length-n.items;return t&&(o-=this._clones.length/2),Math.max(o,0)},n.prototype.minimum=function(t){return t?0:this._clones.length/2},n.prototype.items=function(t){return void 0===t?this._items.slice():(t=this.normalize(t,!0),this._items[t])},n.prototype.mergers=function(t){return void 0===t?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},n.prototype.clones=function(e){var i=this._clones.length/2,s=i+this._items.length,n=function(t){return t%2==0?s+t/2:i-(t+1)/2};return void 0===e?t.map(this._clones,function(t,e){return n(e)}):t.map(this._clones,function(t,i){return t===e?n(i):null})},n.prototype.speed=function(t){return void 0!==t&&(this._speed=t),this._speed},n.prototype.coordinates=function(e){var i,s=1,n=e-1;return void 0===e?t.map(this._coordinates,t.proxy(function(t,e){return this.coordinates(e)},this)):(this.settings.center?(this.settings.rtl&&(s=-1,n=e+1),i=this._coordinates[e],i+=(this.width()-i+(this._coordinates[n]||0))/2*s):i=this._coordinates[n]||0,i=Math.ceil(i))},n.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},n.prototype.to=function(t,e){var i=this.current(),s=null,n=t-this.relative(i),o=(n>0)-(n<0),r=this._items.length,a=this.minimum(),h=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(n)>r/2&&(n+=-1*o*r),(s=(((t=i+n)-a)%r+r)%r+a)!==t&&s-n<=h&&s-n>0&&(i=s-n,t=s,this.reset(i))):t=this.settings.rewind?(t%(h+=1)+h)%h:Math.max(a,Math.min(h,t)),this.speed(this.duration(i,t,e)),this.current(t),this.isVisible()&&this.update()},n.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},n.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},n.prototype.onTransitionEnd=function(t){if(void 0!==t&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},n.prototype.viewport=function(){var s;return this.options.responsiveBaseElement!==e?s=t(this.options.responsiveBaseElement).width():e.innerWidth?s=e.innerWidth:i.documentElement&&i.documentElement.clientWidth?s=i.documentElement.clientWidth:console.warn("Can not detect viewport width."),s},n.prototype.replace=function(e){this.$stage.empty(),this._items=[],e&&(e=e instanceof jQuery?e:t(e)),this.settings.nestedItemSelector&&(e=e.find("."+this.settings.nestedItemSelector)),e.filter(function(){return 1===this.nodeType}).each(t.proxy(function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},n.prototype.add=function(e,i){var s=this.relative(this._current);i=void 0===i?this._items.length:this.normalize(i,!0),e=e instanceof jQuery?e:t(e),this.trigger("add",{content:e,position:i}),e=this.prepare(e),0===this._items.length||i===this._items.length?(0===this._items.length&&this.$stage.append(e),0!==this._items.length&&this._items[i-1].after(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[i].before(e),this._items.splice(i,0,e),this._mergers.splice(i,0,1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[s]&&this.reset(this._items[s].index()),this.invalidate("items"),this.trigger("added",{content:e,position:i})},n.prototype.remove=function(t){void 0!==(t=this.normalize(t,!0))&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},n.prototype.preloadAutoWidthImages=function(e){e.each(t.proxy(function(e,i){this.enter("pre-loading"),i=t(i),t(new Image).one("load",t.proxy(function(t){i.attr("src",t.target.src),i.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",i.attr("src")||i.attr("data-src")||i.attr("data-src-retina"))},this))},n.prototype.destroy=function(){for(var s in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),t(i).off(".owl.core"),!1!==this.settings.responsive&&(e.clearTimeout(this.resizeTimer),this.off(e,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[s].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},n.prototype.op=function(t,e,i){var s=this.settings.rtl;switch(e){case"<":return s?t>i:t<i;case">":return s?t<i:t>i;case">=":return s?t<=i:t>=i;case"<=":return s?t>=i:t<=i}},n.prototype.on=function(t,e,i,s){t.addEventListener?t.addEventListener(e,i,s):t.attachEvent&&t.attachEvent("on"+e,i)},n.prototype.off=function(t,e,i,s){t.removeEventListener?t.removeEventListener(e,i,s):t.detachEvent&&t.detachEvent("on"+e,i)},n.prototype.trigger=function(e,i,s,o,r){var a={item:{count:this._items.length,index:this.current()}},h=t.camelCase(t.grep(["on",e,s],function(t){return t}).join("-").toLowerCase()),l=t.Event([e,"owl",s||"carousel"].join(".").toLowerCase(),t.extend({relatedTarget:this},a,i));return this._supress[e]||(t.each(this._plugins,function(t,e){e.onTrigger&&e.onTrigger(l)}),this.register({type:n.Type.Event,name:e}),this.$element.trigger(l),this.settings&&"function"==typeof this.settings[h]&&this.settings[h].call(this,l)),l},n.prototype.enter=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){void 0===this._states.current[e]&&(this._states.current[e]=0),this._states.current[e]++},this))},n.prototype.leave=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){this._states.current[e]--},this))},n.prototype.register=function(e){if(e.type===n.Type.Event){if(t.event.special[e.name]||(t.event.special[e.name]={}),!t.event.special[e.name].owl){var i=t.event.special[e.name]._default;t.event.special[e.name]._default=function(t){return!i||!i.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&t.namespace.indexOf("owl")>-1:i.apply(this,arguments)},t.event.special[e.name].owl=!0}}else e.type===n.Type.State&&(this._states.tags[e.name]?this._states.tags[e.name]=this._states.tags[e.name].concat(e.tags):this._states.tags[e.name]=e.tags,this._states.tags[e.name]=t.grep(this._states.tags[e.name],t.proxy(function(i,s){return t.inArray(i,this._states.tags[e.name])===s},this)))},n.prototype.suppress=function(e){t.each(e,t.proxy(function(t,e){this._supress[e]=!0},this))},n.prototype.release=function(e){t.each(e,t.proxy(function(t,e){delete this._supress[e]},this))},n.prototype.pointer=function(t){var i={x:null,y:null};return(t=(t=t.originalEvent||t||e.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i},n.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},n.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},t.fn.owlCarousel=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each(function(){var s=t(this),o=s.data("owl.carousel");o||(o=new n(this,"object"==typeof e&&e),s.data("owl.carousel",o),t.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(e,i){o.register({type:n.Type.Event,name:i}),o.$element.on(i+".owl.carousel.core",t.proxy(function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([i]),o[i].apply(this,[].slice.call(arguments,1)),this.release([i]))},o))})),"string"==typeof e&&"_"!==e.charAt(0)&&o[e].apply(o,i)})},t.fn.owlCarousel.Constructor=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={autoRefresh:!0,autoRefreshInterval:500},n.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=e.setInterval(t.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},n.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},n.prototype.destroy=function(){var t,i;for(t in e.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoRefresh=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":t.proxy(function(e){if(e.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(e.property&&"position"==e.property.name||"initialized"==e.type)){var i=this._core.settings,s=i.center&&Math.ceil(i.items/2)||i.items,n=i.center&&-1*s||0,o=(e.property&&void 0!==e.property.value?e.property.value:this._core.current())+n,r=this._core.clones().length,a=t.proxy(function(t,e){this.load(e)},this);for(i.lazyLoadEager>0&&(s+=i.lazyLoadEager,i.loop&&(o-=i.lazyLoadEager,s++));n++<s;)this.load(r/2+this._core.relative(o)),r&&t.each(this._core.clones(this._core.relative(o)),a),o++}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={lazyLoad:!1,lazyLoadEager:0},n.prototype.load=function(i){var s=this._core.$stage.children().eq(i),n=s&&s.find(".owl-lazy");!n||t.inArray(s.get(0),this._loaded)>-1||(n.each(t.proxy(function(i,s){var n,o=t(s),r=e.devicePixelRatio>1&&o.attr("data-src-retina")||o.attr("data-src")||o.attr("data-srcset");this._core.trigger("load",{element:o,url:r},"lazy"),o.is("img")?o.one("load.owl.lazy",t.proxy(function(){o.css("opacity",1),this._core.trigger("loaded",{element:o,url:r},"lazy")},this)).attr("src",r):o.is("source")?o.one("load.owl.lazy",t.proxy(function(){this._core.trigger("loaded",{element:o,url:r},"lazy")},this)).attr("srcset",r):((n=new Image).onload=t.proxy(function(){o.css({"background-image":'url("'+r+'")',opacity:"1"}),this._core.trigger("loaded",{element:o,url:r},"lazy")},this),n.src=r)},this)),this._loaded.push(s.get(0)))},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Lazy=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(i){this._core=i,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&"position"===t.property.name&&this.update()},this),"loaded.owl.lazy":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var s=this;t(e).on("load",function(){s._core.settings.autoHeight&&s.update()}),t(e).resize(function(){s._core.settings.autoHeight&&(null!=s._intervalId&&clearTimeout(s._intervalId),s._intervalId=setTimeout(function(){s.update()},250))})};n.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},n.prototype.update=function(){var e=this._core._current,i=e+this._core.settings.items,s=this._core.settings.lazyLoad,n=this._core.$stage.children().toArray().slice(e,i),o=[],r=0;t.each(n,function(e,i){o.push(t(i).height())}),(r=Math.max.apply(null,o))<=1&&s&&this._previousHeight&&(r=this._previousHeight),this._previousHeight=r,this._core.$stage.parent().height(r).addClass(this._core.settings.autoHeightClass)},n.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoHeight=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find(".owl-video");i.length&&(i.css("display","none"),this.fetch(i,t(e.content)))}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",t.proxy(function(t){this.play(t)},this))};n.Defaults={video:!1,videoHeight:!1,videoWidth:!1},n.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",s=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),n=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,r=t.attr("href");if(!r)throw new Error("Missing video URL.");if((s=r.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu")>-1)i="youtube";else if(s[3].indexOf("vimeo")>-1)i="vimeo";else{if(!(s[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");i="vzaar"}s=s[6],this._videos[r]={type:i,id:s,width:n,height:o},e.attr("data-video",r),this.thumbnail(t,this._videos[r])},n.prototype.thumbnail=function(e,i){var s,n,o=i.width&&i.height?"width:"+i.width+"px;height:"+i.height+"px;":"",r=e.find("img"),a="src",h="",l=this._core.settings,c=function(i){'<div class="owl-video-play-icon"></div>',s=l.lazyLoad?t("<div/>",{class:"owl-video-tn "+h,srcType:i}):t("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+i+")"}),e.after(s),e.after('<div class="owl-video-play-icon"></div>')};if(e.wrap(t("<div/>",{class:"owl-video-wrapper",style:o})),this._core.settings.lazyLoad&&(a="data-src",h="owl-lazy"),r.length)return c(r.attr(a)),r.remove(),!1;"youtube"===i.type?(n="//img.youtube.com/vi/"+i.id+"/hqdefault.jpg",c(n)):"vimeo"===i.type?t.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t[0].thumbnail_large,c(n)}}):"vzaar"===i.type&&t.ajax({type:"GET",url:"//vzaar.com/api/videos/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t.framegrab_url,c(n)}})},n.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},n.prototype.play=function(e){var i,s=t(e.target).closest("."+this._core.settings.itemClass),n=this._videos[s.attr("data-video")],o=n.width||"100%",r=n.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),s=this._core.items(this._core.relative(s.index())),this._core.reset(s.index()),(i=t('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>')).attr("height",r),i.attr("width",o),"youtube"===n.type?i.attr("src","//www.youtube.com/embed/"+n.id+"?autoplay=1&rel=0&v="+n.id):"vimeo"===n.type?i.attr("src","//player.vimeo.com/video/"+n.id+"?autoplay=1"):"vzaar"===n.type&&i.attr("src","//view.vzaar.com/"+n.id+"/player?autoplay=true"),t(i).wrap('<div class="owl-video-frame" />').insertAfter(s.find(".owl-video")),this._playing=s.addClass("owl-video-playing"))},n.prototype.isInFullScreen=function(){var e=i.fullscreenElement||i.mozFullScreenElement||i.webkitFullscreenElement;return e&&t(e).parent().hasClass("owl-video-frame")},n.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Video=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this.core=e,this.core.options=t.extend({},n.Defaults,this.core.options),this.swapping=!0,this.previous=void 0,this.next=void 0,this.handlers={"change.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":t.proxy(function(t){t.namespace&&(this.swapping="translated"==t.type)},this),"translate.owl.carousel":t.proxy(function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};n.Defaults={animateOut:!1,animateIn:!1},n.prototype.swap=function(){if(1===this.core.settings.items&&t.support.animation&&t.support.transition){this.core.speed(0);var e,i=t.proxy(this.clear,this),s=this.core.$stage.children().eq(this.previous),n=this.core.$stage.children().eq(this.next),o=this.core.settings.animateIn,r=this.core.settings.animateOut;this.core.current()!==this.previous&&(r&&(e=this.core.coordinates(this.previous)-this.core.coordinates(this.next),s.one(t.support.animation.end,i).css({left:e+"px"}).addClass("animated owl-animated-out").addClass(r)),o&&n.one(t.support.animation.end,i).addClass("animated owl-animated-in").addClass(o))}},n.prototype.clear=function(e){t(e.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Animate=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":t.proxy(function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":t.proxy(function(t,e,i){t.namespace&&this.play(e,i)},this),"stop.owl.autoplay":t.proxy(function(t){t.namespace&&this.stop()},this),"mouseover.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=t.extend({},n.Defaults,this._core.options)};n.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},n.prototype._next=function(s){this._call=e.setTimeout(t.proxy(this._next,this,s),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||i.hidden||this._core.next(s||this._core.settings.autoplaySpeed)},n.prototype.read=function(){return(new Date).getTime()-this._time},n.prototype.play=function(i,s){var n;this._core.is("rotating")||this._core.enter("rotating"),i=i||this._core.settings.autoplayTimeout,n=Math.min(this._time%(this._timeout||i),i),this._paused?(this._time=this.read(),this._paused=!1):e.clearTimeout(this._call),this._time+=this.read()%i-n,this._timeout=i,this._call=e.setTimeout(t.proxy(this._next,this,s),i-n)},n.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,e.clearTimeout(this._call),this._core.leave("rotating"))},n.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,e.clearTimeout(this._call))},n.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.autoplay=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(e){this._core=e,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":t.proxy(function(e){e.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+t(e.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())},this),"remove.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&this.draw()},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers)};n.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,changeItemOnClick:!1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},n.prototype.initialize=function(){var e,i=this._core.settings;if(this._controls.$relative=(i.navContainer?t(i.navContainer):t("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=t("<"+i.navElement+' value="previous item" title="previous item">').addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",t.proxy(function(t){this.prev(i.navSpeed)},this)),this._controls.$next=t("<"+i.navElement+' value="next item" title="next item">').addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",t.proxy(function(t){this.next(i.navSpeed)},this)),i.changeItemOnClick){var s=this._core.$stage.children(),n=this._core.clones().length/2;s.on("click",t.proxy(function(e){var s=t(e.currentTarget).index();this.to(s-n,i.navSpeed,!0)},this))}for(e in i.dotsData||(this._templates=[t('<button role="button">').addClass(i.dotClass).append(t("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",t.proxy(function(e){var s=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();console.log(t(e.target).index()),e.preventDefault(),this.to(s,i.dotsSpeed)},this)),this._overrides)this._core[e]=t.proxy(this[e],this)},n.prototype.destroy=function(){var t,e,i,s,n;for(t in n=this._core.settings,this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&n.navContainer?this._controls[e].html(""):this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},n.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),o=this._core.settings,r=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0,0;t<s;t++){if(e>=r||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+r-1}),Math.min(n,t-i)===n)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},n.prototype.draw=function(){var e,i=this._core.settings,s=this._core.items().length<=i.items,n=this._core.relative(this._core.current()),o=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||s),i.nav&&(this._controls.$previous.toggleClass("disabled",!o&&n<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!o&&n>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||s),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},n.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},n.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy(function(t,i){return t.start<=e&&t.end>=e},this)).pop()},n.prototype.getPosition=function(e){var i,s,n=this._core.settings;return"page"==n.slideBy?(i=t.inArray(this.current(),this._pages),s=this._pages.length,e?++i:--i,i=this._pages[(i%s+s)%s].start):(i=this._core.relative(this._core.current()),s=this._core.items().length,e?i+=n.slideBy:i-=n.slideBy),i},n.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},n.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},n.prototype.to=function(e,i,s){var n;!s&&this._pages.length?(n=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%n+n)%n].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.owlCarousel.Constructor.Plugins.Navigation=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy(function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}},this),"changed.owl.carousel":t.proxy(function(i){if(i.namespace&&"position"===i.property.name){var s=this._core.items(this._core.relative(this._core.current())),n=t.map(this._hashes,function(t,e){return t===s?e:null}).join();if(!n||e.location.hash.slice(1)===n)return;e.location.hash=n}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy(function(t){var i=e.location.hash.substring(1),s=this._core.$stage.children(),n=this._hashes[i]&&s.index(this._hashes[i]);void 0!==n&&n!==this._core.current()&&this._core.to(this._core.relative(n),!1,!0)},this))};n.Defaults={URLhashListener:!1},n.prototype.destroy=function(){var i,s;for(i in t(e).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(i,this._handlers[i]);for(s in Object.getOwnPropertyNames(this))"function"!=typeof this[s]&&(this[s]=null)},t.fn.owlCarousel.Constructor.Plugins.Hash=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=t("<support>").get(0).style,o="Webkit Moz O ms".split(" "),r={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},a=function(){return!!c("transform")},h=function(){return!!c("perspective")},l=function(){return!!c("animation")};function c(e,i){var r=!1,a=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+o.join(a+" ")+a).split(" "),function(t,e){if(n[e]!==s)return r=!i||e,!1}),r}function p(t){return c(t,!0)}(function(){return!!c("transition")})()&&(t.support.transition=new String(p("transition")),t.support.transition.end=r.transition.end[t.support.transition]),l()&&(t.support.animation=new String(p("animation")),t.support.animation.end=r.animation.end[t.support.animation]),a()&&(t.support.transform=new String(p("transform")),t.support.transform3d=h())}(window.Zepto||window.jQuery,window,document);
1
  /**
2
+ * Owl Carousel v2.3.6 - UE5
3
  * Copyright 2013-2018 David Deutsch
4
  * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
5
  */
15
  * @todo Test Zepto
16
  * @todo stagePadding calculate wrong active classes
17
  */
18
+ !function(t,e,i,s){function n(e,i){this.settings=null,this.options=t.extend({},n.Defaults,i),this.$element=t(e),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},t.each(["onResize","onThrottledResize"],t.proxy(function(e,i){this._handlers[i]=t.proxy(this[i],this)},this)),t.each(n.Plugins,t.proxy(function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)},this)),t.each(n.Workers,t.proxy(function(e,i){this._pipe.push({filter:i.filter,run:t.proxy(i.run,this)})},this)),this.setup(),this.initialize()}n.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,setActiveClass:!0,setActiveClassOnMobile:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,paddingType:"none",stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:e,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab",shuffle:!1},n.Width={Default:"default",Inner:"inner",Outer:"outer"},n.Type={Event:"event",State:"state"},n.Plugins={},n.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,s=this.settings.rtl,n={width:"auto","margin-left":s?e:"","margin-right":s?"":e};!i&&this.$stage.children().css(n),t.css=n}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,s=this._items.length,n=!this.settings.autoWidth,o=[];for(t.items={merge:!1,width:e};s--;)i=this._mergers[s],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=i>1||t.items.merge,o[s]=n?e*i:this._items[s].width();this._widths=o}},{filter:["items","settings"],run:function(){var e=[],i=this._items,s=this.settings,n=Math.max(2*s.items,4),o=2*Math.ceil(i.length/2),r=s.loop&&i.length?s.rewind?n:Math.max(n,o):0,a="",h="";for(r/=2;r>0;)e.push(this.normalize(e.length/2,!0)),a+=i[e[e.length-1]][0].outerHTML,e.push(this.normalize(i.length-1-(e.length-1)/2,!0)),h=i[e[e.length-1]][0].outerHTML+h,r-=1;this._clones=e,t(a).addClass("cloned").appendTo(this.$stage),t(h).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,s=0,n=0,o=[];++i<e;)s=o[i-1]||0,n=this._widths[this.relative(i)]+this.settings.margin,o.push(s+n*t);this._coordinates=o}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i={width:Math.ceil(Math.abs(e[e.length-1])),"padding-left":"","padding-right":""},s={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""},n={width:Math.ceil(Math.abs(e[e.length-1]))+t,"padding-left":t||"","padding-right":""},o={width:Math.ceil(Math.abs(e[e.length-1]))+t,"padding-left":"","padding-right":t||""},r=this.settings.paddingType;r||(r="none"),"none"==r?this.$stage.css(i):"both"==r?this.$stage.css(s):"left"==r?this.$stage.css(n):"right"==r&&this.$stage.css(o)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,s=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],s.eq(e).css(t.css);else i&&(t.css.width=t.items.width,s.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,s,n=this.settings.rtl?1:-1,o=2*this.settings.stagePadding,r=this.coordinates(this.current())+o,a=r+this.width()*n,h=[];for("left"!=this.settings.paddingType&&"right"!=this.settings.paddingType||(o=this.settings.stagePadding),i=0,s=this._coordinates.length;i<s;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+o*n,(this.op(t,"<=",r)&&this.op(t,">",a)||this.op(e,"<",r)&&this.op(e,">",a))&&h.push(i);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+h.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}},{filter:["width","position","items","settings"],run:function(){if(this.settings.setActiveClass&&this.settings.setActiveClass){var t=!0;this.settings.setActiveClassOnMobile?1==this.$stage.children(".active").length&&(t=!0):this.settings.setActiveClassOnMobile||1==this.$stage.children(".active").length&&(t=!1),1==t?this.$stage.children().eq(this.current()).addClass("uc-active-item").siblings().removeClass("uc-active-item"):0==t&&this.$stage.children().removeClass("uc-active-item")}}}],n.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=t("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(t("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},n.prototype.initializeItems=function(){var e=this.$element.find(".owl-item");if(e.length)return this._items=e.get().map(function(e){return t(e)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},n.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.shuffle){var t=this.$element;t.children().sort(function(){return Math.round(Math.random())-.5}).each(function(){t.append(this)})}var e,i,s;this.settings.autoWidth&&!this.is("pre-loading")&&(e=this.$element.find("img"),i=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:void 0,s=this.$element.children(i).width(),e.length&&s<=0&&this.preloadAutoWidthImages(e));this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},n.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},n.prototype.setup=function(){var e=this.viewport(),i=this.options.responsive,s=-1,n=null;i?(t.each(i,function(t){t<=e&&t>s&&(s=Number(t))}),"function"==typeof(n=t.extend({},this.options,i[s])).stagePadding&&(n.stagePadding=n.stagePadding()),delete n.responsive,n.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+s))):n=t.extend({},this.options),this.trigger("change",{property:{name:"settings",value:n}}),this._breakpoint=s,this.settings=n,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},n.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},n.prototype.prepare=function(e){var i=this.trigger("prepare",{content:e});return i.data||(i.data=t("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(e)),this.trigger("prepared",{content:i.data}),i.data},n.prototype.update=function(){for(var e=0,i=this._pipe.length,s=t.proxy(function(t){return this[t]},this._invalidated),n={};e<i;)(this._invalidated.all||t.grep(this._pipe[e].filter,s).length>0)&&this._pipe[e].run(n),e++;this._invalidated={},!this.is("valid")&&this.enter("valid")},n.prototype.width=function(t){switch(t=t||n.Width.Default){case n.Width.Inner:case n.Width.Outer:return this._width;default:return"left"==this.settings.paddingType||"right"==this.settings.paddingType?this._width-this.settings.stagePadding+this.settings.margin:this._width-2*this.settings.stagePadding+this.settings.margin}},n.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},n.prototype.onThrottledResize=function(){e.clearTimeout(this.resizeTimer),this.resizeTimer=e.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},n.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},n.prototype.registerEventHandlers=function(){t.support.transition&&this.$stage.on(t.support.transition.end+".owl.core",t.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(e,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",t.proxy(this.onDragEnd,this)))},n.prototype.onDragStart=function(e){var s=null;3!==e.which&&(t.support.transform?s={x:(s=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===s.length?12:4],y:s[16===s.length?13:5]}:(s=this.$stage.position(),s={x:this.settings.rtl?s.left+this.$stage.width()-this.width()+this.settings.margin:s.left,y:s.top}),this.is("animating")&&(t.support.transform?this.animate(s.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===e.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=t(e.target),this._drag.stage.start=s,this._drag.stage.current=s,this._drag.pointer=this.pointer(e),t(i).on("mouseup.owl.core touchend.owl.core",t.proxy(this.onDragEnd,this)),t(i).one("mousemove.owl.core touchmove.owl.core",t.proxy(function(e){var s=this.difference(this._drag.pointer,this.pointer(e));t(i).on("mousemove.owl.core touchmove.owl.core",t.proxy(this.onDragMove,this)),Math.abs(s.x)<Math.abs(s.y)&&this.is("valid")||(e.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},n.prototype.onDragMove=function(t){var e=null,i=null,s=null,n=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,n);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(e=this.coordinates(this.minimum()),i=this.coordinates(this.maximum()+1)-e,o.x=((o.x-e)%i+i)%i+e):(e=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),i=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),s=this.settings.pullDrag?-1*n.x/5:0,o.x=Math.max(Math.min(o.x,e+s),i+s)),this._drag.stage.current=o,this.animate(o.x))},n.prototype.onDragEnd=function(e){var s=this.difference(this._drag.pointer,this.pointer(e)),n=this._drag.stage.current,o=s.x>0^this.settings.rtl?"left":"right";t(i).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==s.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(n.x,0!==s.x?o:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=o,(Math.abs(s.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},n.prototype.closest=function(e,i){var s=-1,n=this.width(),o=this.coordinates();return this.settings.freeDrag||t.each(o,t.proxy(function(t,r){return"left"===i&&e>r-30&&e<r+30?s=t:"right"===i&&e>r-n-30&&e<r-n+30?s=t+1:this.op(e,"<",r)&&this.op(e,">",void 0!==o[t+1]?o[t+1]:r-n)&&(s="left"===i?t+1:t),-1===s},this)),this.settings.loop||(this.op(e,">",o[this.minimum()])?s=e=this.minimum():this.op(e,"<",o[this.maximum()])&&(s=e=this.maximum())),s},n.prototype.animate=function(e){var i=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),i&&(this.enter("animating"),this.trigger("translate")),t.support.transform3d&&t.support.transition?this.$stage.css({transform:"translate3d("+(e-1)+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):i?this.$stage.animate({left:e+"px"},this.speed(),this.settings.fallbackEasing,t.proxy(this.onTransitionEnd,this)):this.$stage.css({left:e+"px"})},n.prototype.is=function(t){return this._states.current[t]&&this._states.current[t]>0},n.prototype.current=function(t){if(void 0===t)return this._current;if(0!==this._items.length){if(t=this.normalize(t),this._current!==t){var e=this.trigger("change",{property:{name:"position",value:t}});void 0!==e.data&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current}},n.prototype.invalidate=function(e){return"string"===t.type(e)&&(this._invalidated[e]=!0,this.is("valid")&&this.leave("valid")),t.map(this._invalidated,function(t,e){return e})},n.prototype.reset=function(t){void 0!==(t=this.normalize(t))&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},n.prototype.normalize=function(t,e){var i=this._items.length,s=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=void 0:(t<0||t>=i+s)&&(t=((t-s/2)%i+i)%i+s/2),t},n.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},n.prototype.maximum=function(t){var e,i,s,n=this.settings,o=this._coordinates.length;if(n.loop)o=this._clones.length/2+this._items.length-1;else if(n.autoWidth||n.merge){if(e=this._items.length)for(i=this._items[--e].width(),s=this.$element.width();e--&&!((i+=this._items[e].width()+this.settings.margin)>s););o=e+1}else o=n.center?this._items.length-1:this._items.length-n.items;return t&&(o-=this._clones.length/2),Math.max(o,0)},n.prototype.minimum=function(t){return t?0:this._clones.length/2},n.prototype.items=function(t){return void 0===t?this._items.slice():(t=this.normalize(t,!0),this._items[t])},n.prototype.mergers=function(t){return void 0===t?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},n.prototype.clones=function(e){var i=this._clones.length/2,s=i+this._items.length,n=function(t){return t%2==0?s+t/2:i-(t+1)/2};return void 0===e?t.map(this._clones,function(t,e){return n(e)}):t.map(this._clones,function(t,i){return t===e?n(i):null})},n.prototype.speed=function(t){return void 0!==t&&(this._speed=t),this._speed},n.prototype.coordinates=function(e){var i,s=1,n=e-1;return void 0===e?t.map(this._coordinates,t.proxy(function(t,e){return this.coordinates(e)},this)):(this.settings.center?(this.settings.rtl&&(s=-1,n=e+1),i=this._coordinates[e],i+=(this.width()-i+(this._coordinates[n]||0))/2*s):i=this._coordinates[n]||0,i=Math.ceil(i))},n.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},n.prototype.to=function(t,e){var i=this.current(),s=null,n=t-this.relative(i),o=(n>0)-(n<0),r=this._items.length,a=this.minimum(),h=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(n)>r/2&&(n+=-1*o*r),(s=(((t=i+n)-a)%r+r)%r+a)!==t&&s-n<=h&&s-n>0&&(i=s-n,t=s,this.reset(i))):t=this.settings.rewind?(t%(h+=1)+h)%h:Math.max(a,Math.min(h,t)),this.speed(this.duration(i,t,e)),this.current(t),this.isVisible()&&this.update()},n.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},n.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},n.prototype.onTransitionEnd=function(t){if(void 0!==t&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},n.prototype.viewport=function(){var s;return this.options.responsiveBaseElement!==e?s=t(this.options.responsiveBaseElement).width():e.innerWidth?s=e.innerWidth:i.documentElement&&i.documentElement.clientWidth?s=i.documentElement.clientWidth:console.warn("Can not detect viewport width."),s},n.prototype.replace=function(e){this.$stage.empty(),this._items=[],e&&(e=e instanceof jQuery?e:t(e)),this.settings.nestedItemSelector&&(e=e.find("."+this.settings.nestedItemSelector)),e.filter(function(){return 1===this.nodeType}).each(t.proxy(function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},n.prototype.add=function(e,i){var s=this.relative(this._current);i=void 0===i?this._items.length:this.normalize(i,!0),e=e instanceof jQuery?e:t(e),this.trigger("add",{content:e,position:i}),e=this.prepare(e),0===this._items.length||i===this._items.length?(0===this._items.length&&this.$stage.append(e),0!==this._items.length&&this._items[i-1].after(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[i].before(e),this._items.splice(i,0,e),this._mergers.splice(i,0,1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[s]&&this.reset(this._items[s].index()),this.invalidate("items"),this.trigger("added",{content:e,position:i})},n.prototype.remove=function(t){void 0!==(t=this.normalize(t,!0))&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},n.prototype.preloadAutoWidthImages=function(e){e.each(t.proxy(function(e,i){this.enter("pre-loading"),i=t(i),t(new Image).one("load",t.proxy(function(t){i.attr("src",t.target.src),i.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",i.attr("src")||i.attr("data-src")||i.attr("data-src-retina"))},this))},n.prototype.destroy=function(){for(var s in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),t(i).off(".owl.core"),!1!==this.settings.responsive&&(e.clearTimeout(this.resizeTimer),this.off(e,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[s].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},n.prototype.op=function(t,e,i){var s=this.settings.rtl;switch(e){case"<":return s?t>i:t<i;case">":return s?t<i:t>i;case">=":return s?t<=i:t>=i;case"<=":return s?t>=i:t<=i}},n.prototype.on=function(t,e,i,s){t.addEventListener?t.addEventListener(e,i,s):t.attachEvent&&t.attachEvent("on"+e,i)},n.prototype.off=function(t,e,i,s){t.removeEventListener?t.removeEventListener(e,i,s):t.detachEvent&&t.detachEvent("on"+e,i)},n.prototype.trigger=function(e,i,s,o,r){var a={item:{count:this._items.length,index:this.current()}},h=t.camelCase(t.grep(["on",e,s],function(t){return t}).join("-").toLowerCase()),l=t.Event([e,"owl",s||"carousel"].join(".").toLowerCase(),t.extend({relatedTarget:this},a,i));return this._supress[e]||(t.each(this._plugins,function(t,e){e.onTrigger&&e.onTrigger(l)}),this.register({type:n.Type.Event,name:e}),this.$element.trigger(l),this.settings&&"function"==typeof this.settings[h]&&this.settings[h].call(this,l)),l},n.prototype.enter=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){void 0===this._states.current[e]&&(this._states.current[e]=0),this._states.current[e]++},this))},n.prototype.leave=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){this._states.current[e]--},this))},n.prototype.register=function(e){if(e.type===n.Type.Event){if(t.event.special[e.name]||(t.event.special[e.name]={}),!t.event.special[e.name].owl){var i=t.event.special[e.name]._default;t.event.special[e.name]._default=function(t){return!i||!i.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&t.namespace.indexOf("owl")>-1:i.apply(this,arguments)},t.event.special[e.name].owl=!0}}else e.type===n.Type.State&&(this._states.tags[e.name]?this._states.tags[e.name]=this._states.tags[e.name].concat(e.tags):this._states.tags[e.name]=e.tags,this._states.tags[e.name]=t.grep(this._states.tags[e.name],t.proxy(function(i,s){return t.inArray(i,this._states.tags[e.name])===s},this)))},n.prototype.suppress=function(e){t.each(e,t.proxy(function(t,e){this._supress[e]=!0},this))},n.prototype.release=function(e){t.each(e,t.proxy(function(t,e){delete this._supress[e]},this))},n.prototype.pointer=function(t){var i={x:null,y:null};return(t=(t=t.originalEvent||t||e.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i},n.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},n.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},t.fn.owlCarousel=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each(function(){var s=t(this),o=s.data("owl.carousel");o||(o=new n(this,"object"==typeof e&&e),s.data("owl.carousel",o),t.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(e,i){o.register({type:n.Type.Event,name:i}),o.$element.on(i+".owl.carousel.core",t.proxy(function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([i]),o[i].apply(this,[].slice.call(arguments,1)),this.release([i]))},o))})),"string"==typeof e&&"_"!==e.charAt(0)&&o[e].apply(o,i)})},t.fn.owlCarousel.Constructor=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={autoRefresh:!0,autoRefreshInterval:500},n.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=e.setInterval(t.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},n.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},n.prototype.destroy=function(){var t,i;for(t in e.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoRefresh=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":t.proxy(function(e){if(e.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(e.property&&"position"==e.property.name||"initialized"==e.type)){var i=this._core.settings,s=i.center&&Math.ceil(i.items/2)||i.items,n=i.center&&-1*s||0,o=(e.property&&void 0!==e.property.value?e.property.value:this._core.current())+n,r=this._core.clones().length,a=t.proxy(function(t,e){this.load(e)},this);for(i.lazyLoadEager>0&&(s+=i.lazyLoadEager,i.loop&&(o-=i.lazyLoadEager,s++));n++<s;)this.load(r/2+this._core.relative(o)),r&&t.each(this._core.clones(this._core.relative(o)),a),o++}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={lazyLoad:!1,lazyLoadEager:0},n.prototype.load=function(i){var s=this._core.$stage.children().eq(i),n=s&&s.find(".owl-lazy");!n||t.inArray(s.get(0),this._loaded)>-1||(n.each(t.proxy(function(i,s){var n,o=t(s),r=e.devicePixelRatio>1&&o.attr("data-src-retina")||o.attr("data-src")||o.attr("data-srcset");this._core.trigger("load",{element:o,url:r},"lazy"),o.is("img")?o.one("load.owl.lazy",t.proxy(function(){o.css("opacity",1),this._core.trigger("loaded",{element:o,url:r},"lazy")},this)).attr("src",r):o.is("source")?o.one("load.owl.lazy",t.proxy(function(){this._core.trigger("loaded",{element:o,url:r},"lazy")},this)).attr("srcset",r):((n=new Image).onload=t.proxy(function(){o.css({"background-image":'url("'+r+'")',opacity:"1"}),this._core.trigger("loaded",{element:o,url:r},"lazy")},this),n.src=r)},this)),this._loaded.push(s.get(0)))},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Lazy=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(i){this._core=i,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&"position"===t.property.name&&this.update()},this),"loaded.owl.lazy":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var s=this;t(e).on("load",function(){s._core.settings.autoHeight&&s.update()}),t(e).resize(function(){s._core.settings.autoHeight&&(null!=s._intervalId&&clearTimeout(s._intervalId),s._intervalId=setTimeout(function(){s.update()},250))})};n.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},n.prototype.update=function(){var e=this._core._current,i=e+this._core.settings.items,s=this._core.settings.lazyLoad,n=this._core.$stage.children().toArray().slice(e,i),o=[],r=0;t.each(n,function(e,i){o.push(t(i).height())}),(r=Math.max.apply(null,o))<=1&&s&&this._previousHeight&&(r=this._previousHeight),this._previousHeight=r,this._core.$stage.parent().height(r).addClass(this._core.settings.autoHeightClass)},n.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoHeight=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find(".owl-video");i.length&&(i.css("display","none"),this.fetch(i,t(e.content)))}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",t.proxy(function(t){this.play(t)},this))};n.Defaults={video:!1,videoHeight:!1,videoWidth:!1},n.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",s=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),n=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,r=t.attr("href");if(!r)throw new Error("Missing video URL.");if((s=r.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu")>-1)i="youtube";else if(s[3].indexOf("vimeo")>-1)i="vimeo";else{if(!(s[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");i="vzaar"}s=s[6],this._videos[r]={type:i,id:s,width:n,height:o},e.attr("data-video",r),this.thumbnail(t,this._videos[r])},n.prototype.thumbnail=function(e,i){var s,n,o=i.width&&i.height?"width:"+i.width+"px;height:"+i.height+"px;":"",r=e.find("img"),a="src",h="",l=this._core.settings,c=function(i){'<div class="owl-video-play-icon"></div>',s=l.lazyLoad?t("<div/>",{class:"owl-video-tn "+h,srcType:i}):t("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+i+")"}),e.after(s),e.after('<div class="owl-video-play-icon"></div>')};if(e.wrap(t("<div/>",{class:"owl-video-wrapper",style:o})),this._core.settings.lazyLoad&&(a="data-src",h="owl-lazy"),r.length)return c(r.attr(a)),r.remove(),!1;"youtube"===i.type?(n="//img.youtube.com/vi/"+i.id+"/hqdefault.jpg",c(n)):"vimeo"===i.type?t.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t[0].thumbnail_large,c(n)}}):"vzaar"===i.type&&t.ajax({type:"GET",url:"//vzaar.com/api/videos/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t.framegrab_url,c(n)}})},n.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},n.prototype.play=function(e){var i,s=t(e.target).closest("."+this._core.settings.itemClass),n=this._videos[s.attr("data-video")],o=n.width||"100%",r=n.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),s=this._core.items(this._core.relative(s.index())),this._core.reset(s.index()),(i=t('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>')).attr("height",r),i.attr("width",o),"youtube"===n.type?i.attr("src","//www.youtube.com/embed/"+n.id+"?autoplay=1&rel=0&v="+n.id):"vimeo"===n.type?i.attr("src","//player.vimeo.com/video/"+n.id+"?autoplay=1"):"vzaar"===n.type&&i.attr("src","//view.vzaar.com/"+n.id+"/player?autoplay=true"),t(i).wrap('<div class="owl-video-frame" />').insertAfter(s.find(".owl-video")),this._playing=s.addClass("owl-video-playing"))},n.prototype.isInFullScreen=function(){var e=i.fullscreenElement||i.mozFullScreenElement||i.webkitFullscreenElement;return e&&t(e).parent().hasClass("owl-video-frame")},n.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Video=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this.core=e,this.core.options=t.extend({},n.Defaults,this.core.options),this.swapping=!0,this.previous=void 0,this.next=void 0,this.handlers={"change.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":t.proxy(function(t){t.namespace&&(this.swapping="translated"==t.type)},this),"translate.owl.carousel":t.proxy(function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};n.Defaults={animateOut:!1,animateIn:!1},n.prototype.swap=function(){if(1===this.core.settings.items&&t.support.animation&&t.support.transition){this.core.speed(0);var e,i=t.proxy(this.clear,this),s=this.core.$stage.children().eq(this.previous),n=this.core.$stage.children().eq(this.next),o=this.core.settings.animateIn,r=this.core.settings.animateOut;this.core.current()!==this.previous&&(r&&(e=this.core.coordinates(this.previous)-this.core.coordinates(this.next),s.one(t.support.animation.end,i).css({left:e+"px"}).addClass("animated owl-animated-out").addClass(r)),o&&n.one(t.support.animation.end,i).addClass("animated owl-animated-in").addClass(o))}},n.prototype.clear=function(e){t(e.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Animate=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":t.proxy(function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":t.proxy(function(t,e,i){t.namespace&&this.play(e,i)},this),"stop.owl.autoplay":t.proxy(function(t){t.namespace&&this.stop()},this),"mouseover.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=t.extend({},n.Defaults,this._core.options)};n.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},n.prototype._next=function(s){this._call=e.setTimeout(t.proxy(this._next,this,s),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||i.hidden||this._core.next(s||this._core.settings.autoplaySpeed)},n.prototype.read=function(){return(new Date).getTime()-this._time},n.prototype.play=function(i,s){var n;this._core.is("rotating")||this._core.enter("rotating"),i=i||this._core.settings.autoplayTimeout,n=Math.min(this._time%(this._timeout||i),i),this._paused?(this._time=this.read(),this._paused=!1):e.clearTimeout(this._call),this._time+=this.read()%i-n,this._timeout=i,this._call=e.setTimeout(t.proxy(this._next,this,s),i-n)},n.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,e.clearTimeout(this._call),this._core.leave("rotating"))},n.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,e.clearTimeout(this._call))},n.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.autoplay=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(e){this._core=e,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":t.proxy(function(e){e.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+t(e.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())},this),"remove.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&this.draw()},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers)};n.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,changeItemOnClick:!1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},n.prototype.initialize=function(){var e,i=this._core.settings;if(this._controls.$relative=(i.navContainer?t(i.navContainer):t("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=t("<"+i.navElement+' value="previous item" title="previous item">').addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",t.proxy(function(t){this.prev(i.navSpeed)},this)),this._controls.$next=t("<"+i.navElement+' value="next item" title="next item">').addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",t.proxy(function(t){this.next(i.navSpeed)},this)),i.changeItemOnClick){var s=this._core.$stage.children(),n=this._core.clones().length/2;s.on("click",t.proxy(function(e){var s=t(e.currentTarget).index();this.to(s-n,i.navSpeed,!0)},this))}for(e in i.dotsData||(this._templates=[t('<button role="button">').addClass(i.dotClass).append(t("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",t.proxy(function(e){var s=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();console.log(t(e.target).index()),e.preventDefault(),this.to(s,i.dotsSpeed)},this)),this._overrides)this._core[e]=t.proxy(this[e],this)},n.prototype.destroy=function(){var t,e,i,s,n;for(t in n=this._core.settings,this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&n.navContainer?this._controls[e].html(""):this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},n.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),o=this._core.settings,r=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0,0;t<s;t++){if(e>=r||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+r-1}),Math.min(n,t-i)===n)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},n.prototype.draw=function(){var e,i=this._core.settings,s=this._core.items().length<=i.items,n=this._core.relative(this._core.current()),o=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||s),i.nav&&(this._controls.$previous.toggleClass("disabled",!o&&n<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!o&&n>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||s),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},n.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},n.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy(function(t,i){return t.start<=e&&t.end>=e},this)).pop()},n.prototype.getPosition=function(e){var i,s,n=this._core.settings;return"page"==n.slideBy?(i=t.inArray(this.current(),this._pages),s=this._pages.length,e?++i:--i,i=this._pages[(i%s+s)%s].start):(i=this._core.relative(this._core.current()),s=this._core.items().length,e?i+=n.slideBy:i-=n.slideBy),i},n.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},n.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},n.prototype.to=function(e,i,s){var n;!s&&this._pages.length?(n=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%n+n)%n].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.owlCarousel.Constructor.Plugins.Navigation=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy(function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}},this),"changed.owl.carousel":t.proxy(function(i){if(i.namespace&&"position"===i.property.name){var s=this._core.items(this._core.relative(this._core.current())),n=t.map(this._hashes,function(t,e){return t===s?e:null}).join();if(!n||e.location.hash.slice(1)===n)return;e.location.hash=n}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy(function(t){var i=e.location.hash.substring(1),s=this._core.$stage.children(),n=this._hashes[i]&&s.index(this._hashes[i]);void 0!==n&&n!==this._core.current()&&this._core.to(this._core.relative(n),!1,!0)},this))};n.Defaults={URLhashListener:!1},n.prototype.destroy=function(){var i,s;for(i in t(e).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(i,this._handlers[i]);for(s in Object.getOwnPropertyNames(this))"function"!=typeof this[s]&&(this[s]=null)},t.fn.owlCarousel.Constructor.Plugins.Hash=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=t("<support>").get(0).style,o="Webkit Moz O ms".split(" "),r={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},a=function(){return!!c("transform")},h=function(){return!!c("perspective")},l=function(){return!!c("animation")};function c(e,i){var r=!1,a=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+o.join(a+" ")+a).split(" "),function(t,e){if(n[e]!==s)return r=!i||e,!1}),r}function p(t){return c(t,!0)}(function(){return!!c("transition")})()&&(t.support.transition=new String(p("transition")),t.support.transition.end=r.transition.end[t.support.transition]),l()&&(t.support.animation=new String(p("animation")),t.support.animation.end=r.animation.end[t.support.animation]),a()&&(t.support.transform=new String(p("transform")),t.support.transform3d=h())}(window.Zepto||window.jQuery,window,document);
 
assets_libraries/remote/ue-remote-controls.js CHANGED
@@ -664,7 +664,7 @@ function UERemoteCarouselAPI(){
664
  }
665
  return(owlTotalItems);
666
 
667
- break;
668
  case "get_current_text":
669
 
670
  var owlCurrentItem = g_owl.relative(g_owl.current()) + 1;
@@ -770,7 +770,7 @@ function UERemoteCarouselAPI(){
770
  g_owlCarousel = objParent;
771
 
772
  g_owl = g_owlCarousel.data("owl.carousel");
773
-
774
  if(!g_owl)
775
  return(false);
776
 
@@ -1361,7 +1361,6 @@ function UERemoteWidgets(){
1361
  throw new Error("No parent type found");
1362
  }
1363
 
1364
-
1365
  //init the api
1366
  switch(parentType){
1367
  case g_types.CAROUSEL:
664
  }
665
  return(owlTotalItems);
666
 
667
+ break;
668
  case "get_current_text":
669
 
670
  var owlCurrentItem = g_owl.relative(g_owl.current()) + 1;
770
  g_owlCarousel = objParent;
771
 
772
  g_owl = g_owlCarousel.data("owl.carousel");
773
+
774
  if(!g_owl)
775
  return(false);
776
 
1361
  throw new Error("No parent type found");
1362
  }
1363
 
 
1364
  //init the api
1365
  switch(parentType){
1366
  case g_types.CAROUSEL:
assets_libraries/unitegallery/js/unitegallery.js CHANGED
@@ -1,4 +1,4 @@
1
- //Unite Gallery, Version: 1.7.56, released 23 February 2022
2
 
3
  //------ ug-common-libraries.js------
4
 
@@ -13814,7 +13814,7 @@ function UGSlider(){
13814
  var slideSize = g_functions.getElementSize(objCurrentSlide);
13815
  var left = slideSize.left;
13816
  var top = slideSize.top;
13817
-
13818
  //set by image position
13819
  if(g_options.slider_video_constantsize == true){
13820
 
@@ -13826,13 +13826,16 @@ function UGSlider(){
13826
 
13827
  left += g_options.slider_video_padding_left;
13828
  top += g_options.slider_video_padding_top;
13829
-
13830
  }
13831
 
 
 
13832
  g_objVideoPlayer.setPosition(left, top);
13833
  }
13834
 
13835
 
 
13836
  /**
13837
  * set video player constant size
13838
  */
@@ -19733,6 +19736,7 @@ var g_ugWistiaAPI = new UGWistiaAPI();
19733
  * prototype gallery funciton
19734
  */
19735
  jQuery.fn.unitegallery = function(options){
 
19736
  var element = jQuery(this);
19737
  var galleryID = "#" + element.attr("id");
19738
 
@@ -22175,7 +22179,7 @@ function UniteGalleryMain(){
22175
  * add items
22176
  */
22177
  this.addItems = function(itemsContent){
22178
-
22179
  if(!itemsContent || itemsContent.length == 0)
22180
  return(false);
22181
 
@@ -22514,7 +22518,7 @@ function UGLightbox(){
22514
  lightbox_slider_image_padding_top: g_temp.topPanelHeight,
22515
  lightbox_slider_image_padding_bottom: 0,
22516
 
22517
- lightbox_slider_video_padding_top: 0,
22518
  lightbox_slider_video_padding_bottom: 0,
22519
 
22520
  lightbox_textpanel_align: "middle",
@@ -22641,7 +22645,7 @@ function UGLightbox(){
22641
  classAddition = " ug-lightbox-compact";
22642
  }
22643
 
22644
- html += "<div class='ug-gallery-wrapper ug-lightbox"+classAddition+"'>";
22645
  html += "<div class='ug-lightbox-overlay'></div>";
22646
 
22647
  //set top panel only on wide mode
@@ -22662,12 +22666,12 @@ function UGLightbox(){
22662
  }
22663
 
22664
 
22665
- html += "<div class='ug-lightbox-button-close'></div>";
22666
 
22667
  html += "<div class='ug-lightbox-arrow-left'></div>";
22668
  html += "<div class='ug-lightbox-arrow-right'></div>";
22669
 
22670
- html += "</div>";
22671
 
22672
  g_objWrapper = jQuery(html);
22673
 
@@ -22752,7 +22756,7 @@ function UGLightbox(){
22752
  var objOptions = {
22753
  slider_image_padding_top: newHeight
22754
  };
22755
-
22756
  g_objSlider.setOptions(objOptions);
22757
  g_objSlider.refreshSlideItems();
22758
 
@@ -22794,7 +22798,7 @@ function UGLightbox(){
22794
 
22795
  if(panelHeight != newPanelHeight){
22796
  g_objTopPanel.height(newPanelHeight);
22797
-
22798
  if(g_objSlider && g_objSlider.isAnimating() == false)
22799
  refreshSliderItem(newPanelHeight);
22800
  }
@@ -23242,7 +23246,7 @@ function UGLightbox(){
23242
  var sliderHeight = size.height;
23243
  var sliderTop = 0;
23244
  var sliderLeft = 0;
23245
-
23246
  if(g_objSlider){
23247
 
23248
  if(g_objTopPanel){
@@ -23809,7 +23813,7 @@ function UGLightbox(){
23809
  g_gallery.setNextButton(g_objArrowRight);
23810
  g_gallery.setPrevButton(g_objArrowLeft);
23811
 
23812
- g_objButtonClose.click(function(){
23813
  t.close("button");
23814
  });
23815
 
@@ -25670,6 +25674,22 @@ function UG_API(gallery){
25670
 
25671
  }
25672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25673
 
25674
  /**
25675
  * destroy the gallery
1
+ //Unite Gallery, Version: 1.7.57, released 21 March 2022
2
 
3
  //------ ug-common-libraries.js------
4
 
13814
  var slideSize = g_functions.getElementSize(objCurrentSlide);
13815
  var left = slideSize.left;
13816
  var top = slideSize.top;
13817
+
13818
  //set by image position
13819
  if(g_options.slider_video_constantsize == true){
13820
 
13826
 
13827
  left += g_options.slider_video_padding_left;
13828
  top += g_options.slider_video_padding_top;
13829
+
13830
  }
13831
 
13832
+ trace("video top: "+top);
13833
+
13834
  g_objVideoPlayer.setPosition(left, top);
13835
  }
13836
 
13837
 
13838
+
13839
  /**
13840
  * set video player constant size
13841
  */
19736
  * prototype gallery funciton
19737
  */
19738
  jQuery.fn.unitegallery = function(options){
19739
+
19740
  var element = jQuery(this);
19741
  var galleryID = "#" + element.attr("id");
19742
 
22179
  * add items
22180
  */
22181
  this.addItems = function(itemsContent){
22182
+
22183
  if(!itemsContent || itemsContent.length == 0)
22184
  return(false);
22185
 
22518
  lightbox_slider_image_padding_top: g_temp.topPanelHeight,
22519
  lightbox_slider_image_padding_bottom: 0,
22520
 
22521
+ lightbox_slider_video_padding_top: 38,
22522
  lightbox_slider_video_padding_bottom: 0,
22523
 
22524
  lightbox_textpanel_align: "middle",
22645
  classAddition = " ug-lightbox-compact";
22646
  }
22647
 
22648
+ html += "<div class='ug-gallery-wrapper ug-lightbox"+classAddition+"' >";
22649
  html += "<div class='ug-lightbox-overlay'></div>";
22650
 
22651
  //set top panel only on wide mode
22666
  }
22667
 
22668
 
22669
+ html += "<div href=\"javascript:void(0)\" class='ug-lightbox-button-close'></div>";
22670
 
22671
  html += "<div class='ug-lightbox-arrow-left'></div>";
22672
  html += "<div class='ug-lightbox-arrow-right'></div>";
22673
 
22674
+ html += "</div>"; //lightbox wrapper
22675
 
22676
  g_objWrapper = jQuery(html);
22677
 
22756
  var objOptions = {
22757
  slider_image_padding_top: newHeight
22758
  };
22759
+
22760
  g_objSlider.setOptions(objOptions);
22761
  g_objSlider.refreshSlideItems();
22762
 
22798
 
22799
  if(panelHeight != newPanelHeight){
22800
  g_objTopPanel.height(newPanelHeight);
22801
+
22802
  if(g_objSlider && g_objSlider.isAnimating() == false)
22803
  refreshSliderItem(newPanelHeight);
22804
  }
23246
  var sliderHeight = size.height;
23247
  var sliderTop = 0;
23248
  var sliderLeft = 0;
23249
+
23250
  if(g_objSlider){
23251
 
23252
  if(g_objTopPanel){
23813
  g_gallery.setNextButton(g_objArrowRight);
23814
  g_gallery.setPrevButton(g_objArrowLeft);
23815
 
23816
+ g_objButtonClose.on("click",function(){
23817
  t.close("button");
23818
  });
23819
 
25674
 
25675
  }
25676
 
25677
+ /**
25678
+ * change the items
25679
+ */
25680
+ this.changeItems = function(htmlItems){
25681
+
25682
+ g_gallery.changeItems(htmlItems);
25683
+ }
25684
+
25685
+ /**
25686
+ * add new items
25687
+ */
25688
+ this.addItems = function(htmlItems){
25689
+
25690
+ g_gallery.addItems(htmlItems);
25691
+ }
25692
+
25693
 
25694
  /**
25695
  * destroy the gallery
assets_libraries/unitegallery/js/unitegallery.min.js CHANGED
@@ -1,3 +1,3 @@
1
- //Unite Gallery, Version: 1.7.56, released 23 February 2022
2
 
3
- function debugLine(e,t,i){!0===e&&(e="true"),!1===e&&(e="false");var n=e;if("object"==typeof e)for(name in n="",e){var r=e[name];n+=" "+name+": "+r}if(1!=t||i||(n+=" "+Math.random()),1==i){var o=jQuery("#debug_line");o.width(200),o.height()>=500&&o.html(""),n=o.html()+"<br> -------------- <br>"+n}jQuery("#debug_line").show().html(n)}function debugSide(e){var t="";for(name in e){var i=e[name];t+=name+" : "+i+"<br>"}jQuery("#debug_side").show().html(t)}function trace(e){"undefined"!=typeof console&&console.log(e)}function UGFunctions(){var e=null,t=this,i={starTime:0,arrThemes:[],isTouchDevice:-1,isRgbaSupported:-1,timeCache:{},dataCache:{},lastEventType:"",lastEventTime:0,lastTouchStartElement:null,touchThreshold:700,handle:null};function n(e,t,i){t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent?t.attachEvent("on"+e,i):t[e]=i}this.debugVar="",this.getvalopt={FORCE_BOOLEAN:"force_boolean",FORCE_NUMERIC:"force_numeric",TRIM:"trim"},this.z__________GENERAL___________=function(){},this.getVal=function(e,i,n,r){if(!n)n="";var o="";switch(o=e&&"object"==typeof e?0==e.hasOwnProperty(i)?n:e[i]:n,r){case t.getvalopt.FORCE_BOOLEAN:o=t.strToBool(o);break;case t.getvalopt.TRIM:o=String(o),o=jQuery.trim(o);break;case t.getvalopt.FORCE_NUMERIC:"string"==typeof(o=jQuery.trim(o))&&(o.replace("px",""),o=Number(o))}return o},this.z__________FULL_SCREEN___________=function(){},this.toFullscreen=function(e,t){if(e.requestFullscreen)e.requestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},this.exitFullscreen=function(){if(0==t.isFullScreen())return!1;if(document.exitFullscreen)document.exitFullscreen();else if(document.cancelFullScreen)document.cancelFullScreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},this.addFullScreenChangeEvent=function(e){document.webkitCancelFullScreen?n("webkitfullscreenchange",document,e):document.msExitFullscreen?n("MSFullscreenChange",document,e):document.mozCancelFullScreen?n("mozfullscreenchange",document,e):n("fullscreenchange",document,e)},this.destroyFullScreenChangeEvent=function(){jQuery(document).unbind("fullscreenChange"),jQuery(document).unbind("mozfullscreenchange"),jQuery(document).unbind("webkitfullscreenchange"),jQuery(document).unbind("MSFullscreenChange")},this.getFullScreenElement=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},this.isFullScreen=function(){var e=document.fullscreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement;return e=!!e},this.z__________GET_PROPS___________=function(){},this.getBrowserPrefix=function(){if(null!==e)return e;var t=["webkit","Moz","ms","O"],i=document.createElement("div");for(var n in t){var r=t[n];if(r+"Transform"in i.style)return r=r.toLowerCase(),e=r,r}return e="",""},this.getImageInsideParentDataByImage=function(e,i,n){var r=e.parent(),o=t.getImageOriginalSize(e);return t.getImageInsideParentData(r,o.width,o.height,i,n)},this.getImageInsideParentData=function(e,t,i,n,r,o,a){if(!r)r={};var s={};if(void 0===o)o=e.width();if(void 0===a)a=e.height();r.padding_left&&(o-=r.padding_left),r.padding_right&&(o-=r.padding_right),r.padding_top&&(a-=r.padding_top),r.padding_bottom&&(a-=r.padding_bottom);var l=null,u="100%",d=null,_=null,g="display:block;margin:0px auto;";if(t>0&&i>0){if("down"==n&&t<o&&i<a)_=(o-(l=t))/2,d=(a-(u=i))/2;else if("fill"==n){(l=(u=a)*(c=t/i))<o?(u=(l=o)/c,_=0,d=Math.round((u-a)/2*-1)):(d=0,_=Math.round((l-o)/2*-1))}else{var c;d=0,_=(o-(l=(u=a)*(c=t/i)))/2,"fitvert"!=n&&l>o&&(_=0,d=(a-(u=(l=o)/c))/2)}l=Math.floor(l),u=Math.floor(u),d=Math.floor(d),_=Math.floor(_),g="position:absolute;"}return r.padding_top&&(d+=r.padding_top),r.padding_left&&(_+=r.padding_left),s.imageWidth=l,s.imageHeight=u,s.imageTop=d,s.imageLeft=_,s.imageRight=_+l,s.imageBottom=0==d||"100%"==u?null:d+u,s.style=g,s},this.getElementCenterPosition=function(e,i){var n=e.parent(),r=t.getElementSize(e),o=t.getElementSize(n),a=o.width,s=o.height;i&&void 0!==i.padding_top&&(s-=i.padding_top),i&&void 0!==i.padding_bottom&&(s-=i.padding_bottom),i&&void 0!==i.padding_left&&(a-=i.padding_left),i&&void 0!==i.padding_right&&(a-=i.padding_right);var l={};return l.left=Math.round((a-r.width)/2),l.top=Math.round((s-r.height)/2),i&&void 0!==i.padding_top&&(l.top+=i.padding_top),i&&void 0!==i.padding_left&&(l.left+=i.padding_left),l},this.getElementCenterPoint=function(e,i){if(!i)i=!1;var n=t.getElementSize(e),r={};return r.x=n.width/2,r.y=n.height/2,1==i&&(r.x+=n.left,r.y+=n.top),r.x=Math.round(r.x),r.y=Math.round(r.y),r},this.getMousePosition=function(e,t){var i={pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY};if(e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length>0&&(i.pageX=e.originalEvent.touches[0].pageX,i.pageY=e.originalEvent.touches[0].pageY,i.clientX=e.originalEvent.touches[0].clientX,i.clientY=e.originalEvent.touches[0].clientY),t){var n=t.offset();i.mouseX=i.pageX-n.left,i.mouseY=i.pageY-n.top}return i},this.getMouseElementPoint=function(e,i){var n={x:e.pageX,y:e.pageY};return t.getElementLocalPoint(n,i)},this.getElementLocalPoint=function(e,t){var i={},n=t.offset();return i.x=Math.round(e.x-n.left),i.y=Math.round(e.y-n.top),i},this.getImageOriginalSize=function(e,t,i){if(void 0!==t&&void 0!==i)return{width:t,height:i};var n=e[0];if(void 0===n)throw new Error("getImageOriginalSize error - Image not found");var r={};if(void 0===n.naturalWidth){if("number"==typeof e.data("naturalWidth"))return(r={}).width=e.data("naturalWidth"),r.height=e.data("naturalHeight"),r;var o=new Image;return o.src=n.src,o.complete?(r.width=o.width,r.height=o.height,e.data("naturalWidth",r.width),e.data("naturalHeight",r.height),r):{width:0,height:0}}return r.width=n.naturalWidth,r.height=n.naturalHeight,r},this.getimageRatio=function(e){var i=t.getImageOriginalSize(e);return t.getElementSize(e).width/i.width},this.isImageFitParent=function(e){var i=e.parent(),n=t.getElementSize(e),r=t.getElementSize(i);return n.width<=r.width&&n.height<=r.height},this.getElementSize=function(e){if(void 0===e)throw new Error("Can't get size, empty element");var t=e.position();return t.height=e.outerHeight(),t.width=e.outerWidth(),t.left=Math.round(t.left),t.top=Math.round(t.top),t.right=t.left+t.width,t.bottom=t.top+t.height,t},this.isElementBiggerThenParent=function(e){var i=e.parent(),n=t.getElementSize(e),r=t.getElementSize(i);return n.width>r.width||n.height>r.height},this.isPointInsideElement=function(e,t){return 0!=(e.x>=0&&e.x<t.width)&&0!=(e.y>=0&&e.y<t.height)},this.getElementRelativePos=function(e,i,n,r){if(!r)r=e.parent();if("number"==typeof e)var o={width:e,height:e};else o=t.getElementSize(e);var a=t.getElementSize(r);switch(i){case"top":case"left":i=0,n&&(i+=n);break;case"center":i=Math.round((a.width-o.width)/2),n&&(i+=n);break;case"right":i=a.width-o.width,n&&(i-=n);break;case"middle":i=Math.round((a.height-o.height)/2),n&&(i+=n);break;case"bottom":i=a.height-o.height,n&&(i-=n)}return i},this.getScreenVisibleSize=function(){document.body.clientWidth,document.body.clientHeight,jQuery(document).scrollTop();var e=jQuery(document),t=e.scrollLeft(),i=e.scrollTop();t=Math.round(t);var n=(i=Math.round(i))+window.innerHeight,r=t+window.innerWidth;return{top:i,left:t,height:n-i,width:r-t,right:r,bottom:n}},this.isElementsIntersect=function(e,t){return!(e.right<t.left)&&(!(e.left>t.right)&&(!(e.bottom<t.top)&&!(e.top>t.bottom)))},this.isElementInsideScreen=function(e){var i=t.getElementSize(e),n=t.getScreenVisibleSize();return t.isElementsIntersect(n,i)},this.z_________SET_ELEMENT_PROPS_______=function(){},this.zoomImageInsideParent=function(e,i,n,r,o,a,s){if(!n)n=1.2;if(!o)o="fit";var l,u,d,_,g=n,c=e.parent(),h=t.getElementSize(e),p=t.getImageOriginalSize(e),m=!1,f=0,b=0,v=0,y=0;if(r){var I=t.getMouseElementPoint(r,e);m=t.isPointInsideElement(I,h),v=I.x,y=I.y}else m=!1;if(0==m){var w=t.getElementCenterPoint(e);v=w.x,y=w.y}if(1==i)l=h.height*g,u=h.width*g,0!=v&&(f=-(v*g-v)),0!=y&&(b=-(y*g-y));else{if(l=h.height/g,(u=h.width/g)<t.getImageInsideParentData(c,p.width,p.height,o,s).imageWidth)return t.scaleImageFitParent(e,p.width,p.height,o,s),!0;1==m&&(0!=v&&(f=-(v/g-v)),0!=y&&(b=-(y/g-y)))}if(a){var E=1;if(0!=p.width&&(E=u/p.width),E>a)return!1}if(t.setElementSize(e,u,l),0==i&&0==m){var T=t.getElementCenterPosition(e);d=T.left,_=T.top}else d=h.left+f,_=h.top+b;return t.placeElement(e,d,_),!0},this.placeElement=function(e,i,n,r,o,a){if(0==jQuery.isNumeric(i)||0==jQuery.isNumeric(n)){if(!a)a=e.parent();var s=t.getElementSize(e),l=t.getElementSize(a)}if(0==jQuery.isNumeric(i))switch(i){case"left":i=0,r&&(i+=r);break;case"center":i=Math.round((l.width-s.width)/2),r&&(i+=r);break;case"right":i=l.width-s.width,r&&(i-=r)}if(0==jQuery.isNumeric(n))switch(n){case"top":n=0,o&&(n+=o);break;case"middle":case"center":n=Math.round((l.height-s.height)/2),o&&(n+=o);break;case"bottom":n=l.height-s.height,o&&(n-=o)}var u={position:"absolute",margin:"0px"};null!==i&&(u.left=i),null!==n&&(u.top=n),e.css(u)},this.placeElementInParentCenter=function(e){t.placeElement(e,"center","middle")},this.setElementSizeAndPosition=function(e,t,i,n,r){var o={width:n+"px",height:r+"px",left:t+"px",top:i+"px",position:"absolute",margin:"0px"};e.css(o)},this.setElementSize=function(e,t,i){var n={width:t+"px"};null!=i&&(n.height=i+"px"),e.css(n)},this.cloneElementSizeAndPos=function(e,i,n,r,o){var a=e.position();if(null==a)throw new Error("Can't get size, empty element");!0===n?(a.height=e.outerHeight(),a.width=e.outerWidth()):(a.height=e.height(),a.width=e.width()),a.left=Math.round(a.left),a.top=Math.round(a.top),r&&(a.left+=r),o&&(a.top+=o),t.setElementSizeAndPosition(i,a.left,a.top,a.width,a.height)},this.placeImageInsideParent=function(e,i,n,r,o,a){var s=t.getImageInsideParentData(i,n,r,o,a),l="<img";return null!==s.imageWidth&&(l+=" width = '"+s.imageWidth+"'",s.style+="width:"+s.imageWidth+";"),null!=s.imageHeight&&("100%"==s.imageHeight?(l+=" height = '"+s.imageHeight+"'",s.style+="height:"+s.imageHeight+";"):(l+=" height = '"+s.imageHeight+"'",s.style+="height:"+s.imageHeight+"px;")),null!==s.imageTop&&(s.style+="top:"+s.imageTop+"px;"),null!==s.imageLeft&&(s.style+="left:"+s.imageLeft+"px;"),e=t.escapeDoubleSlash(e),l+=" style='"+s.style+"'",l+=' src="'+e+'"',l+=">",i.html(l),i.children("img")},this.scaleImageCoverParent=function(e,i,n){if("number"==typeof i)var r=i,o=n;else r=i.outerWidth(),o=i.outerHeight();var a=t.getImageOriginalSize(e),s=a.width/a.height,l=o,u=l*s,d=0,_=0;u<r?(l=(u=r)/s,_=0,d=Math.round((l-o)/2*-1)):(d=0,_=Math.round((u-r)/2*-1)),u=Math.round(u),l=Math.round(l),e.css({width:u+"px",height:l+"px",left:_+"px",top:d+"px"})},this.scaleImageFitParent=function(e,i,n,r,o){var a=e.parent(),s=t.getImageInsideParentData(a,i,n,r,o),l=!1,u={};return null!==s.imageWidth&&(l=!0,e.removeAttr("width"),u.width=s.imageWidth+"px"),null!=s.imageHeight&&(l=!0,e.removeAttr("height"),u.height=s.imageHeight+"px"),null!==s.imageTop&&(l=!0,u.top=s.imageTop+"px"),null!==s.imageLeft&&(l=!0,u.left=s.imageLeft+"px"),1==l&&(u.position="absolute",u.margin="0px 0px",e.css(u)),s},this.scaleImageByHeight=function(e,i,n,r){var o=t.getImageOriginalSize(e,n,r),a=o.width/o.height,s=Math.round(i*a);i=Math.round(i),t.setElementSize(e,s,i)},this.scaleImageByWidth=function(e,i,n,r){var o=t.getImageOriginalSize(e,n,r),a=o.width/o.height,s=Math.round(i/a);i=Math.round(i),t.setElementSize(e,i,s)},this.scaleImageExactSizeInParent=function(e,i,n,r,o,a){var s=e.parent(),l=t.getElementSize(s);l.width<r&&(r=l.width),l.height<o&&(o=l.height);var u,d=t.getImageInsideParentData(null,i,n,a,null,r,o),_=r,g=o,c=d.imageLeft,h=d.imageLeft,p=d.imageTop,m=d.imageTop,f=Math.round((l.width-r)/2),b=Math.round((l.height-o)/2);0!=(u=r-(d.imageWidth+c+h))&&(h+=u),0!=(u=o-(d.imageHeight+p+m))&&(m+=u),e.removeAttr("width"),e.removeAttr("height");var v={position:"absolute",margin:"0px 0px"};v.width=_+"px",v.height=g+"px",v.left=f+"px",v.top=b+"px",v["padding-left"]=c+"px",v["padding-top"]=p+"px",v["padding-right"]=h+"px",v["padding-bottom"]=m+"px",e.css(v);var y={};return y.imageWidth=_,y.imageHeight=g,y},this.showElement=function(e,t,i){e.show().fadeTo(0,1),t&&t.show().fadeTo(0,1),i&&i.show().fadeTo(0,1)},this.z_________GALLERY_RELATED_FUNCTIONS_______=function(){},this.disableButton=function(e,i){if(!i)i="ug-button-disabled";0==t.isButtonDisabled(e,i)&&e.addClass(i)},this.convertCustomPrefixOptions=function(e,t,i){if(!t)return e;var n={};return jQuery.each(e,function(e,r){if(0===e.indexOf(t+"_"+i+"_")){var o=e.replace(t+"_"+i+"_",i+"_");n[o]=r}else n[e]=r}),n},this.enableButton=function(e,i){if(!i)i="ug-button-disabled";1==t.isButtonDisabled(e,i)&&e.removeClass(i)},this.isButtonDisabled=function(e,t){if(!t)t="ug-button-disabled";return!!e.hasClass(t)},this.z_________MATH_FUNCTIONS_______=function(){},this.normalizeSetting=function(e,t,i,n,r,o){if(!o)o=!1;return r=e+(t-e)*((r-i)/(n-i)),1==o&&(r<e&&(r=e),r>t&&(r=t)),r},this.getNormalizedValue=function(e,t,i,n,r){return r=e+(n-i)*((r-e)/(t-e))},this.getDistance=function(e,t,i,n){return Math.round(Math.sqrt(Math.abs((i-e)*(i-e)+(n-t)*(n-t))))},this.getMiddlePoint=function(e,t,i,n){var r={};return r.x=e+Math.round((i-e)/2),r.y=t+Math.round((n-t)/2),r},this.getNumItemsInSpace=function(e,t,i){return Math.floor((e+i)/(t+i))},this.getNumItemsInSpaceRound=function(e,t,i){return Math.round((e+i)/(t+i))},this.getSpaceByNumItems=function(e,t,i){return e*t+(e-1)*i},this.getItemSizeInSpace=function(e,t,i){return Math.floor((e-(t-1)*i)/t)},this.getColX=function(e,t,i){return e*(t+i)},this.getColByIndex=function(e,t){return t%e},this.getColRowByIndex=function(e,t){var i=Math.floor(e/t);return{col:Math.floor(e%t),row:i}},this.getIndexByRowCol=function(e,t,i){return e<0?-1:t<0?-1:e*i+t},this.getPrevRowSameColIndex=function(e,i){var n=t.getColRowByIndex(e,i);return t.getIndexByRowCol(n.row-1,n.col,i)},this.getNextRowSameColIndex=function(e,i){var n=t.getColRowByIndex(e,i);return t.getIndexByRowCol(n.row+1,n.col,i)},this.z_________DATA_FUNCTIONS_______=function(){},this.setGlobalData=function(e,t){jQuery.data(document.body,e,t)},this.getGlobalData=function(e){return jQuery.data(document.body,e)},this.z_________EVENT_DATA_FUNCTIONS_______=function(){},this.handleScrollTop=function(e){if(0==t.isTouchDevice())return null;var n=t.getStoredEventData(e);if(null===n.scrollDir&&(Math.abs(n.diffMouseX)>15?n.scrollDir="hor":Math.abs(n.diffMouseY)>15&&Math.abs(n.diffMouseY)>Math.abs(n.diffMouseX)&&(n.scrollDir="vert",n.scrollStartY=n.lastMouseClientY,n.scrollOrigin=jQuery(document).scrollTop(),i.dataCache[e].scrollStartY=n.lastMouseClientY,i.dataCache[e].scrollOrigin=n.scrollOrigin),i.dataCache[e].scrollDir=n.scrollDir),"vert"!==n.scrollDir)return n.scrollDir;jQuery(document).scrollTop();var r=n.scrollOrigin-(n.lastMouseClientY-n.scrollStartY);return r>=0&&jQuery(document).scrollTop(r),n.scrollDir},this.wasVerticalScroll=function(e){return"vert"===t.getStoredEventData(e).scrollDir},this.storeEventData=function(e,n,r){var o=t.getMousePosition(e),a=jQuery.now(),s={startTime:a,lastTime:a,startMouseX:o.pageX,startMouseY:o.pageY,lastMouseX:o.pageX,lastMouseY:o.pageY,startMouseClientY:o.clientY,lastMouseClientY:o.clientY,scrollTop:jQuery(document).scrollTop(),scrollDir:null};r&&(s=jQuery.extend(s,r)),i.dataCache[n]=s},this.updateStoredEventData=function(e,n,r){if(!i.dataCache[n])throw new Error("updateEventData error: must have stored cache object");var o=i.dataCache[n],a=t.getMousePosition(e);o.lastTime=jQuery.now(),void 0!==a.pageX&&(o.lastMouseX=a.pageX,o.lastMouseY=a.pageY,o.lastMouseClientY=a.clientY),r&&(o=jQuery.extend(o,r)),i.dataCache[n]=o},this.getStoredEventData=function(e,t){if(!i.dataCache[e])throw new Error("updateEventData error: must have stored cache object");var n=i.dataCache[e];return n.diffMouseX=n.lastMouseX-n.startMouseX,n.diffMouseY=n.lastMouseY-n.startMouseY,n.diffMouseClientY=n.lastMouseClientY-n.startMouseClientY,n.diffTime=n.lastTime-n.startTime,!0===t?(n.startMousePos=n.lastMouseY,n.lastMousePos=n.lastMouseY,n.diffMousePos=n.diffMouseY):(n.startMousePos=n.lastMouseX,n.lastMousePos=n.lastMouseX,n.diffMousePos=n.diffMouseX),n},this.isApproveStoredEventClick=function(e,n){if(!i.dataCache[e])return!0;var r=t.getStoredEventData(e,n),o=Math.abs(r.diffMousePos);return!(r.diffTime>400)&&!(o>30)},this.clearStoredEventData=function(e){i.dataCache[e]=null},this.z_________CHECK_SUPPORT_FUNCTIONS_______=function(){},this.isCanvasExists=function(){return"function"==typeof jQuery('<canvas width="500" height="500" > </canvas>')[0].getContext},this.isScrollbarExists=function(){return window.innerWidth>document.documentElement.clientWidth},this.isTouchDevice=function(){if(-1!==i.isTouchDevice)return i.isTouchDevice;try{document.createEvent("TouchEvent"),i.isTouchDevice=!0}catch(e){i.isTouchDevice=!1}return i.isTouchDevice},this.isRgbaSupported=function(){if(-1!==i.isRgbaSupported)return i.isRgbaSupported;var e=document.getElementsByTagName("script")[0],t=e.style.color;try{e.style.color="rgba(1,5,13,0.44)"}catch(e){}var n=e.style.color!=t;return e.style.color=t,i.isRgbaSupported=n,n},this.z_________GENERAL_FUNCTIONS_______=function(){},this.checkMinJqueryVersion=function(e){for(var t=jQuery.fn.jquery.split("."),i=e.split("."),n=0,r=t.length;n<r;n++){var o=parseInt(t[n]),a=parseInt(i[n]);if(void 0===i[n])return!0;if(a>o)return!1;if(o>a)return!0}return!0},this.getCssSizeParam=function(e){return jQuery.isNumeric(e)?e+"px":e},this.convertHexToRGB=function(e,t){var i=e.replace("#","");return i===e?e:(r=parseInt(i.substring(0,2),16),g=parseInt(i.substring(2,4),16),b=parseInt(i.substring(4,6),16),result="rgba("+r+","+g+","+b+","+t+")",result)},this.timestampToString=function(e){var t=new Date(e),i=t.getDate()+"/"+t.getMonth();return i+=" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+":"+t.getMilliseconds()},this.getArrTouches=function(e){var t=[];return e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length>0&&(t=e.originalEvent.touches),t},this.getArrTouchPositions=function(e){for(var t=[],i=0;i<e.length;i++){var n={pageX:e[i].pageX,pageY:e[i].pageY};t.push(n)}return t},this.startTimeDebug=function(){i.starTime=jQuery.now()},this.showTimeDebug=function(){debugLine({"Time Passed":jQuery.now()-i.starTime},!0)},this.initProgressIndicator=function(e,i,n){switch("bar"!=e&&0==t.isCanvasExists()&&(e="bar"),e){case"bar":(r=new UGProgressBar).putHidden(n,i);break;default:case"pie":(r=new UGProgressPie).putHidden(n,i);break;case"pie2":var r;i.type_fill=!0,(r=new UGProgressPie).putHidden(n,i)}return r},this.setButtonMobileReady=function(e){e.on("touchstart",function(e){jQuery(this).addClass("ug-nohover")}),e.on("mousedown touchend",function(e){return e.stopPropagation(),e.stopImmediatePropagation(),!1})},this.registerTheme=function(e){i.arrThemes.push(e)},this.getArrThemes=function(){return i.arrThemes},this.isThemeRegistered=function(e){return-1!==jQuery.inArray(e,i.arrThemes)},this.getFirstRegisteredTheme=function(){return 0==i.arrThemes.length?"":i.arrThemes[0]},this.isTimePassed=function(e,t){if(!t)t=100;var n=jQuery.now();0==i.timeCache.hasOwnProperty(e)?lastTime=0:lastTime=i.timeCache[e];var r=n-lastTime;return i.timeCache[e]=n,!(r<=t)},this.whenContiniousEventOver=function(e,t,n){if(!n)n=300;1==i.timeCache.hasOwnProperty(e)&&null!=i.timeCache[e]&&(clearTimeout(i.timeCache[e]),i.timeCache[e]=null),i.timeCache[e]=setTimeout(t,n)},this.validateClickTouchstartEvent=function(e){var t=!0,n=jQuery.now()-i.lastEventTime;return"click"==e&&"touchstart"==i.lastEventType&&n<1e3&&(t=!1),i.lastEventTime=jQuery.now(),i.lastEventType=e,t},this.addClassOnHover=function(e,t){if(!t)t="ug-button-hover";e.hover(function(){jQuery(this).addClass(t)},function(){jQuery(this).removeClass(t)})},this.destroyButton=function(e){e.off("mouseenter"),e.off("mouseleave"),e.off("click"),e.off("touchstart"),e.off("touchend"),e.off("mousedown"),e.off("tap")},this.setButtonOnClick=function(e,i){t.setButtonMobileReady(e),e.on("click touchstart",function(e){if(objThis=jQuery(this),e.stopPropagation(),e.stopImmediatePropagation(),0==t.validateClickTouchstartEvent(e.type))return!0;i(objThis,e)})},this.setButtonOnTap=function(e,n){e.on("tap",n),0==t.isTouchDevice()?e.on("click",function(e){var i=jQuery(this);if(0==t.validateClickTouchstartEvent(e.type))return!0;i.trigger("tap")}):(e.on("touchstart",function(e){jQuery(this).addClass("ug-nohover"),i.lastTouchStartElement=jQuery(this),i.lastEventTime=jQuery.now()}),e.on("touchend",function(e){var t=jQuery(this);return 0==t.is(i.lastTouchStartElement)||(!i.lastEventTime||(jQuery.now()-i.lastEventTime>i.touchThreshold||void t.trigger("tap")))}))},this.loadJs=function(e,t){!0===t&&(e=location.protocol+"//"+e);var i=document.createElement("script");i.src=e;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(i,n)},this.loadCss=function(e,t){!0===t&&(e=location.protocol+"//"+e);var i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(i)},this.addEvent=function(e,t,i){void 0!==e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on"+t,i)},this.checkImagesLoaded=function(e,t,i){var n=0,r=e.length;if(0==r&&t)return t(),!1;function o(e,o){n++,"function"==typeof i&&setTimeout(function(){i(e,o)}),n==r&&"function"==typeof t&&setTimeout(function(){t()})}setTimeout(function(){for(var t=0;t<r;t++){var i=e[t];if(void 0!==i.naturalWidth&&0!==i.naturalWidth)o(e[t],!1);else{var n=jQuery("<img/>");n.data("index",t),n.on("load",function(){var t=jQuery(this).data("index");o(e[t],!1)}),n.on("error",function(){var t=jQuery(this).data("index");o(e[t],!0)}),n.attr("src",i.src)}}})},this.waitForWidth=function(e,t){var n=e.width();if(0!=n)return t(),!1;i.handle=setInterval(function(){0!=(n=e.width())&&(clearInterval(i.handle),t())},300)},this.arrayShuffle=function(e){if("object"!=typeof e)return e;for(var t,i,n=e.length;n;t=parseInt(Math.random()*n),i=e[--n],e[n]=e[t],e[t]=i);return e},this.getObjectLength=function(e){var t=0;for(var i in e)t++;return t},this.normalizePercent=function(e){return e<0&&(e=0),e>1&&(e=1),e},this.stripTags=function(e){return e.replace(/(<([^>]+)>)/gi,"")},this.escapeDoubleSlash=function(e){return e.replace('"','"')},this.htmlentitles=function(e){return jQuery("<div/>").text(e).html()},this.z_________END_GENERAL_FUNCTIONS_______=function(){}}!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var a=t||window.event,s=l.call(arguments,1),u=0,d=0,_=0,g=0;if((t=e.event.fix(a)).type="mousewheel","detail"in a&&(_=-1*a.detail),"wheelDelta"in a&&(_=a.wheelDelta),"wheelDeltaY"in a&&(_=a.wheelDeltaY),"wheelDeltaX"in a&&(d=-1*a.wheelDeltaX),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(d=-1*_,_=0),u=0===_?d:_,"deltaY"in a&&(u=_=-1*a.deltaY),"deltaX"in a&&(d=a.deltaX,0===_&&(u=-1*d)),0!==_||0!==d){if(1===a.deltaMode){var c=e.data(this,"mousewheel-line-height");u*=c,_*=c,d*=c}else if(2===a.deltaMode){var h=e.data(this,"mousewheel-page-height");u*=h,_*=h,d*=h}return g=Math.max(Math.abs(_),Math.abs(d)),(!o||o>g)&&(o=g,n(a,g)&&(o/=40)),n(a,g)&&(u/=40,d/=40,_/=40),u=Math[u>=1?"floor":"ceil"](u/o),d=Math[d>=1?"floor":"ceil"](d/o),_=Math[_>=1?"floor":"ceil"](_/o),t.deltaX=d,t.deltaY=_,t.deltaFactor=o,t.deltaMode=0,s.unshift(t,u,d,_),r&&clearTimeout(r),r=setTimeout(i,200),(e.event.dispatch||e.event.handle).apply(this,s)}}function i(){o=null}function n(e,t){return d.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}var r,o,a=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var u=a.length;u;)e.event.fixHooks[a[--u]]=e.event.mouseHooks;var d=e.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var i=s.length;i;)this.addEventListener(s[--i],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",d.getLineHeight(this)),e.data(this,"mousewheel-page-height",d.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=s.length;e;)this.removeEventListener(s[--e],t,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(e(t)["offsetParent"in e.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),function(e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof module&&"object"==typeof module.exports?exports=e(require("jquery")):e(jQuery)}(function(e){e.easing.jswing=e.easing.swing;var t=Math.pow,i=Math.sqrt,n=Math.sin,r=Math.cos,o=Math.PI,a=1.70158,s=1.525*a,l=2*o/3,u=2*o/4.5;function d(e){var t=7.5625,i=2.75;return e<1/i?t*e*e:e<2/i?t*(e-=1.5/i)*e+.75:e<2.5/i?t*(e-=2.25/i)*e+.9375:t*(e-=2.625/i)*e+.984375}e.extend(e.easing,{def:"easeOutQuad",swing:function(t){return e.easing[e.easing.def](t)},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return 1-(1-e)*(1-e)},easeInOutQuad:function(e){return e<.5?2*e*e:1-t(-2*e+2,2)/2},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return 1-t(1-e,3)},easeInOutCubic:function(e){return e<.5?4*e*e*e:1-t(-2*e+2,3)/2},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1-t(1-e,4)},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-t(-2*e+2,4)/2},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1-t(1-e,5)},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1-t(-2*e+2,5)/2},easeInSine:function(e){return 1-r(e*o/2)},easeOutSine:function(e){return n(e*o/2)},easeInOutSine:function(e){return-(r(o*e)-1)/2},easeInExpo:function(e){return 0===e?0:t(2,10*e-10)},easeOutExpo:function(e){return 1===e?1:1-t(2,-10*e)},easeInOutExpo:function(e){return 0===e?0:1===e?1:e<.5?t(2,20*e-10)/2:(2-t(2,-20*e+10))/2},easeInCirc:function(e){return 1-i(1-t(e,2))},easeOutCirc:function(e){return i(1-t(e-1,2))},easeInOutCirc:function(e){return e<.5?(1-i(1-t(2*e,2)))/2:(i(1-t(-2*e+2,2))+1)/2},easeInElastic:function(e){return 0===e?0:1===e?1:-t(2,10*e-10)*n((10*e-10.75)*l)},easeOutElastic:function(e){return 0===e?0:1===e?1:t(2,-10*e)*n((10*e-.75)*l)+1},easeInOutElastic:function(e){return 0===e?0:1===e?1:e<.5?-t(2,20*e-10)*n((20*e-11.125)*u)/2:t(2,-20*e+10)*n((20*e-11.125)*u)/2+1},easeInBack:function(e){return 2.70158*e*e*e-a*e*e},easeOutBack:function(e){return 1+2.70158*t(e-1,3)+a*t(e-1,2)},easeInOutBack:function(e){return e<.5?t(2*e,2)*(7.189819*e-s)/2:(t(2*e-2,2)*((s+1)*(2*e-2)+s)+2)/2},easeInBounce:function(e){return 1-d(1-e)},easeOutBounce:d,easeInOutBounce:function(e){return e<.5?(1-d(1-2*e))/2:(1+d(2*e-1))/2}})}),function(e,t){if(void 0===e.cssHooks)return!1;function i(e,t,i){var n=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=n.floor?~~e:parseFloat(e),isNaN(e)?t.def:n.mod?(e+n.mod)%n.mod:0>e?0:n.max<e?n.max:e)}function n(t){var i=l(),n=i._rgba=[];return t=t.toLowerCase(),c(s,function(e,r){var o,a=r.re.exec(t),s=a&&r.parse(a),l=r.space||"rgba";return s?(o=i[l](s),i[u[l].cache]=o[u[l].cache],n=i._rgba=o._rgba,!1):void 0}),n.length?("0,0,0,0"===n.join()&&e.extend(n,o.transparent),i):o[t]}function r(e,t,i){return 1>6*(i=(i+1)%1)?e+(t-e)*i*6:1>2*i?t:2>3*i?e+(t-e)*(2/3-i)*6:e}var o,a=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,n,r){return new e.Color.fn.parse(t,i,n,r)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},_=l.support={},g=e("<p>")[0],c=e.each;g.style.cssText="background-color:rgba(1,1,1,.5)",_.rgba=g.style.backgroundColor.indexOf("rgba")>-1,c(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(r,a,s,d){if(r===t)return this._rgba=[null,null,null,null],this;(r.jquery||r.nodeType)&&(r=e(r).css(a),a=t);var _=this,g=e.type(r),h=this._rgba=[];return a!==t&&(r=[r,a,s,d],g="array"),"string"===g?this.parse(n(r)||o._default):"array"===g?(c(u.rgba.props,function(e,t){h[t.idx]=i(r[t.idx],t)}),this):"object"===g?(c(u,r instanceof l?function(e,t){r[t.cache]&&(_[t.cache]=r[t.cache].slice())}:function(t,n){var o=n.cache;c(n.props,function(e,t){if(!_[o]&&n.to){if("alpha"===e||null==r[e])return;_[o]=n.to(_._rgba)}_[o][t.idx]=i(r[e],t,!0)}),_[o]&&e.inArray(null,_[o].slice(0,3))<0&&(_[o][3]=1,n.from&&(_._rgba=n.from(_[o])))}),this):void 0},is:function(e){var t=l(e),i=!0,n=this;return c(u,function(e,r){var o,a=t[r.cache];return a&&(o=n[r.cache]||r.to&&r.to(n._rgba)||[],c(r.props,function(e,t){return null!=a[t.idx]?i=a[t.idx]===o[t.idx]:void 0})),i}),i},_space:function(){var e=[],t=this;return c(u,function(i,n){t[n.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var n=l(e),r=n._space(),o=u[r],a=0===this.alpha()?l("transparent"):this,s=a[o.cache]||o.to(a._rgba),_=s.slice();return n=n[o.cache],c(o.props,function(e,r){var o=r.idx,a=s[o],l=n[o],u=d[r.type]||{};null!==l&&(null===a?_[o]=l:(u.mod&&(l-a>u.mod/2?a+=u.mod:a-l>u.mod/2&&(a-=u.mod)),_[o]=i((l-a)*t+a,r)))}),this[r](_)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),r=l(t)._rgba;return l(e.map(i,function(e,t){return(1-n)*r[t]+n*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),n=i.pop();return t&&i.push(~~(255*n)),"#"+e.map(i,function(e){return 1===(e=(e||0).toString(16)).length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,n=e[0]/255,r=e[1]/255,o=e[2]/255,a=e[3],s=Math.max(n,r,o),l=Math.min(n,r,o),u=s-l,d=s+l,_=.5*d;return t=l===s?0:n===s?60*(r-o)/u+360:r===s?60*(o-n)/u+120:60*(n-r)/u+240,i=0===u?0:.5>=_?u/d:u/(2-d),[Math.round(t)%360,i,_,null==a?1:a]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],n=e[2],o=e[3],a=.5>=n?n*(1+i):n+i-n*i,s=2*n-a;return[Math.round(255*r(s,a,t+1/3)),Math.round(255*r(s,a,t)),Math.round(255*r(s,a,t-1/3)),o]},c(u,function(n,r){var o=r.props,s=r.cache,u=r.to,d=r.from;l.fn[n]=function(n){if(u&&!this[s]&&(this[s]=u(this._rgba)),n===t)return this[s].slice();var r,a=e.type(n),_="array"===a||"object"===a?n:arguments,g=this[s].slice();return c(o,function(e,t){var n=_["object"===a?e:t.idx];null==n&&(n=g[t.idx]),g[t.idx]=i(n,t)}),d?((r=l(d(g)))[s]=g,r):l(g)},c(o,function(t,i){l.fn[t]||(l.fn[t]=function(r){var o,s=e.type(r),l="alpha"===t?this._hsla?"hsla":"rgba":n,u=this[l](),d=u[i.idx];return"undefined"===s?d:("function"===s&&(r=r.call(this,d),s=e.type(r)),null==r&&i.empty?this:("string"===s&&((o=a.exec(r))&&(r=d+parseFloat(o[2])*("+"===o[1]?1:-1))),u[i.idx]=r,this[l](u)))})})}),l.hook=function(t){var i=t.split(" ");c(i,function(t,i){e.cssHooks[i]={set:function(t,r){var o,a,s="";if("transparent"!==r&&("string"!==e.type(r)||(o=n(r)))){if(r=l(o||r),!_.rgba&&1!==r._rgba[3]){for(a="backgroundColor"===i?t.parentNode:t;(""===s||"transparent"===s)&&a&&a.style;)try{s=e.css(a,"backgroundColor"),a=a.parentNode}catch(e){}r=r.blend(s&&"transparent"!==s?s:"_default")}r=r.toRgbaString()}try{t.style[i]=r}catch(e){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),e.cssHooks.borderColor={expand:function(e){var t={};return c(["Top","Right","Bottom","Left"],function(i,n){t["border"+n+"Color"]=e}),t}},o=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(e){e.mlp={x:0,y:0},e(function t(){try{var i=this===document?e(this):e(this).contents()}catch(e){return!1}i.mousemove(function(t){e.mlp={x:t.pageX,y:t.pageY}}),i.find("iframe").on("load",t)}),e.fn.ismouseover=function(){var t=!1;return this.eq(0).each(function(){var i=e(this).is("iframe")?e(this).contents().find("body"):e(this),n=i.offset();t=n.left<=e.mlp.x&&n.left+i.outerWidth()>e.mlp.x&&n.top<=e.mlp.y&&n.top+i.outerHeight()>e.mlp.y}),t}}(jQuery);var g_ugFunctions=new UGFunctions;function UGThumbsGeneral(){var e,t,i,n,r=this,o=jQuery(r),a=new UniteGalleryMain,s=new UGFunctions;this.type={GET_THUMBS_ALL:"all",GET_THUMBS_RATIO:"ratio",GET_THUMBS_NO_RATIO:"no_ratio",GET_THUMBS_NEW:"new"},this.events={SETOVERSTYLE:"thumbmouseover",SETNORMALSTYLE:"thumbmouseout",SETSELECTEDSTYLE:"thumbsetselected",PLACEIMAGE:"thumbplaceimage",AFTERPLACEIMAGE:"thumb_after_place_image",IMAGELOADERROR:"thumbimageloaderror",THUMB_IMAGE_LOADED:"thumb_image_loaded"};var l={thumb_width:88,thumb_height:50,thumb_fixed_size:!0,thumb_resize_by:"height",thumb_border_effect:!0,thumb_border_width:0,thumb_border_color:"#000000",thumb_over_border_width:0,thumb_over_border_color:"#d9d9d9",thumb_selected_border_width:1,thumb_selected_border_color:"#d9d9d9",thumb_round_corners_radius:0,thumb_color_overlay_effect:!0,thumb_overlay_color:"#000000",thumb_overlay_opacity:.4,thumb_overlay_reverse:!1,thumb_image_overlay_effect:!1,thumb_image_overlay_type:"bw",thumb_transition_duration:200,thumb_transition_easing:"easeOutQuad",thumb_show_loader:!0,thumb_loader_type:"dark",thumb_wrapper_as_link:!1,thumb_link_newpage:!1},u={touchEnabled:!1,num_thumbs_checking:0,customThumbs:!1,funcSetCustomThumbHtml:null,isEffectBorder:!1,isEffectOverlay:!1,isEffectImage:!1,colorOverlayOpacity:1,thumbInnerReduce:0,allowOnResize:!0,classNewThumb:"ug-new-thumb"},d="thumb_size_change";function _(e,t){var r=i[e],o="";0==u.customThumbs&&(o=" ug-thumb-generated");var a="<div class='ug-thumb-wrapper"+o+"' "+("style='z-index:"+(r.index+1)+";'")+"></div>";if(1==l.thumb_wrapper_as_link){var s=r.link;""==r.link&&(s="javascript:void(0)");var d="";1==l.thumb_link_newpage&&r.link&&(d=" target='_blank'");a="<a href='"+s+"'"+d+" class='ug-thumb-wrapper"+o+"'></a>"}var _=jQuery(a),g=r.objThumbImage;if(0==u.customThumbs){if(1==l.thumb_show_loader&&g){var c="ug-thumb-loader-dark";"bright"==l.thumb_loader_type&&(c="ug-thumb-loader-bright"),_.append("<div class='ug-thumb-loader "+c+"'></div>"),_.append("<div class='ug-thumb-error' style='display:none'></div>")}if(g){if(g.addClass("ug-thumb-image"),1==l.thumb_image_overlay_effect){var h=g.clone().appendTo(_);h.addClass("ug-thumb-image-overlay "+t).removeClass("ug-thumb-image"),h.fadeTo(0,0),r.objImageOverlay=h}_.append(g)}}return u.isEffectBorder&&_.append("<div class='ug-thumb-border-overlay'></div>"),u.isEffectOverlay&&_.append("<div class='ug-thumb-overlay'></div>"),n.append(_),u.customThumbs&&u.funcSetCustomThumbHtml(_,r),i[e].objThumbWrapper=_,_}function g(e,t,i,r){var o={width:e+"px",height:t+"px"},a={width:e-u.thumbInnerReduce+"px",height:t-u.thumbInnerReduce+"px"},s=".ug-thumb-loader, .ug-thumb-error, .ug-thumb-border-overlay, .ug-thumb-overlay";i?(!0!==r&&i.css(o),i.find(s).css(a)):(n.children(".ug-thumb-wrapper").css(o),n.find(s).css(a))}function c(e,t,i,n){if(!n)n=!1;a.isFakeFullscreen()&&(n=!0);var r=e.children(".ug-thumb-border-overlay"),o={};o["border-width"]=t+"px",0!=t&&(o["border-color"]=i),n&&!0===n?(r.css(o),0==t?r.hide():r.show()):(0==t?r.stop().fadeOut(l.thumb_transition_duration):r.show().stop().fadeIn(l.thumb_transition_duration),function(e,t){e.stop(!0).animate(t,{duration:l.thumb_transition_duration,easing:l.thumb_transition_easing,queue:!1})}(r,o))}function h(e,t,i){var n=e.children(".ug-thumb-overlay"),r=l.thumb_transition_duration;i&&!0===i&&(r=0),t?n.stop(!0).fadeTo(r,u.colorOverlayOpacity):n.stop(!0).fadeTo(r,0)}function p(e,t,i){var n=e.children("img.ug-thumb-image"),r=e.children("img.ug-thumb-image-overlay"),o=l.thumb_transition_duration;i&&!0===i&&(o=0),t?r.stop(!0).fadeTo(o,1):(n.fadeTo(0,1),r.stop(!0).fadeTo(o,0))}function m(e,t){(u.isEffectBorder&&c(e,l.thumb_selected_border_width,l.thumb_selected_border_color,t),u.isEffectOverlay)&&h(e,1==l.thumb_overlay_reverse,t);u.isEffectImage&&p(e,!1,t),o.trigger(r.events.SETSELECTEDSTYLE,e)}function f(e){1==v(e)?m(e,!0):r.setThumbNormalStyle(e,!0,"redraw")}function b(e,t,i){if(1==l.thumb_fixed_size)s.scaleImageCoverParent(t,e);else{"height"==l.thumb_resize_by?s.scaleImageByHeight(t,l.thumb_height):s.scaleImageByWidth(t,l.thumb_width);var n=s.getElementSize(t);s.placeElement(t,0,0),g(n.width,n.height,e)}e.children(".ug-thumb-loader").hide(),t.show(),0==l.thumb_image_overlay_effect?t.fadeTo(0,1):(1==l.thumb_image_overlay_effect&&function(e){var t=e.siblings(".ug-thumb-image-overlay");if(0==t.length)return!1;var i=s.getElementSize(e),n={width:i.width+"px",height:i.height+"px",left:i.left+"px",top:i.top+"px"};t.css(n),0==u.customThumbs&&t.fadeTo(0,1)}(t),t.fadeTo(0,0),f(e)),o.trigger(r.events.AFTERPLACEIMAGE,e)}function v(e){return!!e.hasClass("ug-thumb-selected")}function y(e,t){t=jQuery(t);r.getItemByThumb(t);var i=s.getElementSize(t);g(i.width,i.height,t,!0),f(t)}function I(e,t){if(!t)t=!1;var i=jQuery(e),n=i.parents(".ug-thumb-wrapper");return 0!=n.parent().length&&(objItem=r.getItemByThumb(n),(1!=objItem.isLoaded||!1!==t)&&(r.triggerImageLoadedEvent(n,i),void(1==u.customThumbs?o.trigger(r.events.PLACEIMAGE,[n,i]):b(n,i,objItem))))}function w(e,t,i){objItem=r.getItemByThumb(t),objItem.isLoaded=!0,objItem.isThumbImageLoaded=!0;var n=s.getImageOriginalSize(i);objItem.thumbWidth=n.width,objItem.thumbHeight=n.height,objItem.thumbRatioByWidth=n.width/n.height,objItem.thumbRatioByHeight=n.height/n.width,t.addClass("ug-thumb-ratio-set")}this.init=function(n,r){e=n.getObjects(),a=n,jQuery(n),t=e.g_objWrapper,i=e.g_arrItems,l=jQuery.extend(l,r),u.isEffectBorder=l.thumb_border_effect,u.isEffectOverlay=l.thumb_color_overlay_effect,u.isEffectImage=l.thumb_image_overlay_effect},this._____________EXTERNAL_SETTERS__________=function(){},this.setHtmlThumbs=function(e,t){if(n=e,1==u.isEffectImage)var i=function(){var e="",t=l.thumb_image_overlay_type.split(",");for(var i in t){var n=t[i];switch(n){case"bw":e+=" ug-bw-effect";break;case"blur":e+=" ug-blur-effect";break;case"sepia":e+=" ug-sepia-effect"}}return e}();if(!0!==t)for(var o=a.getNumItems(),s=0;s<o;s++)_(s,i);else{r.getThumbs().removeClass(u.classNewThumb);var d=a.getNewAddedItemsIndexes();jQuery.each(d,function(e,t){_(t,i).addClass(u.classNewThumb)})}},this.setThumbNormalStyle=function(e,t,i){(1==u.customThumbs&&e.removeClass("ug-thumb-over"),u.isEffectBorder&&c(e,l.thumb_border_width,l.thumb_border_color,t),u.isEffectOverlay)&&h(e,1!=l.thumb_overlay_reverse,t);u.isEffectImage&&p(e,!0,t),o.trigger(r.events.SETNORMALSTYLE,e)},this.setThumbOverStyle=function(e){(1==u.customThumbs&&e.addClass("ug-thumb-over"),u.isEffectBorder&&c(e,l.thumb_over_border_width,l.thumb_over_border_color),u.isEffectOverlay)&&h(e,1==l.thumb_overlay_reverse);1==u.isEffectImage&&p(e,!1),o.trigger(r.events.SETOVERSTYLE,e)},this.setHtmlProperties=function(e){if(!e)e=r.getThumbs();if(0==u.customThumbs){1==l.thumb_fixed_size&&g(l.thumb_width,l.thumb_height,e),function(e){if(l.thumb_round_corners_radius<=0)return!1;var t={"border-radius":l.thumb_round_corners_radius+"px"};e?(e.css(t),e.find(".ug-thumb-border-overlay").css(t)):n.find(".ug-thumb-wrapper, .ug-thumb-wrapper .ug-thumb-border-overlay").css(t)}(e)}if(e.each(function(){f(jQuery(this))}),u.isEffectOverlay&&l.thumb_overlay_color){var t={};if(s.isRgbaSupported()){var i=s.convertHexToRGB(l.thumb_overlay_color,l.thumb_overlay_opacity);t["background-color"]=i}else t["background-color"]=l.thumb_overlay_color,u.colorOverlayOpacity=l.thumb_overlay_opacity;e.find(".ug-thumb-overlay").css(t)}},this.setThumbSelected=function(e){if(1==u.customThumbs&&e.removeClass("ug-thumb-over"),1==v(e))return!0;e.addClass("ug-thumb-selected"),m(e)},this.setThumbUnselected=function(e){e.removeClass("ug-thumb-selected"),r.setThumbNormalStyle(e,!1,"set unselected")},this.setOptions=function(e){l=jQuery.extend(l,e)},this.setThumbInnerReduce=function(e){u.thumbInnerReduce=e},this.setCustomThumbs=function(e,t,i){if(u.customThumbs=!0,"function"!=typeof e)throw new Error("The argument should be function");u.funcSetCustomThumbHtml=e,-1==jQuery.inArray("overlay",t)&&(u.isEffectOverlay=!1),-1==jQuery.inArray("border",t)&&(u.isEffectBorder=!1),u.isEffectImage=!1,i&&!1===i.allow_onresize&&(u.allowOnResize=!1)},this._____________EXTERNAL_GETTERS__________=function(){},this.getOptions=function(){return l},this.getNumThumbs=function(){return i.length},this.getThumbImage=function(e){return e.find(".ug-thumb-image")},this.getThumbByIndex=function(e){var t=r.getThumbs();if(e>=t.length||e<0)throw new Error("Wrong thumb index");return jQuery(t[e])},this.getThumbs=function(e){switch(e){default:case r.type.GET_THUMBS_ALL:var t=n.children(".ug-thumb-wrapper");break;case r.type.GET_THUMBS_NO_RATIO:t=n.children(".ug-thumb-wrapper").not(".ug-thumb-ratio-set");break;case r.type.GET_THUMBS_RATIO:t=n.children(".ug-thumb-wrapper.ug-thumb-ratio-set");break;case r.type.GET_THUMBS_NEW:t=n.children("."+u.classNewThumb)}return t},this.getItemByThumb=function(e){var t=e.data("index");return void 0===t&&(t=e.index()),i[t]},this.isThumbLoaded=function(e){return r.getItemByThumb(e).isLoaded},this.getGlobalThumbSize=function(){return{width:l.thumb_width,height:l.thumb_height}},this._____________EXTERNAL_OTHERS__________=function(){},this.initEvents=function(){1==u.allowOnResize&&t.on(d,y),o.on(r.events.THUMB_IMAGE_LOADED,w),n.on("touchstart",".ug-thumb-wrapper",function(){u.touchEnabled=!0,n.off("mouseenter").off("mouseleave")}),n.on("mouseenter",".ug-thumb-wrapper",function(e){!function(e){if(1==u.touchEnabled)return objThumbs.off("mouseenter").off("mouseleave"),!0;0==v(e)&&r.setThumbOverStyle(e)}(jQuery(this))}),n.on("mouseleave",".ug-thumb-wrapper",function(e){!function(e){if(1==u.touchEnabled)return!0;0==v(e)&&r.setThumbNormalStyle(e,!1)}(jQuery(this))})},this.destroy=function(){n.off("touchstart",".ug-thumb-wrapper"),t.off(d),n.off("mouseenter",".ug-thumb-wrapper"),n.off("mouseleave",".ug-thumb-wrapper"),o.off(r.events.THUMB_IMAGE_LOADED)},this.loadThumbsImages=function(){var e=n.find(".ug-thumb-image");s.checkImagesLoaded(e,null,function(e,t){0==t?I(e,!0):function(e){var t=r.getItemByThumb(e);if(t.isLoaded=!0,t.isThumbImageLoaded=!1,1==u.customThumbs)return o.trigger(r.events.IMAGELOADERROR,e),!0;e.children(".ug-thumb-loader").hide(),e.children(".ug-thumb-error").show()}(jQuery(e).parent())})},this.triggerImageLoadedEvent=function(e,t){o.trigger(r.events.THUMB_IMAGE_LOADED,[e,t])},this.hideThumbs=function(){n.find(".ug-thumb-wrapper").hide()}}function UGThumbsStrip(){var e,t,n,r,o,a,s,l,u=this,d=new UniteGalleryMain,_=new UGFunctions,g=!1,c=new UGThumbsGeneral,h=(_=new UGFunctions,{strip_vertical_type:!1,strip_thumbs_align:"left",strip_space_between_thumbs:6,strip_thumb_touch_sensetivity:15,strip_scroll_to_thumb_duration:500,strip_scroll_to_thumb_easing:"easeOutCubic",strip_control_avia:!0,strip_control_touch:!0,strip_padding_top:0,strip_padding_bottom:0,strip_padding_left:0,strip_padding_right:0}),p={isRunOnce:!1,is_placed:!1,isNotFixedThumbs:!1,handle:null},m={stripSize:0,stripActiveSize:0,stripInnerSize:0,thumbSize:0,thumbSecondSize:0};this.events={STRIP_MOVE:"stripmove",INNER_SIZE_CHANGE:"size_change"};var f={strip_thumbs_align:"top",thumb_resize_by:"width"};function b(){var e=c.getOptions();p.isNotFixedThumbs=!1===e.thumb_fixed_size,g=h.strip_vertical_type}function v(){var t,i,n,r,_;c.setHtmlProperties(),t=a.children(".ug-thumb-wrapper"),i=jQuery(t[0]),n=i.outerWidth(),r=i.outerHeight(),_=c.getOptions(),0==g?(m.thumbSize=n,1==_.thumb_fixed_size?m.thumbSecondSize=r:m.thumbSecondSize=_.thumb_height,y(o.width()),m.stripInnerSize=a.width()):(m.thumbSize=r,1==_.thumb_fixed_size?m.thumbSecondSize=n:m.thumbSecondSize=_.thumb_width,y(o.height()),m.stripInnerSize=a.height()),function(){if(0==g){var e=m.thumbSecondSize,t={};t.height=e+"px";var i={};i.height=e+"px"}else{var n=m.thumbSecondSize,t={};t.width=n+"px";var i={};i.width=n+"px"}o.css(t),a.css(i)}(),I(),0==p.isRunOnce&&(1==h.strip_control_touch&&(l=new UGTouchThumbsControl).init(u),1==h.strip_control_avia&&(s=new UGAviaControl).init(u),P(),c.loadThumbsImages(),c.initEvents(),o.find(".ug-thumb-wrapper").on("click touchend",function(e){!function(e){if(u.isTouchMotionActive()){var t=l.isSignificantPassed();if(1==t)return!0}var i=c.getItemByThumb(e);d.selectItem(i)}(jQuery(this))}),e.on(d.events.ITEM_CHANGE,j),p.isNotFixedThumbs&&jQuery(c).on(c.events.AFTERPLACEIMAGE,x)),p.isRunOnce=!0}function y(e){m.stripSize=e,m.stripActiveSize=0==g?m.stripSize-h.strip_padding_left-h.strip_padding_right:m.stripSize-h.strip_padding_top-h.strip_padding_bottom,m.stripActiveSize<0&&(m.stripActiveSize=0)}function I(){var e,t=a.children(".ug-thumb-wrapper"),n=0,r=0;for(0==g&&(r=h.strip_padding_top),i=0;i<t.length;i++){var o=jQuery(t[i]);if(1==p.isNotFixedThumbs){if(objItem=c.getItemByThumb(o),0==objItem.isLoaded)continue;o.show()}_.placeElement(o,n,r),0==g?n+=o.outerWidth()+h.strip_space_between_thumbs:r+=o.outerHeight()+h.strip_space_between_thumbs}if(0==g)var s=n-h.strip_space_between_thumbs;else s=r-h.strip_space_between_thumbs;e=s,0==g?a.width(e):a.height(e),m.stripInnerSize=e,P(),jQuery(u).trigger(u.events.INNER_SIZE_CHANGE)}function w(e){var t=u.getInnerStripPos()+e;t=u.fixInnerStripLimits(t),u.positionInnerStrip(t,!0)}function E(e){var t=-1*A(e).min;t=u.fixInnerStripLimits(t),u.positionInnerStrip(t,!0)}function T(e){var t=-1*A(e).max+m.stripSize;t=u.fixInnerStripLimits(t),u.positionInnerStrip(t,!0)}function S(e){if(0==C())return!1;var t,i,n=(t={},i=u.getInnerStripPos(),t.minPosThumbs=-1*i+1,t.maxPosThumbs=-1*i+m.stripSize-1,t),r=A(e);if(r.min<n.minPosThumbs){var o=e.prev();o.length?E(o):E(e)}else if(r.max>n.maxPosThumbs){var a=e.next();a.length?T(a):T(e)}}function P(){1==C()?(s&&s.enable(),l&&l.enable()):(s&&s.disable(),l&&l.disable())}function x(){clearTimeout(p.handle),p.handle=setTimeout(function(){I()},50)}function j(){var e=d.getSelectedItem();c.setThumbSelected(e.objThumbWrapper),S(e.objThumbWrapper)}function C(){return m.stripInnerSize>m.stripActiveSize}function A(e){var t={},i=e.position();return 0==g?(t.min=i.left,t.max=i.left+m.thumbSize):(t.min=i.top,t.max=i.top+m.thumbSize),t}this.setHtml=function(e){if(!e){e=n;null!=h.parent_container&&(e=h.parent_container)}e.append("<div class='ug-thumbs-strip'><div class='ug-thumbs-strip-inner'></div></div>"),o=e.children(".ug-thumbs-strip"),a=o.children(".ug-thumbs-strip-inner"),c.setHtmlThumbs(a),1==p.isNotFixedThumbs&&c.hideThumbs()},this.destroy=function(){var t=o.find(".ug-thumb-wrapper");t.off("click"),t.off("touchend"),e.off(d.events.ITEM_CHANGE),jQuery(c).off(c.events.AFTERPLACEIMAGE),l&&l.destroy(),s&&s.destroy(),c.destroy()},this.________EXTERNAL_GENERAL___________=function(){},this.init=function(i,o){!function(i,o){t=i.getObjects(),(d=i).attachThumbsPanel("strip",u),e=jQuery(i),n=t.g_objWrapper,r=t.g_arrItems,h=jQuery.extend(h,o),1==(g=h.strip_vertical_type)&&(h=jQuery.extend(h,f),h=jQuery.extend(h,o),o.thumb_resize_by="width"),c.init(i,o),b()}(i,o)},this.run=function(){v()},this.positionInnerStrip=function(e,t){if(void 0===t)t=!1;if(0==g)var i={left:e+"px"};else i={top:e+"px"};0==t?(a.css(i),u.triggerStripMoveEvent()):(u.triggerStripMoveEvent(),a.stop(!0).animate(i,{duration:h.strip_scroll_to_thumb_duration,easing:h.strip_scroll_to_thumb_easing,queue:!1,progress:function(){u.triggerStripMoveEvent()},always:function(){u.triggerStripMoveEvent()}}))},this.triggerStripMoveEvent=function(){jQuery(u).trigger(u.events.STRIP_MOVE)},this.isTouchMotionActive=function(){return!!l&&l.isTouchActive()},this.isItemThumbVisible=function(e){var t=e.objThumbWrapper,i=t.position(),n=-1*u.getInnerStripPos();if(0==g)var r=n+m.stripSize,o=i.left,a=i.left+t.width();else r=n+m.stripSize,o=i.top,a=i.top+t.height();var s=!1;return a>=n&&o<=r&&(s=!0),s},this.getInnerStripPos=function(){return 0==g?a.position().left:a.position().top},this.getInnerStripLimits=function(){var e={};return e.maxPos=0==g?h.strip_padding_left:h.strip_padding_top,e.minPos=-(m.stripInnerSize-m.stripActiveSize),e},this.fixInnerStripLimits=function(e){var t=u.getInnerStripLimits();return e>t.maxPos&&(e=t.maxPos),e<t.minPos&&(e=t.minPos),e},this.scrollForeward=function(){w(-m.stripSize)},this.scrollBack=function(){w(m.stripSize)},this.________EXTERNAL_SETTERS___________=function(){},this.setOptions=function(e){h=jQuery.extend(h,e),c.setOptions(e),b()},this.setSizeVertical=function(e){if(0==g)throw new Error("setSizeVertical error, the strip size is not vertical");var t=m.thumbSecondSize,i={};i.width=t+"px",i.height=e+"px",o.css(i),y(e);var n={};n.width=t+"px",n.left="0px",n.top="0px",a.css(n),p.is_placed=!0,P()},this.setSizeHorizontal=function(e){if(1==g)throw new Error("setSizeHorizontal error, the strip size is not horizontal");var t=m.thumbSecondSize+h.strip_padding_top+h.strip_padding_bottom,i={};i.width=e+"px",i.height=t+"px",o.css(i),y(e);var n=h.strip_padding_left,r={};r.height=t+"px",r.left=n+"px",r.top="0px",a.css(r),p.is_placed=!0,P()},this.setPosition=function(e,t,i,n){_.placeElement(o,e,t,i,n)},this.resize=function(e){0==g?(o.width(e),m.stripActiveSize=e-h.strip_padding_left-h.strip_padding_right):(o.height(e),m.stripActiveSize=e-h.strip_padding_top-h.strip_padding_bottom),y(e),P(),function(){if(0==C())return!1;var e=u.getInnerStripPos(),t=u.fixInnerStripLimits(e);e!=t&&u.positionInnerStrip(t,!0)}(),function(){if(C())return!1;0==g?_.placeElement(a,h.strip_thumbs_align,0):_.placeElement(a,0,h.strip_thumbs_align)}(),function(){var e=d.getSelectedItem();if(null==e)return!0;var t=e.objThumbWrapper;t&&S(t)}(),s&&s.onResize()},this.setThumbUnselected=function(e){c.setThumbUnselected(e)},this.setCustomThumbs=function(e){c.setCustomThumbs(e)},this.________EXTERNAL_GETTERS___________=function(){},this.getObjects=function(){var t=c.getOptions(),i=jQuery.extend(h,t);return{g_gallery:d,g_objGallery:e,g_objWrapper:n,g_arrItems:r,g_objStrip:o,g_objStripInner:a,g_aviaControl:s,g_touchThumbsControl:l,isVertical:g,g_options:i,g_thumbs:c}},this.getObjThumbs=function(){return c},this.getSelectedThumb=function(){var e=d.getSelectedItemIndex();return-1==e?null:c.getThumbByIndex(e)},this.getSizeAndPosition=function(){return _.getElementSize(o)},this.getHeight=function(){return o.outerHeight()},this.getWidth=function(){return o.outerWidth()},this.getSizes=function(){return m},this.isVertical=function(){return g},this.isPlaced=function(){return p.is_placed},this.isMoveEnabled=function(){return C()}}function UGTouchThumbsControl(){var e,t,i,n,r,o,a=new UGFunctions,s={touch_portion_time:200,thumb_touch_slowFactor:0,minDeltaTime:70,minPath:10,limitsBreakAddition:30,returnAnimateSpeed:500,animationEasing:"easeOutCubic",returnAnimationEasing:"easeOutCubic"},l={touch_active:!1,loop_active:!1,mousePos:0,innerPos:0,startPos:0,startTime:0,lastTime:0,buttonReleaseTime:0,lastPos:0,lastPortionPos:0,lastDeltaTime:0,lastDeltaPos:0,speed:0,handle:"",touchEnabled:!1,isControlEnabled:!0};function u(){var e=jQuery.now(),t={};return t.passedTime=l.lastTime-l.startTime,t.lastActiveTime=e-l.buttonReleaseTime,t.passedDistance=l.lastPos-l.startPos,t.passedDistanceAbs=Math.abs(t.passedDistance),t}function d(e){return 0==o?a.getMousePosition(e).pageX:a.getMousePosition(e).pageY}function _(){var e=jQuery.now();e-l.lastTime>=s.touch_portion_time&&(l.lastDeltaTime=e-l.lastTime,l.lastDeltaTime>s.touch_portion_time&&(l.lastDeltaTime=s.touch_portion_time),l.lastDeltaPos=l.lastPos-l.lastPortionPos,l.lastPortionPos=l.lastPos,l.lastTime=e)}function g(){l.lastPos=e.getInnerStripPos(),e.triggerStripMoveEvent()}function c(t){if(0==l.loop_active)return!0;if(t){d(t);!function(){var t=s.thumb_touch_slowFactor,i=s.minDeltaTime,r=s.minPath,a=e.getInnerStripPos(),u=jQuery.now()-l.lastTime,d=a-l.lastPortionPos;u<i&&l.lastDeltaTime>0&&(u=l.lastDeltaTime,d=l.lastDeltaPos+d),u<i&&(u=i);var _=0;u>0&&(_=d/u);var c=_*_/(2*t)*(d>0?1:-1);Math.abs(c)<=r&&(c=0);var h=e.getInnerStripPos(),p=h+c,m=e.fixInnerStripLimits(p),f=e.getInnerStripLimits(),b=s.limitsBreakAddition,v=!1,y=m;if(p>f.maxPos&&(v=!0,m=b,p<b&&(m=p)),p<f.minPos){v=!0;var I=f.minPos-b;m=I,p>I&&(m=p)}var w=m-h,E=Math.abs(Math.round(_/t));if(0!=c&&(E=E*w/c),h!=m){var T={left:m+"px"};1==o&&(T={top:m+"px"}),n.animate(T,{duration:E,easing:s.animationEasing,queue:!0,progress:g})}if(1==v){var S=s.returnAnimateSpeed,P={left:y+"px"};1==o&&(P={top:y+"px"}),n.animate(P,{duration:S,easing:s.returnAnimationEasing,queue:!0,progress:g})}}()}l.loop_active=!1,l.handle=clearInterval(l.handle)}function h(e){return 0==l.isControlEnabled||(l.buttonReleaseTime=jQuery.now(),0==l.touch_active?(c(e),!0):(e.preventDefault(),l.touch_active=!1,c(e),void i.removeClass("ug-dragging")))}function p(t){if(0==l.isControlEnabled)return!0;t.preventDefault(),l.touch_active=!0;var r=d(t);n.stop(!0),function(t){var i=e.getInnerStripPos();l.mousePos=t,l.innerPos=i,l.lastPortionPos=i,l.lastDeltaTime=0,l.lastDeltaPos=0,l.startTime=jQuery.now(),l.startPos=l.innerPos,l.lastTime=l.startTime,l.lastPos=l.startPos,l.speed=0}(r),function(){if(1==l.loop_active)return!0;l.loop_active=!0,l.handle=setInterval(_,10)}(),i.addClass("ug-dragging")}function m(t){if(0==l.isControlEnabled)return!0;if(0==l.touch_active)return!0;if(t.preventDefault(),0==t.buttons)return l.touch_active=!1,c(t),!0;var i=d(t);l.lastPos=e.getInnerStripPos(),function(t){var i=l.mousePos-t,n=l.innerPos-i,r=e.getInnerStripLimits();if(n>r.maxPos){var o=n-r.maxPos;n=r.maxPos+o/3}n<r.minPos&&(o=r.minPos-n,n=r.minPos-o/3);e.positionInnerStrip(n)}(i),_()}this.enable=function(){l.isControlEnabled=!0},this.disable=function(){l.isControlEnabled=!1},this.init=function(l){e=l,t=l.getObjects(),t.g_gallery,t.g_objGallery,i=t.g_objStrip,n=t.g_objStripInner,r=t.g_options,o=t.isVertical,s.thumb_touch_slowFactor=a.normalizeSetting(5e-5,.01,1,100,r.strip_thumb_touch_sensetivity,!0),i.bind("mousedown touchstart",p),jQuery(window).add("body").bind("mouseup touchend",h),jQuery("body").bind("mousemove touchmove",m)},this.isSignificantPassed=function(){var e=u();return e.passedTime>300||e.passedDistanceAbs>30},this.isTouchActive=function(){return 1==l.touch_active||(1==n.is(":animated")||u().lastActiveTime<50)},this.destroy=function(){i.unbind("mousedown"),i.unbind("touchstart"),jQuery(window).add("body").unbind("mouseup").unbind("touchend"),jQuery("body").unbind("mousemove").unbind("touchmove")}}function UGPanelsBase(){var e,t,i,n,r,o,a,s=new UniteGalleryMain,l=this,u=new UGFunctions;function d(t,n){switch(e.orientation){case"right":case"left":var r={left:t+"px"};break;case"top":case"bottom":r={top:t+"px"}}i.stop(!0).animate(r,{duration:300,easing:"easeInOutQuad",queue:!1,complete:function(){n&&n()}})}function _(t){switch(e.orientation){case"right":case"left":u.placeElement(i,t,null);break;case"top":case"bottom":u.placeElement(i,null,t)}}function g(){r.trigger(t.events.FINISH_MOVE)}this.init=function(i,o,l,u,d){e=o,t=l,s=i,n=u,r=d,a=jQuery(s)},this.setHtml=function(r){if(i=r,"strip"==e.panelType)var a=n.strippanel_enable_handle;else a=n.gridpanel_enable_handle;if(1==a&&((o=new UGPanelHandle).init(t,i,n,e.panelType,s),o.setHtml()),!0===e.isDisabledAtStart){i.append("<div class='ug-overlay-disabled'></div>"),setTimeout(function(){i.children(".ug-overlay-disabled").hide()},e.disabledAtStartTimeout)}},this.placeElements=function(){o&&o.placeHandle()},this.initEvents=function(){o&&(o.initEvents(),a.on(s.events.SLIDER_ACTION_START,function(){o.hideHandle()}),a.on(s.events.SLIDER_ACTION_END,function(){o.showHandle()}))},this.destroy=function(){o&&(o.destroy(),a.off(s.events.SLIDER_ACTION_START),a.off(s.events.SLIDER_ACTION_END))},this.openPanel=function(n){if(!n)n=!1;return!i.is(":animated")&&(0!=e.isClosed&&(e.isClosed=!1,r.trigger(t.events.OPEN_PANEL),void(!1===n?d(e.originalPos,g):(_(e.originalPos),g()))))},this.closePanel=function(n){if(!n)n=!1;if(i.is(":animated"))return!1;if(1==e.isClosed)return!1;var o=l.getClosedPanelDest();e.isClosed=!0,r.trigger(t.events.CLOSE_PANEL),!1===n?d(o,g):(_(o),g())},this.setClosedState=function(i){e.originalPos=i,r.trigger(t.events.CLOSE_PANEL),e.isClosed=!0},this.setOpenedState=function(i){r.trigger(t.events.OPEN_PANEL),e.isClosed=!1},this.getClosedPanelDest=function(){var t,n=u.getElementSize(i);switch(e.orientation){case"left":e.originalPos=n.left,t=-e.panelWidth;break;case"right":e.originalPos=n.left,t=s.getSize().width;break;case"top":e.originalPos=n.top,t=-e.panelHeight;break;case"bottom":e.originalPos=n.top,t=s.getSize().height}return t},this.isPanelClosed=function(){return e.isClosed},this.setDisabledAtStart=function(t){if(t<=0)return!1;e.isDisabledAtStart=!0,e.disabledAtStartTimeout=t}}function UGPanelHandle(){var e,t,i,n=new UGFunctions,r={panel_handle_align:"top",panel_handle_offset:0,panel_handle_skin:0};function o(){i.removeClass("ug-button-hover")}function a(e){if(e.stopPropagation(),e.stopImmediatePropagation(),0==n.validateClickTouchstartEvent(e.type))return!0;t.isPanelClosed()?t.openPanel():t.closePanel()}this.init=function(i,n,o,a,s){switch(t=i,e=n,a){case"grid":r.panel_handle_align=o.gridpanel_handle_align,r.panel_handle_offset=o.gridpanel_handle_offset,r.panel_handle_skin=o.gridpanel_handle_skin;break;case"strip":r.panel_handle_align=o.strippanel_handle_align,r.panel_handle_offset=o.strippanel_handle_offset,r.panel_handle_skin=o.strippanel_handle_skin;break;default:throw new Error("Panel handle error: wrong panel type: "+a)}var l=s.getOptions().gallery_skin;""==r.panel_handle_skin&&(r.panel_handle_skin=l)},this.setHtml=function(){var n="ug-panel-handle-tip";switch(t.getOrientation()){case"right":n+=" ug-handle-tip-left";break;case"left":n+=" ug-handle-tip-right";break;case"bottom":n+=" ug-handle-tip-top";break;case"top":n+=" ug-handle-tip-bottom"}e.append("<div class='"+n+" ug-skin-"+r.panel_handle_skin+"'></div>"),i=e.children(".ug-panel-handle-tip")},this.initEvents=function(){n.addClassOnHover(i),i.bind("click touchstart",a),jQuery(t).on(t.events.OPEN_PANEL,function(){o(),i.removeClass("ug-button-closed")}),jQuery(t).on(t.events.CLOSE_PANEL,function(){o(),i.addClass("ug-button-closed")})},this.destroy=function(){n.destroyButton(i),jQuery(t).off(t.events.OPEN_PANEL),jQuery(t).off(t.events.CLOSE_PANEL)},this.placeHandle=function(){var e=n.getElementSize(i);!function(){switch(t.getOrientation()){case"right":case"left":"top"!=r.panel_handle_align&&"bottom"!=r.panel_handle_align&&(r.panel_handle_align="top");break;case"bottom":"left"!=r.panel_handle_align&&"right"!=r.panel_handle_align&&(r.panel_handle_align="left");break;case"top":"left"!=r.panel_handle_align&&"right"!=r.panel_handle_align&&(r.panel_handle_align="right")}}();var o=t.getOrientation();switch(o){case"left":n.placeElement(i,"right",r.panel_handle_align,-e.width);break;case"right":n.placeElement(i,-e.width,r.panel_handle_align,0,r.panel_handle_offset);break;case"top":n.placeElement(i,r.panel_handle_align,"bottom",r.panel_handle_offset,-e.height);break;case"bottom":n.placeElement(i,r.panel_handle_align,"top",r.panel_handle_offset,-e.height);break;default:throw new Error("Wrong panel orientation: "+o)}},this.hideHandle=function(){1==i.is(":visible")&&i.hide()},this.showHandle=function(){0==i.is(":visible")&&i.show()}}function UGStripPanel(){var e,t,i,n,r,o=this,a=jQuery(this),s=new UniteGalleryMain,l=new UGFunctions,u=new UGThumbsStrip,d=new UGPanelsBase;this.events={FINISH_MOVE:"gridpanel_move_finish",OPEN_PANEL:"open_panel",CLOSE_PANEL:"close_panel"};var _={strippanel_vertical_type:!1,strippanel_padding_top:8,strippanel_padding_bottom:8,strippanel_padding_left:0,strippanel_padding_right:0,strippanel_enable_buttons:!0,strippanel_buttons_skin:"",strippanel_padding_buttons:2,strippanel_buttons_role:"scroll_strip",strippanel_enable_handle:!0,strippanel_handle_align:"top",strippanel_handle_offset:0,strippanel_handle_skin:"",strippanel_background_color:""},g={strip_vertical_type:!0,strippanel_padding_left:8,strippanel_padding_right:8,strippanel_padding_top:0,strippanel_padding_bottom:0},c={strippanel_padding_left:8,strippanel_padding_right:8,strippanel_padding_top:8,strippanel_padding_bottom:8},h={panelType:"strip",panelWidth:0,panelHeight:0,isEventsInited:!1,isClosed:!1,orientation:null,originalPos:null,isFirstRun:!0};function p(){if(1==h.isFirstRun&&0==function(){if(0==_.strippanel_vertical_type){if(0==h.panelWidth)throw new Error("Strip panel error: The width not set, please set width")}else if(0==h.panelHeight)throw new Error("Strip panel error: The height not set, please set height");if(null==h.orientation)throw new Error("Wrong orientation, please set panel orientation before run");return!0}())return!1;u.run(),f(),b(),function(){if(1==h.isEventsInited)return!1;if(h.isEventsInited=!0,n)if(l.addClassOnHover(n,"ug-button-hover"),l.addClassOnHover(r,"ug-button-hover"),l.setButtonOnClick(r,y),l.setButtonOnClick(n,v),"advance_item"!=_.strippanel_buttons_role)jQuery(u).on(u.events.STRIP_MOVE,w),jQuery(u).on(u.events.INNER_SIZE_CHANGE,I),e.on(s.events.SIZE_CHANGE,I);else{var t=s.getOptions();0==t.gallery_carousel&&jQuery(s).on(s.events.ITEM_CHANGE,E)}d.initEvents()}(),h.isFirstRun=!1,I()}function m(e){if(!e)e=t;if(e.append("<div class='ug-strip-panel'></div>"),i=e.children(".ug-strip-panel"),1==_.strippanel_enable_buttons){var o="ug-strip-arrow-left",a="ug-strip-arrow-right";1==_.strippanel_vertical_type&&(o="ug-strip-arrow-up",a="ug-strip-arrow-down"),i.append("<div class='ug-strip-arrow "+o+" ug-skin-"+_.strippanel_buttons_skin+"'><div class='ug-strip-arrow-tip'></div></div>"),i.append("<div class='ug-strip-arrow "+a+" ug-skin-"+_.strippanel_buttons_skin+"'><div class='ug-strip-arrow-tip'></div></div>")}d.setHtml(i),u.setHtml(i),1==_.strippanel_enable_buttons&&(r=i.children("."+o),n=i.children("."+a)),""!=_.strippanel_background_color&&i.css("background-color",_.strippanel_background_color)}function f(){0==_.strippanel_vertical_type?function(){var e=u.getHeight(),t=h.panelWidth;if(n){r.height(e),n.height(e);var o=r.children(".ug-strip-arrow-tip");l.placeElement(o,"center","middle");var a=n.children(".ug-strip-arrow-tip");l.placeElement(a,"center","middle")}var s=e+_.strippanel_padding_top+_.strippanel_padding_bottom;i.width(t),i.height(s),h.panelHeight=s;var d=t-_.strippanel_padding_left-_.strippanel_padding_right;n&&(d=d-2*n.outerWidth()-2*_.strippanel_padding_buttons),u.resize(d)}():function(){var e=u.getWidth(),t=h.panelHeight;if(n){r.width(e),n.width(e);var o=r.children(".ug-strip-arrow-tip");l.placeElement(o,"center","middle");var a=n.children(".ug-strip-arrow-tip");l.placeElement(a,"center","middle")}var s=e+_.strippanel_padding_left+_.strippanel_padding_right;i.width(s),i.height(t),h.panelWidth=s;var d=t-_.strippanel_padding_top-_.strippanel_padding_bottom;n&&(d=d-2*n.outerHeight()-2*_.strippanel_padding_buttons),u.resize(d)}()}function b(){0==_.strippanel_vertical_type?function(){n&&(l.placeElement(r,"left","top",_.strippanel_padding_left,_.strippanel_padding_top),l.placeElement(n,"right","top",_.strippanel_padding_right,_.strippanel_padding_top));var e=_.strippanel_padding_left;n&&(e+=n.outerWidth()+_.strippanel_padding_buttons),u.setPosition(e,_.strippanel_padding_top)}():function(){n&&(l.placeElement(r,"left","top",_.strippanel_padding_left,_.strippanel_padding_top),l.placeElement(n,"left","bottom",_.strippanel_padding_left,_.strippanel_padding_bottom));var e=_.strippanel_padding_top;n&&(e+=n.outerHeight()+_.strippanel_padding_buttons),u.setPosition(_.strippanel_padding_left,e)}(),d.placeElements()}function v(e){if(l.isButtonDisabled(e))return!0;"advance_item"==_.strippanel_buttons_role?s.nextItem():u.scrollForeward()}function y(e){if(l.isButtonDisabled(e))return!0;"advance_item"==_.strippanel_buttons_role?s.prevItem():u.scrollBack()}function I(){if(!n)return!0;if(0==u.isMoveEnabled())return l.disableButton(r),l.disableButton(n),!0;var e=u.getInnerStripLimits(),t=u.getInnerStripPos();t>=e.maxPos?l.disableButton(r):l.enableButton(r),t<=e.minPos?l.disableButton(n):l.enableButton(n)}function w(){I()}function E(){s.isLastItem()?l.disableButton(n):l.enableButton(n),s.isFirstItem()?l.disableButton(r):l.enableButton(r)}this.destroy=function(){n&&(l.destroyButton(n),l.destroyButton(r),jQuery(u).off(u.events.STRIP_MOVE),jQuery(s).off(s.events.ITEM_CHANGE),jQuery(s).off(s.events.SIZE_CHANGE)),d.destroy(),u.destroy()},this.getOrientation=function(){return h.orientation},this.setOrientation=function(e){h.orientation=e},this.init=function(i,n){!function(i,n){s=i,e=jQuery(s);var r=!1;1==(_=jQuery.extend(_,n)).strippanel_vertical_type&&(_=jQuery.extend(_,g),r=!0),0==_.strippanel_enable_buttons&&(_=jQuery.extend(_,c),r=!0),1==r&&(_=jQuery.extend(_,n));var l=s.getOptions().gallery_skin;""==_.strippanel_buttons_skin&&(_.strippanel_buttons_skin=l),t=s.getElement(),d.init(s,h,o,_,a),(u=new UGThumbsStrip).init(s,_)}(i,n)},this.run=function(){p()},this.setHtml=function(e){m(e)},this.getElement=function(){return i},this.getSize=function(){return l.getElementSize(i)},this.setWidth=function(e){h.panelWidth=e},this.setHeight=function(e){h.panelHeight=e},this.resize=function(e){o.setWidth(e),f(),b()},this.__________Functions_From_Base_____=function(){},this.isPanelClosed=function(){return d.isPanelClosed()},this.getClosedPanelDest=function(){return d.getClosedPanelDest()},this.openPanel=function(e){d.openPanel(e)},this.closePanel=function(e){d.closePanel(e)},this.setOpenedState=function(e){d.setOpenedState(e)},this.setClosedState=function(e){d.setClosedState(e)},this.setCustomThumbs=function(e){u.setCustomThumbs(e)},this.setDisabledAtStart=function(e){d.setDisabledAtStart(e)}}function UGGridPanel(){var e,t,i,n,r=this,o=jQuery(this),a=new UniteGalleryMain,s=new UGFunctions,l=new UGThumbsGrid,u=new UGPanelsBase;this.events={FINISH_MOVE:"gridpanel_move_finish",OPEN_PANEL:"open_panel",CLOSE_PANEL:"close_panel"};var d={gridpanel_vertical_scroll:!0,gridpanel_grid_align:"middle",gridpanel_padding_border_top:10,gridpanel_padding_border_bottom:4,gridpanel_padding_border_left:10,gridpanel_padding_border_right:10,gridpanel_arrows_skin:"",gridpanel_arrows_align_vert:"middle",gridpanel_arrows_padding_vert:4,gridpanel_arrows_align_hor:"center",gridpanel_arrows_padding_hor:10,gridpanel_space_between_arrows:20,gridpanel_arrows_always_on:!1,gridpanel_enable_handle:!0,gridpanel_handle_align:"top",gridpanel_handle_offset:0,gridpanel_handle_skin:"",gridpanel_background_color:""},_={gridpanel_grid_align:"middle",gridpanel_padding_border_top:2,gridpanel_padding_border_bottom:2},g={gridpanel_grid_align:"center"},c={panelType:"grid",isHorType:!1,arrowsVisible:!1,panelHeight:0,panelWidth:0,originalPosX:null,isEventsInited:!1,isClosed:!1,orientation:null};function h(){if(null==c.orientation)throw new Error("Wrong orientation, please set panel orientation before run")}function p(){h(),"center"==d.gridpanel_grid_align&&(d.gridpanel_grid_align="middle"),l.run(),function(){var e=!1;if(1==d.gridpanel_arrows_always_on)e=!0;else{var t=l.getNumPanes();t>1&&(e=!0)}1==e?(i.show().fadeTo(0,1),n.show().fadeTo(0,1),c.arrowsVisible=!0):(i.hide(),n.hide(),c.arrowsVisible=!1)}(),function(){var e=l.getSize();1==c.isHorType?c.panelHeight=e.height+d.gridpanel_padding_border_top+d.gridpanel_padding_border_bottom:c.panelWidth=e.width+d.gridpanel_padding_border_left+d.gridpanel_padding_border_right;s.setElementSize(t,c.panelWidth,c.panelHeight)}(),function(){0==c.isHorType?1==d.gridpanel_vertical_scroll?1==c.arrowsVisible?function(){var e,t,r,o,a=s.getElementSize(n),u=l.getSize();switch(d.gridpanel_grid_align){default:case"top":e=d.gridpanel_padding_border_top+a.height+d.gridpanel_arrows_padding_vert;break;case"middle":e="middle";break;case"bottom":e=c.panelHeight-u.height-a.height-d.gridpanel_padding_border_bottom-d.gridpanel_arrows_padding_vert}var _=f(),g=l.getElement();s.placeElement(g,_,e);var u=l.getSize();switch(d.gridpanel_arrows_align_vert){default:case"center":case"middle":t=(u.top-a.height)/2,r=u.bottom+(c.panelHeight-u.bottom-a.height)/2,o=0;break;case"grid":t=u.top-a.height-d.gridpanel_arrows_padding_vert_vert,r=u.bottom+d.gridpanel_arrows_padding_vert,o=0;break;case"border":case"borders":t=d.gridpanel_padding_border_top,r="bottom",o=d.gridpanel_padding_border_bottom}s.placeElement(n,"center",t),s.placeElement(i,"center",r,0,o)}():b():1==c.arrowsVisible?function(){var e,t,r,o=s.getElementSize(n),a=l.getSize(),u=d.gridpanel_padding_border_top;switch(d.gridpanel_grid_align){case"middle":switch(d.gridpanel_arrows_align_vert){default:var _=a.height+d.gridpanel_arrows_padding_vert+o.height;u=(c.panelHeight-_)/2;break;case"border":case"borders":var g=c.panelHeight-o.height-d.gridpanel_padding_border_bottom;u=(g-a.height)/2}break;case"bottom":var _=a.height+o.height+d.gridpanel_arrows_padding_vert;u=c.panelHeight-_-d.gridpanel_padding_border_bottom}var h=l.getElement(),p=f();s.placeElement(h,p,u);var a=l.getSize();switch(d.gridpanel_arrows_align_vert){default:case"center":case"middle":e=a.bottom+(c.panelHeight-a.bottom-o.height)/2,r=0;break;case"grid":e=a.bottom+d.gridpanel_arrows_padding_vert,r=0;break;case"border":case"borders":e="bottom",r=d.gridpanel_padding_border_bottom}t=-o.width/2-d.gridpanel_space_between_arrows/2,s.placeElement(n,"center",e,t,r);var m=Math.abs(t);s.placeElement(i,"center",e,m,r)}():b():1==c.arrowsVisible?function(){var e,t,r,o,a=s.getElementSize(n),u=l.getSize();switch(d.gridpanel_grid_align){default:case"left":e=d.gridpanel_padding_border_left+d.gridpanel_arrows_padding_hor+a.width;break;case"middle":case"center":e="center";break;case"right":e=c.panelWidth-u.width-a.width-d.gridpanel_padding_border_right-d.gridpanel_arrows_padding_hor}var _=l.getElement();switch(s.placeElement(_,e,d.gridpanel_padding_border_top),u=l.getSize(),d.gridpanel_arrows_align_vert){default:case"center":case"middle":o=(u.height-a.height)/2+u.top;break;case"top":o=d.gridpanel_padding_border_top+d.gridpanel_arrows_padding_vert;break;case"bottom":o=c.panelHeight-d.gridpanel_padding_border_bottom-d.gridpanel_arrows_padding_vert-a.height}switch(d.gridpanel_arrows_align_hor){default:case"borders":t=d.gridpanel_padding_border_left,r=c.panelWidth-d.gridpanel_padding_border_right-a.width;break;case"grid":t=u.left-d.gridpanel_arrows_padding_hor-a.width,r=u.right+d.gridpanel_arrows_padding_hor;break;case"center":t=(u.left-a.width)/2,r=u.right+(c.panelWidth-u.right-a.width)/2}s.placeElement(n,t,o),s.placeElement(i,r,o)}():function(){var e,t=l.getSize();switch(d.gridpanel_grid_align){default:case"left":e=d.gridpanel_padding_border_left;break;case"middle":case"center":e="center";break;case"right":e=c.panelWidth-t.width-d.gridpanel_padding_border_right}var i=l.getElement();s.placeElement(i,e,d.gridpanel_padding_border_top)}();u.placeElements()}(),function(){if(1==c.isEventsInited)return!1;c.isEventsInited=!0,n&&(s.addClassOnHover(n),l.attachPrevPaneButton(n));i&&(s.addClassOnHover(i),l.attachNextPaneButton(i));u.initEvents()}()}function m(){e.append("<div class='ug-grid-panel'></div>"),t=e.children(".ug-grid-panel"),c.isHorType?(t.append("<div class='grid-arrow grid-arrow-left-hortype ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),t.append("<div class='grid-arrow grid-arrow-right-hortype ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),n=t.children(".grid-arrow-left-hortype"),i=t.children(".grid-arrow-right-hortype")):0==d.gridpanel_vertical_scroll?(t.append("<div class='grid-arrow grid-arrow-left ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),t.append("<div class='grid-arrow grid-arrow-right ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),n=t.children(".grid-arrow-left"),i=t.children(".grid-arrow-right")):(t.append("<div class='grid-arrow grid-arrow-up ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),t.append("<div class='grid-arrow grid-arrow-down ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),n=t.children(".grid-arrow-up"),i=t.children(".grid-arrow-down")),u.setHtml(t),n.fadeTo(0,0),i.fadeTo(0,0),l.setHtml(t),""!=d.gridpanel_background_color&&t.css("background-color",d.gridpanel_background_color)}function f(){return d.gridpanel_padding_border_left}function b(){var e=d.gridpanel_grid_align,t=0;switch(e){case"top":t=d.gridpanel_padding_border_top;break;case"bottom":t=d.gridpanel_padding_border_bottom}var i=f(),n=l.getElement();s.placeElement(n,i,e,0,t)}this.destroy=function(){n&&s.destroyButton(n),i&&s.destroyButton(i),u.destroy(),l.destroy()},this.getOrientation=function(){return c.orientation},this.setOrientation=function(e){switch(c.orientation=e,e){case"right":case"left":c.isHorType=!1;break;case"top":case"bottom":c.isHorType=!0;break;default:throw new Error("Wrong grid panel orientation: "+e)}},this.setHeight=function(e){if(1==c.isHorType)throw new Error("setHeight is not appliable to this orientatio ("+c.orientation+"). Please use setWidth");c.panelHeight=e;var t,n,r=(t=d.gridpanel_padding_border_top+d.gridpanel_padding_border_bottom,n=c.panelHeight-t,0==d.gridpanel_arrows_always_on&&1==l.getNumPanesEstimationByHeight(n)?n:(t=s.getElementSize(i).height+d.gridpanel_arrows_padding_vert,1==d.gridpanel_vertical_scroll&&(t*=2),t+=d.gridpanel_padding_border_top+d.gridpanel_padding_border_bottom,n=c.panelHeight-t));l.setMaxHeight(r)},this.setWidth=function(e){if(0==c.isHorType)throw new Error("setWidth is not appliable to this orientatio ("+c.orientation+"). Please use setHeight");c.panelWidth=e;var t,n,r=(t=d.gridpanel_padding_border_left+d.gridpanel_padding_border_right,n=c.panelWidth-t,0==d.gridpanel_arrows_always_on&&1==l.getNumPanesEstimationByWidth(n)?n:(t+=2*(s.getElementSize(i).width+d.gridpanel_arrows_padding_hor),n=c.panelWidth-t));l.setMaxWidth(r)},this.init=function(t,i){!function(t,i){a=t,h(),i&&i.vertical_scroll&&(d.gridpanel_vertical_scroll=i.vertical_scroll),d=jQuery.extend(d,i),1==c.isHorType?(d=jQuery.extend(d,g),d=jQuery.extend(d,i)):1==d.gridpanel_vertical_scroll&&(d=jQuery.extend(d,_),(d=jQuery.extend(d,i)).grid_panes_direction="bottom");var n=a.getOptions().gallery_skin;""==d.gridpanel_arrows_skin&&(d.gridpanel_arrows_skin=n);var s=t.getObjects();e=s.g_objWrapper,u.init(a,c,r,d,o),(l=new UGThumbsGrid).init(a,d)}(t,i)},this.setHtml=function(){m()},this.run=function(){p()},this.getElement=function(){return t},this.getSize=function(){return s.getElementSize(t)},this.__________Functions_From_Base_____=function(){},this.isPanelClosed=function(){return u.isPanelClosed()},this.getClosedPanelDest=function(){return u.getClosedPanelDest()},this.openPanel=function(e){u.openPanel(e)},this.closePanel=function(e){u.closePanel(e)},this.setOpenedState=function(e){u.setOpenedState(e)},this.setClosedState=function(e){u.setClosedState(e)},this.setDisabledAtStart=function(e){u.setDisabledAtStart(e)}}function UGThumbsGrid(){var e,t,n,r,o,a,s=this,l=jQuery(this),u=new UniteGalleryMain,d=new UGFunctions,_=new UGThumbsGeneral,g=new UGTileDesign,c={grid_panes_direction:"left",grid_num_cols:2,grid_min_cols:2,grid_num_rows:2,grid_space_between_cols:10,grid_space_between_rows:10,grid_space_between_mobile:10,grid_transition_duration:300,grid_transition_easing:"easeInOutQuad",grid_carousel:!1,grid_padding:0,grid_vertical_scroll_ondrag:!1};this.events={PANE_CHANGE:"pane_change"};var h={eventSizeChange:"thumb_size_change",isHorizontal:!1,isMaxHeight:!1,isMaxWidth:!1,gridHeight:0,gridWidth:0,innerWidth:0,innerHeight:0,numPanes:0,arrPanes:0,numThumbs:0,currentPane:0,numThumbsInPane:0,isNavigationVertical:!1,touchActive:!1,startScrollPos:0,isFirstTimeRun:!0,isTilesMode:!1,storedEventID:"thumbsgrid",tileMaxWidth:null,tileMaxHeight:null,spaceBetweenCols:null,spaceBetweenRows:null};function p(i,o,a){var l;if(t=i.getObjects(),(u=i).attachThumbsPanel("grid",s),e=jQuery(i),n=t.g_objWrapper,r=t.g_arrItems,!0===a&&(h.isTilesMode=!0),h.numThumbs=r.length,l=o,c=jQuery.extend(c,l),_.setOptions(l),h.isNavigationVertical="top"==c.grid_panes_direction||"bottom"==c.grid_panes_direction,h.spaceBetweenCols=c.grid_space_between_cols,h.spaceBetweenRows=c.grid_space_between_rows,1==h.isTilesMode){g.setFixedMode(),g.setApproveClickFunction(j),g.init(i,c);var d=g.getOptions();h.tileMaxHeight=d.tile_height,h.tileMaxWidth=d.tile_width,_=g.getObjThumbs()}else o.thumb_fixed_size=!0,_.init(i,o)}function m(){var t=u.getSelectedItem();(function(){if(0==h.isHorizontal){if(0==h.gridHeight)throw new Error("You must set height before run.")}else if(0==h.gridWidth)throw new Error("You must set width before run.")}(),1==h.isFirstTimeRun)?(!function(){if(0==h.isTilesMode){_.initEvents();var t=o.find(".ug-thumb-wrapper");t.on("click touchend",C),e.on(u.events.ITEM_CHANGE,z)}else g.initEvents();o.bind("mousedown touchstart",A),jQuery("body").bind("mousemove touchmove",M),jQuery(window).add("body").bind("mouseup touchend",O)}(),1==h.isTilesMode?(b(),v(),g.run()):(_.setHtmlProperties(),v(),_.loadThumbsImages())):1==h.isTilesMode&&1==b()&&(v(),g.run());if(0==h.isHorizontal?h.isNavigationVertical?function(){var e=a.children(".ug-thumb-wrapper"),t=0,n=0,r=0,s=0,l=0,u=0;h.innerWidth=0,h.numPanes=1,h.arrPanes=[],h.numThumbsInPane=0,h.arrPanes.push(l);var _=e.length;for(i=0;i<_;i++){var g=jQuery(e[i]);d.placeElement(g,t,n);var p=g.outerWidth(),m=g.outerHeight();t+=p+h.spaceBetweenCols;var f=n+m;f>r&&(r=f),++s>=c.grid_num_cols&&(n+=m+h.spaceBetweenRows,t=l,s=0),1==h.numPanes&&h.numThumbsInPane++,f=n+m;var b=u+h.gridHeight;f>b&&(1==h.isMaxHeight&&1==h.numPanes&&(h.gridHeight=r,o.height(h.gridHeight),b=h.gridHeight),n=b+h.spaceBetweenRows,u=n,t=l=0,s=0,i<_-1&&(h.numPanes++,h.arrPanes.push(n)))}a.height(r),h.innerHeight=r,1==h.isMaxHeight&&1==h.numPanes&&(h.gridHeight=r,o.height(r))}():function(){var e=a.children(".ug-thumb-wrapper"),t=0,n=0,r=0,s=0,l=0,u=0;h.innerWidth=0,h.numPanes=1,h.arrPanes=[],h.numThumbsInPane=0,h.arrPanes.push(s);var _=e.length;for(i=0;i<_;i++){var g=jQuery(e[i]);d.placeElement(g,t,n);var p=g.outerWidth(),m=g.outerHeight();t>l&&(l=t);var f=n+m;f>u&&(u=f);var b=l+p;b>h.innerWidth&&(h.innerWidth=b),t+=p+h.spaceBetweenCols,++r>=c.grid_num_cols&&(n+=m+h.spaceBetweenRows,t=s,r=0),1==h.numPanes&&h.numThumbsInPane++,n+m>h.gridHeight&&(n=0,s=h.innerWidth+h.spaceBetweenCols,t=s,r=0,1==h.isMaxHeight&&1==h.numPanes&&(h.gridHeight=u,o.height(h.gridHeight)),i<_-1&&(h.numPanes++,h.arrPanes.push(s)))}a.width(h.innerWidth),1==h.isMaxHeight&&1==h.numPanes&&(h.gridHeight=u,o.height(u))}():function(){var e=a.children(".ug-thumb-wrapper"),t=c.grid_padding,n=c.grid_padding,r=n,s=t,l=0,u=0,_=0,g=0,p=0;h.innerWidth=0,h.numPanes=1,h.arrPanes=[],h.numThumbsInPane=0,h.arrPanes.push(t-c.grid_padding);var m=e.length;for(i=0;i<m;i++){var f=jQuery(e[i]),b=f.outerWidth(),v=f.outerHeight();s-t+b>h.gridWidth&&(r=0,++p>=c.grid_num_rows?(p=0,t=s,r=n,_=0,1==h.numPanes&&(h.gridWidth=l+c.grid_padding,o.width(h.gridWidth),h.gridHeight=g+c.grid_padding,o.height(h.gridHeight)),h.numPanes++,h.arrPanes.push(t-c.grid_padding)):(s=t,r=_+h.spaceBetweenRows)),d.placeElement(f,s,r);var y=s+b;y>l&&(l=y);var I=r+v;I>_&&(_=I),I>g&&(g=I),I>u&&(u=I);var y=l+b;y>h.innerWidth&&(h.innerWidth=y),s+=b+h.spaceBetweenCols,1==h.numPanes&&h.numThumbsInPane++}h.innerWidth=l+c.grid_padding,h.innerHeight=g+c.grid_padding,a.width(h.innerWidth),a.height(h.innerHeight),1==h.numPanes&&(h.gridWidth=l+c.grid_padding,h.gridHeight=g+c.grid_padding,o.width(h.gridWidth),o.height(h.gridHeight))}(),1==h.isFirstTimeRun&&h.isTilesMode){var r=_.getThumbs();r.each(function(e,t){n.trigger(h.eventSizeChange,jQuery(t))}),r.fadeTo(0,1)}null!=t&&y(t.index),l.trigger(s.events.PANE_CHANGE,h.currentPane),h.isFirstTimeRun=!1}function f(){if(1==h.isTilesMode)var e=g.getGlobalTileSize();else e=_.getGlobalThumbSize();return e}function b(){if(0==h.isTilesMode)throw new Error("Dynamic size can be set only in tiles mode");var e=!1,t=u.isMobileMode(),i=h.spaceBetweenCols;1==t?(h.spaceBetweenCols=c.grid_space_between_mobile,h.spaceBetweenRows=c.grid_space_between_mobile):(h.spaceBetweenCols=c.grid_space_between_cols,h.spaceBetweenRows=c.grid_space_between_rows),h.spaceBetweenCols!=i&&(e=!0);var n=f().width,r=h.tileMaxWidth;return d.getNumItemsInSpace(h.gridWidth,h.tileMaxWidth,h.spaceBetweenCols)<c.grid_min_cols&&(r=d.getItemSizeInSpace(h.gridWidth,c.grid_min_cols,h.spaceBetweenCols)),g.setTileSizeOptions(r),r!=n&&(e=!0),e}function v(){var e,t,i;0==h.isHorizontal?(e=f().width,t=c.grid_num_cols*e+(c.grid_num_cols-1)*h.spaceBetweenCols+2*c.grid_padding,i=h.gridHeight,h.gridWidth=t,d.setElementSize(o,t,i),d.setElementSize(a,t,i),h.innerWidth=t,h.innerHeight=i):function(){var e=f().height,t=h.gridWidth,i=c.grid_num_rows*e+(c.grid_num_rows-1)*h.spaceBetweenRows+2*c.grid_padding;h.gridHeight=i,d.setElementSize(o,t,i),d.setElementSize(a,t,i),h.innerWidth=t,h.innerHeight=i}()}function y(e){var t=P(e);if(-1==t)return!1;s.gotoPane(t,"scroll")}function I(e){if(e>=h.numPanes||e<0)throw new Error("Pane "+index+" doesn't exists.");return!0}function w(e){var t=T(e);if(0==t)return!1;a.stop(!0).animate(t,{duration:c.grid_transition_duration,easing:c.grid_transition_easing,queue:!1})}function E(){w(-h.arrPanes[h.currentPane])}function T(e){var t={};return 1==h.isNavigationVertical?t.top=e+"px":t.left=e+"px",t}function S(){var e=d.getElementSize(a);return 1==h.isNavigationVertical?e.top:e.left}function P(e){return 0==function(e){if(e<0||e>=h.numThumbs)throw new Error("Thumb not exists: "+e);return!0}(e)?-1:Math.floor(e/h.numThumbsInPane)}function x(){var e=d.getStoredEventData(h.storedEventID),t=S();diffPos=Math.abs(e.startInnerPos-t);var i=1==h.isNavigationVertical?h.gridHeight:h.gridWidth,n=Math.round(3*i/8);return diffPos>=n||e.diffTime<300&&diffPos>25}function j(){return 1==h.numPanes||d.isApproveStoredEventClick(h.storedEventID,h.isNavigationVertical)}function C(e){if(1==function(){if(1==h.numPanes)return!1;var e=d.getStoredEventData(h.storedEventID),t=e.diffTime,i=S(),n=Math.abs(i-e.startInnerPos);return n>30||n>5&&t>300}())return!0;var t=jQuery(this),i=_.getItemByThumb(t);u.selectItem(i)}function A(e){if(1==h.numPanes)return!0;if(1==h.touchActive)return!0;0==h.isTilesMode&&e.preventDefault(),h.touchActive=!0;var t={startInnerPos:S()};d.storeEventData(e,h.storedEventID,t)}function M(e){if(0==h.touchActive)return!0;e.preventDefault(),d.updateStoredEventData(e,h.storedEventID);var t=d.getStoredEventData(h.storedEventID,h.isNavigationVertical);if(0!=c.grid_vertical_scroll_ondrag&&1!=h.isNavigationVertical&&"vert"===d.handleScrollTop(h.storedEventID))return!0;var i=t.diffMousePos,n=t.startInnerPos+i,r=i>0?"prev":"next",o=h.arrPanes[h.numPanes-1];0==c.grid_carousel&&n>0&&"prev"==r&&(n/=3),0==c.grid_carousel&&n<-o&&"next"==r&&(n=t.startInnerPos+i/3),function(e){var t=T(e);if(0==t)return!1;a.css(t)}(n)}function O(e){if(0==h.touchActive)return!0;d.updateStoredEventData(e,h.storedEventID);var t=d.getStoredEventData(h.storedEventID,h.isNavigationVertical);if(h.touchActive=!1,0==x())return E(),!0;"next"==(S()-t.startInnerPos>0?"prev":"next")?0==c.grid_carousel&&s.isLastPane()?E():s.nextPane():0==c.grid_carousel&&s.isFirstPane()?E():s.prevPane()}function z(){var e=u.getSelectedItem();_.setThumbSelected(e.objThumbWrapper),y(e.index)}this.destroy=function(){if(0==h.isTilesMode){var t=o.find(".ug-thumb-wrapper");t.off("click"),t.off("touchend"),e.on(u.events.ITEM_CHANGE),_.destroy()}else g.destroy();o.unbind("mousedown"),o.unbind("touchstart"),jQuery("body").unbind("mousemove"),jQuery("body").unbind("touchmove"),jQuery(window).add("body").unbind("touchend"),jQuery(window).add("body").unbind("mouseup"),l.off(s.events.PANE_CHANGE)},this.__________EXTERNAL_GENERAL_________=function(){},this.setThumbUnselected=function(e){_.setThumbUnselected(e)},this.isItemThumbVisible=function(e){return P(e.index)==h.currentPane},this.__________EXTERNAL_API_________=function(){},this.getNumPanesEstimationByHeight=function(e){if(1==h.isTilesMode)var t=c.tile_height;else t=_.getOptions().thumb_height;var i=_.getNumThumbs(),n=Math.ceil(i/c.grid_num_cols),r=n*t+(n-1)*h.spaceBetweenRows;return Math.ceil(r/e)},this.getNumPanesEstimationByWidth=function(e){if(h.isTilesMode)var t=c.tile_width;else t=_.getOptions().thumb_width;var i=_.getNumThumbs(),n=Math.ceil(i/c.grid_num_rows),r=n*t+(n-1)*h.spaceBetweenCols;return Math.ceil(r/e)},this.getHeightEstimationByWidth=function(e){if(0==h.isTilesMode)throw new Error("This function works only with tiles mode");var t=_.getNumThumbs(),i=d.getNumItemsInSpace(e,c.tile_width,h.spaceBetweenCols),n=Math.ceil(t/i);n>c.grid_num_rows&&(n=c.grid_num_rows);var r=d.getSpaceByNumItems(n,c.tile_height,h.spaceBetweenRows);return r+=2*c.grid_padding},this.getElement=function(){return o},this.getSize=function(){return d.getElementSize(o)},this.getNumPanes=function(){return h.numPanes},this.isFirstPane=function(){return 0==h.currentPane},this.isLastPane=function(){return h.currentPane==h.numPanes-1},this.getPaneInfo=function(){return{pane:h.currentPane,total:h.numPanes}},this.getPane=function(){return h.currentPane},this.setWidth=function(e){h.gridWidth=e,h.isHorizontal=!0},this.setMaxWidth=function(e){h.gridWidth=e,h.isMaxWidth=!0,h.isHorizontal=!0},this.setHeight=function(e){h.gridHeight=e,h.isHorizontal=!1},this.setMaxHeight=function(e){h.gridHeight=e,h.isMaxHeight=!0,h.isHorizontal=!1},this.gotoPane=function(e,t){if(0==I(e))return!1;if(e==h.currentPane)return!1;var i=-h.arrPanes[e];h.currentPane=e,w(i),l.trigger(s.events.PANE_CHANGE,e)},this.nextPane=function(){var e=h.currentPane+1;if(e>=h.numPanes){if(0==c.grid_carousel)return!0;e=0}s.gotoPane(e,"next")},this.prevPane=function(){var e=h.currentPane-1;if(e<0&&(e=h.numPanes-1,0==c.grid_carousel))return!1;s.gotoPane(e,"prev")},this.attachNextPaneButton=function(e){if(d.setButtonOnClick(e,s.nextPane),1==c.grid_carousel)return!0;s.isLastPane()&&e.addClass("ug-button-disabled"),l.on(s.events.PANE_CHANGE,function(){s.isLastPane()?e.addClass("ug-button-disabled"):e.removeClass("ug-button-disabled")})},this.attachPrevPaneButton=function(e){if(d.setButtonOnClick(e,s.prevPane),1==c.grid_carousel)return!0;s.isFirstPane()&&e.addClass("ug-button-disabled"),l.on(s.events.PANE_CHANGE,function(){s.isFirstPane()?e.addClass("ug-button-disabled"):e.removeClass("ug-button-disabled")})},this.attachBullets=function(e){e.setActive(h.currentPane),jQuery(e).on(e.events.BULLET_CLICK,function(t,i){s.gotoPane(i,"theme"),e.setActive(i)}),jQuery(s).on(s.events.PANE_CHANGE,function(t,i){e.setActive(i)})},this.getObjTileDesign=function(){return g},this.init=function(e,t,i){p(e,t,i)},this.run=function(){m()},this.setHtml=function(e){!function(e){var t=n;e&&(t=e),t.append("<div class='ug-thumbs-grid'><div class='ug-thumbs-grid-inner'></div></div>"),o=t.children(".ug-thumbs-grid"),a=o.children(".ug-thumbs-grid-inner"),1==h.isTilesMode?g.setHtml(a):_.setHtmlThumbs(a)}(e)}}function UGTileDesign(){var e,t,i=this,n=jQuery(this),r=new UniteGalleryMain,o=new UGFunctions,a=new UGThumbsGeneral;this.resizemode={FULL:"full",WRAPPER_ONLY:"wrapper_only",VISIBLE_ELEMENTS:"visible_elements"},this.sizeby={GLOBAL_RATIO:"global_ratio",TILE_RATIO:"tile_ratio",IMAGE_RATIO:"image_ratio",CUSTOM:"custom"},this.events={TILE_CLICK:"tile_click"};var s={tile_width:250,tile_height:200,tile_size_by:i.sizeby.IMAGE_RATIO,tile_visible_before_image:!1,tile_enable_background:!0,tile_background_color:"#F0F0F0",tile_enable_border:!1,tile_border_width:3,tile_border_color:"#F0F0F0",tile_border_radius:0,tile_enable_outline:!1,tile_outline_color:"#8B8B8B",tile_enable_shadow:!1,tile_shadow_h:1,tile_shadow_v:1,tile_shadow_blur:3,tile_shadow_spread:2,tile_shadow_color:"#8B8B8B",tile_enable_action:!0,tile_as_link:!1,tile_link_newpage:!0,tile_enable_overlay:!0,tile_overlay_opacity:.4,tile_overlay_color:"#000000",tile_enable_icons:!0,tile_show_link_icon:!1,tile_videoplay_icon_always_on:"never",tile_space_between_icons:26,tile_enable_image_effect:!1,tile_image_effect_type:"bw",tile_image_effect_reverse:!1,tile_enable_textpanel:!1,tile_textpanel_source:"title",tile_textpanel_always_on:!1,tile_textpanel_appear_type:"slide",tile_textpanel_position:"inside_bottom",tile_textpanel_offset:0},l={thumb_color_overlay_effect:!0,thumb_overlay_reverse:!0,thumb_image_overlay_effect:!1,tile_textpanel_enable_description:!1,tile_textpanel_bg_opacity:.6,tile_textpanel_padding_top:8,tile_textpanel_padding_bottom:8},u={ratioByHeight:0,ratioByWidth:0,eventSizeChange:"thumb_size_change",funcCustomTileHtml:null,funcCustomPositionElements:null,funcParentApproveClick:null,isSaparateIcons:!1,tileInnerReduce:0,isTextpanelOutside:!1,hasImageContainer:!1,isVideoplayIconAlwaysOn:!1,isTextPanelHidden:!1};function d(e,n){r=e,jQuery(e);var d=r.getObjects();t=d.g_objWrapper,r.getArrItems(),s=jQuery.extend(s,l),s=jQuery.extend(s,n),function(){1==s.tile_enable_overlay?(s.thumb_overlay_opacity=s.tile_overlay_opacity,s.thumb_overlay_color=s.tile_overlay_color):0==s.tile_enable_icons?s.thumb_color_overlay_effect=!1:s.thumb_overlay_opacity=0;s.tile_as_link&&(s.thumb_wrapper_as_link=!0,s.thumb_link_newpage=s.tile_link_newpage);1==s.tile_enable_outline&&0==s.tile_enable_border&&(s.tile_enable_outline=!1);u.tileInnerReduce=0,s.tile_enable_border&&(u.tileInnerReduce=2*s.tile_border_width,a.setThumbInnerReduce(u.tileInnerReduce));if(u.isSaparateIcons=!o.isRgbaSupported(),1==s.tile_enable_textpanel){switch(s.tile_textpanel_position){case"top":s.tile_textpanel_align="top";case"bottom":u.isTextpanelOutside=!0,s.tile_textpanel_always_on=!0,s.tile_textpanel_offset=0;break;case"inside_top":s.tile_textpanel_align="top";break;case"middle":s.tile_textpanel_align="middle",s.tile_textpanel_appear_type="fade"}0==s.tile_textpanel_always_on&&(u.isSaparateIcons=!0)}0!=s.tile_textpanel_offset&&(s.tile_textpanel_appear_type="fade",s.tile_textpanel_margin=s.tile_textpanel_offset);"title_and_desc"==s.tile_textpanel_source&&(s.tile_textpanel_enable_description=!0,s.tile_textpanel_desc_style_as_title=!0)}(),a.init(e,s);var _=["overlay"];u.funcCustomTileHtml&&(_=[]),a.setCustomThumbs(g,_,{allow_onresize:!1});var c=a.getOptions();s=jQuery.extend(s,c),u.ratioByWidth=s.tile_width/s.tile_height,u.ratioByHeight=s.tile_height/s.tile_width,s.tile_size_by==i.sizeby.GLOBAL_RATIO&&u.isTextpanelOutside&&(u.hasImageContainer=!0)}function _(){var e=r.isMobileMode();switch(u.isTextPanelHidden=!1,1==e&&0==s.tile_textpanel_always_on&&(u.isTextPanelHidden=!0),u.isVideoplayIconAlwaysOn=s.tile_videoplay_icon_always_on,s.tile_videoplay_icon_always_on){case"always":u.isVideoplayIconAlwaysOn=!0;break;case"never":u.isVideoplayIconAlwaysOn=!1;break;case"mobile_only":u.isVideoplayIconAlwaysOn=1==e;break;case"desktop_only":u.isVideoplayIconAlwaysOn=0==e}}function g(e,t){if(e.addClass("ug-tile"),u.funcCustomTileHtml)return u.funcCustomTileHtml(e,t),!1;var n="";1==u.hasImageContainer&&(n+="<div class='ug-image-container ug-trans-enabled'>");var a="ug-thumb-image";0!=s.tile_enable_image_effect&&1!=s.tile_image_effect_reverse||(a+=" ug-trans-enabled");var l=o.stripTags(t.title);l=o.htmlentitles(l),n+='<img src="'+o.escapeDoubleSlash(t.urlThumb)+"\" alt='"+l+"' class='"+a+"'>",1==u.hasImageContainer&&(n+="</div>"),e.append(n),s.tile_size_by==i.sizeby.GLOBAL_RATIO&&e.fadeTo(0,0);var d={};if(1==s.tile_enable_background&&(d["background-color"]=s.tile_background_color),1==s.tile_enable_border&&(d["border-width"]=s.tile_border_width+"px",d["border-style"]="solid",d["border-color"]=s.tile_border_color,s.tile_border_radius&&(d["border-radius"]=s.tile_border_radius+"px")),1==s.tile_enable_outline&&(d.outline="1px solid "+s.tile_outline_color),1==s.tile_enable_shadow){var _=s.tile_shadow_h+"px ";_+=s.tile_shadow_v+"px ",_+=s.tile_shadow_blur+"px ",_+=s.tile_shadow_spread+"px ",_+=s.tile_shadow_color,d["box-shadow"]=_}e.css(d);var g="";if(s.tile_enable_icons){if(0==s.tile_as_link&&1==s.tile_enable_action){var c="ug-button-play ug-icon-zoom";"image"!=t.type&&(c="ug-button-play ug-icon-play"),g+="<div class='ug-tile-icon "+c+"' style='display:none'></div>"}if(t.link&&1==s.tile_show_link_icon||1==s.tile_as_link)if(0==s.tile_as_link){var h="";1==s.tile_link_newpage&&(h=" target='_blank'"),g+="<a href='"+t.link+"'"+h+" class='ug-tile-icon ug-icon-link'></a>"}else g+="<div class='ug-tile-icon ug-icon-link' style='display:none'></div>";var m=u.isSaparateIcons;if(0==m&&"image"!=t.type&&1==u.isVideoplayIconAlwaysOn&&(m=!0),m)var f=e;else f=e.children(".ug-thumb-overlay");f.append(g);var b=f.children("."+c);0==b.length?b=null:b.hide();var v=f.children(".ug-icon-link");0==v.length?v=null:v.hide(),v||1!=s.tile_enable_action||e.addClass("ug-tile-clickable")}else 1==s.tile_enable_action&&e.addClass("ug-tile-clickable");if(1==s.tile_enable_image_effect){var y="";0==s.tile_image_effect_reverse&&(y=" ug-trans-enabled");var I="<div class='ug-tile-image-overlay"+y+"' >",w=" ug-"+s.tile_image_effect_type+"-effect";I+='<img src="'+o.escapeDoubleSlash(t.urlThumb)+"\" alt='"+t.title+"' class='"+w+y+"'>",I+="</div>",e.append(I),1==s.tile_image_effect_reverse&&e.children(".ug-tile-image-overlay").fadeTo(0,0)}if(1==s.tile_enable_textpanel){var E=new UGTextPanel;E.init(r,s,"tile");var T="";1!=s.tile_textpanel_always_on&&1!=u.isTextpanelOutside||(T="ug-trans-enabled"),E.appendHTML(e,T);var S=t.title,P="";switch(s.tile_textpanel_source){case"desc":case"description":S=t.description;break;case"desc_title":""!=t.description&&(S=t.description);break;case"title_and_desc":S=t.title,P=t.description}if(E.setTextPlain(S,P),0==s.tile_textpanel_always_on&&E.getElement().fadeTo(0,0),e.data("objTextPanel",E),1==s.tile_textpanel_always_on)p(e).css("z-index",2);if(1==u.isTextpanelOutside){e.append("<div class='ug-tile-cloneswrapper'></div>");var x=e.children(".ug-tile-cloneswrapper"),j=new UGTextPanel;j.init(r,s,"tile"),j.appendHTML(x),j.setTextPlain(S,P),e.data("objTextPanelClone",j)}}null!==t.addHtml&&e.append(t.addHtml)}function c(e){return e.children(".ug-tile-image-overlay")}function h(e){return e.data("objTextPanel")}function p(e){return e.children(".ug-textpanel")}function m(e){if(1==u.isTextpanelOutside)var t=function(e){var t=e.find(".ug-tile-cloneswrapper .ug-textpanel");if(0==t.length)throw new Error("text panel cloned element not found");return t}(e);else t=p(e);return t?o.getElementSize(t).height:0}function f(e){var t=e.find(".ug-icon-link");return 0==t.length?null:t}function b(e){var t=e.find(".ug-button-play");return 0==t.length?null:t}function v(e){return!!e.hasClass("ug-thumb-over")}function y(e){return e.hasClass("ug-tile-clickable")}function I(e){return 1==s.tile_enable_icons&&1==u.isVideoplayIconAlwaysOn&&"image"!=e.type}function w(e,t,n,r){var a=c(e),l=i.getTileImage(e),d=function(e){return e.find(".ug-tile-image-overlay img")}(e);t-=u.tileInnerReduce,n-=u.tileInnerReduce;var _=null;if(1==u.isTextpanelOutside){var g=m(e);if(n-=g,"top"==s.tile_textpanel_position&&(_=g),1==u.hasImageContainer){var h=function(e){return 0==u.hasImageContainer?null:e.children(".ug-image-container")}(e);o.setElementSize(h,t,n),null!==_&&o.placeElement(h,0,_)}}if(0==s.tile_enable_image_effect)o.scaleImageCoverParent(l,t,n),0==u.hasImageContainer&&null!==_&&o.placeElement(l,0,_);else{var p="nothing";!0===r&&0==u.isTextpanelOutside&&(p=1==s.tile_image_effect_reverse?"effect":"image"),"effect"!=p&&(o.setElementSize(a,t,n),null!==_&&o.placeElement(a,0,_),o.scaleImageCoverParent(d,t,n)),"image"!=p&&(1==u.hasImageContainer?o.scaleImageCoverParent(l,t,n):"effect"==p?(o.scaleImageCoverParent(l,t,n),null!==_&&o.placeElement(l,0,_)):o.cloneElementSizeAndPos(d,l,!1,null,_))}}function E(e,t,n,r){var o=null;if(n&&(o=n-u.tileInnerReduce),r&&(r-=u.tileInnerReduce),"clone"==t)return function(e){return e.data("objTextPanelClone")}(e).refresh(!0,!0,o),i.getItemByTile(e).textPanelCloneSizeSet=!0,!1;var a=h(e);if(!a)return!1;var l=null;if(1==u.isTextpanelOutside&&(l=m(e)),a.refresh(!1,!0,o,l),1==s.tile_textpanel_always_on||"fade"==s.tile_textpanel_appear_type)if(1==u.isTextpanelOutside&&r&&"bottom"==s.tile_textpanel_position){var d=r-l;a.positionPanel(d)}else a.positionPanel()}function T(e){i.getItemByTile(e);var t=b(e),n=f(e),r=o.getElementSize(e);w(e,r.width,r.height),1==s.tile_enable_textpanel&&E(e,"regular",r.width,r.height);var a=r.width-u.tileInnerReduce,l=r.height-u.tileInnerReduce,d=0;if(1==u.isTextpanelOutside){var _=m(e);l-=_,"top"==s.tile_textpanel_position&&(d=_)}var g=function(e){return e.children(".ug-thumb-overlay")}(e);if(o.setElementSizeAndPosition(g,0,d,a,l),t||n){var c=0;if(1==s.tile_enable_textpanel&&0==u.isTextPanelHidden&&0==u.isTextpanelOutside){var h=p(e),v=o.getElementSize(h);v.height>0&&(c=Math.floor(v.height/2*-1))}}if(t&&n){var y=o.getElementSize(t),I=o.getElementSize(n),T=s.tile_space_between_icons,S=y.width+T+I.width,P=Math.floor((r.width-S)/2);P<T&&(T=Math.floor((r.width-y.width-I.width)/3),S=y.width+T+I.width,P=Math.floor((r.width-S)/2)),o.placeElement(t,P,"middle",0,c),o.placeElement(n,P+y.width+T,"middle",0,c)}else t&&o.placeElement(t,"center","middle",0,c),n&&o.placeElement(n,"center","middle",0,c);t&&t.show(),n&&n.show()}function S(e,t){i.getItemByTile(e);var n=c(e),r=s.thumb_transition_duration;if(0==s.tile_image_effect_reverse){var o=i.getTileImage(e);t?(o.fadeTo(0,1),n.stop(!0).fadeTo(r,0)):n.stop(!0).fadeTo(r,1)}else t?n.stop(!0).fadeTo(r,1):n.stop(!0).fadeTo(r,0)}function P(e,t){var i=s.thumb_transition_duration,n=p(e);if(!n)return!0;if("slide"==s.tile_textpanel_appear_type){var r=o.getElementSize(n);if(0==r.width)return!1;var a=-r.height,l={},u={},d="bottom";"inside_top"==s.tile_textpanel_position&&(d="top"),l[d]=a+"px",u[d]="0px",1==t?(n.fadeTo(0,1),0==n.is(":animated")&&n.css(l),u.opacity=1,n.stop(!0).animate(u,i)):n.stop(!0).animate(l,i)}else 1==t?n.stop(!0).fadeTo(i,1):n.stop(!0).fadeTo(i,0)}function x(e,t,i){var n=s.thumb_transition_duration;i&&!0===i&&(n=0);var r=b(e),o=f(e),a=t?1:0;r&&r.stop(!0).fadeTo(n,a),o&&o.stop(!0).fadeTo(n,a)}function j(e,t){if(t=jQuery(t),s.tile_enable_image_effect&&S(t,!0),1==s.tile_enable_textpanel&&0==s.tile_textpanel_always_on&&0==u.isTextPanelHidden&&P(t,!0),u.isSaparateIcons&&1==s.tile_enable_icons){var n=1==s.thumb_overlay_reverse;0==I(i.getItemByTile(t))&&x(t,n,!1)}}function C(e,t){if(t=jQuery(t),s.tile_enable_image_effect&&S(t,!1),1==s.tile_enable_textpanel&&0==s.tile_textpanel_always_on&&P(t,!1),1==u.isSaparateIcons&&1==s.tile_enable_icons){var n=1!=s.thumb_overlay_reverse;0==I(i.getItemByTile(t))?x(t,n,!1):x(t,!0,!0)}}function A(e,t,i){if(t=jQuery(t),1==s.tile_visible_before_image&&!0!==t.data("image_placed")&&!0!==i)return!0;T(t),a.setThumbNormalStyle(t)}function M(e,t,i){T(t),i.fadeTo(0,1),t.data("image_placed",!0)}function O(e){if(1==y(e))return n.trigger(i.events.TILE_CLICK,e),!0;var t;0==v(e)&&(t=e,a.getThumbs().not(t).each(function(e,t){a.setThumbNormalStyle(jQuery(t))}),a.setThumbOverStyle(e))}function z(e){var t=jQuery(this),r=t.prop("tagName").toLowerCase(),o=!0;if(u.funcParentApproveClick&&0==u.funcParentApproveClick()&&(o=!1),"a"==r)0==o&&e.preventDefault();else if(0==v(t))1==o&&O(t);else{if(0==y(t))return!0;1==o&&n.trigger(i.events.TILE_CLICK,t)}}function L(e){e.stopPropagation();var t=jQuery(this).parents(".ug-tile"),r=!0;return u.funcParentApproveClick&&0==u.funcParentApproveClick()&&(r=!1),0==v(t)?(O(t),!0):1==r?(n.trigger(i.events.TILE_CLICK,t),!1):void 0}function N(e){var t=jQuery(this).parents(".ug-tile");u.funcParentApproveClick&&0==u.funcParentApproveClick()&&e.preventDefault(),0==v(t)&&0==s.tile_as_link&&(e.preventDefault(),O(t))}this.loadTileImage=function(e){var t=i.getTileImage(e);o.checkImagesLoaded(t,null,function(t,i){M(null,e,jQuery(t))})},this.setHtml=function(t,i){e=t,!0!==i&&_(),a.setHtmlThumbs(t,i)},this.initEvents=function(){a.initEvents(),jQuery(a).on(a.events.SETOVERSTYLE,j),jQuery(a).on(a.events.SETNORMALSTYLE,C),jQuery(a).on(a.events.PLACEIMAGE,M),t.on(u.eventSizeChange,A),e.on("click",".ug-tile",z),e.on("click",".ug-tile .ug-button-play",L),e.on("click",".ug-tile .ug-icon-link",N)},this.destroy=function(){if(e.off("click",".ug-tile"),e.off("click",".ug-tile .ug-button-play"),e.off("click",".ug-tile .ug-icon-link"),jQuery(a).off(a.events.SETOVERSTYLE),jQuery(a).off(a.events.SETNORMALSTYLE),jQuery(a).off(a.events.PLACEIMAGE),t.off(u.eventSizeChange),1==s.tile_enable_textpanel){var i=a.getThumbs();jQuery.each(i,function(e,t){var i=h(jQuery(t));i&&i.destroy()})}a.destroy()},this.init=function(e,t,i){d(e,t)},this.setFixedMode=function(){s.tile_size_by=i.sizeby.GLOBAL_RATIO,s.tile_visible_before_image=!0},this.setApproveClickFunction=function(e){u.funcParentApproveClick=e},this.resizeTile=function(e,t,n,r){if(1==u.isTextpanelOutside&&E(e,"clone",t),t){if(!n)n=i.getTileHeightByWidth(t,e)}else{t=s.tile_width;var n=s.tile_height}switch(o.setElementSize(e,t,n),r){default:case i.resizemode.FULL:i.triggerSizeChangeEvent(e,!0);break;case i.resizemode.WRAPPER_ONLY:return!0;case i.resizemode.VISIBLE_ELEMENTS:if(u.funcCustomTileHtml)return i.triggerSizeChangeEvent(e,!0),!0;w(e,t,n,!0),1==s.tile_enable_textpanel&&1==s.tile_textpanel_always_on&&t&&E(e,"regular",t,n)}},this.resizeAllTiles=function(e,t,n){_();var r=null;if(s.tile_size_by==i.sizeby.GLOBAL_RATIO&&(r=i.getTileHeightByWidth(e)),!n)n=a.getThumbs();n.each(function(n,o){i.resizeTile(jQuery(o),e,r,t)})},this.triggerSizeChangeEvent=function(e,i){if(!e)return!1;if(!i)i=!1;t.trigger(u.eventSizeChange,[e,i])},this.triggerSizeChangeEventAllTiles=function(e){a.getThumbs().each(function(){var t=jQuery(this);i.triggerSizeChangeEvent(t,e)})},this.disableEvents=function(){a.getThumbs().css("pointer-events","none")},this.enableEvents=function(){a.getThumbs().css("pointer-events","auto")},this.setOptions=function(e){s=jQuery.extend(s,e),a.setOptions(e)},this.setTileSizeOptions=function(e){if(s.tile_size_by!==i.sizeby.GLOBAL_RATIO)throw new Error("setNewTileOptions works with global ration only");s.tile_width=e,s.tile_height=Math.floor(e*u.ratioByHeight)},this.setCustomFunctions=function(e,t){u.funcCustomTileHtml=e,u.funcCustomPositionElements=t},this.run=function(e){var t=a.type.GET_THUMBS_ALL;!0===e&&(t=a.type.GET_THUMBS_NEW);var n=a.getThumbs(t);s.tile_size_by==i.sizeby.GLOBAL_RATIO&&i.resizeAllTiles(s.tile_width,i.resizemode.WRAPPER_ONLY,n),1==s.tile_enable_image_effect&&0==s.tile_image_effect_reverse&&n.children(".ug-thumb-image").fadeTo(0,0),a.setHtmlProperties(n),1==s.tile_visible_before_image&&(n.children(".ug-thumb-image").fadeTo(0,0),a.loadThumbsImages())},this._____________EXTERNAL_GETTERS____________=function(){},this.getObjThumbs=function(){return a},this.getOptions=function(){return s},this.getTileImage=function(e){return e.find("img.ug-thumb-image")},this.getItemByTile=function(e){return a.getItemByThumb(e)},this.getTileHeightByWidth=function(e,t){var n=function(e){var t=u.ratioByHeight;switch(s.tile_size_by){default:t=u.ratioByHeight;break;case i.sizeby.IMAGE_RATIO:if(!e)throw new Error("tile should be given for tile ratio");var n=i.getItemByTile(e);if(void 0!==n.thumbRatioByHeight){if(0==n.thumbRatioByHeight)throw trace(n),new Error("the item ratio not inited yet");t=n.thumbRatioByHeight}break;case i.sizeby.CUSTOM:return null}return t}(t);if(null===n)return null;var r=Math.floor((e-u.tileInnerReduce)*n)+u.tileInnerReduce;return t&&1==u.isTextpanelOutside&&s.tile_size_by==i.sizeby.IMAGE_RATIO&&(r+=m(t)),r},this.getTileImageSize=function(e){var t=i.getItemByTile(e);if(!t.thumbWidth||!t.thumbHeight)throw new Error("Can't get image size - image not inited.");return{width:t.thumbWidth,height:t.thumbHeight}},this.getGlobalTileSize=function(){if(s.tile_size_by!=i.sizeby.GLOBAL_RATIO)throw new Error("The size has to be global ratio");return{width:s.tile_width,height:s.tile_height}}}function UGTiles(){var e,t,i,n,r,o=this,a=jQuery(this),s=new UniteGalleryMain,l=new UGFunctions,u=new UGTileDesign,d=new UGThumbsGeneral,_={},g={tiles_type:"columns",tiles_col_width:250,tiles_align:"center",tiles_exact_width:!1,tiles_space_between_cols:3,tiles_space_between_cols_mobile:3,tiles_include_padding:!0,tiles_min_columns:2,tiles_max_columns:0,tiles_keep_order:!1,tiles_set_initial_height:!0,tiles_justified_row_height:150,tiles_justified_space_between:3,tiles_nested_optimal_tile_width:250,tiles_nested_col_width:null,tiles_nested_debug:!1,tiles_enable_transition:!0};this.events={THUMB_SIZE_CHANGE:"thumb_size_change",TILES_FIRST_PLACED:"tiles_first_placed",ALL_TILES_LOADED:"all_tiles_loaded"};var c={isFirstTimeRun:!0,handle:null,isTransActive:!1,isTransInited:!1,isFirstPlaced:!0,isAllLoaded:!1},h={colWidth:null,nestedOptimalCols:5,gridY:0,maxColumns:0,columnsValueToEnableHeightResize:3,resizeLeftRightToColumn:!0,currentItem:0,currentGap:null,optimalTileWidth:null,maxGridY:0};function p(i,n){g_objects=i.getObjects(),s=i,e=jQuery(i),t=g_objects.g_objWrapper,g_objects.g_arrItems,g=jQuery.extend(g,n),function(){g.tiles_min_columns<1&&(g.tiles_min_columns=1);0!=g.tiles_max_columns&&g.tiles_max_columns<g.tiles_min_columns&&(g.tiles_max_columns=g.tiles_min_columns)}(),u.init(i,g),d=u.getObjThumbs()}function m(){if(i.addClass("ug-tiles-rest-mode"),c.isTransInited=!0,1==g.tiles_enable_transition){i.addClass("ug-tiles-transit");var e=u.getOptions();1==e.tile_enable_image_effect&&0==e.tile_image_effect_reverse&&i.addClass("ug-tiles-transit-overlays"),c.isTransActive=!0}}function f(){return l.getElementSize(i).width}function b(){return 0!=c.isTransInited&&(i.addClass("ug-tiles-transition-active"),i.removeClass("ug-tiles-rest-mode"),0!=c.isTransActive&&void u.disableEvents())}function v(){if(0==c.isTransInited)return!1;i.removeClass("ug-tiles-transition-active"),i.addClass("ug-tiles-rest-mode")}function y(){1==c.isTransActive?(setTimeout(function(){u.enableEvents(),u.triggerSizeChangeEventAllTiles(),v()},800),c.handle&&clearTimeout(c.handle),c.handle=setTimeout(function(){v(),u.triggerSizeChangeEventAllTiles(),c.handle=null},2e3)):(u.triggerSizeChangeEventAllTiles(),v())}function I(){_.colWidth=(_.availWidth-_.colGap*(_.numCols-1))/_.numCols,_.colWidth=Math.floor(_.colWidth),_.totalWidth=l.getSpaceByNumItems(_.numCols,_.colWidth,_.colGap)}function w(){if(_.colWidth=g.tiles_col_width,_.minCols=g.tiles_min_columns,_.maxCols=g.tiles_max_columns,0==s.isMobileMode()?_.colGap=g.tiles_space_between_cols:_.colGap=g.tiles_space_between_cols_mobile,_.galleryWidth=f(),_.availWidth=_.galleryWidth,1==g.tiles_include_padding&&(_.availWidth=_.galleryWidth-2*_.colGap),1==g.tiles_exact_width)_.numCols=l.getNumItemsInSpace(_.availWidth,_.colWidth,_.colGap),_.maxCols>0&&_.numCols>_.maxCols&&(_.numCols=_.maxCols),_.numCols<_.minCols?(_.numCols=_.minCols,I()):_.totalWidth=_.numCols*(_.colWidth+_.colGap)-_.colGap;else{var e=l.getNumItemsInSpaceRound(_.availWidth,_.colWidth,_.colGap);e<_.minCols?e=_.minCols:0!=_.maxCols&&e>_.maxCols&&(e=_.maxCols),_.numCols=e,I()}switch(g.tiles_align){case"center":default:_.addX=Math.round((_.galleryWidth-_.totalWidth)/2);break;case"left":_.addX=0;break;case"right":_.addX=_.galleryWidth-_.totalWidth}for(_.arrPosx=[],col=0;col<_.numCols;col++){var t=l.getColX(col,_.colWidth,_.colGap);_.arrPosx[col]=t+_.addX}}function E(){_.maxColHeight=0,_.colHeights=[0]}function T(e,t,n,r){if(null==r)r=function(){var e=0,t=999999999;for(col=0;col<_.numCols;col++){if(null==_.colHeights[col]||0==_.colHeights[col])return col;_.colHeights[col]<t&&(e=col,t=_.colHeights[col])}return e}();var o=0;void 0!==_.colHeights[r]&&(o=_.colHeights[r]);var a=u.getTileHeightByWidth(_.colWidth,e);if(null===a){if(1==g.tiles_enable_transition)throw new Error("Can't know tile height, please turn off transition");a=l.getElementSize(e).height}var s=_.arrPosx[r];l.placeElement(e,s,o);var d=o+a;_.colHeights[r]=d+_.colGap,_.maxColHeight<d&&(_.maxColHeight=d),1==t&&e.show().fadeTo(0,1),1==n&&i.height(_.maxColHeight)}function S(e){e||(e=!1),w(),E();var t=d.getThumbs(d.type.GET_THUMBS_RATIO);b(),u.resizeAllTiles(_.colWidth,u.resizemode.VISIBLE_ELEMENTS,t);for(var n=0;n<t.length;n++){var r=jQuery(t[n]),o=void 0;1==g.tiles_keep_order&&(o=l.getColByIndex(_.numCols,n)),T(r,e,!1,o)}y();var a=i.height();1==c.isTransActive&&a>_.maxColHeight?setTimeout(function(){i.height(_.maxColHeight)},700):i.height(_.maxColHeight)}function P(e,t){if(!0!==t&&0==function(e){var t=e.index();if(!0===s.getItem(t).ordered_placed)return!1;var i=l.getPrevRowSameColIndex(t,_.numCols);return i<0||!0===s.getItem(i).ordered_placed}(e))return!1;var i=e.index(),n=l.getColByIndex(_.numCols,i),r=s.getItem(i);u.resizeTile(e,_.colWidth),T(e,!0,!0,n),r.ordered_placed=!0;var o=s.getNumItems(),a=l.getNextRowSameColIndex(i,_.numCols);if(a>=o)return!1;var g=d.getThumbByIndex(a),c=s.getItem(a);d.isThumbLoaded(g);d.isThumbLoaded(g)&&!c.ordered_placed&&P(g,!0)}function x(){var e=d.getThumbs(d.type.GET_THUMBS_NO_RATIO);if(!e||0==e.length)return!1;if(c.isAllLoaded=!1,1==c.isFirstPlaced){w(),E();var t=Math.abs(_.galleryWidth-_.totalWidth);if(1==g.tiles_set_initial_height&&0==l.isScrollbarExists()&&t<25){e.length;var n=Math.ceil(e.length/_.numCols)*g.tiles_col_width*.75;i.height(n),w()}}e.fadeTo(0,0);var r=e.find("img.ug-thumb-image"),h=_.numCols,p=_.galleryWidth;l.checkImagesLoaded(r,function(){w(),h==_.numCols&&p==_.galleryWidth||S(!1),m(),a.trigger(o.events.ALL_TILES_LOADED)},function(e,t){1==c.isFirstPlaced&&s.triggerEvent(o.events.TILES_FIRST_PLACED),function(e,t){if(1==t)return!1;e=jQuery(e);var i=jQuery(e).parent();d.triggerImageLoadedEvent(i,e),1==g.tiles_keep_order?P(i):(u.resizeTile(i,_.colWidth),T(i,!0,!0))}(e,t)})}function j(){var e=f(),t=d.getThumbs(!0),i=g.tiles_justified_row_height,n=[],r=0,o=g.tiles_justified_space_between,a=t.length;jQuery.each(t,function(e,t){t=jQuery(t);var o=d.getItemByThumb(t),a=o.thumbWidth;o.thumbHeight!==i&&(a=Math.floor(o.thumbRatioByWidth*i)),n[e]=a,r+=a});var s=Math.ceil(r/e);s>a&&(s=a);var l=r/s,u=[],_=0,c=[],h=[],p=0,m=0;jQuery.each(t,function(e,t){var i=n[e];p+i/2>(m+1)*l&&(c[u.length]=_,u.push(h),h=[],_=0,m++),p+=i,_+=i,h.push(t)}),c[u.length]=_,u.push(h);var b=[],v=[],y=0;return jQuery.each(u,function(t,r){r.length;var a=c[t],s=(r.length-1)*o,l=(e-s)/a,u=Math.round(i*l);y+=u,t>0&&(y+=o),v.push(u);var d=u/i,_=[],g=s;jQuery.each(r,function(e,t){var i=jQuery(t).index(),r=n[i],o=Math.round(r*d);_[e]=o,g+=o});var h=g-e;jQuery.each(_,function(e,t){if(0==h)return!1;h<0?(_[e]=t+1,h++):(_[e]=t-1,h--),e==_.length-1&&0!=h&&(_[e]-=h)}),b[t]=_}),{arrRows:u,arrRowWidths:b,arrRowHeights:v,gap:o,totalHeight:y}}function C(e){if(!e)e=!1;var t=f(),n=j();i.height(n.totalHeight),f()!=t&&(n=j()),b();var r=0,o=0;jQuery.each(n.arrRows,function(t,i){var a=n.arrRowWidths[t],s=n.arrRowHeights[t],d=0;jQuery.each(i,function(t,i){var _=jQuery(i),g=s,c=a[t];u.resizeTile(_,c,g,u.resizemode.VISIBLE_ELEMENTS),l.placeElement(_,d,r),(d+=c)>o&&(o=d),d+=n.gap,1==e&&jQuery(i).show()}),r+=s+n.gap}),y()}function A(){var e=f();switch(h.galleryWidth=e,n={},h.colWidth=g.tiles_nested_col_width,h.optimalTileWidth=g.tiles_nested_optimal_tile_width,h.currentGap=g.tiles_space_between_cols,1==s.isMobileMode()&&(h.currentGap=g.tiles_space_between_cols_mobile),null==h.colWidth?h.colWidth=Math.floor(h.optimalTileWidth/h.nestedOptimalCols):h.optimalTileWidth>h.colWidth?h.nestedOptimalCols=Math.ceil(h.optimalTileWidth/h.colWidth):h.nestedOptimalCols=1,h.maxColumns=l.getNumItemsInSpace(e,h.colWidth,h.currentGap),h.colWidth=l.getItemSizeInSpace(e,h.maxColumns,h.currentGap),h.gridY=0,r=[],d.getThumbs(!0).each(function(){var e=function(e){var t,i,n={},r=h.colWidth,o=h.currentGap,a=u.getTileImageSize(e),s=e.index(),l=Math.ceil(function(e){return Math.abs(Math.sin(Math.abs(1e3*Math.sin(e))))}(s)*(1*h.nestedOptimalCols/3)+2*h.nestedOptimalCols/3),d=a.width,_=a.height,g=d/_;d>_?(t=l,0==(i=Math.round(t/g))&&(i=1)):(i=l,0==(t=Math.round(i*g))&&(t=1));return n.dimWidth=t,n.dimHeight=i,n.width=t*r+o*(t-1),n.height=i*r+o*(i-1),n.imgWidth=d,n.imgHeight=_,n.left=0,n.top=0,n}(jQuery(this));r.push(e)}),h.optimalTileWidth>h.colWidth?h.nestedOptimalCols=Math.ceil(h.optimalTileWidth/h.colWidth):h.nestedOptimalCols=1,h.totalWidth=h.maxColumns*(h.colWidth+h.currentGap)-h.currentGap,g.tiles_align){case"center":default:h.addX=Math.round((h.galleryWidth-h.totalWidth)/2);break;case"left":h.addX=0;break;case"right":h.addX=h.galleryWidth-h.totalWidth}h.maxGridY=0}function M(e){var t=f();A(),O();var n=h.maxGridY*(h.colWidth+h.currentGap)-h.currentGap;i.height(n),f()!=t&&(A(),O()),0==g.tiles_nested_debug&&function(e){if(!e)var e=!1;b();for(var t=0;t<r.length;t++)U(t,e);i.height(h.maxColHeight),y()}(e)}function O(e){if(1==g.tiles_nested_debug)return void 0===e&&(e=!0),function(e,t){if(0==t){for(var i=h.currentItem;i<r.length;i++)z(i,!0);h.currentItem=r.length-1}else z(h.currentItem,!0);for(i=0;i<=h.currentItem;i++)U(i,!0);h.currentItem++}(0,e),!1;for(var t=0;t<r.length;t++)z(t,!0)}function z(e,t){if(!t)t=!1;h.maxColHeight=0;for(var i=l.getObjectLength(n),r=h.gridY;r<=i+1;r++){for(var o=0;o<h.maxColumns;o++){if(0==Q(h.gridY)||0==B(h.gridY,o))return void L(e,D(o),o)}h.gridY++}}function L(e,t,i){var o=jQuery.extend(!0,{},r[e]),a=o.dimWidth,s=t-o.dimWidth,l=h.nestedOptimalCols;if(t<=o.dimWidth||s<=.33*l||t<=l)H(e,t);else if(s<=l)l>=4?1==G(Math.floor(t/2),i)?H(e,Math.floor(t/2)+1):H(e,Math.floor(t/2)):H(objImage,t);else if(1==G(a,i))switch(a>=l){case!0:H(e,a-1);break;case!1:H(e,a+1)}var u,d,_,g,c,p,m,f,b,v=function(e,t,i){var r=h.gridY-1,o=0,a=0,s=1,l=[],u=[];if(l.push(e),r>=0){for(a=0;r>=0;){if(o=n[r][i],void 0!==n[r][i-1]&&n[r][i-1]==n[r][i]||void 0!==n[r][i+t]&&n[r][i+t-1]==n[r][i+t]||n[r][i]!=n[r][i+t-1])return u.push(s),u.push(l),u;a!=o&&(s++,l.push(o)),r--,a=o}return u.push(s),u.push(l),u}return[0,[]]}(e,(o=jQuery.extend(!0,{},r[e])).dimWidth,i);if(h.columnsValueToEnableHeightResize<=v[0]&&h.maxColumns>=2*h.nestedOptimalCols){var y=function(e,t){var i=0,r=0,o=t.dimWidth,a=t.dimHeight,s=0,l=0,u=jQuery.map(n,function(e,t){return[e]});if(void 0===u[h.gridY]||void 0===u[h.gridY][e-1])r=0;else for(var d=0;void 0!==n[h.gridY+d]&&-1!=n[h.gridY+d][e-1];)s=n[h.gridY+d][e-2],d++,r++;if(void 0===u[h.gridY]||void 0===u[h.gridY][e+o])i=0;else for(d=0;void 0!==n[h.gridY+d]&&-1!=n[h.gridY+d][e+o];)l=n[h.gridY+d][e+o+1],d++,i++;var _=0,g=0;Math.abs(a-r)<Math.abs(a-i)&&0!=r?(_=r,g=s):0!=i?(_=i,g=l):_=a;return{newHeight:_,idToResize:g}}(i,o),I=k(e,y.newHeight,!0);r[e].dimHeight=I.dimHeight;var w=function(e,t){for(var i=0,n=0,o=[],a=0,s=0,l=0;l<e[1].length;l++){var u=e[1][l],d=r[e[1][l]];if(n+=d.dimHeight,0!=l)i+=d.dimHeight,o.push([u,d.dimHeight]);else{var _=H(u,t,!0);i+=_.dimHeight,o.push([e[1][l],_.dimHeight])}}a=d.left,s=d.top;for(var g=n,c=[],l=o.length-1;l>=0;l--){var h,u=o[l][0];0!=l?(h=Math.max(Math.round(1*n/3),Math.floor(o[l][1]*(n/i))),g-=h,(_=k(u,h,!0)).left=a,_.top=s,c.push({tileID:u,sizes:_}),s+=_.dimHeight):((_=k(u,h=g,!0)).left=a,_.top=s,c.push({tileID:u,sizes:_}))}return c}(v,I.dimWidth),E=!1;(function(e){for(var t=0,i=0,r=0;r<e.length-1;r++){var o=e[r].sizes,a=-1,s=-1;Q(o.top+o.dimHeight)&&h.maxColumns>o.left+o.dimWidth&&(a=n[o.top+o.dimHeight-1][o.left+o.dimWidth],s=n[o.top+o.dimHeight][o.left+o.dimWidth]),a!=s&&t++}for(var r=0;r<e.length-1;r++){var o=e[r].sizes,a=-1,s=-1;Q(o.top+o.dimHeight)&&o.left-1>=0&&(a=n[o.top+o.dimHeight-1][o.left-1],s=n[o.top+o.dimHeight][o.left-1]),a!=s&&i++}return Math.max(i,t)})(w)>=2&&(E=!0),y.newHeight>=o.dimHeight&&(o=k(e,y.newHeight,!0));var T=(u=y.idToResize,d=y.newHeight,_=o.dimHeight,g=r[u],c=g.dimHeight,g.dimWidth,p=g.left,m=g.top,parseInt(m/(h.colWidth+h.currentGap)),parseInt(p/(h.colWidth+h.currentGap)),f=k(u,c-d+_,!0),(b=[]).push({tileID:u,sizes:f}),b);return o.top=h.gridY,o.left=i,T.push({tileID:e,sizes:o}),R(T)<R(w)||1==E?void N(T):void N(w)}o.left=i,o.top=h.gridY,r[e]=o,W(e,o,i,h.gridY),h.maxGridY=o.top+o.dimHeight}function N(e){for(var t=0;t<e.length;t++){var i=e[t].sizes,n=e[t].tileID;r[n]=jQuery.extend(!0,{},i),W(n,i,i.left,i.top)}}function H(e,t,i){i||(i=!1);var n=h.colWidth,o=h.currentGap,a=r[e],s=a.imgWidth/a.imgHeight;if(dimWidth=t,dimHeight=Math.round(dimWidth/s),1==i){var l=jQuery.extend(!0,{},a);return l.dimWidth=dimWidth,l.dimHeight=dimHeight,l.width=dimWidth*n+o*(dimWidth-1),l.height=dimHeight*n+o*(dimHeight-1),l}a.dimWidth=dimWidth,a.dimHeight=dimHeight,a.width=dimWidth*n+o*(dimWidth-1),a.height=dimHeight*n+o*(dimHeight-1)}function k(e,t,i){i||(i=!1);var n=r[e],o=n.dimWidth,a=h.colWidth,s=h.currentGap;if(1==i){var l=jQuery.extend(!0,{},n);return l.dimHeight=t,l.width=o*a+s*(o-1),l.height=t*a+s*(t-1),l}n.dimHeight=t,n.width=o*a+s*(o-1),n.height=t*a+s*(t-1)}function R(e){for(var t=0,i=0,n=0;n<e.length;n++){var o=r[e[n].tileID];if(0==o.dimHeight||0==o.height)return;resizeVal=o.dimWidth/o.dimHeight/(o.imgWidth/o.imgHeight),resizeVal<1&&(resizeVal=1/resizeVal),t+=resizeVal,i++}return t/i}function G(e,t){var i=h.gridY-1;return!(i<=0||0==Q(i))&&n[i][t+e-1]!=n[i][t+e]}function D(e){var t=e,i=0;if(1==Q(h.gridY))for(;0==B(h.gridY,t);)i++,t++;else i=h.maxColumns;return i}function Q(e){return void 0!==n[e]}function W(e,t,i,n){for(var r=0;r<t.dimHeight;r++)for(var o=0;o<t.dimWidth;o++)0==Q(n+r)&&F(n+r),Y(n+r,i+o,e)}function F(e){n[e]=new Object;for(var t=0;t<h.maxColumns;t++)n[e][t]=-1}function B(e,t){return-1!=n[e][t]}function Y(e,t,i){n[e][t]=i}function U(e,t){var i=d.getThumbByIndex(e),n=r[e],o=n.top*(h.colWidth+h.currentGap),a=h.addX+n.left*(h.colWidth+h.currentGap);u.resizeTile(i,n.width,n.height,u.resizemode.VISIBLE_ELEMENTS),l.placeElement(i,a,o),o+n.height>h.maxColHeight&&(h.maxColHeight=o+n.height),1==t&&i.fadeTo(0,1)}function V(){if(1==c.isFirstTimeRun)return!0;if(0==c.isAllLoaded)return!1;switch(g.tiles_type){case"columns":S(!1);break;case"justified":C(!1);break;case"nested":1==s.isMobileMode()?S(!1):M(!1)}}function X(){switch(t.children(".ug-tile").show(),1==c.isFirstTimeRun&&(a.on(o.events.ALL_TILES_LOADED,function(){c.isAllLoaded=!0}),e.on(s.events.SIZE_CHANGE,V),e.on(o.events.TILES_FIRST_PLACED,function(){c.isFirstPlaced=!1}),u.initEvents()),u.run(),g.tiles_type){default:case"columns":x();break;case"justified":i=jQuery(t).find("img.ug-thumb-image"),n=d.getThumbs(),c.isAllLoaded=!1,n.fadeTo(0,0),l.checkImagesLoaded(i,function(){setTimeout(function(){C(!0),n.fadeTo(0,1),s.triggerEvent(o.events.TILES_FIRST_PLACED),m(),a.trigger(o.events.ALL_TILES_LOADED)})},function(e,t){e=jQuery(e);var i=jQuery(e).parent();d.triggerImageLoadedEvent(i,e)});break;case"nested":!function(){var e=jQuery(t).find("img.ug-thumb-image"),i=d.getThumbs();c.isAllLoaded=!1,i.fadeTo(0,0),l.checkImagesLoaded(e,function(){1==s.isMobileMode()?S(!0):M(!0),s.triggerEvent(o.events.TILES_FIRST_PLACED),m(),a.trigger(o.events.ALL_TILES_LOADED)},function(e,t){e=jQuery(e);var i=jQuery(e).parent();d.triggerImageLoadedEvent(i,e)})}()}var i,n;c.isFirstTimeRun=!1}this.destroy=function(){e.off(s.events.SIZE_CHANGE),u.destroy(),e.off(o.events.TILES_FIRST_PLACED)},this.init=function(e,t){p(e,t)},this.setHtml=function(e){!function(e){e||(e=i||t);i=e;var n=g.tiles_type;e.addClass("ug-tiletype-"+n),u.setHtml(e),e.children(".ug-thumb-wrapper").hide()}(e)},this.getObjTileDesign=function(){return u},this.run=function(){X()},this.runNewItems=function(){if(!i)throw new Error("Can't run new items - parent not set");switch(u.setHtml(i,!0),u.run(!0),g.tiles_type){case"columns":x();break;default:case"justified":case"nested":throw new Error("Tiles type: "+g.tiles_type+" not support load more yet")}}}function UGAviaControl(){var e,t,i,n,r,o,a={touchEnabled:!1,isMouseInsideStrip:!1,strip_finalPos:0,handle_timeout:"",isStripMoving:!1,isControlEnabled:!0,maxDpos:1e3};function s(t){if(0==a.isControlEnabled)return!0;if(1==a.touchEnabled)return jQuery("body").off("mousemove"),!0;a.isMouseInsideStrip=i.ismouseover();var s=e.isTouchMotionActive();1==a.isMouseInsideStrip&&0==s?function(e){var t=function(e){return 0==o?function(e){var t=r.strip_padding_left,o=r.strip_padding_right,a=i.width()-t-o,s=n.width();if(a>s)return null;var l=i.offset().left,u=e-l-t,d=r.thumb_width,_=a-r.thumb_width;u<d&&(u=d);u>_&&(u=_);var g=(u-d)/(_-d)*(s-a);return g=-1*Math.round(g)+t}(e):function(e){var t=r.strip_padding_top,o=(r.strip_padding_bottom,i.height()),a=n.height();if(o>a)return null;var s=i.offset().top,l=e-s-t;if(l<0)return null;var u=r.thumb_height,d=o-r.thumb_height;l<u&&(l=u);l>d&&(l=d);var _=(l-u)/(d-u)*(a-o);return _=-1*Math.round(_)+t}(e)}(e);if(null===t)return!1;a.is_strip_moving=!0,a.strip_finalPos=t,function(){if(1==a.isStripMoving)return!1;a.isStripMoving=!0,a.handle_timeout=setInterval(l,10)}()}(function(e){return 0==o?e.pageX:e.pageY}(t)):u()}function l(){if(0==a.is_strip_moving)return!1;var t=a.maxDpos,i=e.getInnerStripPos();Math.floor(i)==Math.floor(a.strip_finalPos)&&u();var n,r=Math.abs(a.strip_finalPos-i);r<1?n=r:(n=r/4)>0&&n<1&&(n=1),a.strip_finalPos<i&&(n*=-1),n>t&&(n=t),n<-t&&(n=-t);var o=i+n;e.positionInnerStrip(o)}function u(){if(0==a.isStripMoving)return!1;a.isStripMoving=!1,a.handle_timeout=clearInterval(a.handle_timeout)}this.enable=function(){a.isControlEnabled=!0},this.disable=function(){a.isControlEnabled=!1},this.onResize=function(){},this.init=function(l){e=l,t=l.getObjects(),t.g_gallery,i=t.g_objStrip,n=t.g_objStripInner,r=t.g_options,o=t.isVertical,jQuery("body").on("touchstart",function(e){if(0==a.isControlEnabled)return!0;a.touchEnabled=!0}),jQuery("body").mousemove(s)},this.destroy=function(){jQuery("body").off("touchstart"),jQuery("body").off("mousemove")}}function UGSlider(){var e,t,i,n,r,o,a,s,l,u,d,_,g,c=this,h=jQuery(c),p=new UniteGalleryMain,m=null,f=null,b=null,v=new UGVideoPlayer,y=new UGFunctions,I=null,w=null;this.events={ITEM_CHANGED:"item_changed",BEFORE_SWITCH_SLIDES:"before_switch",BEFORE_RETURN:"before_return",AFTER_RETURN:"after_return",ZOOM_START:"slider_zoom_start",ZOOM_END:"slider_zoom_end",ZOOMING:"slider_zooming",ZOOM_CHANGE:"slider_zoom_change",START_DRAG:"start_drag",AFTER_DRAG_CHANGE:"after_drag_change",ACTION_START:"action_start",ACTION_END:"action_end",CLICK:"slider_click",TRANSITION_START:"slider_transition_start",TRANSITION_END:"slider_transition_end",AFTER_PUT_IMAGE:"after_put_image",IMAGE_MOUSEENTER:"slider_image_mouseenter",IMAGE_MOUSELEAVE:"slider_image_mouseleave",CURRENTSLIDE_LOAD_START:"slider_current_loadstart",CURRENTSLIDE_LOAD_END:"slider_current_loadend"};var E={slider_scale_mode:"fill",slider_scale_mode_media:"fill",slider_scale_mode_fullscreen:"down",slider_item_padding_top:0,slider_item_padding_bottom:0,slider_item_padding_left:0,slider_item_padding_right:0,slider_background_color:"",slider_background_opacity:1,slider_image_padding_top:0,slider_image_padding_bottom:0,slider_image_padding_left:0,slider_image_padding_right:0,slider_image_border:!1,slider_image_border_width:10,slider_image_border_color:"#ffffff",slider_image_border_radius:0,slider_image_border_maxratio:.35,slider_image_shadow:!1,slider_video_constantsize:!1,slider_video_constantsize_scalemode:"fit",slider_video_constantsize_width:854,slider_video_constantsize_height:480,slider_video_padding_top:0,slider_video_padding_bottom:0,slider_video_padding_left:0,slider_video_padding_right:0,slider_video_enable_closebutton:!0,slider_transition:"slide",slider_transition_speed:300,slider_transition_easing:"easeInOutQuad",slider_control_swipe:!0,slider_control_zoom:!0,slider_zoom_mousewheel:!0,slider_vertical_scroll_ondrag:!1,slider_loader_type:1,slider_loader_color:"white",slider_enable_links:!0,slider_links_newpage:!1,slider_enable_bullets:!1,slider_bullets_skin:"",slider_bullets_space_between:-1,slider_bullets_align_hor:"center",slider_bullets_align_vert:"bottom",slider_bullets_offset_hor:0,slider_bullets_offset_vert:10,slider_enable_arrows:!0,slider_arrows_skin:"",slider_arrow_left_align_hor:"left",slider_arrow_left_align_vert:"middle",slider_arrow_left_offset_hor:20,slider_arrow_left_offset_vert:0,slider_arrow_right_align_hor:"right",slider_arrow_right_align_vert:"middle",slider_arrow_right_offset_hor:20,slider_arrow_right_offset_vert:0,slider_enable_progress_indicator:!0,slider_progress_indicator_type:"pie",slider_progress_indicator_align_hor:"right",slider_progress_indicator_align_vert:"top",slider_progress_indicator_offset_hor:10,slider_progress_indicator_offset_vert:10,slider_enable_play_button:!0,slider_play_button_skin:"",slider_play_button_align_hor:"left",slider_play_button_align_vert:"top",slider_play_button_offset_hor:40,slider_play_button_offset_vert:8,slider_play_button_mobilehide:!1,slider_enable_fullscreen_button:!0,slider_fullscreen_button_skin:"",slider_fullscreen_button_align_hor:"left",slider_fullscreen_button_align_vert:"top",slider_fullscreen_button_offset_hor:11,slider_fullscreen_button_offset_vert:9,slider_fullscreen_button_mobilehide:!1,slider_enable_zoom_panel:!0,slider_zoompanel_skin:"",slider_zoompanel_align_hor:"left",slider_zoompanel_align_vert:"top",slider_zoompanel_offset_hor:12,slider_zoompanel_offset_vert:92,slider_zoompanel_mobilehide:!1,slider_controls_always_on:!1,slider_controls_appear_ontap:!0,slider_controls_appear_duration:300,slider_enable_text_panel:!0,slider_textpanel_always_on:!0,slider_videoplay_button_type:"square"},T={slider_progress_indicator_align_hor:"left",slider_progress_indicator_align_vert:"bottom",slider_progress_indicator_offset_hor:0,slider_progress_indicator_offset_vert:0},S={isRunOnce:!1,isTextPanelSaparateHover:!1,numPrev:1,numCurrent:2,numNext:3,isControlsVisible:!0,currentControlsMode:"image"};function P(i,n,r){p=i,r&&(g=r,n=y.convertCustomPrefixOptions(n,g,"slider")),e=jQuery(i);var o=p.getObjects();if(t=o.g_objWrapper,o.g_objThumbs,n.hasOwnProperty("slider_progress_indicator_type")&&(E.slider_progress_indicator_type=n.slider_progress_indicator_type),"bar"==E.slider_progress_indicator_type&&(E=jQuery.extend(E,T)),n&&c.setOptions(n),function(){var e=p.getOptions(),t=e.gallery_skin;""==E.slider_bullets_skin&&(E.slider_bullets_skin=t);""==E.slider_arrows_skin&&(E.slider_arrows_skin=t);""==E.slider_zoompanel_skin&&(E.slider_zoompanel_skin=t);""==E.slider_play_button_skin&&(E.slider_play_button_skin=t);""==E.slider_fullscreen_button_skin&&(E.slider_fullscreen_button_skin=t);E.video_enable_closebutton=E.slider_video_enable_closebutton,"zoom"!=e.gallery_mousewheel_role&&(E.slider_zoom_mousewheel=!1)}(),1==E.slider_enable_bullets){b=new UGBullets;var a={bullets_skin:E.slider_bullets_skin,bullets_space_between:E.slider_bullets_space_between};b.init(p,a)}E.slider_enable_text_panel&&(w=new UGTextPanel).init(p,E,"slider"),E.slider_enable_zoom_panel&&(_=new UGZoomButtonsPanel).init(c,E);var s=p.getGalleryID();v.init(E,!1,s)}function x(){if(1==S.isRunOnce)return!1;if(S.isRunOnce=!0,E.slider_background_color){var t=E.slider_background_color;1!=E.slider_background_opacity&&(t=y.convertHexToRGB(t,E.slider_background_opacity)),i.css("background-color",t)}else 1!=E.slider_background_opacity&&(t=y.convertHexToRGB("#000000",E.slider_background_opacity),i.css("background-color",t));1==E.slider_control_swipe&&(u=new UGTouchSliderControl).init(c,E),1==E.slider_control_zoom&&(d=new UGZoomSliderControl).init(c,E),w&&w.run(),function(){e.on(p.events.ITEM_IMAGE_UPDATED,se),e.on(p.events.ITEM_CHANGE,K),b&&jQuery(b).on(b.events.BULLET_CLICK,J);1==E.slider_enable_arrows&&(y.addClassOnHover(l,"ug-arrow-hover"),y.addClassOnHover(s,"ug-arrow-hover"),p.setNextButton(l),p.setPrevButton(s));0==E.slider_controls_always_on&&i.hover(ie,ne);i.on("touchend click",$),h.on(c.events.CLICK,ee),w&&1==S.isTextPanelSaparateHover&&i.hover(D,G);m&&(y.addClassOnHover(m,"ug-button-hover"),p.setPlayButton(m));f&&(y.addClassOnHover(f,"ug-button-hover"),p.setFullScreenToggleButton(f));d&&h.on(c.events.ZOOM_CHANGE,te);_&&_.initEvents();v.initEvents(),jQuery(v).on(v.events.SHOW,oe),jQuery(v).on(v.events.HIDE,ae),ue(r),ue(o),ue(a),h.on(c.events.AFTER_PUT_IMAGE,le),i.on("mouseenter",".ug-item-wrapper img",function(e){h.trigger(c.events.IMAGE_MOUSEENTER)}),i.on("mouseleave",".ug-item-wrapper img",function(e){var t=c.isMouseInsideSlideImage(e);0==t&&h.trigger(c.events.IMAGE_MOUSELEAVE)})}()}function j(e,t){var i="ug-type-square";"round"==E.slider_videoplay_button_type&&(i="ug-type-round");var n="";return n+="<div class='ug-slide-wrapper ug-slide"+t+"'>",n+="<div class='ug-item-wrapper'></div>",n+="<div class='ug-slider-preloader "+e+"'></div>",n+="<div class='ug-button-videoplay "+i+"' style='display:none'></div>",n+="</div>"}function C(e){e&&(t=e);var u=function(){var e;switch(E.slider_loader_type){default:case 1:e="ug-loader1";break;case 2:e="ug-loader2";break;case 3:e="ug-loader3";break;case 4:e="ug-loader4";break;case 5:e="ug-loader5";break;case 6:e="ug-loader6";break;case 7:e="ug-loader7";break;case 8:e="ug-loader8";break;case 9:e="ug-loader9"}"black"==E.slider_loader_color&&(e+=" ug-loader-black");return e}(),d=(p.getOptions(),"<div class='ug-slider-wrapper'>");(d+="<div class='ug-slider-inner'>",d+=j(u,1),d+=j(u,2),d+=j(u,3),d+="</div>",1==E.slider_enable_arrows&&(d+="<div class='ug-slider-control ug-arrow-left ug-skin-"+E.slider_arrows_skin+"'></div>",d+="<div class='ug-slider-control ug-arrow-right ug-skin-"+E.slider_arrows_skin+"'></div>"),1==E.slider_enable_play_button&&(d+="<div class='ug-slider-control ug-button-play ug-skin-"+E.slider_play_button_skin+"'></div>"),1==E.slider_enable_fullscreen_button&&(d+="<div class='ug-slider-control ug-button-fullscreen ug-skin-"+E.slider_fullscreen_button_skin+"'></div>"),d+="</div>",t.append(d),i=t.children(".ug-slider-wrapper"),n=i.children(".ug-slider-inner"),r=n.children(".ug-slide1"),o=n.children(".ug-slide2"),a=n.children(".ug-slide3"),r.data("slidenum",1),o.data("slidenum",2),a.data("slidenum",3),b&&b.appendHTML(i),1==E.slider_enable_arrows&&(s=i.children(".ug-arrow-left"),l=i.children(".ug-arrow-right")),1==E.slider_enable_play_button&&(m=i.children(".ug-button-play")),1==E.slider_enable_fullscreen_button&&(f=i.children(".ug-button-fullscreen")),1==E.slider_enable_progress_indicator)&&("bar"==(I=y.initProgressIndicator(E.slider_progress_indicator_type,E,i)).getType()&&"pie"==E.slider_progress_indicator_type&&(E.slider_progress_indicator_type="bar",E=jQuery.extend(E,T)),p.setProgressIndicator(I));1==E.slider_enable_text_panel&&(w.appendHTML(i),0==E.slider_textpanel_always_on&&(w.getElement().hide().data("isHidden",!0),S.isTextPanelSaparateHover=!0));1==E.slider_enable_zoom_panel&&_.appendHTML(i),v.setHtml(n)}function A(e){var t=_e(e);y.placeElementInParentCenter(t);var i=ge(e);y.placeElementInParentCenter(i)}function M(){if(b&&(objBullets=b.getElement(),y.placeElement(objBullets,E.slider_bullets_align_hor,E.slider_bullets_align_vert,E.slider_bullets_offset_hor,E.slider_bullets_offset_vert),y.placeElement(objBullets,E.slider_bullets_align_hor,E.slider_bullets_align_vert,E.slider_bullets_offset_hor,E.slider_bullets_offset_vert)),1==E.slider_enable_arrows&&(y.placeElement(s,E.slider_arrow_left_align_hor,E.slider_arrow_left_align_vert,E.slider_arrow_left_offset_hor,E.slider_arrow_left_offset_vert),y.placeElement(l,E.slider_arrow_right_align_hor,E.slider_arrow_left_align_vert,E.slider_arrow_right_offset_hor,E.slider_arrow_right_offset_vert)),0==E.slider_controls_always_on&&X(!0),I){var e=I.getElement();if("bar"==E.slider_progress_indicator_type){var t=i.width();I.setSize(t),y.placeElement(e,"left",E.slider_progress_indicator_align_vert,0,E.slider_progress_indicator_offset_vert)}else y.placeElement(e,E.slider_progress_indicator_align_hor,E.slider_progress_indicator_align_vert,E.slider_progress_indicator_offset_hor,E.slider_progress_indicator_offset_vert)}w&&w.positionPanel(),function(){m&&y.placeElement(m,E.slider_play_button_align_hor,E.slider_play_button_align_vert,E.slider_play_button_offset_hor,E.slider_play_button_offset_vert);f&&y.placeElement(f,E.slider_fullscreen_button_align_hor,E.slider_fullscreen_button_align_vert,E.slider_fullscreen_button_offset_hor,E.slider_fullscreen_button_offset_vert);if(_){var e=_.getElement();y.placeElement(e,E.slider_zoompanel_align_hor,E.slider_zoompanel_align_vert,E.slider_zoompanel_offset_hor,E.slider_zoompanel_offset_vert)}}(),A(r),A(o),A(a),p.isMobileMode()?(1==E.slider_fullscreen_button_mobilehide&&f&&f.hide(),1==E.slider_play_button_mobilehide&&m&&m.hide(),1==E.slider_zoompanel_mobilehide&&_&&_.getElement().hide()):(1==E.slider_fullscreen_button_mobilehide&&f&&f.show(),1==E.slider_play_button_mobilehide&&m&&m.show(),1==E.slider_zoompanel_mobilehide&&_&&_.getElement().show())}function O(){var e,t,i,r,o=c.getSlidesReference(),a=0;i=c.isSlideHasItem(o.objNextSlide),(r=c.isSlideHasItem(o.objPrevSlide))?(a=o.objPrevSlide.outerWidth(),o.objPrevSlide.css("z-index",1)):o.objPrevSlide.hide(),e=t=a+o.objCurrentSlide.outerWidth(),i?(e=t+o.objNextSlide.outerWidth(),o.objPrevSlide.css("z-index",2)):o.objNextSlide.hide(),o.objCurrentSlide.css("z-index",3),y.placeElement(o.objCurrentSlide,a,0),n.css({left:-a+"px",width:e+"px"}),r&&(y.placeElement(o.objPrevSlide,0,0),y.showElement(o.objPrevSlide)),i&&(y.showElement(o.objNextSlide),y.placeElement(o.objNextSlide,t,0))}function z(e){var t=e.data("index");if(void 0===t||null==t)return!1;var i=p.getItem(t);if(!i)return!1;R(e,i)}function L(e){e.stop(!0).hide(100)}function N(e,t,i){var n={};if(1==E.slider_image_border){n["border-style"]="solid";var r=function(e,t){if((a=E.slider_image_border_width)<=10)return a;var i=y.getElementSize(e),n=i.width,r=i.height;if(t&&(t.hasOwnProperty("imageWidth")&&(n=t.imageWidth),t.hasOwnProperty("imageHeight")&&(r=t.imageHeight)),n<=0)return a;var o=n<r?n:r;if(2*a/o<E.slider_image_border_maxratio)return a;var a=o*E.slider_image_border_maxratio/2;return a=Math.round(a)}(e,i);n["border-width"]=r+"px",n["border-color"]=E.slider_image_border_color,n["border-radius"]=E.slider_image_border_radius}"image"!=t&&1==E.slider_video_constantsize&&(n["background-color"]="#000000"),1==E.slider_image_shadow&&(n["box-shadow"]="3px 3px 10px 0px #353535"),e.css(n)}function H(e,t){var i=E.slider_video_constantsize_width,n=E.slider_video_constantsize_height,r=E.slider_video_constantsize_scalemode;return y.scaleImageExactSizeInParent(e,t.imageWidth,t.imageHeight,i,n,r)}function k(e,t,i){var n=e.children(".ug-item-wrapper"),r=_e(e);if(void 0===t.urlImage||""==t.urlImage)throw new Error("The slide don't have big image defined ( data-image='imageurl' ). Please check gallery items.","showbig");var o=t.urlImage,a=e.data("urlImage");e.data("urlImage",o);var s=c.getScaleMode(e),l=c.getSlideType(e);objPadding=c.getObjImagePadding();var u="";if("string"==typeof t.description&&(u=t.description),a==o&&!0!==i){(_=n.children("img")).attr("alt",u),0!=t.imageWidth&&0!=t.imageHeight||p.checkFillImageSize(_,t);var d={};N(_,l,d="image"!=l&&1==E.slider_video_constantsize?H(_,t):y.scaleImageFitParent(_,t.imageWidth,t.imageHeight,s,objPadding)),h.trigger(c.events.AFTER_PUT_IMAGE,e)}else{var _;if((_=y.placeImageInsideParent(o,n,t.imageWidth,t.imageHeight,s,objPadding)).attr("alt",u),1==t.isBigImageLoaded){if(_.fadeTo(0,1),L(r),"image"!=l&&1==E.slider_video_constantsize)d=H(_,t);else d=y.getImageInsideParentData(n,t.imageWidth,t.imageHeight,s,objPadding);_.css("width",d.imageWidth+"px"),N(_,l,d),h.trigger(c.events.AFTER_PUT_IMAGE,e)}else _.fadeTo(0,0),function(e){e.stop(!0).show(100)}(r),e.data("isLoading",!0),c.isSlideCurrent(e)&&h.trigger(c.events.CURRENTSLIDE_LOAD_START),_.data("itemIndex",t.index),_.on("load",function(){var e=jQuery(this),t=e.data("itemIndex");e.fadeTo(0,1);var i=e.parent().parent(),n=c.getSlideType(i),r=_e(i),o=c.getObjImagePadding(),a=c.getScaleMode(i);L(r),i.data("isLoading",!1),c.isSlideCurrent(i)&&h.trigger(c.events.CURRENTSLIDE_LOAD_END),p.onItemBigImageLoaded(null,e);var s=p.getItem(t),l={};"image"!=n&&1==E.slider_video_constantsize?H(e,s):l=y.scaleImageFitParent(e,s.imageWidth,s.imageHeight,a,o),e.fadeTo(0,1),N(e,n,l),h.trigger(c.events.AFTER_PUT_IMAGE,i)})}}function R(e,t){try{var i=e.children(".ug-item-wrapper");if(null==t)return i.html(""),e.removeData("index"),e.removeData("type"),e.removeData("urlImage"),!1;e.data("index");e.data("index",t.index),e.data("type",t.type),1==E.slider_enable_links&&"image"==t.type&&(t.link?e.addClass("ug-slide-clickable"):e.removeClass("ug-slide-clickable")),k(e,t);var n=ge(e);switch(t.type){case"image":n.hide();break;default:n.show()}}catch(e){throw void 0!==e.fileName&&"showbig"==e.fileName&&p.showErrorMessageReplaceGallery(e.message),i.html(""),new Error(e)}}function G(){if(!w)return!1;if(1==Q())return!1;var e=w.getElement(),t=0;1!=S.isTextPanelSaparateHover&&1!=E.slider_textpanel_always_on||(t=E.slider_controls_appear_duration),e.stop().fadeTo(t,0),e.data("isHidden",!0)}function D(){if(!w)return!1;if(0==Q())return!1;var e=w.getElement(),t=0;1!=S.isTextPanelSaparateHover&&1!=E.slider_textpanel_always_on||(e.show(),w.positionElements(),t=E.slider_controls_appear_duration),e.stop().show().fadeTo(t,1),e.data("isHidden",!1)}function Q(){return!1!==w.getElement().data("isHidden")}function W(){var e=c.getCurrentSlide(),t=c.getSlideImage(e),i=y.getElementSize(e),n=i.left,r=i.top;if(1==E.slider_video_constantsize){var o=y.getElementSize(t);n+=o.left,r+=o.top}else n+=E.slider_video_padding_left,r+=E.slider_video_padding_top;v.setPosition(n,r)}function F(){var e=E.slider_video_constantsize_width,t=E.slider_video_constantsize_height;v.setSize(e,t),N(v.getObject(),"video")}function B(e,t,i){h.trigger(c.events.TRANSITION_START);var r=E.slider_transition;switch(i&&(r=i),c.stopSlideAction(null,!0),r){default:case"fade":U(t);break;case"slide":!function e(t,i){var r=c.isAnimating();if(1==r)return S.itemWaiting=i,!0;null!=S.itemWaiting&&(S.itemWaiting=null);var o=c.getSlidesReference();switch(t){case"right":R(o.objPrevSlide,i),O();var a=y.getElementSize(o.objPrevSlide),s=-a.left;c.switchSlideNums("right");break;case"left":R(o.objNextSlide,i),O();var l=y.getElementSize(o.objNextSlide),s=-l.left;c.switchSlideNums("left");break;default:throw new Error("wrong direction: "+t)}var u=E.slider_transition_speed;var d=E.slider_transition_easing;var _={duration:u,easing:d,queue:!1,always:function(){if(c.stopSlideAction(),v.hide(),null!=S.itemWaiting){var t=function(e){var t=c.getSlidesReference().objCurrentSlide.data("index"),i=e.index,n="left";t>i&&(n="right");return n}(S.itemWaiting);e(t,S.itemWaiting)}else c.placeNabourItems(),h.trigger(c.events.TRANSITION_END)}};n.animate({left:s+"px"},_)}(e,t);break;case"lightbox_open":U(t,!1,!0)}}function Y(e,t,i){i?e.fadeTo(E.slider_transition_speed,t,i):e.fadeTo(E.slider_transition_speed,t)}function U(e,t,i){if(!t)t=!1;var n=c.getSlidesReference();R(n.objNextSlide,e);var r=y.getElementSize(n.objCurrentSlide);y.placeElement(n.objNextSlide,r.left,r.top);var o=S.numCurrent;if(S.numCurrent=S.numNext,S.numNext=o,h.trigger(c.events.ITEM_CHANGED),n.objNextSlide.stop(!0),n.objCurrentSlide.stop(!0),1==t)n.objCurrentSlide.fadeTo(0,0),n.objNextSlide.fadeTo(0,1),c.placeNabourItems(),h.trigger(c.events.TRANSITION_END),!0!==i&&v.hide();else{if(n.objNextSlide.fadeTo(0,0),Y(n.objCurrentSlide,0,function(){c.placeNabourItems(),h.trigger(c.events.TRANSITION_END),!0!==i&&v.hide()}),1==v.isVisible())Y(v.getObject(),0);Y(n.objNextSlide,1)}}function V(){return i.children(".ug-slider-control")}function X(e){if(0==y.isTimePassed("sliderControlsToggle"))return!1;if(0==S.isControlsVisible)return!1;if(!e)e=!1;var t=V();!0===e?t.stop().fadeTo(0,0).hide():t.stop().fadeTo(E.slider_controls_appear_duration,0,function(){t.hide()}),S.isControlsVisible=!1}function Z(e){if(0==y.isTimePassed("sliderControlsToggle"))return!1;if(1==S.isControlsVisible)return!0;if(!e)e=!1;var t=V();!0===e?t.stop().show():(t.stop().show().fadeTo(0,0),t.fadeTo(E.slider_controls_appear_duration,1)),S.isControlsVisible=!0}function q(e){if(e==S.currentControlsMode)return!1;switch(e){case"image":_&&_.getElement().show();break;case"video":_&&_.getElement().hide();break;default:throw new Error("wrong controld mode: "+e)}S.currentControlsMode=e}function K(e,t,i){var n=p.getSelectedItem();c.setItem(n,!1,i);var r=n.index;b&&b.setActive(r),w&&0==S.isTextPanelSaparateHover&&D(),"image"==n.type?q("image"):q("video")}function J(e,t){p.selectItem(t)}function $(e){if(u&&0==u.isTapEventOccured(e))return!0;h.trigger(c.events.CLICK,e)}function ee(){var e=c.getCurrentSlide().hasClass("ug-slide-clickable"),t=c.getCurrentItem();if(e)return 0==E.slider_links_newpage?location.href=t.link:window.open(t.link,"_blank"),!0;0==E.slider_controls_always_on&&1==E.slider_controls_appear_ontap&&1==c.isCurrentSlideType("image")&&(0==S.isControlsVisible?Z():X(),w&&1==E.slider_textpanel_always_on&&c.isCurrentSlideType("image")&&c.isCurrentSlideImageFit()&&D())}function te(e){w&&c.isCurrentSlideType("image")&&0==c.isCurrentSlideImageFit()&&G()}function ie(){Z()}function ne(){X()}function re(e){var t=e.parent();c.startSlideAction(t)}function oe(){p.isPlayMode()&&p.pausePlaying(),h.trigger(c.events.ACTION_START)}function ae(){p.isPlayMode()&&p.continuePlaying(),h.trigger(c.events.ACTION_END)}function se(e,t,i){r.data("index")==t&&(objItem=p.getItem(t),k(r,objItem,!0)),o.data("index")==t&&(objItem=p.getItem(t),k(o,objItem,!0)),a.data("index")==t&&(objItem=p.getItem(t),k(a,objItem,!0))}function le(e,t){t=jQuery(t);var i=c.getSlideImage(t),n=ge(t),r=y.getElementSize(i);y.placeElement(n,"center","middle",r.left,r.top,i)}function ue(e){var t=ge(e);y.addClassOnHover(t),y.setButtonOnClick(t,re)}function de(e){switch(e){case 1:return r;case 2:return o;case 3:return a;default:throw new Error("wrong num: "+e)}}function _e(e){if(!e)e=c.getCurrentSlide();return e.children(".ug-slider-preloader")}function ge(e){return e.children(".ug-button-videoplay")}function ce(e){if(!e)e=c.getCurrentSlide();var t=e.data("index");return null==t?null:p.getItem(t)}this.switchSlideNums=function(e){switch(h.trigger(c.events.BEFORE_SWITCH_SLIDES),e){case"left":var t=S.numCurrent;S.numCurrent=S.numNext,S.numNext=S.numPrev,S.numPrev=t;break;case"right":t=S.numCurrent;S.numCurrent=S.numPrev,S.numPrev=S.numNext,S.numNext=t;break;default:throw new Error("wrong direction: "+e)}h.trigger(c.events.ITEM_CHANGED)},this.destroy=function(){h.off(c.events.AFTER_PUT_IMAGE),e.off(p.events.ITEM_IMAGE_UPDATED),e.off(p.events.ITEM_CHANGE),b&&jQuery(b).on(b.events.BULLET_CLICK),i.off("mouseenter"),i.off("mouseleave"),i.off("touchend"),i.off("click"),h.off(c.events.CLICK),d&&h.off(c.events.ZOOM_CHANGE),h.off(c.events.BEFORE_SWITCH_SLIDES),jQuery(v).off(v.events.SHOW),jQuery(v).off(v.events.HIDE),v.destroy(),i.off("mouseenter",".ug-item-wrapper img"),i.off("mouseleave",".ug-item-wrapper img")},this.________EXTERNAL_GENERAL___________=function(){},this.init=function(e,t,i){P(e,t,i)},this.getSlideImage=function(e){if(!e)e=c.getCurrentSlide();return e.find(".ug-item-wrapper img")},this.setHtml=function(e){C(e)},this.run=function(){x()},this.isInnerInPlace=function(){var e=c.getSlidesReference();return-y.getElementSize(e.objCurrentSlide).left==y.getElementSize(n).left},this.isAnimating=function(){return n.is(":animated")},this.isSlideCurrent=function(e){var t=e.data("slidenum");return S.numCurrent==t},this.isSlideHasItem=function(e){var t=e.data("index");return null!=t},this.getObjImagePadding=function(){return{padding_top:E.slider_image_padding_top,padding_bottom:E.slider_image_padding_bottom,padding_left:E.slider_image_padding_left,padding_right:E.slider_image_padding_right}},this.getSlidesReference=function(){return{objPrevSlide:de(S.numPrev),objNextSlide:de(S.numNext),objCurrentSlide:de(S.numCurrent)}},this.getCurrentSlide=function(){return c.getSlidesReference().objCurrentSlide},this.getCurrentItemIndex=function(){var e=c.getSlidesReference().objCurrentSlide.data("index");return null==e&&(e=-1),e},this.getCurrentItem=function(){var e=c.getCurrentItemIndex();return-1==e?null:p.getItem(e)},this.getSlideType=function(e){return null==e&&(e=c.getCurrentSlide()),e.data("type")},this.isMouseInsideSlideImage=function(e){var t=c.getSlideImage(),i=y.getMousePosition(e);void 0===i.pageX&&(i=u.getLastMousePos());var n=y.getMouseElementPoint(i,t),r=y.getElementSize(t);return isMouseInside=y.isPointInsideElement(n,r),isMouseInside},this.isCurrentSlideType=function(e){return c.getSlideType()==e},this.isCurrentSlideLoadingImage=function(){return!0===c.getCurrentSlide().data("isLoading")},this.setItem=function(e,t,i){var n=c.getSlidesReference(),r=n.objCurrentSlide.data("index"),o=e.index;if(o==r)return!0;if(null==r)R(n.objCurrentSlide,e),c.placeNabourItems();else{var a="left";p.getNumItems();"next"==i?a="left":"prev"==i||r>o?a="right":r>o&&(a="right"),B(a,e,t)}},this.placeNabourItems=function(){var e=c.getSlidesReference(),t=e.objCurrentSlide.data("index"),i=p.getPrevItem(t),n=p.getNextItem(t);R(e.objNextSlide,n),R(e.objPrevSlide,i),O()},this.________EXTERNAL_API___________=function(){},this.stopSlideAction=function(e,t){e||(e=c.getCurrentSlide()),!0===t?v.pause():v.hide()},this.startSlideAction=function(e){e||(e=c.getCurrentSlide());var t=ce(e);if("image"==t.type)return!0;switch(1==E.slider_video_constantsize&&F(),W(),v.show(),t.type){case"youtube":v.playYoutube(t.videoid,!0,t.video_start);break;case"vimeo":v.playVimeo(t.videoid);break;case"html5video":v.playHtml5Video(t.videoogv,t.videowebm,t.videomp4,t.urlImage);break;case"soundcloud":v.playSoundCloud(t.trackid);break;case"wistia":v.playWistia(t.videoid)}},this.getScaleMode=function(e){if(!e)e=c.getCurrentSlide();return"image"!=c.getSlideType(e)?E.slider_scale_mode_media:E.slider_scale_mode==E.slider_scale_mode_fullscreen?E.slider_scale_mode:1==p.isFullScreen()?E.slider_scale_mode_fullscreen:E.slider_scale_mode},this.getObjects=function(){return{g_objSlider:i,g_objInner:n,g_options:E,g_objZoomSlider:d}},this.getObjZoom=function(){return d},this.getOptions=function(){return E},this.getElement=function(){return i},this.getVideoObject=function(){return v},this.isCurrentSlideImageFit=function(){var e=c.getCurrentSlide();c.getSlideType(e);!function(e,t){null==t&&(t=c.getCurrentSlide());var i=c.getSlideType(t);if(i!=e)throw new Error("Wrong slide type: "+i+", should be: "+e)}("image",e);var t=c.getSlideImage(e);return 0!=t.length&&y.isImageFitParent(t)},this.isCurrentImageInPlace=function(){var e=c.getSlideImage();if(0==e.length)return!1;var t=c.getScaleMode(),i=c.getObjImagePadding(),n=ce(),r=e.parent(),o=y.getImageInsideParentData(r,n.imageWidth,n.imageHeight,t,i),a=y.getElementSize(e),s=!1;return o.imageWidth==a.width&&(s=!0),s},this.isSlideActionActive=function(){return v.isVisible()},this.isSwiping=function(){return!!u&&u.isTouchActive()},this.isPreloading=function(){return!!_e().is(":visible")},this.setOptions=function(e){g&&(e=y.convertCustomPrefixOptions(e,g,"slider")),E=jQuery.extend(E,e)},this.setSize=function(e,t){if(e<0||t<0)return!0;var s={};s.width=e+"px",s.height=t+"px",i.css(s);var l={};l.height=t+"px",l.top="0px",l.left="0px",n.css(l);var u={};u.height=t+"px",u.width=e+"px",r.css(u),o.css(u),a.css(u);var d=e-E.slider_item_padding_left-E.slider_item_padding_right,_=t-E.slider_item_padding_top-E.slider_item_padding_bottom,g={};if(g.width=d+"px",g.height=_+"px",g.top=E.slider_item_padding_top+"px",g.left=E.slider_item_padding_left+"px",i.find(".ug-item-wrapper").css(g),w&&w.setSizeByParent(),M(),z(r),z(o),z(a),O(),"image"!=c.getSlideType()&&1==E.slider_video_constantsize)F();else{var h=e-E.slider_video_padding_left-E.slider_video_padding_right,p=t-E.slider_video_padding_top-E.slider_video_padding_bottom;v.setSize(h,p)}W()},this.refreshSlideItems=function(){if(1==c.isAnimating())return!0;z(r),z(o),z(a),O()},this.isMouseOver=function(){return i.ismouseover()},this.setPosition=function(e,t){y.placeElement(i,e,t)},this.zoomIn=function(){if(!d)return!0;d.zoomIn()},this.zoomOut=function(){if(!d)return!0;d.zoomOut()},this.zoomBack=function(){if(!d)return!0;d.zoomBack()}}function UGTextPanel(){var e,t,i,n,r,o,a,s=this,l=new UGFunctions,u="",d={textpanel_align:"bottom",textpanel_margin:0,textpanel_text_valign:"middle",textpanel_padding_top:10,textpanel_padding_bottom:10,textpanel_height:null,textpanel_padding_title_description:5,textpanel_padding_right:11,textpanel_padding_left:11,textpanel_fade_duration:200,textpanel_enable_title:!0,textpanel_enable_description:!0,textpanel_title_as_link:!1,textpanel_title_link_newtab:!0,textpanel_enable_bg:!0,textpanel_bg_color:"#000000",textpanel_bg_opacity:.4,textpanel_title_color:null,textpanel_title_font_family:null,textpanel_title_text_align:null,textpanel_title_font_size:null,textpanel_title_bold:null,textpanel_css_title:{},textpanel_desc_color:null,textpanel_desc_font_family:null,textpanel_desc_text_align:null,textpanel_desc_font_size:null,textpanel_desc_bold:null,textpanel_css_description:{},textpanel_desc_style_as_title:!1,textpanel_bg_css:{}},_={isFirstTime:!0,setInternalHeight:!0,lastTitleBottom:0,lastDescHeight:0};function g(t,a){if(!a)a=d.textpanel_padding_top;var s=a;if(i){var u=s;if(l.placeElement(i,0,u),1==i.is(":visible")){(s=l.getElementSize(i).bottom)>0&&(_.lastTitleBottom=s)}else{s=20;_.lastTitleBottom>0&&(s=_.lastTitleBottom)}}var g="";if(n&&(g=jQuery.trim(n.text())),""!=g){var c=s;if(i&&(c+=d.textpanel_padding_title_description),l.placeElement(n,0,c),1==jQuery(n).is(":visible")){var h=l.getElementSize(n);s=h.bottom,h.height>0&&(_.lastDescHeight=h.height)}else{var p=16;_.lastDescHeight>0&&(p=_.lastDescHeight),s=c+p}}d.textpanel_height||1!=_.setInternalHeight||function(t,i){if(!i)var i=!1;if(1==i){if(r){var n=r.height();t>n&&r.height(t)}var a={height:t+"px"};e.add(o).animate(a,d.textpanel_fade_duration)}else r&&r.height(t),e.add(o).height(t)}(s+d.textpanel_padding_bottom,t)}function c(){var e=0;if(i&&(e+=i.outerHeight()),n){var t="";n&&(t=jQuery.trim(n.text())),""!=t&&(i&&(e+=d.textpanel_padding_title_description),e+=n.outerHeight())}return e}function h(){if(1==d.textpanel_enable_bg){(r=e.children(".ug-textpanel-bg")).fadeTo(0,d.textpanel_bg_opacity);var t={"background-color":d.textpanel_bg_color};t=jQuery.extend(t,d.textpanel_bg_css),r.css(t)}if(1==d.textpanel_enable_title){i=o.children(".ug-textpanel-title");var a={};null!==d.textpanel_title_color&&(a.color=d.textpanel_title_color),null!==d.textpanel_title_font_family&&(a["font-family"]=d.textpanel_title_font_family),null!==d.textpanel_title_text_align&&(a["text-align"]=d.textpanel_title_text_align),null!==d.textpanel_title_font_size&&(a["font-size"]=d.textpanel_title_font_size+"px"),null!==d.textpanel_title_bold&&(!0===d.textpanel_title_bold?a["font-weight"]="bold":a["font-weight"]="normal"),d.textpanel_css_title&&(a=jQuery.extend(a,d.textpanel_css_title)),i.css(a)}if(1==d.textpanel_enable_description){n=o.children(".ug-textpanel-description");var s={};null!==d.textpanel_desc_color&&(s.color=d.textpanel_desc_color),null!==d.textpanel_desc_font_family&&(s["font-family"]=d.textpanel_desc_font_family),null!==d.textpanel_desc_text_align&&(s["text-align"]=d.textpanel_desc_text_align),null!==d.textpanel_desc_font_size&&(s["font-size"]=d.textpanel_desc_font_size+"px"),null!==d.textpanel_desc_bold&&(!0===d.textpanel_desc_bold?s["font-weight"]="bold":s["font-weight"]="normal"),d.textpanel_css_title&&(s=jQuery.extend(s,d.textpanel_css_description)),n.css(s)}}function p(){var e=a.getSelectedItem();s.setText(e.title,e.description,e.link)}this.positionElements=function(e){if(!d.textpanel_height||"top"==d.textpanel_text_valign)return g(e),!1;switch(d.textpanel_text_valign){default:case"top":g(!1);break;case"bottom":t=c(),g(!1,o.height()-t-d.textpanel_padding_bottom);break;case"center":case"middle":!function(){var e=c();g(!1,(o.height()-e)/2)}()}var t},this.init=function(e,t,i){if(a=e,i&&(u=i,t=l.convertCustomPrefixOptions(t,u,"textpanel")),t&&(d=jQuery.extend(d,t)),0==d.textpanel_enable_title&&0==d.textpanel_enable_description)throw new Error("Textpanel Error: The title or description must be enabled");d.textpanel_height&&d.textpanel_height<0&&(d.textpanel_height=null),1==d.textpanel_desc_style_as_title&&(d.textpanel_desc_color||(d.textpanel_desc_color=d.textpanel_title_color),d.textpanel_desc_bold||(d.textpanel_desc_bold=d.textpanel_title_bold),d.textpanel_desc_font_family||(d.textpanel_desc_font_family=d.textpanel_title_font_family),d.textpanel_desc_font_size||(d.textpanel_desc_font_size=d.textpanel_title_font_size),d.textpanel_desc_text_align||(d.textpanel_desc_text_align=d.textpanel_title_text_align))},this.appendHTML=function(i,n){t=i;var r="<div class='ug-textpanel"+(n=n?" "+n:"")+"'>";1==d.textpanel_enable_bg&&(r+="<div class='ug-textpanel-bg"+n+"'></div>"),r+="<div class='ug-textpanel-textwrapper"+n+"'>",1==d.textpanel_enable_title&&(r+="<div class='ug-textpanel-title"+n+"'></div>"),1==d.textpanel_enable_description&&(r+="<div class='ug-textpanel-description"+n+"'></div>"),r+="</div></div>",i.append(r),e=i.children(".ug-textpanel"),o=e.children(".ug-textpanel-textwrapper"),h()},this.destroy=function(){jQuery(a).off(a.events.ITEM_CHANGE)},this.run=function(){s.setSizeByParent(),jQuery(a).on(a.events.ITEM_CHANGE,p)},this.setPanelSize=function(t,a){if(_.setInternalHeight=!0,a)_.setInternalHeight=!1;else a=80;d.textpanel_height&&(a=d.textpanel_height),e.width(t),e.height(a),r&&(r.width(t),r.height(a));var u=t-d.textpanel_padding_left-d.textpanel_padding_right,g=d.textpanel_padding_left;l.setElementSizeAndPosition(o,g,0,u,a),i&&i.width(u),n&&n.width(u),0==_.isFirstTime&&s.positionElements(!1)},this.setSizeByParent=function(){var e=l.getElementSize(t);s.setPanelSize(e.width)},this.setTextPlain=function(e,t,r){if(1==d.textpanel_title_as_link&&e&&r){var o="";1==d.textpanel_title_link_newtab&&(o+=' target="blank"'),e='<a class="ug-textpanel-link" href="'+r+'" '+o+">"+e+"</a>"}i&&i.html(e),n&&n.html(t)},this.setText=function(e,t,i){1==_.isFirstTime?(s.setTextPlain(e,t,i),_.isFirstTime=!1,s.positionElements(!1)):o.stop().fadeTo(d.textpanel_fade_duration,0,function(){s.setTextPlain(e,t,i),s.positionElements(!0),jQuery(this).fadeTo(d.textpanel_fade_duration,1)})},this.positionPanel=function(t,i){var n={};if(null!=t)n.top=t,n.bottom="auto";else switch(d.textpanel_align){case"top":n.top=d.textpanel_margin+"px";break;case"bottom":n.top="auto",n.bottom=d.textpanel_margin+"px";break;case"middle":n.top=l.getElementRelativePos(e,"middle",d.textpanel_margin)}null!=i&&(n.left=i),e.css(n)},this.setOptions=function(e){u&&(e=l.convertCustomPrefixOptions(e,u,"textpanel")),d=jQuery.extend(d,e)},this.getElement=function(){return e},this.getSize=function(){return l.getElementSize(e)},this.refresh=function(e,t,i,n){h(),i?s.setPanelSize(i,n):s.setSizeByParent(),s.positionElements(!1),!0!==t&&s.positionPanel(),!0===e&&s.show()},this.hide=function(){e.hide()},this.show=function(){e.show()},this.getOptions=function(){return d},this.getOption=function(e){return 0==d.hasOwnProperty(e)?null:d[e]}}function UGZoomButtonsPanel(){var e,t,i,n,r=new UGSlider,o=new UGFunctions,a={slider_zoompanel_skin:""};function s(e){return!e||!!e.hasClass("ug-zoompanel-button-disabled")}function l(e){e&&e.addClass("ug-zoompanel-button-disabled")}function u(e){e&&e.removeClass("ug-zoompanel-button-disabled")}function d(){if(0==r.isCurrentSlideType("image"))return!0;1==r.isCurrentSlideImageFit()?0==s(i)&&(l(i),l(n)):1==s(i)&&(u(i),u(n))}this.init=function(e,t){r=e,t&&(a=jQuery.extend(a,t))},this.appendHTML=function(r){r;var o="<div class='ug-slider-control ug-zoompanel ug-skin-"+a.slider_zoompanel_skin+"'>";o+="<div class='ug-zoompanel-button ug-zoompanel-plus'></div>",o+="<div class='ug-zoompanel-button ug-zoompanel-minus ug-zoompanel-button-disabled'></div>",o+="<div class='ug-zoompanel-button ug-zoompanel-return ug-zoompanel-button-disabled'></div>",o+="</div>",r.append(o),e=r.children(".ug-zoompanel"),t=e.children(".ug-zoompanel-plus"),i=e.children(".ug-zoompanel-minus"),n=e.children(".ug-zoompanel-return")},this.setObjects=function(e,r,o){t=e,n=o,(i=r)&&i.addClass("ug-zoompanel-button-disabled"),n&&n.addClass("ug-zoompanel-button-disabled")},this.getElement=function(){return e},this.initEvents=function(){o.addClassOnHover(t,"ug-button-hover"),o.addClassOnHover(i,"ug-button-hover"),o.addClassOnHover(n,"ug-button-hover"),o.setButtonOnClick(t,function(){if(1==s(t))return!0;r.zoomIn()}),o.setButtonOnClick(i,function(){if(1==s(i))return!0;r.zoomOut()}),o.setButtonOnClick(n,function(){if(1==s(n))return!0;r.zoomBack()}),jQuery(r).on(r.events.ZOOM_CHANGE,d),jQuery(r).on(r.events.ITEM_CHANGED,d)}}function UGBullets(){var e,t,i=this,n=0,r=new UniteGalleryMain,o=new UGFunctions,a={isInited:!1},s={bullets_skin:"",bullets_addclass:"",bullets_space_between:-1};function l(){var i="",r="";-1!=s.bullets_space_between&&(r=" style='margin-left:"+s.bullets_space_between+"px'");for(var o=0;o<n;o++)i+=0==o?"<div class='ug-bullet'></div>":"<div class='ug-bullet'"+r+"></div>";if(e.html(i),!t){var a=e.find(".ug-bullet:first-child");a.length&&(t=a.width())}}function u(e){if(1==i.isActive(e))return!0;var t=e.index();jQuery(i).trigger(i.events.BULLET_CLICK,t)}function d(){var t=e.children(".ug-bullet");o.setButtonOnClick(t,u),t.on("mousedown mouseup",function(e){return!1})}function _(e){if(e<0||e>=n)throw new Error("wrong bullet index: "+e)}function g(){if(1==a.isInited)return!0;throw new Error("The bullets are not inited!")}this.events={BULLET_CLICK:"bullet_click"},this.init=function(e,t,i){r=e,n=i||r.getNumItems(),a.isInited=!0,""==(s=jQuery.extend(s,t)).bullets_skin&&(s.bullets_skin=s.gallery_skin)},this.getBulletsWidth=function(){return 0==n?0:t?n*t+(n-1)*s.bullets_space_between:0},this.appendHTML=function(t){t,g();var i="";""!=s.bullets_addclass&&(i=" "+s.bullets_addclass);var n="<div class='ug-slider-control ug-bullets ug-skin-"+s.bullets_skin+i+"'>";e=jQuery(n+="</div>"),t.append(e),l(),d()},this.updateNumBullets=function(e){n=e,l(),d()},this.getElement=function(){return e},this.setActive=function(t){g(),_(t);var i=e.children(".ug-bullet");i.removeClass("ug-bullet-active"),jQuery(i[t]).addClass("ug-bullet-active"),t},this.isActive=function(t){if(_(t),"number"!=typeof t)var i=t;else i=e.children(".ug-bullet")[t];return!!i.hasClass("ug-bullet-active")},this.getNumBullets=function(){return n}}function UGProgressBar(){var e,t,i=this,n=0,r=new UGFunctions,o={slider_progressbar_color:"#ffffff",slider_progressbar_opacity:.6,slider_progressbar_line_width:5};this.put=function(i,n){n&&(o=jQuery.extend(o,n)),i.append("<div class='ug-progress-bar'><div class='ug-progress-bar-inner'></div></div>"),e=i.children(".ug-progress-bar"),(t=e.children(".ug-progress-bar-inner")).css("background-color",o.slider_progressbar_color),e.height(o.slider_progressbar_line_width),t.height(o.slider_progressbar_line_width),t.width("0%");var r=o.slider_progressbar_opacity,a=t[0];a.style.opacity=r,a.style.filter="alpha(opacity="+100*r+")"},this.putHidden=function(t,n){i.put(t,n),e.hide()},this.getElement=function(){return e},this.setSize=function(n){e.width(n),t.width(n),i.draw()},this.setPosition=function(t,i,n,o){r.placeElement(e,t,i,n,o)},this.draw=function(){var e=100*n;t.width(e+"%")},this.setProgress=function(e){n=r.normalizePercent(e),i.draw()},this.getType=function(){return"bar"}}function UGProgressPie(){var e,t=this,i=!1,n=new UGFunctions,r={slider_progresspie_type_fill:!1,slider_progresspie_color1:"#B5B5B5",slider_progresspie_color2:"#E5E5E5",slider_progresspie_stroke_width:6,slider_progresspie_width:30,slider_progresspie_height:30};function o(t){if(!t)t=0;var n=Math.min(r.slider_progresspie_width,r.slider_progresspie_height)/2,o=e[0].getContext("2d");0==i&&(i=!0,o.rotate(1.5*Math.PI),o.translate(-2*n,0)),o.clearRect(0,0,r.slider_progresspie_width,r.slider_progresspie_height);var a=r.slider_progresspie_width/2,s=r.slider_progresspie_height/2,l=0,u=t*Math.PI*2;if(1==r.slider_progresspie_type_fill)o.beginPath(),o.moveTo(a,s),o.arc(a,s,n,l,u),o.lineTo(a,s),o.fillStyle=r.slider_progresspie_color1,o.fill(),o.closePath();else{o.globalCompositeOperation="source-over",o.beginPath(),o.moveTo(a,s),o.arc(a,s,n,l,u),o.lineTo(a,s),o.fillStyle=r.slider_progresspie_color1,o.fill(),o.closePath(),o.globalCompositeOperation="destination-out";var d=n-r.slider_progresspie_stroke_width;o.beginPath(),o.moveTo(a,s),o.arc(a,s,d,l,u),o.lineTo(a,s),o.fillStyle=r.slider_progresspie_color1,o.fill(),o.closePath()}1==r.slider_progresspie_type_fill&&(l=u,u=2*Math.PI,o.beginPath(),o.arc(a,s,n,l,u),o.lineTo(a,s),o.fillStyle=r.slider_progresspie_color2,o.fill(),o.closePath())}this.put=function(t,i){i&&(r=jQuery.extend(r,i)),t.append("<canvas class='ug-canvas-pie' width='"+r.slider_progresspie_width+"' height='"+r.slider_progresspie_height+"'></canvas>"),e=t.children(".ug-canvas-pie")},this.putHidden=function(i,n){t.put(i,n),o(.1),e.hide()},this.getElement=function(){return e},this.setPosition=function(t,i){n.placeElement(e,t,i)},this.getSize=function(){return{width:r.slider_progresspie_width,height:r.slider_progresspie_height}},this.setProgress=function(e){e=n.normalizePercent(e),e,o(e)},this.getType=function(){return"pie"}}function UGTouchSliderControl(){var e,t,i,n=new UGSlider,r=new UGFunctions,o={slider_transition_continuedrag_speed:250,slider_transition_continuedrag_easing:"linear",slider_transition_return_speed:300,slider_transition_return_easing:"easeInOutQuad"},a={touch_active:!1,startMouseX:0,startMouseY:0,lastMouseX:0,lastMouseY:0,startPosx:0,startTime:0,isInitDataValid:!1,slides:null,lastNumTouches:0,isDragging:!1,storedEventID:"touchSlider",videoStartX:0,isDragVideo:!1,videoObject:null};function s(e){if(!e)e=n.getSlidesReference();return-r.getElementSize(e.objCurrentSlide).left-r.getElementSize(t).left}function l(e){if(1==n.isInnerInPlace())return!1;if(i.trigger(n.events.BEFORE_RETURN),!e)e=n.getSlidesReference();var s=-r.getElementSize(e.objCurrentSlide).left;t.animate({left:s+"px"},{duration:o.slider_transition_return_speed,easing:o.slider_transition_continuedrag_easing,queue:!1,progress:function(e,i,n){if(1==a.isDragVideo){var o=r.getElementSize(t).left-s,l=a.videoStartX+o;a.videoObject.css("left",l)}},complete:function(){i.trigger(n.events.AFTER_RETURN)}})}function u(){var e=n.getSlidesReference(),u=s(e);if(0==u)return!1;var d=u>0?"left":"right",_=!1;switch(d){case"right":if(n.isSlideHasItem(e.objPrevSlide))var g=-r.getElementSize(e.objPrevSlide).left;else _=!0;break;case"left":if(n.isSlideHasItem(e.objNextSlide))g=-r.getElementSize(e.objNextSlide).left;else _=!0}1==_?l(e):t.stop().animate({left:g+"px"},{duration:o.slider_transition_continuedrag_speed,easing:o.slider_transition_continuedrag_easing,queue:!1,progress:function(){if(1==a.isDragVideo){var e=r.getElementSize(t).left-a.startPosx,i=a.videoStartX+e;a.videoObject.css("left",i)}},always:function(){!function(e){n.getVideoObject().hide(),n.switchSlideNums(e),n.placeNabourItems()}(d),i.trigger(n.events.AFTER_DRAG_CHANGE)}})}function d(e){var i=r.getMousePosition(e);a.startMouseX=i.pageX,a.startMouseY=i.pageY,a.lastMouseX=a.startMouseX,a.lastMouseY=a.startMouseY,a.startTime=jQuery.now();var n=r.getArrTouches(e);a.startArrTouches=r.getArrTouchPositions(n);var o=r.getElementSize(t);a.startPosx=o.left,a.isInitDataValid=!0,a.isDragVideo=!1,r.storeEventData(e,a.storedEventID)}function _(e){a.touch_active=!1}function g(e,t){a.touch_active=!0,d(t)}function c(e){return e.preventDefault(),a.isDragging=!1,1==n.isAnimating()&&t.stop(!0,!0),r.getArrTouches(e).length>1?(1==a.touch_active&&_(),!0):1==a.touch_active||void g(0,e)}function h(s){if(0==a.touch_active)return!0;if(0==s.buttons)return _(),u(),!0;r.updateStoredEventData(s,a.storedEventID),s.preventDefault();var l=r.getMousePosition(s);a.lastMouseX=l.pageX,a.lastMouseY=l.pageY;var g=null;1==o.slider_vertical_scroll_ondrag&&(g=r.handleScrollTop(a.storedEventID)),"vert"!==g&&function(r){var o=a.lastMouseX-a.startMouseX;if(0==o)return!0;var s=o<0?"left":"right",l=n.getObjZoom();if(l){if(1==l.isPanEnabled(r,s))return a.isInitDataValid=!1,!0;if(0==a.isInitDataValid)return d(r),!0}var u=a.startPosx+o;o>0&&u>0?u/=3:o<0&&u+t.width()<e.width()&&(u=a.startPosx+o/3);if(0==a.isDragging&&(a.isDragging=!0,i.trigger(n.events.START_DRAG)),t.css("left",u+"px"),1==a.isDragVideo){var _=u-a.startPosx,g=a.videoStartX+_;a.videoObject.css("left",g)}}(s)}function p(e){var t=r.getArrTouches(e).length;if(1==n.isInnerInPlace()&&0==a.touch_active&&0==t)return!0;if(0==t&&1==a.touch_active){_();var i=!1;0==r.wasVerticalScroll(a.storedEventID)&&(i=function(){var e=n.getSlidesReference(),t=s(e),i=Math.round(3*e.objCurrentSlide.width()/8);if(Math.abs(t)>=i)return!0;var r=Math.abs(a.lastMouseX-a.startMouseX);return Math.abs(a.lastMouseY-a.startMouseY),!(r<20)&&jQuery.now()-a.startTime<500}()),1==i?u():l()}else 1==t&&0==a.touch_active&&g(0,e)}this.isTapEventOccured=function(e){var t=r.getArrTouches(e).length;if(0!=t||0!=a.lastNumTouches)return a.lastNumTouches=t,!1;a.lastNumTouches=t;s(n.getSlidesReference());var i=Math.abs(a.lastMouseX-a.startMouseX),o=Math.abs(a.lastMouseY-a.startMouseY),l=jQuery.now()-a.startTime;return i<20&&o<50&&l<500},this.init=function(r,a){n=r,i=jQuery(n),g_objects=r.getObjects(),e=g_objects.g_objSlider,t=g_objects.g_objInner,o=jQuery.extend(o,a),e.bind("mousedown touchstart",c),jQuery("body").bind("mousemove touchmove",h),jQuery(window).add("body").bind("mouseup touchend",p)},this.getLastMousePos=function(){return{pageX:a.lastMouseX,pageY:a.lastMouseY}},this.isTouchActive=function(){return a.touch_active}}function UGZoomSliderControl(){var e,t,i=new UGSlider,n=new UGFunctions,r={slider_zoom_step:1.2,slider_zoom_max_ratio:6,slider_zoom_return_pan_duration:400,slider_zoom_return_pan_easing:"easeOutCubic"},o={isPanActive:!1,startMouseX:0,startMouseY:0,lastMouseX:0,lastMouseY:0,startImageX:0,startImageY:0,panXActive:!1,panYActive:!1,objImage:null,objImageSize:null,objParent:null,objParentSize:null,objSlide:null,storeImageLastTime:0,isZoomActive:!1,startDistance:0,startMiddlePoint:null,imageOrientPoint:null,objFitImageSize:null,isZoomedOnce:!1};function a(n,a){i=n,t=jQuery(i),g_objects=n.getObjects(),e=g_objects.g_objSlider,g_objects.g_objInner,r=jQuery.extend(r,a),e.on("mousewheel",b),e.bind("mousedown touchstart",p),jQuery("body").bind("mousemove touchmove",f),jQuery(window).add("body").bind("mouseup touchend",m),t.bind(i.events.BEFORE_RETURN,function(){h()}),t.bind(i.events.ITEM_CHANGED,function(){o.isZoomedOnce=!1}),t.bind(i.events.ZOOM_CHANGE,function(){o.isZoomedOnce=!0})}function s(){var e=i.getScaleMode();return"down"!=e&&(e="fit"),e}function l(){if((r=jQuery.now())-o.storeImageLastTime<20)return!1;var e=i.getSlidesReference();if(o.objSlide=e.objCurrentSlide,o.objImage=e.objCurrentSlide.find("img"),0==o.objImage.length)return!1;o.objImageSize=n.getElementSize(o.objImage),o.objParent=o.objImage.parent(),o.objParentSize=n.getElementSize(o.objParent);var t=s();objPadding=i.getObjImagePadding(),o.objFitImageSize=n.getImageInsideParentDataByImage(o.objImage,t,objPadding);var r=jQuery.now();return o.storeImageLastTime=r,!0}function u(e,o){var a=i.getSlidesReference().objCurrentSlide.find("img"),l=s();t.trigger(i.events.ZOOM_START);var u=!0,d=i.getObjImagePadding();if("back"==e){var _=n.getImageOriginalSize(a);n.scaleImageFitParent(a,_.width,_.height,l,d)}else{var g="in"==e;u=n.zoomImageInsideParent(a,g,r.slider_zoom_step,o,l,r.slider_zoom_max_ratio,d)}1==u&&(t.trigger(i.events.ZOOMING),t.trigger(i.events.ZOOM_CHANGE),t.trigger(i.events.ZOOM_END))}function d(e,t,i){var r=n.getArrTouches(t);if(!0===i){if(1!=r.length)return!1}else if(r.length>1)return!1;return!!n.isElementBiggerThenParent(e)}function _(e){o.isPanActive=!0,function(e){var t=n.getMousePosition(e);o.startMouseX=t.pageX,o.startMouseY=t.pageY,o.lastMouseX=o.startMouseX,o.lastMouseY=o.startMouseY,o.startImageX=o.objImageSize.left,o.startImageY=o.objImageSize.top,o.panXActive=o.objImageSize.width>o.objParentSize.width,o.panYActive=o.objImageSize.height>o.objParentSize.height}(e)}function g(e){if(0==o.isZoomActive)return!1;2!=n.getArrTouches(e).length&&(o.isZoomActive=!1,t.trigger(i.events.ZOOM_END))}function c(e){if(1==o.isZoomActive)return!0;var r=n.getArrTouches(e);if(2!=r.length)return!0;!function(e){o.isZoomActive=!0,o.startDistance=n.getDistance(e[0].pageX,e[0].pageY,e[1].pageX,e[1].pageY),0==o.startDistance&&(o.startDistance=1),o.startMiddlePoint=n.getMiddlePoint(e[0].pageX,e[0].pageY,e[1].pageX,e[1].pageY),o.objImageSize=n.getElementSize(o.objImage),o.startImageX=o.objImageSize.left,o.startImageY=o.objImageSize.top,o.imageOrientPoint=n.getElementLocalPoint(o.startMiddlePoint,o.objImage),0==n.isPointInsideElement(o.imageOrientPoint,o.objImageSize)&&(o.imageOrientPoint=n.getElementCenterPoint(o.objImage)),t.trigger(i.events.ZOOM_START)}(r)}function h(){if(null==o.objImage||0==o.objImage.length)return!0;if(n.getElementSize(o.objImage).width<o.objFitImageSize.imageWidth){o.objImage.css({position:"absolute",margin:"none"});var e={top:o.objFitImageSize.imageTop+"px",left:o.objFitImageSize.imageLeft+"px",width:o.objFitImageSize.imageWidth+"px",height:o.objFitImageSize.imageHeight+"px"};o.objImage.animate(e,{duration:r.slider_zoom_return_pan_duration,easing:r.slider_zoom_return_pan_easing,queue:!1})}else!function(){var e=!1,t=!1,a=0,s=0,l=n.getElementSize(o.objImage),u=i.getObjImagePadding(),d=n.getElementCenterPosition(o.objImage,u);o.panXActive=o.objImageSize.width>o.objParentSize.width,o.panYActive=o.objImageSize.height>o.objParentSize.height,1==o.panYActive?l.top>0?(s=0,t=!0):l.bottom<o.objParentSize.height&&(s=o.objParentSize.height-l.height,t=!0):l.top!=d.top&&(t=!0,s=d.top),1==o.panXActive?l.left>0?(a=0,e=!0):l.right<o.objParentSize.width&&(a=o.objParentSize.width-l.width,e=!0):l.left!=d.left&&(e=!0,a=d.left);var _={};1==t&&(_.top=s+"px"),1==e&&(_.left=a+"px"),1!=t&&1!=e||o.objImage.animate(_,{duration:r.slider_zoom_return_pan_duration,easing:r.slider_zoom_return_pan_easing,queue:!1})}()}function p(e){if(0==i.isCurrentSlideType("image"))return!0;l();if(null==o.objImage||0==o.objImage.length)return!0;e.preventDefault(),1==!(!o.objImage||!o.objImage.is(":animated"))&&o.objImage.stop(!0),1==o.isZoomActive?g(e):c(e),1==o.isZoomActive?o.isPanActive=!1:1==d(o.objImage,e)&&1==o.isZoomedOnce&&_(e)}function m(e){if(0==i.isCurrentSlideType("image"))return!0;if(1==jQuery(e.target).data("ug-button"))return!1;l();if(null==o.objImage||0==o.objImage.length)return!0;var t=o.isPanActive,n=o.isZoomActive;if(0==i.isInnerInPlace())return o.isZoomActive=!1,o.isPanActive=!1,!0;if(1==o.isZoomActive?g(e):c(e),1==o.isZoomActive)o.isPanActive=!1;else{var r=d(o.objImage,e,!0);1==o.isPanActive?o.isPanActive=!1:1==r&&_(e)}(t||n)&&0==o.isZoomActive&&0==o.isPanActive&&h()}function f(e){if(0==i.isCurrentSlideType("image"))return!0;1==o.isZoomActive?function(e){var a=n.getArrTouches(e),s=n.getDistance(a[0].pageX,a[0].pageY,a[1].pageX,a[1].pageY)/o.startDistance,l=n.getMiddlePoint(a[0].pageX,a[0].pageY,a[1].pageX,a[1].pageY),u=o.objImageSize.width*s,d=o.objImageSize.height*s,_=n.getImageOriginalSize(o.objImage),g=1;if(_.width>0&&(g=u/_.width),g>r.slider_zoom_max_ratio)return!0;panX=-(o.imageOrientPoint.x*s-o.imageOrientPoint.x),panY=-(o.imageOrientPoint.y*s-o.imageOrientPoint.y);var c=l.x-o.startMiddlePoint.x,h=l.y-o.startMiddlePoint.y,p=o.startImageX+panX+c,m=o.startImageY+panY+h;n.setElementSizeAndPosition(o.objImage,p,m,u,d),t.trigger(i.events.ZOOMING),t.trigger(i.events.ZOOM_CHANGE)}(e):1==o.isPanActive&&function(e){if(null==o.objImage||0==o.objImage.length)return!0;var t=n.getMousePosition(e),r=(t.pageX,o.startMouseX,t.pageY,o.startMouseY,t.pageX-o.lastMouseX),a=t.pageY-o.lastMouseY,s=r<0?"left":"right",l=a<0?"up":"down";o.lastMouseX=t.pageX,o.lastMouseY=t.pageY;var u=n.getElementSize(o.objImage);0==o.panYActive?a=0:"down"==l&&u.top>0?a/=3:"up"==l&&u.bottom<o.objParentSize.height&&(a/=3),0==o.panXActive||0==i.isInnerInPlace()?r=0:"right"==s&&u.left>0?r/=3:"left"==s&&u.right<o.objParentSize.width&&(r/=3);var d=u.left+r,_=u.top+a;n.placeElement(o.objImage,d,_)}(e)}function b(e,t,o,a){return 0==r.slider_zoom_mousewheel||(0==i.isCurrentSlideType("image")||(e.preventDefault(),void u(1==t>0?"in":"out",n.getMousePosition(e))))}this.________EXTERNAL_____________=function(){},this.isPanEnabled=function(e,t){if(l(),null==o.objImage||0==o.objImage.length)return!1;if(0==o.isZoomedOnce)return!1;if(0==d(o.objImage,e))return!1;if(0==i.isInnerInPlace())return!1;if("left"==t){if(o.objImageSize.right<=o.objParentSize.width)return!1}else if(o.objImageSize.left>=0)return!1;return!0},this.init=function(e,t){a(e,t)},this.zoomIn=function(){u("in")},this.zoomOut=function(){u("out")},this.zoomBack=function(){u("back")}}function UGWistiaAPI(){this.isAPILoaded=!1;var e,t,i=this,n=jQuery(this),r=!1;function o(){return"undefined"!=typeof Wistia}function a(e,o,a,s,l){t=null,r=!1;var u=e+"_video",d="<div id='"+u+"' class='wistia_embed' style='width:"+a+";height:"+s+";' data-video-width='"+a+"' data-video-height='"+s+"'>&nbsp;</div>";jQuery("#"+e).html(d),t=Wistia.embed(o,{version:"v1",videoWidth:a,videoHeight:s,container:u,autoPlay:l}),r=!0,t.bind("play",function(){n.trigger(i.events.START_PLAYING)}),t.bind("pause",function(){n.trigger(i.events.STOP_PLAYING)}),t.bind("end",function(){n.trigger(i.events.STOP_PLAYING),n.trigger(i.events.VIDEO_ENDED)})}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(e){return 1==g_ugWistiaAPI.isAPILoaded||(o()?(g_ugWistiaAPI.isAPILoaded=!0,!0):(!0!==e&&g_ugFunctions.loadJs("fast.wistia.com/assets/external/E-v1.js",!0),void(g_ugWistiaAPI.isAPILoaded=!0)))},this.doCommand=function(e){if(null==t)return!1;if(0==r)return!1;switch(e){case"play":t.play();break;case"pause":t.pause()}},this.pause=function(){i.doCommand("pause")},this.play=function(){i.doCommand("play")},this.putVideo=function(t,i,n,r,s,l){if(o())return a(t,i,n,r,s),!0;this.loadAPI(),e=setInterval(function(){o()&&(a(t,i,n,r,s),clearInterval(e))},500)},this.isPlayerReady=function(){return!(!r||!t)}}function UGSoundCloudAPI(){this.isAPILoaded=!1;var e,t,i,n=this,r=jQuery(this);function o(){return"undefined"!=typeof SC}function a(e,o,a,s,l){t=null,g_isPlayerReady=!1;var u=e+"_iframe",d=location.protocol+"//w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/"+o;d+="&amp;buying=false&amp;liking=false&amp;download=false&amp;sharing=false&amp;show_artwork=true&show_comments=false&amp;show_playcount=true&amp;show_user=false&amp;hide_related=true&amp;visual=true&amp;start_track=0&amp;callback=true";var _="<iframe id='"+u+"' src="+(d+=!0===l?"&amp;auto_play=true":"&amp;auto_play=false")+" width='"+a+"' height='"+s+"' frameborder='0' scrolling='no' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";jQuery("#"+e).html(_),(t=SC.Widget(u)).bind(SC.Widget.Events.READY,function(){t&&(g_isPlayerReady=!0,t.bind(SC.Widget.Events.PLAY,function(){r.trigger(n.events.START_PLAYING)}),t.bind(SC.Widget.Events.PAUSE,function(){r.trigger(n.events.STOP_PLAYING)}),t.bind(SC.Widget.Events.FINISH,function(){r.trigger(n.events.STOP_PLAYING),r.trigger(n.events.VIDEO_ENDED)}))}),i=e}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(e){return 1==g_ugSoundCloudAPI.isAPILoaded||(o()?(g_ugSoundCloudAPI.isAPILoaded=!0,!0):(!0!==e&&g_ugFunctions.loadJs("w.soundcloud.com/player/api.js",!0),void(g_ugSoundCloudAPI.isAPILoaded=!0)))},this.putSound=function(t,i,n,r,s){if(o())return a(t,i,n,r,s),!0;this.loadAPI(),e=setInterval(function(){o()&&(a(t,i,n,r,s),clearInterval(e))},500)},this.doCommand=function(e){if(null==t)return!1;if(0==g_isPlayerReady)return!1;switch(e){case"play":t.play();break;case"pause":t.pause()}},this.pause=function(){n.doCommand("pause")},this.play=function(){n.doCommand("play")},this.destroy=function(){g_isPlayerReady=!1,t=null,i&&(jQuery("#"+i).html(""),i=null)}}function UGHtml5MediaAPI(){this.isAPILoaded=!1;var e,t,i=this,n=jQuery(this);function r(){return"undefined"!=typeof mejs}function o(e,r,o,a,s){t=null,g_isPlayerReady=!1;var l=location.protocol+"//cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/flashmediaelement-cdn.swf",u=location.protocol+"//cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/silverlightmediaelement.xap",d=e+"_video",_="";s&&!0===s&&(_="autoplay='autoplay'");var g="";r.posterImage&&(g="poster='"+r.posterImage+"'");var c="<video id='"+d+"' width='"+o+"' height='"+a+"' controls='controls' preload='none' "+_+" "+g+">";""!=r.mp4&&(c+="<source type='video/mp4' src='"+r.mp4+"' />"),""!=r.webm&&(c+="<source type='video/webm' src='"+r.webm+"' />"),""!=r.ogv&&(c+="<source type='video/ogg' src='"+r.ogv+"' />"),c+="<object width='"+o+"' height='"+a+"' type='application/x-shockwave-flash' data='"+l+"'>",c+="<param name='movie' value='"+l+"' />",c+="<param name='flashvars' value='controls=true&file="+r.mp4+"' />",c+="</object>",c+="</video>",jQuery("#"+e).html(c),new MediaElement(d,{enablePluginDebug:!1,flashName:l,silverlightName:u,success:function(e,r){g_isPlayerReady=!0,t=e,0==s&&t.pause(),g_ugFunctions.addEvent(t,"play",function(){n.trigger(i.events.START_PLAYING)}),g_ugFunctions.addEvent(t,"pause",function(){n.trigger(i.events.STOP_PLAYING)}),g_ugFunctions.addEvent(t,"ended",function(){n.trigger(i.events.STOP_PLAYING),n.trigger(i.events.VIDEO_ENDED)})},error:function(e){trace(e)}})}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(e){return 1==g_ugHtml5MediaAPI.isAPILoaded||(r()?(g_ugHtml5MediaAPI.isAPILoaded=!0,!0):(!0!==e&&(g_ugFunctions.loadJs("cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/mediaelement.min.js",!0),g_ugFunctions.loadCss("cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/mediaelementplayer.min.css",!0)),void(g_ugHtml5MediaAPI.isAPILoaded=!0)))},this.putVideo=function(t,i,n,a,s){if(r())return o(t,i,n,a,s),!0;this.loadAPI(),e=setInterval(function(){r()&&(o(t,i,n,a,s),clearInterval(e))},500)},this.doCommand=function(e){if(null==t)return!1;if(0==g_isPlayerReady)return!1;switch(e){case"play":t.play();break;case"pause":t.pause()}},this.pause=function(){i.doCommand("pause")},this.play=function(){i.doCommand("play")}}function UGVimeoAPI(){this.isAPILoaded=!1;var e,t,i=this,n=jQuery(this),r=null,o=!1,a=!1;function s(){return"undefined"!=typeof Froogaloop}function l(e,s,l,u,d){r=null,o=!1;var _=location.protocol+"//player.vimeo.com/video/"+s+"?api=1";!0===d&&(_+="&amp;byline=0&amp;autoplay=1&amp;title=0&amp;portrait=0");var g="<iframe src="+_+" width='"+l+"' height='"+u+"' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";jQuery("#"+e).html(g);var c=jQuery("#"+e+" iframe")[0];(r=Froogaloop(c)).addEvent("ready",function(){r&&(o=!0,function(){if(!r)return!1;r.addEvent("cuechange",function(){1==a&&i.play()}),r.addEvent("play",function(){n.trigger(i.events.START_PLAYING)}),r.addEvent("pause",function(){n.trigger(i.events.STOP_PLAYING)}),r.addEvent("finish",function(){n.trigger(i.events.STOP_PLAYING),n.trigger(i.events.VIDEO_ENDED)})}())}),t=e}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(e){return 1==g_ugVimeoAPI.isAPILoaded||(s()?(g_ugVimeoAPI.isAPILoaded=!0,!0):(!0!==e&&g_ugFunctions.loadJs("f.vimeocdn.com/js/froogaloop2.min.js",!0),void(g_ugVimeoAPI.isAPILoaded=!0)))},this.doCommand=function(e){return null!=r&&(0!=o&&void r.api(e))},this.pause=function(){i.doCommand("pause")},this.play=function(){i.doCommand("play")},this.destroy=function(){r&&(r.api("unload"),r=null,o=!1),t&&jQuery("#"+t).html("")},this.putVideo=function(t,i,n,r,o){if(s())return l(t,i,n,r,o),!0;this.loadAPI(),e=setInterval(function(){s()&&(l(t,i,n,r,o),clearInterval(e))},500)},this.isPlayerReady=function(){return!(!o||!r)},this.changeVideo=function(e,t){if(0==i.isPlayerReady())return!1;a=t,r.api("loadVideo",e)},this.getVideoImages=function(e,t,i){var n=location.protocol+"//vimeo.com/api/v2/video/"+e+".json";jQuery.get(n,{},function(e){var n={};n.preview=e[0].thumbnail_large,n.thumb=e[0].thumbnail_medium,i(t,n)})}}function UGYoutubeAPI(){this.isAPILoaded=!1;var e,t,i=this,n=null,r=!1,o=jQuery(this),a=-1,s=new UGFunctions,l={video_youtube_showinfo:!0};function u(e,i,o,a,u,d){n&&r&&n.destroy();var c={controls:1,showinfo:l.video_youtube_showinfo,start:0,rel:0};!0===u&&(c.autoplay=1);var h=s.getVal(d,"start");h&&jQuery.isNumeric(h)&&(c.start=h),r=!1,n=new YT.Player(e,{height:a,width:o,videoId:i,playerVars:c,events:{onReady:_,onStateChange:g}}),t=e}function d(){return"undefined"!=typeof YT&&void 0!==YT.Player}function _(){r=!0}function g(){if("function"!=typeof n.getPlayerState)return trace("Youtube API error: can't get player state"),!1;var e=n.getPlayerState();switch(e){case YT.PlayerState.PLAYING:o.trigger(i.events.START_PLAYING);break;case YT.PlayerState.ENDED:o.trigger(i.events.STOP_PLAYING),o.trigger(i.events.VIDEO_ENDED);break;default:a==YT.PlayerState.PLAYING&&o.trigger(i.events.STOP_PLAYING)}a=e}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.setOptions=function(e){l=jQuery.extend(l,e)},this.putVideo=function(t,i,n,r,o,a){if(d())return u(t,i,n,r,o,a),!0;this.loadAPI(),e=setInterval(function(){d()&&(u(t,i,n,r,o,a),clearInterval(e))},500)},this.loadAPI=function(e){return 1==g_ugYoutubeAPI.isAPILoaded||("undefined"!=typeof YT?(g_ugYoutubeAPI.isAPILoaded=!0,!0):(!0!==e&&g_ugFunctions.loadJs("https://www.youtube.com/player_api",!1),void(g_ugYoutubeAPI.isAPILoaded=!0)))},this.doCommand=function(e,t){if(!n)return!0;if(0==r)return!1;switch(e){case"play":if("function"!=typeof n.playVideo)return!1;n.playVideo();break;case"pause":if("function"!=typeof n.pauseVideo)return!1;n.pauseVideo();break;case"seek":if("function"!=typeof n.seekTo)return!1;n.seekTo(t);break;case"stopToBeginning":var i=n.getPlayerState();switch(n.pauseVideo(),i){case YT.PlayerState.PLAYING:case YT.PlayerState.ENDED:case YT.PlayerState.PAUSED:n.seekTo(0)}}},this.play=function(){i.doCommand("play")},this.pause=function(){i.doCommand("pause")},this.destroy=function(){try{n&&(r=!1,n.clearVideo(),n.destroy())}catch(e){jQuery("#"+t).html("")}},this.stopToBeginning=function(){i.doCommand("stopToBeginning")},this.changeVideo=function(e,t){if(0==i.isPlayerReady())return!1;t&&1==t?n.loadVideoById(e,0,"large"):n.cueVideoById(e,0,"large")},this.isPlayerReady=function(){return!(!r||!n)},this.getVideoImages=function(e){var t={};return t.preview="https://i.ytimg.com/vi/"+e+"/sddefault.jpg",t.thumb="https://i.ytimg.com/vi/"+e+"/default.jpg",t}}function UGVideoPlayer(){var e,t,i,n,r,o,a,s,l=this,u=jQuery(this),d=new UGFunctions,_=new UGYoutubeAPI,g=new UGVimeoAPI,c=new UGHtml5MediaAPI,h=new UGSoundCloudAPI,p=new UGWistiaAPI,m=null,f={video_enable_closebutton:!0};this.events={SHOW:"video_show",HIDE:"video_hide",PLAY_START:"video_play_start",PLAY_STOP:"video_play_stop",VIDEO_ENDED:"video_ended"};var b={standAloneMode:!1,youtubeInnerID:"",vimeoPlayerID:"",html5PlayerID:"",wistiaPlayerID:"",soundCloudPlayerID:""};function v(){l.hide()}function y(){u.trigger(l.events.PLAY_START),o&&o.hide()}function I(){u.trigger(l.events.PLAY_STOP),o&&o.show()}function w(){u.trigger(l.events.VIDEO_ENDED)}function E(e){var t=["youtube","vimeo","html5","soundcloud","wistia"];for(var o in t){var l=t[o];if(l!=e)switch(l){case"youtube":_.pause(),_.destroy(),i.hide();break;case"vimeo":g.pause(),g.destroy(),n.hide();break;case"html5":c.pause(),r.hide();break;case"soundcloud":h.pause(),h.destroy(),a.hide();break;case"wistia":p.pause(),s.hide()}}}this.init=function(t,i,n){if(!(e=n))throw new Error("missing gallery ID for video player, it's a must!");f=jQuery.extend(f,t),_.setOptions(f),i&&1==i&&(b.standAloneMode=!0)},this.setHtml=function(l){b.youtubeInnerID=e+"_youtube_inner",b.vimeoPlayerID=e+"_videoplayer_vimeo",b.html5PlayerID=e+"_videoplayer_html5",b.wistiaPlayerID=e+"_videoplayer_wistia",b.soundCloudPlayerID=e+"_videoplayer_soundcloud";var u="<div class='ug-videoplayer' style='display:none'>";u+="<div class='ug-videoplayer-wrapper ug-videoplayer-youtube' style='display:none'><div id='"+b.youtubeInnerID+"'></div></div>",u+="<div id='"+b.vimeoPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-vimeo' style='display:none'></div>",u+="<div id='"+b.html5PlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-html5'></div>",u+="<div id='"+b.soundCloudPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-soundcloud'></div>",u+="<div id='"+b.wistiaPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-wistia'></div>",0==b.standAloneMode&&1==f.video_enable_closebutton&&(u+="<div class='ug-videoplayer-button-close'></div>"),u+="</div>",l.append(u),t=l.children(".ug-videoplayer"),i=t.children(".ug-videoplayer-youtube"),n=t.children(".ug-videoplayer-vimeo"),r=t.children(".ug-videoplayer-html5"),a=t.children(".ug-videoplayer-soundcloud"),s=t.children(".ug-videoplayer-wistia"),0==b.standAloneMode&&1==f.video_enable_closebutton&&(o=t.children(".ug-videoplayer-button-close"))},this.destroy=function(){o&&(o.off("click"),o.off("touchend")),jQuery(_).off(_.events.START_PLAYING),jQuery(_).off(_.events.STOP_PLAYING),jQuery(g).off(g.events.START_PLAYING),jQuery(g).off(g.events.STOP_PLAYING),jQuery(c).off(c.events.START_PLAYING),jQuery(c).off(c.events.STOP_PLAYING),jQuery(h).off(h.events.START_PLAYING,y),jQuery(h).off(h.events.STOP_PLAYING,I),jQuery(p).off(p.events.START_PLAYING,y),jQuery(p).off(p.events.STOP_PLAYING,I),m=null},this.initEvents=function(){o&&(d.setButtonMobileReady(o),d.setButtonOnClick(o,v)),jQuery(_).on(_.events.START_PLAYING,y),jQuery(_).on(_.events.STOP_PLAYING,I),jQuery(_).on(_.events.VIDEO_ENDED,w),jQuery(g).on(g.events.START_PLAYING,y),jQuery(g).on(g.events.STOP_PLAYING,I),jQuery(g).on(g.events.VIDEO_ENDED,w),jQuery(c).on(c.events.START_PLAYING,y),jQuery(c).on(c.events.STOP_PLAYING,I),jQuery(c).on(c.events.VIDEO_ENDED,w),jQuery(h).on(h.events.START_PLAYING,y),jQuery(h).on(h.events.STOP_PLAYING,I),jQuery(h).on(h.events.VIDEO_ENDED,w),jQuery(p).on(p.events.START_PLAYING,y),jQuery(p).on(p.events.STOP_PLAYING,I),jQuery(p).on(p.events.VIDEO_ENDED,w)},this.setSize=function(e,i){d.setElementSize(t,e,i),o&&d.placeElement(o,"right","top")},this.setPosition=function(e,i){d.placeElement(t,e,i)},this.getObject=function(){return t},this.show=function(){if(1==l.isVisible())return!0;t.show(),t.fadeTo(0,1),o&&o.show(),u.trigger(l.events.SHOW)},this.hide=function(){if(0==l.isVisible())return!0;E(),m=null,t.hide(),u.trigger(l.events.HIDE)},this.getActiveAPI=function(){switch(m){case"youtube":return _;case"vimeo":return g;case"wistia":return p;case"soundcloud":return h;case"html5":return c;default:return null}},this.pause=function(){var e=l.getActiveAPI();if(null==e)return!1;"function"==typeof e.pause&&e.pause()},this.isVisible=function(){return t.is(":visible")},this.playYoutube=function(e,t,n){if(void 0===t)t=!0;if(!n)n=null;E("youtube"),i.show(),0==i.children("#"+b.youtubeInnerID).length&&i.append("<div id='"+b.youtubeInnerID+"'></div>");var r={};n&&(r.start=n),1==_.isPlayerReady()&&1==b.standAloneMode?_.changeVideo(e,t):_.putVideo(b.youtubeInnerID,e,"100%","100%",t,r),m="youtube"},this.playVimeo=function(e,t){if(void 0===t)t=!0;E("vimeo"),n.show(),g.putVideo(b.vimeoPlayerID,e,"100%","100%",t),m="vimeo"},this.playHtml5Video=function(e,t,i,n,o){if(void 0===o)o=!0;E("html5"),r.show();var a={ogv:e,webm:t,mp4:i,posterImage:n};c.putVideo(b.html5PlayerID,a,"100%","100%",o),m="html5"},this.playSoundCloud=function(e,t){if(void 0===t)t=!0;E("soundcloud"),a.show(),h.putSound(b.soundCloudPlayerID,e,"100%","100%",t),m="soundcloud"},this.playWistia=function(e,t){if(void 0===t)t=!0;E("wistia"),s.show(),p.putVideo(b.wistiaPlayerID,e,"100%","100%",t),m="wistia"}}var g_ugYoutubeAPI=new UGYoutubeAPI,g_ugVimeoAPI=new UGVimeoAPI,g_ugHtml5MediaAPI=new UGHtml5MediaAPI,g_ugSoundCloudAPI=new UGSoundCloudAPI,g_ugWistiaAPI=new UGWistiaAPI;function ugCheckForMinJQueryVersion(){if(0==g_ugFunctions.checkMinJqueryVersion("1.8.0"))throw new Error("The gallery can run from jquery 1.8 You have jQuery "+jQuery.fn.jquery+" Please update your jQuery library.")}function ugCheckForErrors(e,t){try{"jquery"==t?(!function(){if("undefined"==typeof jQuery)throw new Error("jQuery library not included")}(),ugCheckForMinJQueryVersion()):(ugCheckForMinJQueryVersion(),function(){if("function"==typeof jQuery.fn.unitegallery)return!0;var e="You have some jquery.js library include that comes after the gallery files js include.";throw e+="<br> This include eliminates the gallery libraries, and make it not work.","cms"==t?(e+="<br><br> To fix it you can:<br>&nbsp;&nbsp;&nbsp; 1. In the Gallery Settings -> Troubleshooting set option: <strong><b>Put JS Includes To Body</b></strong> option to true.",e+="<br>&nbsp;&nbsp;&nbsp; 2. Find the double jquery.js include and remove it."):e+="<br><br> Please find and remove this jquery.js include and the gallery will work. <br> * There should be only one jquery.js include before all other js includes in the page.",new Error(e)}())}catch(r){var i=r.message;if(i="<div style='font-size:16px;color:#BC0C06;max-width:900px;border:1px solid red;padding:10px;'>"+(i="Unite Gallery Error: "+i)+"</div>","jquery"==t){var n=document.getElementById(e);n.innerHTML=i,n.style.display="block"}else jQuery(e).show().html(i);return!1}return!0}function UniteGalleryMain(){var t=this,g_galleryID,g_objGallery=jQuery(t),g_objWrapper,g_objParent,g_objThumbs,g_objSlider,g_objLightbox,g_functions=new UGFunctions,g_objTabs,g_objLoadMore,g_arrItems=[],g_numItems,g_selectedItem=null,g_selectedItemIndex=-1,g_objTheme,g_objCache={};this.events={ITEM_CHANGE:"item_change",SIZE_CHANGE:"size_change",ENTER_FULLSCREEN:"enter_fullscreen",EXIT_FULLSCREEN:"exit_fullscreen",START_PLAY:"start_play",STOP_PLAY:"stop_play",PAUSE_PLAYING:"pause_playing",CONTINUE_PLAYING:"continue_playing",SLIDER_ACTION_START:"slider_action_start",SLIDER_ACTION_END:"slider_action_end",ITEM_IMAGE_UPDATED:"item_image_updated",GALLERY_KEYPRESS:"gallery_keypress",GALLERY_BEFORE_REQUEST_ITEMS:"gallery_before_request_items",OPEN_LIGHTBOX:"open_lightbox",CLOSE_LIGHTBOX:"close_lightbox"};var g_options={gallery_width:900,gallery_height:500,gallery_min_width:150,gallery_min_height:100,gallery_theme:"default",gallery_skin:"default",gallery_images_preload_type:"minimal",gallery_autoplay:!1,gallery_play_interval:3e3,gallery_pause_on_mouseover:!0,gallery_mousewheel_role:"zoom",gallery_control_keyboard:!0,gallery_carousel:!0,gallery_preserve_ratio:!0,gallery_background_color:"",gallery_debug_errors:!1,gallery_shuffle:!1,gallery_urlajax:null,gallery_enable_tabs:!1,gallery_enable_loadmore:!1,gallery_enable_cache:!0,gallery_initial_catid:"",load_api_externally:!1},g_temp={objCustomOptions:{},isAllItemsPreloaded:!1,isFreestyleMode:!1,lastWidth:0,lastHeigh:0,handleResize:null,isInited:!1,isPlayMode:!1,isPlayModePaused:!1,playTimePassed:0,playTimeLastStep:0,playHandle:"",playStepInterval:33,objProgress:null,isFakeFullscreen:!1,thumbsType:null,isYoutubePresent:!1,isVimeoPresent:!1,isHtml5VideoPresent:!1,isSoundCloudPresent:!1,isWistiaPresent:!1,resizeDelay:100,isRunFirstTime:!0,originalOptions:{},funcCustomHeight:null};function __________INIT_GALLERY_______(){}function getThemeFunction(e){var t=e;return-1==t.indexOf("UGTheme_")&&(t="UGTheme_"+t),t}function initTheme(objCustomOptions){if(objCustomOptions.hasOwnProperty("gallery_theme"))g_options.gallery_theme=objCustomOptions.gallery_theme;else{var defaultTheme=g_options.gallery_theme;0==g_ugFunctions.isThemeRegistered(defaultTheme)&&(g_options.gallery_theme=g_ugFunctions.getFirstRegisteredTheme())}var themeFunction=getThemeFunction(g_options.gallery_theme);try{g_options.gallery_theme=eval(themeFunction)}catch(e){}g_options.gallery_theme=eval(themeFunction),g_objTheme=new g_options.gallery_theme,g_objTheme.init(t,objCustomOptions)}function resetOptions(){g_options=jQuery.extend({},g_temp.originalOptions),g_selectedItemIndex=-1,g_selectedItem=null,g_objSlider=void 0,g_objThumbs=void 0,g_objLightbox=void 0}function checkForStartupErrors(){try{ugCheckForMinJQueryVersion()}catch(e){throwErrorShowMessage(e.message)}"object"==typeof g_objWrapper.outerWidth()&&throwErrorShowMessage("You have some buggy script. most chances jquery-ui.js that destroy jquery outerWidth, outerHeight functions. The gallery can't run. Please update jquery-ui.js to latest version."),setTimeout(function(){ugCheckForErrors(g_galleryID,"cms")},5e3)}function runGallery(e,i,n,r){var o="object"==typeof i;if(o&&(g_temp.objCustomOptions=i),1==g_temp.isRunFirstTime){if(g_galleryID=e,0==(g_objWrapper=jQuery(g_galleryID)).length)return trace("div with id: "+g_galleryID+" not found"),!1;g_objParent=g_objWrapper.parent(),checkForStartupErrors(),g_temp.originalOptions=jQuery.extend({},g_options),o&&(g_options=jQuery.extend(g_options,i)),1==g_options.gallery_enable_cache&&g_options.gallery_initial_catid&&cacheItems(g_options.gallery_initial_catid),t.setSizeClass(),fillItemsArray(g_objWrapper.children()),loadAPIs(),g_objWrapper.find("img").fadeTo(0,0).hide(),g_objWrapper.show(),clearInitData()}else if(t.destroy(),resetOptions(),g_options=jQuery.extend(g_options,g_temp.objCustomOptions),n){if(r&&1==g_options.gallery_enable_cache&&cacheItems(r,n),"noitems"==n)return showErrorMessage("No items in this category",""),!1;g_objWrapper.html(n),fillItemsArray(g_objWrapper.children()),loadAPIs(),g_objWrapper.children().fadeTo(0,0).hide(),g_objWrapper.show(),clearInitData()}1==g_temp.isRunFirstTime&&1==g_options.gallery_enable_tabs&&(g_objTabs=new UGTabs).init(t,g_options),1==g_temp.isRunFirstTime&&1==g_options.gallery_enable_loadmore&&(g_objLoadMore=new UGLoadMore).init(t,g_options),o&&modifyInitParams(g_temp.objCustomOptions),validateParams(),1==g_options.gallery_shuffle&&t.shuffleItems(),initTheme(g_temp.objCustomOptions),setGalleryHtml(),setHtmlObjectsProperties(),0==g_objWrapper.width()?g_functions.waitForWidth(g_objWrapper,runGalleryActually):runGalleryActually()}function runGalleryActually(){t.setSizeClass(),0==g_temp.isFreestyleMode&&1==g_options.gallery_preserve_ratio&&setHeightByOriginalRatio(),g_objTheme.run(),g_objTabs&&g_temp.isRunFirstTime&&g_objTabs.run(),preloadBigImages(),initEvents(),g_numItems>0&&t.selectItem(0),1==g_options.gallery_autoplay&&t.startPlayMode(),g_temp.isRunFirstTime=!1}function showErrorMessage(e,t){if(void 0===t)t="<b>Unite Gallery Error: </b>";else t="<b>"+t+": </b>";var i="<div class='ug-error-message-wrapper'><div class='ug-error-message'>"+(e=t+e)+"</div></div>";g_objWrapper.children().remove(),g_objWrapper.html(i),g_objWrapper.show()}function throwErrorShowMessage(e){throw showErrorMessage(e),new Error(e)}function modifyInitParams(){g_options.gallery_images_preload_type||(g_options.gallery_images_preload_type="minimal"),(null==g_options.gallery_min_height||g_options.gallery_height<g_options.gallery_min_height)&&(g_options.gallery_min_height=0),(null==g_options.gallery_min_width||g_options.gallery_width<g_options.gallery_min_width)&&(g_options.gallery_min_width=0)}function validateParams(){if(!g_options.gallery_theme)throw new Error("The gallery can't run without theme");if(jQuery.isNumeric(g_options.gallery_height)&&g_options.gallery_height<g_options.gallery_min_height)throw new Error("The <b>gallery_height</b> option must be bigger then <b>gallery_min_height option</b>");if(g_options.gallery_width<g_options.gallery_min_width)throw new Error("The <b>gallery_width</b> option must be bigger then <b>gallery_min_width option</b>")}function setGalleryHtml(){g_objWrapper.addClass("ug-gallery-wrapper"),g_objWrapper.append("<div class='ug-overlay-disabled' style='display:none'></div>"),t.setSizeClass()}function clearInitData(){g_objWrapper.children().remove()}function storeLastSize(){var e=t.getSize();g_temp.lastWidth=e.width,g_temp.lastHeight=e.height}function setHeightByOriginalRatio(){var e=t.getSize();if(e.width/e.height!=e.orig_ratio){var i=e.width/e.orig_ratio;(i=Math.round(i))<g_options.gallery_min_height&&(i=g_options.gallery_min_height),g_objWrapper.height(i)}}function setHtmlObjectsProperties(){var e={"max-width":g_functions.getCssSizeParam(g_options.gallery_width),"min-width":g_functions.getCssSizeParam(g_options.gallery_min_width)};if(0==g_temp.isFreestyleMode){var t=g_functions.getCssSizeParam(g_options.gallery_height);e.height=t}else e.overflow="visible";g_options.gallery_background_color&&(e["background-color"]=g_options.gallery_background_color),g_objWrapper.css(e)}function fillItemByChild(e){var i=t.isMobileMode();if("noscript"==(a=e.prop("tagName").toLowerCase()))return null;if("picture"==a){var n=e.find("img");if(0==n.length)return null;e=n,a="img"}var r=e.data("lazy-src");r&&e.attr("src",r);var o="";if("a"==a){o=e.attr("href");var a=(e=e.children("img:first-child")).prop("tagName").toLowerCase()}var s=e.data("type");null==s&&(s="image");var l={};if(l.type=s,"img"==a){if(!(u=e.data("lazyload-src")))var u=e.data("lazy-src");u&&""!=u&&(e.attr("src",u),jQuery.removeData(e,"lazyload-src"));var d=e.data("image"),_=e.data("thumb"),g=e.data("title");void 0===d&&(d=null),void 0===_&&(_=null);var c=e.attr("src");d||(d=c),_||(_=c),_||(_=d),d||(d=_),l.urlThumb=_,l.urlImage=d,l.title=e.attr("alt"),g&&(l.title=g),l.objThumbImage=e,l.objThumbImage.attr("src",l.urlThumb)}else{if("image"==s)throw trace("Problematic gallery item found:"),trace(e),trace("Please look for some third party js script that could add this item to the gallery"),new Error("The item should not be image type");l.urlThumb=e.data("thumb"),l.title=e.data("title"),l.objThumbImage=null,l.urlImage=e.data("image")}if(1==i){var h=e.data("thumb-mobile");void 0!==h&&""!=h&&(l.urlThumb=h,"img"==a&&e.attr("src",l.urlThumb));var p=e.data("image-mobile");void 0!==p&&""!=p&&(l.urlImage=p)}l.link=o,l.description=e.attr("title"),l.description||(l.description=e.data("description")),l.description||(l.description=""),l.isNewAdded=!1,l.isLoaded=!1,l.isThumbImageLoaded=!1,l.objPreloadImage=null,l.isBigImageLoadStarted=!1,l.isBigImageLoaded=!1,l.isBigImageLoadError=!1,l.imageWidth=0,l.imageHeight=0,l.thumbWidth=0,l.thumbHeight=0,l.thumbRatioByWidth=0,l.thumbRatioByHeight=0;var m=e.data("width"),f=e.data("height");m&&"number"==typeof m&&f&&"number"==typeof f&&(l.thumbWidth=m,l.thumbHeight=f,l.thumbRatioByWidth=m/f,l.thumbRatioByHeight=f/m),l.addHtml=null;var b=null==l.urlImage||""==l.urlImage,v=null==l.urlThumb||""==l.urlThumb;switch(l.type){case"youtube":if(l.videoid=e.data("videoid"),l.video_start=e.data("start"),b||v){var y=g_ugYoutubeAPI.getVideoImages(l.videoid);b&&(l.urlImage=y.preview),v&&(l.urlThumb=y.thumb,"img"==a&&e.attr("src",l.urlThumb))}g_temp.isYoutubePresent=!0;break;case"vimeo":l.videoid=e.data("videoid"),g_temp.isVimeoPresent=!0;break;case"html5video":l.videoogv=e.data("videoogv"),l.videowebm=e.data("videowebm"),l.videomp4=e.data("videomp4"),g_temp.isHtml5VideoPresent=!0;break;case"soundcloud":l.trackid=e.data("trackid"),g_temp.isSoundCloudPresent=!0;break;case"wistia":l.videoid=e.data("videoid"),g_temp.isWistiaPresent=!0;break;case"custom":var I=e.children("img");I.length&&(I=jQuery(I[0]),l.urlThumb=I.attr("src"),l.title=I.attr("alt"),l.objThumbImage=I);var w=e.children().not("img:first-child");w.length&&(l.addHtml=w.clone())}return l.objThumbImage&&(l.objThumbImage.removeAttr("data-description",""),l.objThumbImage.removeAttr("data-image",""),l.objThumbImage.removeAttr("data-thumb",""),l.objThumbImage.removeAttr("title","")),l}function fillItemsArray(e,t){if(!0!==t)g_arrItems=[];else for(var i=0;i<g_numItems;i++)g_arrItems[i].isNewAdded=!1;for(i=0;i<e.length;i++){var n=jQuery(e[i]),r=fillItemByChild(n);null!==r?(numIndex=g_arrItems.length,r.index=numIndex,!0===t&&(r.isNewAdded=!0),g_arrItems.push(r)):n.remove()}g_numItems=g_arrItems.length}function loadAPIs(){var e=g_options.load_api_externally;g_temp.isYoutubePresent&&g_ugYoutubeAPI.loadAPI(e),g_temp.isVimeoPresent&&g_ugVimeoAPI.loadAPI(e),g_temp.isHtml5VideoPresent&&g_ugHtml5MediaAPI.loadAPI(e),g_temp.isSoundCloudPresent&&g_ugSoundCloudAPI.loadAPI(e),g_temp.isWistiaPresent&&g_ugWistiaAPI.loadAPI(e)}function preloadBigImages(){if("visible"!=g_options.gallery_images_preload_type||g_objThumbs||(g_options.gallery_images_preload_type="minimal"),1==g_temp.isAllItemsPreloaded)return!0;switch(g_options.gallery_images_preload_type){default:case"minimal":break;case"all":jQuery(g_arrItems).each(function(){preloadItemImage(this)});break;case"visible":jQuery(g_arrItems).each(function(){1==g_objThumbs.isItemThumbVisible(this)&&preloadItemImage(this)})}}function checkPreloadItemImage(e){if(1==e.isBigImageLoadStarted||1==e.isBigImageLoaded||1==e.isBigImageLoadError)return!1;switch(g_options.gallery_images_preload_type){default:case"minimal":break;case"all":preloadItemImage(e);break;case"visible":1==g_objThumbs.isItemThumbVisible(e)&&preloadItemImage(e)}}function preloadItemImage(e){if(1==e.isBigImageLoadStarted||1==e.isBigImageLoaded||1==e.isBigImageLoadError)return!0;var i=e.urlImage;if(""==i||null==i)return e.isBigImageLoadError=!0,!1;e.isBigImageLoadStarted=!0,e.objPreloadImage=jQuery("<img/>").attr("src",i),e.objPreloadImage.data("itemIndex",e.index),e.objPreloadImage.on("load",t.onItemBigImageLoaded),e.objPreloadImage.on("error",function(){var e=jQuery(this).data("itemIndex"),i=g_arrItems[e];i.isBigImageLoadError=!0,i.isBigImageLoaded=!1;var n=jQuery(this).attr("src");console.log("Can't load image: "+n),g_objGallery.trigger(t.events.ITEM_IMAGE_UPDATED,[e,i.urlImage]),i.objThumbImage.attr("src",i.urlThumb)}),checkAllItemsStartedPreloading()}function preloadNearBigImages(e){if(1==g_temp.isAllItemsPreloaded)return!1;if(!e)e=g_selectedItem;if(!e)return!0;var t=e.index,i=t-1,n=t+1;i>0&&preloadItemImage(g_arrItems[i]),n<g_numItems&&preloadItemImage(g_arrItems[n])}function checkAllItemsStartedPreloading(){if(1==g_temp.isAllItemsPreloaded)return!1;for(var e in g_arrItems)if(0==g_arrItems[e].isBigImageLoadStarted)return!1;g_temp.isAllItemsPreloaded=!0}function __________END_INIT_GALLERY_______(){}function __________EVENTS_____________(){}function onSliderMouseEnter(e){1==g_options.gallery_pause_on_mouseover&&0==t.isFullScreen()&&1==g_temp.isPlayMode&&g_objSlider&&0==g_objSlider.isSlideActionActive()&&t.pausePlaying()}function onSliderMouseLeave(e){1==g_options.gallery_pause_on_mouseover&&1==g_temp.isPlayMode&&g_objSlider&&0==g_objSlider.isSlideActionActive()&&(0==g_objSlider.isCurrentSlideLoadingImage()&&t.continuePlaying())}function isThisGalleryForKeyAction(){if(!window.ugArrGalleriesObjects)return!0;window.ugArrGalleriesObjects.length;if(1==window.ugArrGalleriesObjects.length)return!0;var e,i=0,n=t.getGalleryID();return jQuery.each(window.ugArrGalleriesObjects,function(t,r){var o=r.getGalleryID(),a=r.getKeyPressScore();a>i&&(i=a),o==n&&(e=a)}),e==i}function onKeyPress(e){var i=jQuery(e.target);if(i.is("textarea")||i.is("select")||i.is("input"))return!0;var n=e.charCode?e.charCode:e.keyCode?e.keyCode:e.which?e.which:0,r=!1;switch(n){case 39:1==isThisGalleryForKeyAction()&&(t.nextItem(),r=!0);break;case 37:1==isThisGalleryForKeyAction()&&(t.prevItem(),r=!0);break;default:r=!1}1==r&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()),g_objGallery.trigger(t.events.GALLERY_KEYPRESS,[n,e])}function onGalleryResized(){var e;if(0==(e=t.getSize()).width)return!0;if(t.setSizeClass(),(e=t.getSize()).width!=g_temp.lastWidth||0==g_temp.isFreestyleMode&&e.height!=g_temp.lastHeight){var i=!1;if(g_temp.funcCustomHeight){var n=g_temp.funcCustomHeight(e);n&&(g_objWrapper.height(n),i=!0)}0==i&&1==g_options.gallery_preserve_ratio&&0==g_temp.isFreestyleMode&&setHeightByOriginalRatio(),storeLastSize(),g_objGallery.trigger(t.events.SIZE_CHANGE)}}function onThumbsChange(e){"visible"==g_options.gallery_images_preload_type&&0==g_temp.isAllItemsPreloaded&&preloadBigImages()}function onFullScreenChange(){var e=g_functions.isFullScreen(),i=e?t.events.ENTER_FULLSCREEN:t.events.EXIT_FULLSCREEN,n=g_functions.getGlobalData("fullscreenID");if(g_galleryID!==n)return!0;e?g_objWrapper.addClass("ug-fullscreen"):g_objWrapper.removeClass("ug-fullscreen"),g_objGallery.trigger(i),onGalleryResized()}function onItemImageUpdated(e,i){checkPreloadItemImage(t.getItem(i))}function onCurrentSlideImageLoadEnd(){1==t.isPlayMode()&&t.continuePlaying()}function initEvents(){if(g_objWrapper.on("dragstart",function(e){e.preventDefault()}),g_objGallery.on(t.events.ITEM_IMAGE_UPDATED,onItemImageUpdated),g_objThumbs)switch(g_temp.thumbsType){case"strip":jQuery(g_objThumbs).on(g_objThumbs.events.STRIP_MOVE,onThumbsChange);break;case"grid":jQuery(g_objThumbs).on(g_objThumbs.events.PANE_CHANGE,onThumbsChange)}if("advance"==g_options.gallery_mousewheel_role&&0==g_temp.isFreestyleMode&&g_objWrapper.on("mousewheel",t.onGalleryMouseWheel),storeLastSize(),jQuery(window).resize(function(){g_objWrapper.css("width","auto"),g_functions.whenContiniousEventOver("gallery_resize",onGalleryResized,g_temp.resizeDelay)}),setTimeout(function(){setInterval(onGalleryResized,2e3)},1e4),g_functions.addFullScreenChangeEvent(onFullScreenChange),g_objSlider){if(jQuery(g_objSlider).on(g_objSlider.events.ITEM_CHANGED,function(){var e=g_objSlider.getCurrentItemIndex();-1!=e&&t.selectItem(e)}),1==g_options.gallery_pause_on_mouseover)g_objSlider.getElement().hover(onSliderMouseEnter,onSliderMouseLeave),g_objGallery.on(t.events.ENTER_FULLSCREEN,function(){onSliderMouseLeave()});retriggerEvent(g_objSlider,g_objSlider.events.ACTION_START,t.events.SLIDER_ACTION_START),retriggerEvent(g_objSlider,g_objSlider.events.ACTION_END,t.events.SLIDER_ACTION_END),jQuery(g_objSlider).on(g_objSlider.events.CURRENTSLIDE_LOAD_END,onCurrentSlideImageLoadEnd)}1==g_options.gallery_control_keyboard&&jQuery(document).keydown(onKeyPress)}function __________GENERAL_______(){}function cacheItems(e,t){if(t)"noitems"!=(i=t)&&(i=jQuery(t).clone());else var i=g_objWrapper.children().clone();g_objCache[e]=i}function removeAllSizeClasses(e){e||(e=g_objWrapper),e.removeClass("ug-under-480"),e.removeClass("ug-under-780"),e.removeClass("ug-under-960")}function retriggerEvent(e,t,i){jQuery(e).on(t,function(e){g_objGallery.trigger(i,[this])})}function advanceNextStep(){var e=jQuery.now(),i=e-g_temp.playTimeLastStep;if(g_temp.playTimeLastStep=e,0==t.isGalleryVisible())return!1;if(g_temp.playTimePassed+=i,g_temp.objProgress){var n=g_temp.playTimePassed/g_options.gallery_play_interval;g_temp.objProgress.setProgress(n)}g_temp.playTimePassed>=g_options.gallery_play_interval&&(t.nextItem(),g_temp.playTimePassed=0)}function unselectSeletedItem(){if(null==g_selectedItem)return!0;g_objThumbs&&g_objThumbs.setThumbUnselected(g_selectedItem.objThumbWrapper),g_selectedItem=null,g_selectedItemIndex=-1}function toFakeFullScreen(){jQuery("body").addClass("ug-body-fullscreen"),g_objWrapper.addClass("ug-fake-fullscreen"),g_temp.isFakeFullscreen=!0,g_objGallery.trigger(t.events.ENTER_FULLSCREEN),g_objGallery.trigger(t.events.SIZE_CHANGE)}function exitFakeFullscreen(){jQuery("body").removeClass("ug-body-fullscreen"),g_objWrapper.removeClass("ug-fake-fullscreen"),g_temp.isFakeFullscreen=!1,g_objGallery.trigger(t.events.EXIT_FULLSCREEN),g_objGallery.trigger(t.events.SIZE_CHANGE)}this.onItemBigImageLoaded=function(e,t){if(!t)t=jQuery(this);var i=t.data("itemIndex"),n=g_arrItems[i];n.isBigImageLoaded=!0;var r=g_functions.getImageOriginalSize(t);n.imageWidth=r.width,n.imageHeight=r.height},this.checkFillImageSize=function(e,t){if(!t){var i=e.data("itemIndex");if(void 0===i)throw new Error("Wrong image given to gallery.checkFillImageSize");t=g_arrItems[i]}var n=g_functions.getImageOriginalSize(e);t.imageWidth=n.width,t.imageHeight=n.height},this.setFreestyleMode=function(){g_temp.isFreestyleMode=!0},this.attachThumbsPanel=function(e,t){g_temp.thumbsType=e,g_objThumbs=t},this.initSlider=function(e,i){if(!e)e={};e=jQuery.extend(g_temp.objCustomOptions,e),(g_objSlider=new UGSlider).init(t,e,i)},this.onGalleryMouseWheel=function(e,i,n,r){e.preventDefault(),i>0?t.prevItem():t.nextItem()},this.getKeyPressScore=function(){if(t.isGalleryInsideScreen())return 1;if(g_objLightbox&&1==g_objLightbox.isOpened())return 2;return 0},this.getGalleryID=function(){return g_galleryID},this.destroy=function(){if(g_objWrapper.off("dragstart"),g_objGallery.off(t.events.ITEM_IMAGE_UPDATED),g_objThumbs)switch(g_temp.thumbsType){case"strip":jQuery(g_objThumbs).off(g_objThumbs.events.STRIP_MOVE);break;case"grid":jQuery(g_objThumbs).off(g_objThumbs.events.PANE_CHANGE)}if(g_objWrapper.off("mousewheel"),jQuery(window).off("resize"),g_functions.destroyFullScreenChangeEvent(),g_objSlider){jQuery(g_objSlider).off(g_objSlider.events.ITEM_CHANGED);var e=g_objSlider.getElement();e.off("mouseenter"),e.off("mouseleave"),g_objGallery.off(t.events.ENTER_FULLSCREEN),jQuery(g_objSlider).off(g_objSlider.events.ACTION_START),jQuery(g_objSlider).off(g_objSlider.events.ACTION_END),jQuery(g_objSlider).off(g_objSlider.events.CURRENTSLIDE_LOAD_END)}1==g_options.gallery_control_keyboard&&jQuery(document).off("keydown"),g_objTheme&&"function"==typeof g_objTheme.destroy&&g_objTheme.destroy(),g_objWrapper.html("")},this.getArrItems=function(){return g_arrItems},this.getObjects=function(){return{g_galleryID:g_galleryID,g_objWrapper:g_objWrapper,g_objThumbs:g_objThumbs,g_objSlider:g_objSlider,g_options:g_options,g_arrItems:g_arrItems,g_numItems:g_numItems}},this.getObjSlider=function(){return g_objSlider},this.getItem=function(e){if(e<0)throw new Error("item with index: "+e+" not found");if(e>=g_numItems)throw new Error("item with index: "+e+" not found");return g_arrItems[e]},this.getWidth=function(){return t.getSize().width},this.getHeight=function(){return t.getSize().height},this.getSize=function(){var e=g_functions.getElementSize(g_objWrapper);return e.orig_width=g_options.gallery_width,e.orig_height=g_options.gallery_height,e.orig_ratio=e.orig_width/e.orig_height,e},this.getGalleryID=function(){return g_galleryID.replace("#","")},this.getNextItem=function(e,t){"object"==typeof e&&(e=e.index);var i=e+1;if(!0!==t&&1==g_numItems)return null;if(i>=g_numItems){if(1!=g_options.gallery_carousel&&!0!==t)return null;i=0}return g_arrItems[i]},this.getPrevItem=function(e){"object"==typeof e&&(e=e.index);var t=e-1;if(t<0){if(1!=g_options.gallery_carousel&&!0!==forceCarousel)return null;t=g_numItems-1}return g_arrItems[t]},this.getSelectedItem=function(){return g_selectedItem},this.getSelectedItemIndex=function(){return g_selectedItemIndex},this.getNumItems=function(){return g_numItems},this.isLastItem=function(){return g_selectedItemIndex==g_numItems-1},this.isFirstItem=function(){return 0==g_selectedItemIndex},this.getOptions=function(){return g_options},this.getElement=function(){return g_objWrapper},this.___________SET_CONTROLS___________=function(){},this.setNextButton=function(e){e.data("ug-button",!0),g_functions.setButtonOnClick(e,t.nextItem)},this.setPrevButton=function(e){e.data("ug-button",!0),g_functions.setButtonOnClick(e,t.prevItem)},this.setFullScreenToggleButton=function(e){e.data("ug-button",!0),g_functions.setButtonOnTap(e,t.toggleFullscreen),g_objGallery.on(t.events.ENTER_FULLSCREEN,function(){e.addClass("ug-fullscreenmode")}),g_objGallery.on(t.events.EXIT_FULLSCREEN,function(){e.removeClass("ug-fullscreenmode")})},this.destroyFullscreenButton=function(e){g_functions.destroyButton(e),g_objGallery.off(t.events.ENTER_FULLSCREEN),g_objGallery.off(t.events.EXIT_FULLSCREEN)},this.setPlayButton=function(e){e.data("ug-button",!0),g_functions.setButtonOnClick(e,t.togglePlayMode),g_objGallery.on(t.events.START_PLAY,function(){e.addClass("ug-stop-mode")}),g_objGallery.on(t.events.STOP_PLAY,function(){e.removeClass("ug-stop-mode")})},this.destroyPlayButton=function(e){g_functions.destroyButton(e),g_objGallery.off(t.events.START_PLAY),g_objGallery.off(t.events.STOP_PLAY)},this.setProgressIndicator=function(e){g_temp.objProgress=e},this.setTextContainers=function(e,i){g_objGallery.on(t.events.ITEM_CHANGE,function(){var n=t.getSelectedItem();e.html(n.title),i.html(n.description)})},this.showDisabledOverlay=function(){g_objWrapper.children(".ug-overlay-disabled").show()},this.hideDisabledOverlay=function(){g_objWrapper.children(".ug-overlay-disabled").hide()},this.___________END_SET_CONTROLS___________=function(){},this.___________PLAY_MODE___________=function(){},this.startPlayMode=function(){if(g_temp.isPlayMode=!0,g_temp.isPlayModePaused=!1,g_temp.playTimePassed=0,g_temp.playTimeLastStep=jQuery.now(),g_temp.playHandle=setInterval(advanceNextStep,g_temp.playStepInterval),g_temp.objProgress){var e=g_temp.objProgress.getElement();g_temp.objProgress.setProgress(0),e.show()}g_objGallery.trigger(t.events.START_PLAY),g_objSlider&&1==g_objSlider.isCurrentSlideLoadingImage()&&t.pausePlaying()},this.resetPlaying=function(){if(0==g_temp.isPlayMode)return!0;g_temp.playTimePassed=0,g_temp.playTimeLastStep=jQuery.now()},this.pausePlaying=function(){if(1==g_temp.isPlayModePaused)return!0;g_temp.isPlayModePaused=!0,clearInterval(g_temp.playHandle),g_objGallery.trigger(t.events.PAUSE_PLAYING)},this.continuePlaying=function(){if(0==g_temp.isPlayModePaused)return!0;g_temp.isPlayModePaused=!1,g_temp.playTimeLastStep=jQuery.now(),g_temp.playHandle=setInterval(advanceNextStep,g_temp.playStepInterval)},this.stopPlayMode=function(){(g_temp.isPlayMode=!1,clearInterval(g_temp.playHandle),g_temp.playTimePassed=0,g_temp.objProgress)&&g_temp.objProgress.getElement().hide();g_objGallery.trigger(t.events.STOP_PLAY)},this.isPlayMode=function(){return g_temp.isPlayMode},this.togglePlayMode=function(){0==t.isPlayMode()?t.startPlayMode():t.stopPlayMode()},this.___________GENERAL_EXTERNAL___________=function(){},this.getCurrentNumItem=function(){return g_selectedItemIndex},this.shuffleItems=function(){for(var e in g_arrItems=g_functions.arrayShuffle(g_arrItems))g_arrItems[e].index=parseInt(e)},this.setOptions=function(e){g_options=jQuery.extend(g_options,e)},this.selectItem=function(e,i){"number"==typeof e&&(e=t.getItem(e));var n=e.index;if(n==g_selectedItemIndex)return!0;(unselectSeletedItem(),g_selectedItem=e,g_selectedItemIndex=n,g_objGallery.trigger(t.events.ITEM_CHANGE,[e,i]),1==g_temp.isPlayMode)&&(t.resetPlaying(),1==g_objSlider.isCurrentSlideLoadingImage()&&t.pausePlaying())},this.nextItem=function(){var e=g_selectedItemIndex+1;return 0==g_numItems||(0==g_options.gallery_carousel&&e>=g_numItems||(e>=g_numItems&&(e=0),void t.selectItem(e,"next")))},this.prevItem=function(){var e=g_selectedItemIndex-1;return-1==g_selectedItemIndex&&(e=0),0==g_numItems||(0==g_options.gallery_carousel&&e<0||(e<0&&(e=g_numItems-1),void t.selectItem(e,"prev")))},this.isFullScreen=function(){return 1==g_temp.isFakeFullscreen||1==g_functions.isFullScreen()},this.isFakeFullscreen=function(){return g_temp.isFakeFullscreen},this.toFullScreen=function(){g_functions.setGlobalData("fullscreenID",g_galleryID);var e=g_objWrapper.get(0);0==g_functions.toFullscreen(e)&&toFakeFullScreen()},this.exitFullScreen=function(){1==g_temp.isFakeFullscreen?exitFakeFullscreen():g_functions.exitFullscreen()},this.toggleFullscreen=function(){0==t.isFullScreen()?t.toFullScreen():t.exitFullScreen()},this.resize=function(e,t,i){g_objWrapper.css("width","auto"),g_objWrapper.css("max-width",e+"px"),t&&g_objWrapper.height(t),i||!0===i||onGalleryResized()},this.setSizeClass=function(e,i){if(!e)e=g_objWrapper;if(!i)i=t.getSize().width;if(0==i)i=jQuery(window).width();var n="";if(i<=480?n="ug-under-480":i<=780?n="ug-under-780":i<960&&(n="ug-under-960"),1==e.hasClass(n))return!0;removeAllSizeClasses(e),""!=n&&e.addClass(n)},this.isMobileMode=function(){return!!g_objWrapper.hasClass("ug-under-480")},this.isSmallWindow=function(){var e=jQuery(window).width();return!e||e<=480},this.isGalleryVisible=function(){return g_objWrapper.is(":visible")},this.isGalleryInsideScreen=function(){return 1!=g_temp.isFreestyleMode&&(!!g_objSlider&&g_functions.isElementInsideScreen(g_objWrapper))},this.changeItems=function(e,t){if(!e)e="noitems";runGallery(g_galleryID,"nochange",e,t)},this.addItems=function(e){if(!e||0==e.length)return!1;var t=g_objWrapper.children(".ug-newitems-wrapper");if(0==t.length&&g_objWrapper.append("<div class='ug-newitems-wrapper' style='display:none'></div>"),(t=g_objWrapper.children(".ug-newitems-wrapper")).append(e),fillItemsArray(jQuery(t.children()),!0),loadAPIs(),!g_objTheme||"function"!=typeof g_objTheme.addItems)throw new Error("addItems function not found in the theme");t.remove(),g_objTheme.addItems()},this.getNewAddedItemsIndexes=function(){var e=[];return jQuery.each(g_arrItems,function(t,i){1==i.isNewAdded&&e.push(t)}),e},this.showErrorMessageReplaceGallery=function(e){showErrorMessage(e)},this.setFuncCustomHeight=function(e){g_temp.funcCustomHeight=e},this.setObjLightbox=function(e){g_objLightbox=e},this.__________EXTERNAL_EVENTS_______=function(){},this.triggerEvent=function(e,t){t?("array"!=jQuery.type(t)&&(t=[t]),g_objGallery.trigger(e,t)):g_objGallery.trigger(e)},this.onEvent=function(e,t){g_objGallery.on(e,t)},this.destroyEvent=function(e){g_objGallery.off(e)},this.__________AJAX_REQUEST_______=function(){},this.ajaxRequest=function(e,t,i,n){if(!i||"function"!=typeof i)throw new Error("ajaxRequest error: success function should be passed");var r=g_options.gallery_urlajax;if(!r||""==r)throw new Error("ajaxRequest error: Ajax url don't passed");if(void 0===t)t={};var o={action:"unitegallery_ajax_action",client_action:e,galleryID:g_galleryID,data:t};jQuery.ajax({type:"post",url:g_options.gallery_urlajax,dataType:"json",data:o,success:function(e){if(!e)throw new Error("Empty ajax response!");if(-1==e||0===e)throw new Error("ajax error!!!");if(void 0===e.success)throw new Error("ajax error!!!");if(0==e.success)return showErrorMessage(e.message,"ajax error"),!1;i(e)},error:function(e,t,i){console.log("Ajax Error!!! "+t),responseText=e.responseText,n&&"function"==typeof n?n(responseText):trace(responseText)}})},this.requestNewItems=function(e,i,n){var r=g_options.gallery_enable_cache;if(n||(n=e),1==i&&(r=!1),1==r&&g_objCache.hasOwnProperty(n)){var o=g_objCache[n];t.changeItems(o,n)}else g_objGallery.trigger(t.events.GALLERY_BEFORE_REQUEST_ITEMS),t.ajaxRequest("front_get_cat_items",{catid:e},function(e){var i=e.html;t.changeItems(i,n)})},this.run=function(e,t){if(t&&t.hasOwnProperty("gallery_debug_errors")&&(g_options.gallery_debug_errors=t.gallery_debug_errors),1==g_options.gallery_debug_errors)try{runGallery(e,t)}catch(e){if("object"==typeof e){var i=e.message,n=e.lineNumber,r=e.fileName;e.stack;i+=" <br><br> in file: "+r,i+=" <b> line "+n+"</b>",trace(e)}else i=e;showErrorMessage(i=i.replace("Error:",""))}else runGallery(e,t)}}function UGLightbox(){var e,t,i,n,r,o,a,s,l=this,u=jQuery(this),d=new UniteGalleryMain,_=new UGSlider,g=new UGFunctions,c=new UGTextPanel,h={lightbox_type:"wide",lightbox_show_textpanel:!0,lightbox_textpanel_width:550,lightbox_hide_arrows_onvideoplay:!0,lightbox_arrows_position:"sides",lightbox_arrows_offset:10,lightbox_arrows_inside_offset:10,lightbox_arrows_inside_alwayson:!1,lightbox_overlay_color:null,lightbox_overlay_opacity:1,lightbox_top_panel_opacity:null,lightbox_show_numbers:!0,lightbox_numbers_size:null,lightbox_numbers_color:null,lightbox_numbers_padding_top:null,lightbox_numbers_padding_right:null,lightbox_compact_closebutton_offsetx:1,lightbox_compact_closebutton_offsety:1,lightbox_close_on_emptyspace:!0};this.events={LIGHTBOX_INIT:"lightbox_init"};var p={topPanelHeight:44,initTextPanelHeight:26,isOpened:!1,isRightNowOpened:!1,putSlider:!0,isCompact:!1,fadeDuration:300,positionFrom:null,textPanelTop:null,textPanelLeft:null,isArrowsInside:!1,isArrowsOnHoverMode:!1,lastMouseX:null,lastMouseY:null,originalOptions:null,isSliderChangedOnce:!1,isTopPanelEnabled:!0},m={lightbox_slider_controls_always_on:!0,lightbox_slider_enable_bullets:!1,lightbox_slider_enable_arrows:!1,lightbox_slider_enable_progress_indicator:!1,lightbox_slider_enable_play_button:!1,lightbox_slider_enable_fullscreen_button:!1,lightbox_slider_enable_zoom_panel:!1,lightbox_slider_enable_text_panel:!1,lightbox_slider_scale_mode_media:"down",lightbox_slider_scale_mode:"down",lightbox_slider_loader_type:3,lightbox_slider_loader_color:"black",lightbox_slider_transition:"fade",lightbox_slider_image_padding_top:p.topPanelHeight,lightbox_slider_image_padding_bottom:0,lightbox_slider_video_padding_top:0,lightbox_slider_video_padding_bottom:0,lightbox_textpanel_align:"middle",lightbox_textpanel_padding_top:5,lightbox_textpanel_padding_bottom:5,slider_video_constantsize:!1,lightbox_slider_image_border:!1,lightbox_textpanel_enable_title:!0,lightbox_textpanel_enable_description:!1,lightbox_textpanel_desc_style_as_title:!0,lightbox_textpanel_enable_bg:!1,video_enable_closebutton:!1,lightbox_slider_video_enable_closebutton:!1,video_youtube_showinfo:!1,lightbox_slider_enable_links:!1},f={lightbox_overlay_opacity:.6,lightbox_slider_image_border:!0,lightbox_slider_image_shadow:!0,lightbox_slider_image_padding_top:30,lightbox_slider_image_padding_bottom:30,slider_video_constantsize:!0,lightbox_textpanel_align:"bottom",lightbox_textpanel_title_text_align:"left",lightbox_textpanel_desc_text_align:"left",lightbox_textpanel_padding_left:10,lightbox_textpanel_padding_right:10};function b(){1==p.isCompact&&1==h.lightbox_show_textpanel&&(h.lightbox_slider_image_padding_bottom=p.initTextPanelHeight),1==p.isCompact&&"inside"==h.lightbox_arrows_position&&(p.isArrowsInside=!0),1==p.isArrowsInside&&0==h.lightbox_arrows_inside_alwayson&&(p.isArrowsOnHoverMode=!0),0==h.lightbox_show_textpanel&&(p.isTopPanelEnabled=!1,p.topPanelHeight=0,h.lightbox_slider_image_padding_top=0)}function v(e){if(!_)return!0;var t={slider_image_padding_top:e};_.setOptions(t),_.refreshSlideItems()}function y(e){if(!s)return!1;if(!c)return!1;var t=s.height();if(0==t)return!1;if(0==s.is(":visible"))return!1;var i=t,n=c.getSize().height;t!=p.topPanelHeight&&(i=p.topPanelHeight),n>i&&(i=n),t!=i&&(s.height(i),_&&0==_.isAnimating()&&v(i))}function I(e){if(0==p.isOpened)return!1;if(!c)return!1;if(!_)return!1;var i=g.getElementSize(t),n=c.getSize();if(0==n.width||n.height>120)return!1;if(!e){var r=_.getSlideImage();e=g.getElementSize(r)}if(0==e.height||0==e.width)return!1;if(e.bottom+n.height<i.height)return!1;var o=_.getOptions(),a=n.height;if(a!=o.slider_image_padding_bottom){var s={slider_image_padding_bottom:a};if(0==_.isAnimating())return _.setOptions(s),_.refreshSlideItems(),!0}return!1}function w(e){g.getElementSize(t);var i=_.getSlideImage(),n=g.getElementSize(i);if(0==n.width)return!1;p.textPanelLeft=n.left,p.textPanelTop=n.bottom;var r=n.width;if(a){var o=g.getElementSize(a);r-=o.width;var s=n.right-o.width;g.placeElement(a,s,p.textPanelTop)}c&&(c.show(),c.refresh(!0,!0,r),function(e,t){if(!e){var i=_.getSlideImage();e=g.getElementSize(i)}p.textPanelTop=e.bottom,!0===t&&c.positionPanel(p.textPanelTop,p.textPanelLeft)}(n)),0==I(n)&&(p.positionFrom="handleCompactTextpanelSizes",c&&(c.positionPanel(p.textPanelTop,p.textPanelLeft),!0===e&&(e(),H())))}function E(){return 0==_.isCurrentSlideType("image")||1==_.isCurrentImageInPlace()}function T(e,t){if(0==p.isArrowsInside)return!1;if(!n)return!1;var i=E();if(n.show(),r.show(),p.positionFrom="positionArrowsInside",1==p.isArrowsOnHoverMode&&1==i&&0==A()&&M(!0),0==i)var o=g.getElementRelativePos(n,"left",h.lightbox_arrows_offset),a=g.getElementRelativePos(n,"middle"),s=g.getElementRelativePos(r,"right",h.lightbox_arrows_offset),l=a;else{var u=_.getSlideImage(),d=g.getElementSize(u);g.getElementSize(_.getElement()),o=g.getElementRelativePos(n,"left",0,u)+d.left+h.lightbox_arrows_inside_offset,a=g.getElementRelativePos(n,"middle",0,u)+d.top,s=g.getElementRelativePos(n,"right",0,u)+d.left-h.lightbox_arrows_inside_offset,l=a}if(!0===t){var c={left:o,top:a},m={left:s,top:l};n.stop().animate(c,{duration:p.fadeDuration}),r.stop().animate(m,{duration:p.fadeDuration})}else n.stop(),r.stop(),g.placeElement(n,o,a),g.placeElement(r,s,l);1==e&&O(t)}function S(e,i){p.positionFrom=null;var n=E(),r=g.getElementRelativePos(o,"right",2,t);if(0==n)var a=2,s=r;else{var l=_.getSlideImage(),u=g.getElementSize(l),d=g.getElementSize(_.getElement()),c=g.getElementSize(o);d.top==d.height&&(d.top=0);s=d.left+u.right-c.width/2+h.lightbox_compact_closebutton_offsetx;(a=d.top+u.top-c.height/2-h.lightbox_compact_closebutton_offsety)<2&&(a=2),s>r&&(s=r)}if(!0===i){var m={left:s,top:a};o.stop().animate(m,{duration:p.fadeDuration})}else o.stop(),g.placeElement(o,s,a);!0===e&&function(e){!0!==e&&o.stop();o.fadeTo(p.fadeDuration,1)}(i)}function P(){o&&o.stop().fadeTo(p.fadeDuration,0),j(),C(),p.positionFrom="hideCompactElements",1==p.isArrowsInside&&M()}function x(){var e=g.getElementSize(t);s&&g.setElementSizeAndPosition(s,0,0,e.width,p.topPanelHeight),n&&0==p.isArrowsInside&&(1==h.lightbox_hide_arrows_onvideoplay&&(n.show(),r.show()),g.placeElement(n,"left","middle",h.lightbox_arrows_offset),g.placeElement(r,"right","middle",h.lightbox_arrows_offset)),0==p.isCompact&&g.placeElement(o,"right","top",2,2),c&&(p.positionFrom="positionElements",0==p.isCompact?function(e){var t={},i=h.lightbox_textpanel_width;i>e.width-47-40?(t.textpanel_padding_left=47,t.textpanel_padding_right=40,t.textpanel_title_text_align="center",t.textpanel_desc_text_align="center"):(t.textpanel_padding_left=Math.floor((e.width-i)/2),t.textpanel_padding_right=t.textpanel_padding_left,t.textpanel_title_text_align="left",t.textpanel_desc_text_align="left",h.lightbox_textpanel_title_text_align&&(t.textpanel_title_text_align=h.lightbox_textpanel_desc_text_align),h.lightbox_textpanel_desc_text_align&&(t.textpanel_desc_text_align=h.lightbox_textpanel_desc_text_align)),c.setOptions(t),c.refresh(!0,!0),y(),c.positionPanel()}(e):(N(),H()));var i=e.width,a=e.height;if(_){if(s){var l={slider_image_padding_top:s.height()};_.setOptions(l)}_.setSize(i,a),_.setPosition(0,0)}}function j(){c&&c.getElement().stop().fadeTo(p.fadeDuration,0)}function C(){a&&a.stop().fadeTo(p.fadeDuration,0)}function A(){if(!p.lastMouseX)return!0;var e={pageX:p.lastMouseX,pageY:p.lastMouseY};return _.isMouseInsideSlideImage(e)}function M(e,t){return!!n&&(1==p.isArrowsOnHoverMode&&!1===t?(A(),!0):void(!0===e?(n.stop().fadeTo(0,0),r.stop().fadeTo(0,0)):(n.stop().fadeTo(p.fadeDuration,0),r.stop().fadeTo(p.fadeDuration,0))))}function O(e,t){return!!n&&(1==p.isArrowsOnHoverMode&&!0!==t&&1==E()||(1==_.isSwiping()||(!0!==e&&(n.stop(),r.stop()),n.fadeTo(p.fadeDuration,1),void r.fadeTo(p.fadeDuration,1))))}function z(e){if(!c)return!1;if(!e)e=_.getCurrentItem();c.setTextPlain(e.title,e.description)}function L(e){if(!a)return!1;if(!e)e=_.getCurrentItem();var t=d.getNumItems(),i=e.index+1;a.html(i+" / "+t)}function N(){if(!c)return!1;c.getElement().show().stop().fadeTo(p.fadeDuration,1)}function H(){a&&a.stop().fadeTo(p.fadeDuration,1)}function k(){if(0==p.isCompact)return!0;P()}function R(){if(0==p.isCompact)return!0;(p.positionFrom="onZoomChange",S(!1,!0),T(!1,!0),1==p.isCompact)&&(0==(_.isCurrentSlideType("image")&&1==_.isCurrentImageInPlace())?(j(),C()):(p.positionFrom="onZoomChange",N(),H()))}function G(){if(0==p.isCompact)return!0;p.positionFrom="onSliderAfterReturn",S(!0),T(!0),0==I()&&w(),N(),H()}function D(e,t){return t=jQuery(t),0==p.isCompact||(0==_.isSlideCurrent(t)||(p.positionFrom="onSliderAfterPutImage",S(!0),T(!0),void w()))}function Q(){var e=_.getOptions().slider_image_padding_top;if(s){var t=s.height();t!=e&&v(t)}if(1==p.isCompact){if(z(),L(),p.positionFrom="onSliderTransitionEnd",S(!0),T(!0),0==_.isSlideActionActive())0==I()&&w();N(),H()}}function W(e,t){0==p.isCompact?(a&&L(t),c&&(z(t),0==p.isRightNowOpened&&(c.positionElements(!1),y(),c.positionPanel()))):0==_.isAnimating()&&(c&&z(t),a&&L(t)),0==p.isSliderChangedOnce&&(p.isSliderChangedOnce=!0,u.trigger(l.events.LIGHTBOX_INIT))}function F(e,t){if("image"!=_.getSlideType()&&0==p.isCompact&&_.isSlideActionActive())return!0;if(1==_.isPreloading())return l.close("slider"),!0;1==h.lightbox_close_on_emptyspace&&(0==_.isMouseInsideSlideImage(t)&&l.close("slider_inside"))}function B(){x()}function Y(){s?function(){if(!s)return!1;s.hide()}():a&&a.hide(),n&&1==h.lightbox_hide_arrows_onvideoplay&&(n.hide(),r.hide())}function U(){s?(!function(){if(!s)return!1;s.show()}(),y()):a&&a.show(),n&&1==h.lightbox_hide_arrows_onvideoplay&&(n.show(),r.show())}function V(e,t,i){var n=!1;switch(t){case 27:1==p.isOpened&&l.close("keypress");break;case 38:case 40:case 33:case 34:n=!0}1==p.isOpened&&1==n&&i.preventDefault()}function X(){1==p.isArrowsOnHoverMode&&O(!1,!0)}function Z(e){p.positionFrom="hideCompactElements",1==p.isArrowsOnHoverMode&&1==E()&&M(!1,!0)}function q(e){p.lastMouseX=e.pageX,p.lastMouseY=e.pageY,1==(!n||0==n.is(":visible")||1!=n.css("opacity"))&&A()&&0==_.isAnimating()&&(p.positionFrom="onMouseMove",n&&0==n.is(":animated")&&O(!1,!0))}function K(e,t,i,n){if(0==p.isOpened)return!0;switch(h.gallery_mousewheel_role){default:case"zoom":"image"!=_.getSlideType()&&e.preventDefault();break;case"none":e.preventDefault();break;case"advance":d.onGalleryMouseWheel(e,t,i,n)}}this.destroy=function(){if(jQuery(document).unbind("mousemove"),i.off("touchstart"),i.off("touchend"),o.off("click"),e.off(d.events.ITEM_CHANGE),_){jQuery(_).off(_.events.TRANSITION_END),jQuery(_).off(_.events.CLICK),jQuery(_).off(_.events.START_DRAG),jQuery(_).off(_.events.TRANSITION_START),jQuery(_).off(_.events.AFTER_DRAG_CHANGE),jQuery(_).off(_.events.AFTER_RETURN);var n=_.getVideoObject();jQuery(n).off(n.events.PLAY_START),jQuery(n).off(n.events.PLAY_STOP),jQuery(_).on(_.events.IMAGE_MOUSEENTER,X),jQuery(_).on(_.events.IMAGE_MOUSELEAVE,Z),_.destroy()}jQuery(window).unbind("resize"),e.off(d.events.GALLERY_KEYPRESS,V),t.off("mousewheel"),t.remove()},this.isOpened=function(){return p.isOpened},this.open=function(s){var l=d.getItem(s);(p.isOpened=!0,p.isRightNowOpened=!0,setTimeout(function(){p.isRightNowOpened=!1},100),_&&_.setItem(l,"lightbox_open"),c&&c.setTextPlain(l.title,l.description),i.stop().fadeTo(0,0),t.show(),t.fadeTo(0,1),i.stop().fadeTo(p.fadeDuration,h.lightbox_overlay_opacity),x(),1==p.isCompact)&&(1==_.isPreloading()?(o&&o.hide(),n&&1==p.isArrowsInside&&(n.hide(),r.hide()),a&&a.hide(),c&&c.hide()):1==p.isArrowsInside&&(n.hide(),r.hide()));_&&_.startSlideAction(),e.trigger(d.events.OPEN_LIGHTBOX,l)},this.close=function(i){p.isOpened=!1,1==p.isCompact&&P(),_&&_.stopSlideAction(),"image"!=_.getSlideType()?t.hide():t.fadeTo(p.fadeDuration,0,function(){t.hide()}),e.trigger(d.events.CLOSE_LIGHTBOX)},this.init=function(t,i){!function(t,i){d=t,e=jQuery(t),d.setObjLightbox(l),h=jQuery.extend(h,m),h=jQuery.extend(h,i),p.originalOptions=jQuery.extend({},h),"compact"==h.lightbox_type&&(p.isCompact=!0,h=jQuery.extend(h,f),h=jQuery.extend(h,i)),b(),1==p.putSlider?(d.initSlider(h,"lightbox"),g_objects=t.getObjects(),_=g_objects.g_objSlider):_=null,1==h.lightbox_show_textpanel?c.init(d,h,"lightbox"):c=null}(t,i)},this.putHtml=function(){var e,l;d.isSmallWindow()&&1==p.isCompact&&(p.isCompact=!1,b(),p.isArrowsInside=!1,p.isArrowsOnHoverMode=!1,(h=jQuery.extend({},p.originalOptions)).lightbox_arrows_position="sides",_.setOptions(h)),e="",l="",1==p.isCompact&&(l=" ug-lightbox-compact"),e+="<div class='ug-gallery-wrapper ug-lightbox"+l+"'>",e+="<div class='ug-lightbox-overlay'></div>",0==p.isCompact&&p.isTopPanelEnabled?(e+="<div class='ug-lightbox-top-panel'>",e+="<div class='ug-lightbox-top-panel-overlay'></div>",h.lightbox_show_numbers&&(e+="<div class='ug-lightbox-numbers'></div>"),e+="</div>"):h.lightbox_show_numbers&&(e+="<div class='ug-lightbox-numbers'></div>"),e+="<div class='ug-lightbox-button-close'></div>",e+="<div class='ug-lightbox-arrow-left'></div>",e+="<div class='ug-lightbox-arrow-right'></div>",e+="</div>",t=jQuery(e),jQuery("body").append(t),_&&_.setHtml(t),i=t.children(".ug-lightbox-overlay"),0==p.isCompact&&1==p.isTopPanelEnabled&&0==(s=t.children(".ug-lightbox-top-panel")).length&&(s=null),o=t.find(".ug-lightbox-button-close"),h.lightbox_show_numbers&&(a=t.find(".ug-lightbox-numbers")),n=t.children(".ug-lightbox-arrow-left"),r=t.children(".ug-lightbox-arrow-right"),c&&(s?c.appendHTML(s):c.appendHTML(t))},this.run=function(){!function(){if(null!==h.lightbox_overlay_color&&i.css("background-color",h.lightbox_overlay_color),null!==h.lightbox_overlay_opacity&&i.fadeTo(0,h.lightbox_overlay_opacity),s&&null!==h.lightbox_top_panel_opacity&&s.children(".ug-lightbox-top-panel-overlay").fadeTo(0,h.lightbox_top_panel_opacity),a){var e={};null!==h.lightbox_numbers_size&&(e["font-size"]=h.lightbox_numbers_size+"px"),h.lightbox_numbers_color&&(e.color=h.lightbox_numbers_color),null!==h.lightbox_numbers_padding_right&&(e["padding-right"]=h.lightbox_numbers_padding_right+"px"),null!==h.lightbox_numbers_padding_top&&(e["padding-top"]=h.lightbox_numbers_padding_top+"px"),a.css(e)}}(),_&&_.run(),function(){if(i.on("touchstart",function(e){e.preventDefault()}),i.on("touchend",function(e){l.close("overlay")}),g.addClassOnHover(r,"ug-arrow-hover"),g.addClassOnHover(n,"ug-arrow-hover"),g.addClassOnHover(o),d.setNextButton(r),d.setPrevButton(n),o.click(function(){l.close("button")}),e.on(d.events.ITEM_CHANGE,W),_){jQuery(_).on(_.events.TRANSITION_END,Q),jQuery(_).on(_.events.CLICK,F);var a=_.getVideoObject();jQuery(a).on(a.events.PLAY_START,Y),jQuery(a).on(a.events.PLAY_STOP,U),jQuery(_).on(_.events.START_DRAG,k),jQuery(_).on(_.events.TRANSITION_START,k),jQuery(_).on(_.events.AFTER_DRAG_CHANGE,G),jQuery(_).on(_.events.AFTER_RETURN,G),jQuery(_).on(_.events.AFTER_PUT_IMAGE,D),jQuery(_).on(_.events.ZOOM_CHANGE,R),jQuery(_).on(_.events.IMAGE_MOUSEENTER,X),jQuery(_).on(_.events.IMAGE_MOUSELEAVE,Z)}jQuery(window).resize(function(){if(0==p.isOpened)return!0;g.whenContiniousEventOver("lightbox_resize",B,100)}),e.on(d.events.GALLERY_KEYPRESS,V),1==p.isArrowsOnHoverMode&&jQuery(document).bind("mousemove",q),t.on("mousewheel",K)}()}}function UGCarousel(){var e,t,i,n,r=this,o=jQuery(this),a=new UniteGalleryMain,s=new UGFunctions,l=new UGTileDesign,u=new UGThumbsGeneral,d={carousel_padding:8,carousel_space_between_tiles:20,carousel_navigation_numtiles:3,carousel_scroll_duration:500,carousel_scroll_easing:"easeOutCubic",carousel_autoplay:!0,carousel_autoplay_timeout:3e3,carousel_autoplay_direction:"right",carousel_autoplay_pause_onhover:!0,carousel_vertical_scroll_ondrag:!1};this.events={START_PLAY:"carousel_start_play",PAUSE_PLAY:"carousel_pause_play",STOP_PLAY:"carousel_stop_play"};var _={eventSizeChange:"thumb_size_change",isFirstTimeRun:!0,carouselMaxWidth:null,tileWidth:0,initTileWidth:0,initTileHeight:0,sideSpace:1500,spaceActionSize:500,numCurrent:0,touchActive:!1,startInnerPos:0,lastTime:0,startTime:0,startMousePos:0,lastMousePos:0,scrollShortDuration:200,scrollShortEasing:"easeOutQuad",handle:null,isPlayMode:!1,isPaused:!1,storedEventID:"carousel"};function g(e,t){if(!t)t=_.initTileHeight/_.initTileWidth*e;_.tileWidth=e;var i={tile_width:e,tile_height:t};l.setOptions(i),d.tile_width=e,d.tile_height=t,l.resizeAllTiles(e),I(!0)}function c(){if(null===_.carouselMaxWidth)throw new Error("The carousel width not set");if(_.tileWidth<_.initTileWidth){(a=_.carouselMaxWidth-2*d.carousel_padding)>_.initTileWidth&&(a=_.initTileWidth),g(a);var o=s.getNumItemsInSpace(_.carouselMaxWidth,a,d.carousel_space_between_tiles)}else{var a;if((o=s.getNumItemsInSpace(_.carouselMaxWidth,_.tileWidth,d.carousel_space_between_tiles))<=0)o=1,g(a=_.carouselMaxWidth-2*d.carousel_padding)}var u=s.getSpaceByNumItems(o,_.tileWidth,d.carousel_space_between_tiles);u+=2*d.carousel_padding,i.width(u),1==_.isFirstTimeRun?(l.initEvents(),i.bind("mousedown touchstart",C),jQuery("body").bind("mousemove touchmove",A),jQuery(window).add("body").bind("mouseup touchend",M),i.hover(O,z),l.run(),jQuery.each(t,function(t,i){i.objThumbWrapper.data("index",t),e.trigger(_.eventSizeChange,[i.objThumbWrapper,!0]),i.objTileOriginal=i.objThumbWrapper.clone(!0,!0)}),I(!0),1==d.carousel_autoplay&&r.startAutoplay()):(1==d.carousel_autoplay&&r.pauseAutoplay(),S(0,!1),1==d.carousel_autoplay&&r.startAutoplay()),s.placeElement(n,0,d.carousel_padding),x(),_.isFirstTimeRun=!1}function h(){return s.getElementSize(n).left}function p(e){return s.getMousePosition(e).pageX}function m(){return n.children(".ug-thumb-wrapper")}function f(e){return s.getNumItemsInSpace(e,_.tileWidth,d.carousel_space_between_tiles)}function b(){return m().length}function v(e){w(e);var t=m();return jQuery(t[e])}function y(){return f(s.getElementSize(i).width)}function I(e){if(!e)e=!1;var t,r=m(),o=0,a=0;return jQuery.each(r,function(e,i){i=jQuery(i),s.placeElement(i,o,0);var n=s.getElementSize(i);o+=n.width+d.carousel_space_between_tiles,a=Math.max(a,n.height),e==r.length-1&&(t=n.right)}),n.width(t),a+=2*d.carousel_padding,!0===e&&(n.height(a),i.height(a)),S(_.numCurrent,!1),t}function w(e){if(e>m().length-1)throw new Error("Wrogn tile number: "+e)}function E(t,i){if("left"==i)var r=n.children(".ug-thumb-wrapper").first();else r=n.children(".ug-thumb-wrapper").last();var o=function(e,t,i){var n=e.data("index");if(null==n)throw new Error("every tile should have index!");for(var r=[],o=0;o<t;o++){if("prev"==i)var s=a.getPrevItem(n,!0);else s=a.getNextItem(n,!0);if(!s)throw new Error("the item to add is empty");var l=s.objTileOriginal.clone(!0,!0);n=s.index,l.addClass("cloned"),r.push(l)}return r}(r,t,"left"==i?"prev":"next");jQuery.each(o,function(t,r){"left"==i?n.prepend(r):n.append(r),e.trigger(_.eventSizeChange,r),l.loadTileImage(r)})}function T(e,t){w(n);for(var i=m(),n=i.length,r=0;r<e;r++)"left"==t?jQuery(i[r]).remove():jQuery(i[n-1-r]).remove()}function S(e,t,i){if(void 0===t){t=!0;if(n.is(":animated"))return!0}var r=v(e),o={left:-s.getElementSize(r).left+d.carousel_padding+"px"};if(!0===t){var a=d.carousel_scroll_duration,l=d.carousel_scroll_easing;!0===i&&(a=_.scrollShortDuration,l=_.scrollShortEasing),n.stop(!0).animate(o,{duration:a,easing:l,queue:!1,complete:function(){_.numCurrent=e,x()}})}else _.numCurrent=e,n.css(o)}function P(){var e,t,i,n;S((e=-h(),t=f(e),i=s.getElementSize(v(t)).left,n=s.getElementSize(v(t+1)).left,Math.abs(i-e)<Math.abs(n-e)?t:t+1),!0,!0)}function x(){var e,t=(e=-h(),_.sideSpace-e),r=function(){var e=s.getElementSize(i),t=s.getElementSize(n),r=t.width-e.width+t.left;return _.sideSpace-r}(),o=0,a=0,l=0,u=0,d=b();if(t>_.spaceActionSize)E(o=f(t),"left"),_.numCurrent+=o;else if(t<-_.spaceActionSize){T(l=f(Math.abs(t)),"left"),_.numCurrent-=l}if(r>_.spaceActionSize?E(a=f(r),"right"):r<-_.spaceActionSize&&T(u=f(Math.abs(r)),"right"),u>d)throw new Error("Can't remove more then num tiles");var g=!1;return(o||a||l||u)&&(I(),g=!0),g}function j(){"left"==d.carousel_autoplay_direction?r.scrollRight(1):r.scrollLeft(1)}function C(e){if(1==_.touchActive)return!0;_.touchActive=!0,r.pauseAutoplay(),_.startTime=jQuery.now(),_.startMousePos=p(e),_.startInnerPos=h(),_.lastTime=_.startTime,_.lastMousePos=_.startMousePos,s.storeEventData(e,_.storedEventID)}function A(e){if(0==_.touchActive)return!0;s.updateStoredEventData(e,_.storedEventID),e.preventDefault();var t=null;if(1==d.carousel_vertical_scroll_ondrag&&(t=s.handleScrollTop(_.storedEventID)),"vert"===t)return!0;_.lastMousePos=p(e);var i,r=_.lastMousePos-_.startMousePos,o=_.startInnerPos+r,a=r>0?"prev":"next";o>0&&"prev"==a&&(o/=3),o<-s.getElementSize(n).width&&"next"==a&&(o=_.startInnerPos+r/3),i={left:o+"px"},n.css(i)}function M(e){if(0==_.touchActive)return!0;_.touchActive=!1,P(),r.unpauseAutoplay()}function O(e){if(0==d.carousel_autoplay_pause_onhover)return!0;1==_.isPlayMode&&0==_.isPaused&&r.pauseAutoplay()}function z(e){if(0==d.carousel_autoplay_pause_onhover)return!0;r.unpauseAutoplay()}function L(){var e=_.lastTime-_.startTime,t=Math.abs(_.lastMousePos-_.startMousePos);return!(e>300)&&!(t>30)}this.startAutoplay=function(){_.isPlayMode=!0,_.isPaused=!1,o.trigger(r.events.START_PLAY),_.handle&&clearInterval(_.handle),_.handle=setInterval(j,d.carousel_autoplay_timeout)},this.unpauseAutoplay=function(){return 0==_.isPlayMode||(0==_.isPaused||void r.startAutoplay())},this.pauseAutoplay=function(){if(0==_.isPlayMode)return!0;_.isPaused=!0,_.handle&&clearInterval(_.handle),o.trigger(r.events.PAUSE_PLAY)},this.stopAutoplay=function(){if(0==_.isPlayMode)return!0;_.isPaused=!1,_.isPlayMode=!1,_.handle&&clearInterval(_.handle),o.trigger(r.events.STOP_PLAY)},this.destroy=function(){_.handle&&clearInterval(_.handle),o.off(r.events.START_PLAY),o.off(r.events.STOP_PLAY),i.unbind("mousedown"),i.unbind("touchstart"),jQuery("body").unbind("mousemove"),jQuery("body").unbind("touchmove"),jQuery(window).add("body").unbind("mouseup").unbind("touchend"),i.off("mouseenter").off("mouseleave"),l.destroy()},this.init=function(i,n,r){r&&this.setMaxWidth(r),function(i,n){g_objects=i.getObjects(),a=i,jQuery(i),e=g_objects.g_objWrapper,t=g_objects.g_arrItems,d=jQuery.extend(d,n),l.setFixedMode(),l.setApproveClickFunction(L),l.init(i,d),u=l.getObjThumbs(),d=l.getOptions(),_.initTileWidth=d.tile_width,_.initTileHeight=d.tile_height,_.tileWidth=d.tile_width}(i,n)},this.setMaxWidth=function(e){_.carouselMaxWidth=e},this.setHtml=function(t){!function(t){t||(t=e);e.append("<div class='ug-carousel-wrapper'><div class='ug-carousel-inner'></div></div>"),i=e.children(".ug-carousel-wrapper"),n=i.children(".ug-carousel-inner"),l.setHtml(n),u.getThumbs().fadeTo(0,1)}(t)},this.getElement=function(){return i},this.getObjTileDesign=function(){return l},this.getEstimatedHeight=function(){return d.tile_height+2*d.carousel_padding},this.run=function(){c()},this.scrollRight=function(e){if(!e||"object"==typeof e)e=d.carousel_navigation_numtiles;var t=y();e>t&&(e=t);var i=_.numCurrent-e;i<=0&&(i=0),S(i)},this.scrollLeft=function(e){if(!e||"object"==typeof e)e=d.carousel_navigation_numtiles;var t=y();e>t&&(e=t);var i=b(),n=_.numCurrent+e;n>=i&&(n=i-1),S(n)},this.setScrollLeftButton=function(e){s.setButtonMobileReady(e),s.setButtonOnClick(e,r.scrollLeft)},this.setScrollRightButton=function(e){s.setButtonMobileReady(e),s.setButtonOnClick(e,r.scrollRight)},this.setPlayPauseButton=function(e){s.setButtonMobileReady(e),1==_.isPlayMode&&0==_.isPaused&&e.addClass("ug-pause-icon"),o.on(r.events.START_PLAY,function(){e.addClass("ug-pause-icon")}),o.on(r.events.STOP_PLAY,function(){e.removeClass("ug-pause-icon")}),s.setButtonOnClick(e,function(){0==_.isPlayMode||1==_.isPaused?r.startAutoplay():r.stopAutoplay()})}}function UGLoadMore(){jQuery(this);var e,t,i,n,r=new UniteGalleryMain,o=(new UGFunctions,{isInited:!1}),a={loadmore_container:"ug_loadmore_wrapper"};function s(){e.show()}function l(){t.hide(),i.show();var o={numitems:r.getNumItems()};r.ajaxRequest("front_loadmore",o,function(n){i.hide();var o=n.html_items;1==n.show_loadmore?(t.blur().show(),i.hide()):e.hide(),r.addItems(o)},function(e){e="Ajax Error!"+e,i.hide(),n.show(),n.html(e)})}this.events={},this.destroy=function(){if(0==o.isInited)return!1},this.init=function(u,d){if(r=u,jQuery(r),a=jQuery.extend(a,d),0!=(e=jQuery("#"+a.loadmore_container)).length&&0!=(t=e.find(".ug-loadmore-button")).length&&0!=(i=e.find(".ug-loadmore-loader")).length&&0!=(n=e.find(".ug-loadmore-error")).length&&(o.isInited=!0),0==o.isInited)return trace("load more not inited, something is wrong"),!1;r.onEvent("tiles_first_placed",s),t.click(l)}}function UGTabs(){jQuery(this);var e,t,i=new UniteGalleryMain,n=(new UGFunctions,{tabs_type:"tabs",tabs_container:"#ug_tabs",tabs_class_selected:"ug-tab-selected"});function r(){"select"==n.tabs_type?t.change(s):e.click(a)}function o(e){i.requestNewItems(e)}function a(){var t=n.tabs_class_selected,i=jQuery(this);if(i.hasClass(t))return!0;e.not(i).removeClass(t),i.addClass(t);var r=i.data("catid");if(!r)return!0;o(r)}function s(){var e=jQuery(this).val();if(!e)return!0;o(e)}this.events={},this.destroy=function(){t&&t.off("change"),e&&e.off("click")},this.init=function(r,o){!function(r,o){i=r,jQuery(i),"select"==(n=jQuery.extend(n,o)).tabs_type?t=jQuery(n.tabs_container):e=jQuery(n.tabs_container+" .ug-tab")}(r,o)},this.run=function(){r()}}function UG_API(e){var t,i=this,n=(jQuery(i),new UniteGalleryMain),r=[];function o(e){var t={index:e.index,title:e.title,description:e.description,urlImage:e.urlImage,urlThumb:e.urlThumb},i=e.objThumbImage.data();for(var n in i){switch(n){case"image":case"description":continue}t[n]=i[n]}return t}n=e,t=jQuery(e),this.events={API_INIT_FUNCTIONS:"api_init",API_ON_EVENT:"api_on_event"},this.on=function(e,a,s){switch(!0!==s&&r.push({event:e,func:a}),e){case"item_change":t.on(n.events.ITEM_CHANGE,function(){var e=o(n.getSelectedItem());a(e.index,e)});break;case"resize":t.on(n.events.SIZE_CHANGE,a);break;case"enter_fullscreen":t.on(n.events.ENTER_FULLSCREEN,a);break;case"exit_fullscreen":t.on(n.events.EXIT_FULLSCREEN,a);break;case"play":t.on(n.events.START_PLAY,a);break;case"stop":t.on(n.events.STOP_PLAY,a);break;case"pause":t.on(n.events.PAUSE_PLAYING,a);break;case"continue":t.on(n.events.CONTINUE_PLAYING,a);break;case"open_lightbox":t.on(n.events.OPEN_LIGHTBOX,a);break;case"close_lightbox":t.on(n.events.CLOSE_LIGHTBOX,a);break;default:console&&console.log("wrong api event: "+e)}t.trigger(i.events.API_ON_EVENT,[e,a])},this.play=function(){n.startPlayMode()},this.stop=function(){n.stopPlayMode()},this.togglePlay=function(){n.togglePlayMode()},this.enterFullscreen=function(){n.toFullScreen()},this.exitFullscreen=function(){n.exitFullScreen()},this.toggleFullscreen=function(){n.toggleFullscreen()},this.resetZoom=function(){var e=n.getObjSlider();if(!e)return!1;e.zoomBack()},this.zoomIn=function(){var e=n.getObjSlider();if(!e)return!1;e.zoomIn()},this.zoomOut=function(){var e=n.getObjSlider();if(!e)return!1;e.zoomOut()},this.nextItem=function(){n.nextItem()},this.prevItem=function(){n.prevItem()},this.selectItem=function(e){n.selectItem(e)},this.resize=function(e,t){t?n.resize(e,t):n.resize(e)},this.getItem=function(e){return o(n.getItem(e))},this.getNumItems=function(){return n.getNumItems()},this.getNumCurrent=function(){return n.getCurrentNumItem()},this.reloadGallery=function(e){if(!e)e={};n.run(null,e),r.map(function(e){i.on(e.event,e.func,!0)})},this.destroy=function(){n.destroy()},t.trigger(i.events.API_INIT_FUNCTIONS,i)}jQuery.fn.unitegallery=function(e){var t="#"+jQuery(this).attr("id");if(!e)e={};var i=new UniteGalleryMain;return i.run(t,e),void 0===window.ugArrGalleriesObjects&&(window.ugArrGalleriesObjects=[]),window.ugArrGalleriesObjects.push(i),new UG_API(i)};
1
+ //Unite Gallery, Version: 1.7.57, released 21 March 2022
2
 
3
+ function debugLine(e,t,i){!0===e&&(e="true"),!1===e&&(e="false");var n=e;if("object"==typeof e)for(name in n="",e){var r=e[name];n+=" "+name+": "+r}if(1!=t||i||(n+=" "+Math.random()),1==i){var o=jQuery("#debug_line");o.width(200),o.height()>=500&&o.html(""),n=o.html()+"<br> -------------- <br>"+n}jQuery("#debug_line").show().html(n)}function debugSide(e){var t="";for(name in e){var i=e[name];t+=name+" : "+i+"<br>"}jQuery("#debug_side").show().html(t)}function trace(e){"undefined"!=typeof console&&console.log(e)}function UGFunctions(){var e=null,t=this,i={starTime:0,arrThemes:[],isTouchDevice:-1,isRgbaSupported:-1,timeCache:{},dataCache:{},lastEventType:"",lastEventTime:0,lastTouchStartElement:null,touchThreshold:700,handle:null};function n(e,t,i){t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent?t.attachEvent("on"+e,i):t[e]=i}this.debugVar="",this.getvalopt={FORCE_BOOLEAN:"force_boolean",FORCE_NUMERIC:"force_numeric",TRIM:"trim"},this.z__________GENERAL___________=function(){},this.getVal=function(e,i,n,r){if(!n)n="";var o="";switch(o=e&&"object"==typeof e?0==e.hasOwnProperty(i)?n:e[i]:n,r){case t.getvalopt.FORCE_BOOLEAN:o=t.strToBool(o);break;case t.getvalopt.TRIM:o=String(o),o=jQuery.trim(o);break;case t.getvalopt.FORCE_NUMERIC:"string"==typeof(o=jQuery.trim(o))&&(o.replace("px",""),o=Number(o))}return o},this.z__________FULL_SCREEN___________=function(){},this.toFullscreen=function(e,t){if(e.requestFullscreen)e.requestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},this.exitFullscreen=function(){if(0==t.isFullScreen())return!1;if(document.exitFullscreen)document.exitFullscreen();else if(document.cancelFullScreen)document.cancelFullScreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},this.addFullScreenChangeEvent=function(e){document.webkitCancelFullScreen?n("webkitfullscreenchange",document,e):document.msExitFullscreen?n("MSFullscreenChange",document,e):document.mozCancelFullScreen?n("mozfullscreenchange",document,e):n("fullscreenchange",document,e)},this.destroyFullScreenChangeEvent=function(){jQuery(document).unbind("fullscreenChange"),jQuery(document).unbind("mozfullscreenchange"),jQuery(document).unbind("webkitfullscreenchange"),jQuery(document).unbind("MSFullscreenChange")},this.getFullScreenElement=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},this.isFullScreen=function(){var e=document.fullscreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement;return e=!!e},this.z__________GET_PROPS___________=function(){},this.getBrowserPrefix=function(){if(null!==e)return e;var t=["webkit","Moz","ms","O"],i=document.createElement("div");for(var n in t){var r=t[n];if(r+"Transform"in i.style)return r=r.toLowerCase(),e=r,r}return e="",""},this.getImageInsideParentDataByImage=function(e,i,n){var r=e.parent(),o=t.getImageOriginalSize(e);return t.getImageInsideParentData(r,o.width,o.height,i,n)},this.getImageInsideParentData=function(e,t,i,n,r,o,a){if(!r)r={};var s={};if(void 0===o)o=e.width();if(void 0===a)a=e.height();r.padding_left&&(o-=r.padding_left),r.padding_right&&(o-=r.padding_right),r.padding_top&&(a-=r.padding_top),r.padding_bottom&&(a-=r.padding_bottom);var l=null,u="100%",d=null,_=null,g="display:block;margin:0px auto;";if(t>0&&i>0){if("down"==n&&t<o&&i<a)_=(o-(l=t))/2,d=(a-(u=i))/2;else if("fill"==n){(l=(u=a)*(c=t/i))<o?(u=(l=o)/c,_=0,d=Math.round((u-a)/2*-1)):(d=0,_=Math.round((l-o)/2*-1))}else{var c;d=0,_=(o-(l=(u=a)*(c=t/i)))/2,"fitvert"!=n&&l>o&&(_=0,d=(a-(u=(l=o)/c))/2)}l=Math.floor(l),u=Math.floor(u),d=Math.floor(d),_=Math.floor(_),g="position:absolute;"}return r.padding_top&&(d+=r.padding_top),r.padding_left&&(_+=r.padding_left),s.imageWidth=l,s.imageHeight=u,s.imageTop=d,s.imageLeft=_,s.imageRight=_+l,s.imageBottom=0==d||"100%"==u?null:d+u,s.style=g,s},this.getElementCenterPosition=function(e,i){var n=e.parent(),r=t.getElementSize(e),o=t.getElementSize(n),a=o.width,s=o.height;i&&void 0!==i.padding_top&&(s-=i.padding_top),i&&void 0!==i.padding_bottom&&(s-=i.padding_bottom),i&&void 0!==i.padding_left&&(a-=i.padding_left),i&&void 0!==i.padding_right&&(a-=i.padding_right);var l={};return l.left=Math.round((a-r.width)/2),l.top=Math.round((s-r.height)/2),i&&void 0!==i.padding_top&&(l.top+=i.padding_top),i&&void 0!==i.padding_left&&(l.left+=i.padding_left),l},this.getElementCenterPoint=function(e,i){if(!i)i=!1;var n=t.getElementSize(e),r={};return r.x=n.width/2,r.y=n.height/2,1==i&&(r.x+=n.left,r.y+=n.top),r.x=Math.round(r.x),r.y=Math.round(r.y),r},this.getMousePosition=function(e,t){var i={pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY};if(e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length>0&&(i.pageX=e.originalEvent.touches[0].pageX,i.pageY=e.originalEvent.touches[0].pageY,i.clientX=e.originalEvent.touches[0].clientX,i.clientY=e.originalEvent.touches[0].clientY),t){var n=t.offset();i.mouseX=i.pageX-n.left,i.mouseY=i.pageY-n.top}return i},this.getMouseElementPoint=function(e,i){var n={x:e.pageX,y:e.pageY};return t.getElementLocalPoint(n,i)},this.getElementLocalPoint=function(e,t){var i={},n=t.offset();return i.x=Math.round(e.x-n.left),i.y=Math.round(e.y-n.top),i},this.getImageOriginalSize=function(e,t,i){if(void 0!==t&&void 0!==i)return{width:t,height:i};var n=e[0];if(void 0===n)throw new Error("getImageOriginalSize error - Image not found");var r={};if(void 0===n.naturalWidth){if("number"==typeof e.data("naturalWidth"))return(r={}).width=e.data("naturalWidth"),r.height=e.data("naturalHeight"),r;var o=new Image;return o.src=n.src,o.complete?(r.width=o.width,r.height=o.height,e.data("naturalWidth",r.width),e.data("naturalHeight",r.height),r):{width:0,height:0}}return r.width=n.naturalWidth,r.height=n.naturalHeight,r},this.getimageRatio=function(e){var i=t.getImageOriginalSize(e);return t.getElementSize(e).width/i.width},this.isImageFitParent=function(e){var i=e.parent(),n=t.getElementSize(e),r=t.getElementSize(i);return n.width<=r.width&&n.height<=r.height},this.getElementSize=function(e){if(void 0===e)throw new Error("Can't get size, empty element");var t=e.position();return t.height=e.outerHeight(),t.width=e.outerWidth(),t.left=Math.round(t.left),t.top=Math.round(t.top),t.right=t.left+t.width,t.bottom=t.top+t.height,t},this.isElementBiggerThenParent=function(e){var i=e.parent(),n=t.getElementSize(e),r=t.getElementSize(i);return n.width>r.width||n.height>r.height},this.isPointInsideElement=function(e,t){return 0!=(e.x>=0&&e.x<t.width)&&0!=(e.y>=0&&e.y<t.height)},this.getElementRelativePos=function(e,i,n,r){if(!r)r=e.parent();if("number"==typeof e)var o={width:e,height:e};else o=t.getElementSize(e);var a=t.getElementSize(r);switch(i){case"top":case"left":i=0,n&&(i+=n);break;case"center":i=Math.round((a.width-o.width)/2),n&&(i+=n);break;case"right":i=a.width-o.width,n&&(i-=n);break;case"middle":i=Math.round((a.height-o.height)/2),n&&(i+=n);break;case"bottom":i=a.height-o.height,n&&(i-=n)}return i},this.getScreenVisibleSize=function(){document.body.clientWidth,document.body.clientHeight,jQuery(document).scrollTop();var e=jQuery(document),t=e.scrollLeft(),i=e.scrollTop();t=Math.round(t);var n=(i=Math.round(i))+window.innerHeight,r=t+window.innerWidth;return{top:i,left:t,height:n-i,width:r-t,right:r,bottom:n}},this.isElementsIntersect=function(e,t){return!(e.right<t.left)&&(!(e.left>t.right)&&(!(e.bottom<t.top)&&!(e.top>t.bottom)))},this.isElementInsideScreen=function(e){var i=t.getElementSize(e),n=t.getScreenVisibleSize();return t.isElementsIntersect(n,i)},this.z_________SET_ELEMENT_PROPS_______=function(){},this.zoomImageInsideParent=function(e,i,n,r,o,a,s){if(!n)n=1.2;if(!o)o="fit";var l,u,d,_,g=n,c=e.parent(),h=t.getElementSize(e),p=t.getImageOriginalSize(e),m=!1,f=0,b=0,v=0,y=0;if(r){var I=t.getMouseElementPoint(r,e);m=t.isPointInsideElement(I,h),v=I.x,y=I.y}else m=!1;if(0==m){var w=t.getElementCenterPoint(e);v=w.x,y=w.y}if(1==i)l=h.height*g,u=h.width*g,0!=v&&(f=-(v*g-v)),0!=y&&(b=-(y*g-y));else{if(l=h.height/g,(u=h.width/g)<t.getImageInsideParentData(c,p.width,p.height,o,s).imageWidth)return t.scaleImageFitParent(e,p.width,p.height,o,s),!0;1==m&&(0!=v&&(f=-(v/g-v)),0!=y&&(b=-(y/g-y)))}if(a){var E=1;if(0!=p.width&&(E=u/p.width),E>a)return!1}if(t.setElementSize(e,u,l),0==i&&0==m){var T=t.getElementCenterPosition(e);d=T.left,_=T.top}else d=h.left+f,_=h.top+b;return t.placeElement(e,d,_),!0},this.placeElement=function(e,i,n,r,o,a){if(0==jQuery.isNumeric(i)||0==jQuery.isNumeric(n)){if(!a)a=e.parent();var s=t.getElementSize(e),l=t.getElementSize(a)}if(0==jQuery.isNumeric(i))switch(i){case"left":i=0,r&&(i+=r);break;case"center":i=Math.round((l.width-s.width)/2),r&&(i+=r);break;case"right":i=l.width-s.width,r&&(i-=r)}if(0==jQuery.isNumeric(n))switch(n){case"top":n=0,o&&(n+=o);break;case"middle":case"center":n=Math.round((l.height-s.height)/2),o&&(n+=o);break;case"bottom":n=l.height-s.height,o&&(n-=o)}var u={position:"absolute",margin:"0px"};null!==i&&(u.left=i),null!==n&&(u.top=n),e.css(u)},this.placeElementInParentCenter=function(e){t.placeElement(e,"center","middle")},this.setElementSizeAndPosition=function(e,t,i,n,r){var o={width:n+"px",height:r+"px",left:t+"px",top:i+"px",position:"absolute",margin:"0px"};e.css(o)},this.setElementSize=function(e,t,i){var n={width:t+"px"};null!=i&&(n.height=i+"px"),e.css(n)},this.cloneElementSizeAndPos=function(e,i,n,r,o){var a=e.position();if(null==a)throw new Error("Can't get size, empty element");!0===n?(a.height=e.outerHeight(),a.width=e.outerWidth()):(a.height=e.height(),a.width=e.width()),a.left=Math.round(a.left),a.top=Math.round(a.top),r&&(a.left+=r),o&&(a.top+=o),t.setElementSizeAndPosition(i,a.left,a.top,a.width,a.height)},this.placeImageInsideParent=function(e,i,n,r,o,a){var s=t.getImageInsideParentData(i,n,r,o,a),l="<img";return null!==s.imageWidth&&(l+=" width = '"+s.imageWidth+"'",s.style+="width:"+s.imageWidth+";"),null!=s.imageHeight&&("100%"==s.imageHeight?(l+=" height = '"+s.imageHeight+"'",s.style+="height:"+s.imageHeight+";"):(l+=" height = '"+s.imageHeight+"'",s.style+="height:"+s.imageHeight+"px;")),null!==s.imageTop&&(s.style+="top:"+s.imageTop+"px;"),null!==s.imageLeft&&(s.style+="left:"+s.imageLeft+"px;"),e=t.escapeDoubleSlash(e),l+=" style='"+s.style+"'",l+=' src="'+e+'"',l+=">",i.html(l),i.children("img")},this.scaleImageCoverParent=function(e,i,n){if("number"==typeof i)var r=i,o=n;else r=i.outerWidth(),o=i.outerHeight();var a=t.getImageOriginalSize(e),s=a.width/a.height,l=o,u=l*s,d=0,_=0;u<r?(l=(u=r)/s,_=0,d=Math.round((l-o)/2*-1)):(d=0,_=Math.round((u-r)/2*-1)),u=Math.round(u),l=Math.round(l),e.css({width:u+"px",height:l+"px",left:_+"px",top:d+"px"})},this.scaleImageFitParent=function(e,i,n,r,o){var a=e.parent(),s=t.getImageInsideParentData(a,i,n,r,o),l=!1,u={};return null!==s.imageWidth&&(l=!0,e.removeAttr("width"),u.width=s.imageWidth+"px"),null!=s.imageHeight&&(l=!0,e.removeAttr("height"),u.height=s.imageHeight+"px"),null!==s.imageTop&&(l=!0,u.top=s.imageTop+"px"),null!==s.imageLeft&&(l=!0,u.left=s.imageLeft+"px"),1==l&&(u.position="absolute",u.margin="0px 0px",e.css(u)),s},this.scaleImageByHeight=function(e,i,n,r){var o=t.getImageOriginalSize(e,n,r),a=o.width/o.height,s=Math.round(i*a);i=Math.round(i),t.setElementSize(e,s,i)},this.scaleImageByWidth=function(e,i,n,r){var o=t.getImageOriginalSize(e,n,r),a=o.width/o.height,s=Math.round(i/a);i=Math.round(i),t.setElementSize(e,i,s)},this.scaleImageExactSizeInParent=function(e,i,n,r,o,a){var s=e.parent(),l=t.getElementSize(s);l.width<r&&(r=l.width),l.height<o&&(o=l.height);var u,d=t.getImageInsideParentData(null,i,n,a,null,r,o),_=r,g=o,c=d.imageLeft,h=d.imageLeft,p=d.imageTop,m=d.imageTop,f=Math.round((l.width-r)/2),b=Math.round((l.height-o)/2);0!=(u=r-(d.imageWidth+c+h))&&(h+=u),0!=(u=o-(d.imageHeight+p+m))&&(m+=u),e.removeAttr("width"),e.removeAttr("height");var v={position:"absolute",margin:"0px 0px"};v.width=_+"px",v.height=g+"px",v.left=f+"px",v.top=b+"px",v["padding-left"]=c+"px",v["padding-top"]=p+"px",v["padding-right"]=h+"px",v["padding-bottom"]=m+"px",e.css(v);var y={};return y.imageWidth=_,y.imageHeight=g,y},this.showElement=function(e,t,i){e.show().fadeTo(0,1),t&&t.show().fadeTo(0,1),i&&i.show().fadeTo(0,1)},this.z_________GALLERY_RELATED_FUNCTIONS_______=function(){},this.disableButton=function(e,i){if(!i)i="ug-button-disabled";0==t.isButtonDisabled(e,i)&&e.addClass(i)},this.convertCustomPrefixOptions=function(e,t,i){if(!t)return e;var n={};return jQuery.each(e,function(e,r){if(0===e.indexOf(t+"_"+i+"_")){var o=e.replace(t+"_"+i+"_",i+"_");n[o]=r}else n[e]=r}),n},this.enableButton=function(e,i){if(!i)i="ug-button-disabled";1==t.isButtonDisabled(e,i)&&e.removeClass(i)},this.isButtonDisabled=function(e,t){if(!t)t="ug-button-disabled";return!!e.hasClass(t)},this.z_________MATH_FUNCTIONS_______=function(){},this.normalizeSetting=function(e,t,i,n,r,o){if(!o)o=!1;return r=e+(t-e)*((r-i)/(n-i)),1==o&&(r<e&&(r=e),r>t&&(r=t)),r},this.getNormalizedValue=function(e,t,i,n,r){return r=e+(n-i)*((r-e)/(t-e))},this.getDistance=function(e,t,i,n){return Math.round(Math.sqrt(Math.abs((i-e)*(i-e)+(n-t)*(n-t))))},this.getMiddlePoint=function(e,t,i,n){var r={};return r.x=e+Math.round((i-e)/2),r.y=t+Math.round((n-t)/2),r},this.getNumItemsInSpace=function(e,t,i){return Math.floor((e+i)/(t+i))},this.getNumItemsInSpaceRound=function(e,t,i){return Math.round((e+i)/(t+i))},this.getSpaceByNumItems=function(e,t,i){return e*t+(e-1)*i},this.getItemSizeInSpace=function(e,t,i){return Math.floor((e-(t-1)*i)/t)},this.getColX=function(e,t,i){return e*(t+i)},this.getColByIndex=function(e,t){return t%e},this.getColRowByIndex=function(e,t){var i=Math.floor(e/t);return{col:Math.floor(e%t),row:i}},this.getIndexByRowCol=function(e,t,i){return e<0?-1:t<0?-1:e*i+t},this.getPrevRowSameColIndex=function(e,i){var n=t.getColRowByIndex(e,i);return t.getIndexByRowCol(n.row-1,n.col,i)},this.getNextRowSameColIndex=function(e,i){var n=t.getColRowByIndex(e,i);return t.getIndexByRowCol(n.row+1,n.col,i)},this.z_________DATA_FUNCTIONS_______=function(){},this.setGlobalData=function(e,t){jQuery.data(document.body,e,t)},this.getGlobalData=function(e){return jQuery.data(document.body,e)},this.z_________EVENT_DATA_FUNCTIONS_______=function(){},this.handleScrollTop=function(e){if(0==t.isTouchDevice())return null;var n=t.getStoredEventData(e);if(null===n.scrollDir&&(Math.abs(n.diffMouseX)>15?n.scrollDir="hor":Math.abs(n.diffMouseY)>15&&Math.abs(n.diffMouseY)>Math.abs(n.diffMouseX)&&(n.scrollDir="vert",n.scrollStartY=n.lastMouseClientY,n.scrollOrigin=jQuery(document).scrollTop(),i.dataCache[e].scrollStartY=n.lastMouseClientY,i.dataCache[e].scrollOrigin=n.scrollOrigin),i.dataCache[e].scrollDir=n.scrollDir),"vert"!==n.scrollDir)return n.scrollDir;jQuery(document).scrollTop();var r=n.scrollOrigin-(n.lastMouseClientY-n.scrollStartY);return r>=0&&jQuery(document).scrollTop(r),n.scrollDir},this.wasVerticalScroll=function(e){return"vert"===t.getStoredEventData(e).scrollDir},this.storeEventData=function(e,n,r){var o=t.getMousePosition(e),a=jQuery.now(),s={startTime:a,lastTime:a,startMouseX:o.pageX,startMouseY:o.pageY,lastMouseX:o.pageX,lastMouseY:o.pageY,startMouseClientY:o.clientY,lastMouseClientY:o.clientY,scrollTop:jQuery(document).scrollTop(),scrollDir:null};r&&(s=jQuery.extend(s,r)),i.dataCache[n]=s},this.updateStoredEventData=function(e,n,r){if(!i.dataCache[n])throw new Error("updateEventData error: must have stored cache object");var o=i.dataCache[n],a=t.getMousePosition(e);o.lastTime=jQuery.now(),void 0!==a.pageX&&(o.lastMouseX=a.pageX,o.lastMouseY=a.pageY,o.lastMouseClientY=a.clientY),r&&(o=jQuery.extend(o,r)),i.dataCache[n]=o},this.getStoredEventData=function(e,t){if(!i.dataCache[e])throw new Error("updateEventData error: must have stored cache object");var n=i.dataCache[e];return n.diffMouseX=n.lastMouseX-n.startMouseX,n.diffMouseY=n.lastMouseY-n.startMouseY,n.diffMouseClientY=n.lastMouseClientY-n.startMouseClientY,n.diffTime=n.lastTime-n.startTime,!0===t?(n.startMousePos=n.lastMouseY,n.lastMousePos=n.lastMouseY,n.diffMousePos=n.diffMouseY):(n.startMousePos=n.lastMouseX,n.lastMousePos=n.lastMouseX,n.diffMousePos=n.diffMouseX),n},this.isApproveStoredEventClick=function(e,n){if(!i.dataCache[e])return!0;var r=t.getStoredEventData(e,n),o=Math.abs(r.diffMousePos);return!(r.diffTime>400)&&!(o>30)},this.clearStoredEventData=function(e){i.dataCache[e]=null},this.z_________CHECK_SUPPORT_FUNCTIONS_______=function(){},this.isCanvasExists=function(){return"function"==typeof jQuery('<canvas width="500" height="500" > </canvas>')[0].getContext},this.isScrollbarExists=function(){return window.innerWidth>document.documentElement.clientWidth},this.isTouchDevice=function(){if(-1!==i.isTouchDevice)return i.isTouchDevice;try{document.createEvent("TouchEvent"),i.isTouchDevice=!0}catch(e){i.isTouchDevice=!1}return i.isTouchDevice},this.isRgbaSupported=function(){if(-1!==i.isRgbaSupported)return i.isRgbaSupported;var e=document.getElementsByTagName("script")[0],t=e.style.color;try{e.style.color="rgba(1,5,13,0.44)"}catch(e){}var n=e.style.color!=t;return e.style.color=t,i.isRgbaSupported=n,n},this.z_________GENERAL_FUNCTIONS_______=function(){},this.checkMinJqueryVersion=function(e){for(var t=jQuery.fn.jquery.split("."),i=e.split("."),n=0,r=t.length;n<r;n++){var o=parseInt(t[n]),a=parseInt(i[n]);if(void 0===i[n])return!0;if(a>o)return!1;if(o>a)return!0}return!0},this.getCssSizeParam=function(e){return jQuery.isNumeric(e)?e+"px":e},this.convertHexToRGB=function(e,t){var i=e.replace("#","");return i===e?e:(r=parseInt(i.substring(0,2),16),g=parseInt(i.substring(2,4),16),b=parseInt(i.substring(4,6),16),result="rgba("+r+","+g+","+b+","+t+")",result)},this.timestampToString=function(e){var t=new Date(e),i=t.getDate()+"/"+t.getMonth();return i+=" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+":"+t.getMilliseconds()},this.getArrTouches=function(e){var t=[];return e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length>0&&(t=e.originalEvent.touches),t},this.getArrTouchPositions=function(e){for(var t=[],i=0;i<e.length;i++){var n={pageX:e[i].pageX,pageY:e[i].pageY};t.push(n)}return t},this.startTimeDebug=function(){i.starTime=jQuery.now()},this.showTimeDebug=function(){debugLine({"Time Passed":jQuery.now()-i.starTime},!0)},this.initProgressIndicator=function(e,i,n){switch("bar"!=e&&0==t.isCanvasExists()&&(e="bar"),e){case"bar":(r=new UGProgressBar).putHidden(n,i);break;default:case"pie":(r=new UGProgressPie).putHidden(n,i);break;case"pie2":var r;i.type_fill=!0,(r=new UGProgressPie).putHidden(n,i)}return r},this.setButtonMobileReady=function(e){e.on("touchstart",function(e){jQuery(this).addClass("ug-nohover")}),e.on("mousedown touchend",function(e){return e.stopPropagation(),e.stopImmediatePropagation(),!1})},this.registerTheme=function(e){i.arrThemes.push(e)},this.getArrThemes=function(){return i.arrThemes},this.isThemeRegistered=function(e){return-1!==jQuery.inArray(e,i.arrThemes)},this.getFirstRegisteredTheme=function(){return 0==i.arrThemes.length?"":i.arrThemes[0]},this.isTimePassed=function(e,t){if(!t)t=100;var n=jQuery.now();0==i.timeCache.hasOwnProperty(e)?lastTime=0:lastTime=i.timeCache[e];var r=n-lastTime;return i.timeCache[e]=n,!(r<=t)},this.whenContiniousEventOver=function(e,t,n){if(!n)n=300;1==i.timeCache.hasOwnProperty(e)&&null!=i.timeCache[e]&&(clearTimeout(i.timeCache[e]),i.timeCache[e]=null),i.timeCache[e]=setTimeout(t,n)},this.validateClickTouchstartEvent=function(e){var t=!0,n=jQuery.now()-i.lastEventTime;return"click"==e&&"touchstart"==i.lastEventType&&n<1e3&&(t=!1),i.lastEventTime=jQuery.now(),i.lastEventType=e,t},this.addClassOnHover=function(e,t){if(!t)t="ug-button-hover";e.hover(function(){jQuery(this).addClass(t)},function(){jQuery(this).removeClass(t)})},this.destroyButton=function(e){e.off("mouseenter"),e.off("mouseleave"),e.off("click"),e.off("touchstart"),e.off("touchend"),e.off("mousedown"),e.off("tap")},this.setButtonOnClick=function(e,i){t.setButtonMobileReady(e),e.on("click touchstart",function(e){if(objThis=jQuery(this),e.stopPropagation(),e.stopImmediatePropagation(),0==t.validateClickTouchstartEvent(e.type))return!0;i(objThis,e)})},this.setButtonOnTap=function(e,n){e.on("tap",n),0==t.isTouchDevice()?e.on("click",function(e){var i=jQuery(this);if(0==t.validateClickTouchstartEvent(e.type))return!0;i.trigger("tap")}):(e.on("touchstart",function(e){jQuery(this).addClass("ug-nohover"),i.lastTouchStartElement=jQuery(this),i.lastEventTime=jQuery.now()}),e.on("touchend",function(e){var t=jQuery(this);return 0==t.is(i.lastTouchStartElement)||(!i.lastEventTime||(jQuery.now()-i.lastEventTime>i.touchThreshold||void t.trigger("tap")))}))},this.loadJs=function(e,t){!0===t&&(e=location.protocol+"//"+e);var i=document.createElement("script");i.src=e;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(i,n)},this.loadCss=function(e,t){!0===t&&(e=location.protocol+"//"+e);var i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(i)},this.addEvent=function(e,t,i){void 0!==e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on"+t,i)},this.checkImagesLoaded=function(e,t,i){var n=0,r=e.length;if(0==r&&t)return t(),!1;function o(e,o){n++,"function"==typeof i&&setTimeout(function(){i(e,o)}),n==r&&"function"==typeof t&&setTimeout(function(){t()})}setTimeout(function(){for(var t=0;t<r;t++){var i=e[t];if(void 0!==i.naturalWidth&&0!==i.naturalWidth)o(e[t],!1);else{var n=jQuery("<img/>");n.data("index",t),n.on("load",function(){var t=jQuery(this).data("index");o(e[t],!1)}),n.on("error",function(){var t=jQuery(this).data("index");o(e[t],!0)}),n.attr("src",i.src)}}})},this.waitForWidth=function(e,t){var n=e.width();if(0!=n)return t(),!1;i.handle=setInterval(function(){0!=(n=e.width())&&(clearInterval(i.handle),t())},300)},this.arrayShuffle=function(e){if("object"!=typeof e)return e;for(var t,i,n=e.length;n;t=parseInt(Math.random()*n),i=e[--n],e[n]=e[t],e[t]=i);return e},this.getObjectLength=function(e){var t=0;for(var i in e)t++;return t},this.normalizePercent=function(e){return e<0&&(e=0),e>1&&(e=1),e},this.stripTags=function(e){return e.replace(/(<([^>]+)>)/gi,"")},this.escapeDoubleSlash=function(e){return e.replace('"','"')},this.htmlentitles=function(e){return jQuery("<div/>").text(e).html()},this.z_________END_GENERAL_FUNCTIONS_______=function(){}}!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var a=t||window.event,s=l.call(arguments,1),u=0,d=0,_=0,g=0;if((t=e.event.fix(a)).type="mousewheel","detail"in a&&(_=-1*a.detail),"wheelDelta"in a&&(_=a.wheelDelta),"wheelDeltaY"in a&&(_=a.wheelDeltaY),"wheelDeltaX"in a&&(d=-1*a.wheelDeltaX),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(d=-1*_,_=0),u=0===_?d:_,"deltaY"in a&&(u=_=-1*a.deltaY),"deltaX"in a&&(d=a.deltaX,0===_&&(u=-1*d)),0!==_||0!==d){if(1===a.deltaMode){var c=e.data(this,"mousewheel-line-height");u*=c,_*=c,d*=c}else if(2===a.deltaMode){var h=e.data(this,"mousewheel-page-height");u*=h,_*=h,d*=h}return g=Math.max(Math.abs(_),Math.abs(d)),(!o||o>g)&&(o=g,n(a,g)&&(o/=40)),n(a,g)&&(u/=40,d/=40,_/=40),u=Math[u>=1?"floor":"ceil"](u/o),d=Math[d>=1?"floor":"ceil"](d/o),_=Math[_>=1?"floor":"ceil"](_/o),t.deltaX=d,t.deltaY=_,t.deltaFactor=o,t.deltaMode=0,s.unshift(t,u,d,_),r&&clearTimeout(r),r=setTimeout(i,200),(e.event.dispatch||e.event.handle).apply(this,s)}}function i(){o=null}function n(e,t){return d.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}var r,o,a=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var u=a.length;u;)e.event.fixHooks[a[--u]]=e.event.mouseHooks;var d=e.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var i=s.length;i;)this.addEventListener(s[--i],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",d.getLineHeight(this)),e.data(this,"mousewheel-page-height",d.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=s.length;e;)this.removeEventListener(s[--e],t,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(e(t)["offsetParent"in e.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),function(e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof module&&"object"==typeof module.exports?exports=e(require("jquery")):e(jQuery)}(function(e){e.easing.jswing=e.easing.swing;var t=Math.pow,i=Math.sqrt,n=Math.sin,r=Math.cos,o=Math.PI,a=1.70158,s=1.525*a,l=2*o/3,u=2*o/4.5;function d(e){var t=7.5625,i=2.75;return e<1/i?t*e*e:e<2/i?t*(e-=1.5/i)*e+.75:e<2.5/i?t*(e-=2.25/i)*e+.9375:t*(e-=2.625/i)*e+.984375}e.extend(e.easing,{def:"easeOutQuad",swing:function(t){return e.easing[e.easing.def](t)},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return 1-(1-e)*(1-e)},easeInOutQuad:function(e){return e<.5?2*e*e:1-t(-2*e+2,2)/2},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return 1-t(1-e,3)},easeInOutCubic:function(e){return e<.5?4*e*e*e:1-t(-2*e+2,3)/2},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1-t(1-e,4)},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-t(-2*e+2,4)/2},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1-t(1-e,5)},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1-t(-2*e+2,5)/2},easeInSine:function(e){return 1-r(e*o/2)},easeOutSine:function(e){return n(e*o/2)},easeInOutSine:function(e){return-(r(o*e)-1)/2},easeInExpo:function(e){return 0===e?0:t(2,10*e-10)},easeOutExpo:function(e){return 1===e?1:1-t(2,-10*e)},easeInOutExpo:function(e){return 0===e?0:1===e?1:e<.5?t(2,20*e-10)/2:(2-t(2,-20*e+10))/2},easeInCirc:function(e){return 1-i(1-t(e,2))},easeOutCirc:function(e){return i(1-t(e-1,2))},easeInOutCirc:function(e){return e<.5?(1-i(1-t(2*e,2)))/2:(i(1-t(-2*e+2,2))+1)/2},easeInElastic:function(e){return 0===e?0:1===e?1:-t(2,10*e-10)*n((10*e-10.75)*l)},easeOutElastic:function(e){return 0===e?0:1===e?1:t(2,-10*e)*n((10*e-.75)*l)+1},easeInOutElastic:function(e){return 0===e?0:1===e?1:e<.5?-t(2,20*e-10)*n((20*e-11.125)*u)/2:t(2,-20*e+10)*n((20*e-11.125)*u)/2+1},easeInBack:function(e){return 2.70158*e*e*e-a*e*e},easeOutBack:function(e){return 1+2.70158*t(e-1,3)+a*t(e-1,2)},easeInOutBack:function(e){return e<.5?t(2*e,2)*(7.189819*e-s)/2:(t(2*e-2,2)*((s+1)*(2*e-2)+s)+2)/2},easeInBounce:function(e){return 1-d(1-e)},easeOutBounce:d,easeInOutBounce:function(e){return e<.5?(1-d(1-2*e))/2:(1+d(2*e-1))/2}})}),function(e,t){if(void 0===e.cssHooks)return!1;function i(e,t,i){var n=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=n.floor?~~e:parseFloat(e),isNaN(e)?t.def:n.mod?(e+n.mod)%n.mod:0>e?0:n.max<e?n.max:e)}function n(t){var i=l(),n=i._rgba=[];return t=t.toLowerCase(),c(s,function(e,r){var o,a=r.re.exec(t),s=a&&r.parse(a),l=r.space||"rgba";return s?(o=i[l](s),i[u[l].cache]=o[u[l].cache],n=i._rgba=o._rgba,!1):void 0}),n.length?("0,0,0,0"===n.join()&&e.extend(n,o.transparent),i):o[t]}function r(e,t,i){return 1>6*(i=(i+1)%1)?e+(t-e)*i*6:1>2*i?t:2>3*i?e+(t-e)*(2/3-i)*6:e}var o,a=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,n,r){return new e.Color.fn.parse(t,i,n,r)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},_=l.support={},g=e("<p>")[0],c=e.each;g.style.cssText="background-color:rgba(1,1,1,.5)",_.rgba=g.style.backgroundColor.indexOf("rgba")>-1,c(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(r,a,s,d){if(r===t)return this._rgba=[null,null,null,null],this;(r.jquery||r.nodeType)&&(r=e(r).css(a),a=t);var _=this,g=e.type(r),h=this._rgba=[];return a!==t&&(r=[r,a,s,d],g="array"),"string"===g?this.parse(n(r)||o._default):"array"===g?(c(u.rgba.props,function(e,t){h[t.idx]=i(r[t.idx],t)}),this):"object"===g?(c(u,r instanceof l?function(e,t){r[t.cache]&&(_[t.cache]=r[t.cache].slice())}:function(t,n){var o=n.cache;c(n.props,function(e,t){if(!_[o]&&n.to){if("alpha"===e||null==r[e])return;_[o]=n.to(_._rgba)}_[o][t.idx]=i(r[e],t,!0)}),_[o]&&e.inArray(null,_[o].slice(0,3))<0&&(_[o][3]=1,n.from&&(_._rgba=n.from(_[o])))}),this):void 0},is:function(e){var t=l(e),i=!0,n=this;return c(u,function(e,r){var o,a=t[r.cache];return a&&(o=n[r.cache]||r.to&&r.to(n._rgba)||[],c(r.props,function(e,t){return null!=a[t.idx]?i=a[t.idx]===o[t.idx]:void 0})),i}),i},_space:function(){var e=[],t=this;return c(u,function(i,n){t[n.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var n=l(e),r=n._space(),o=u[r],a=0===this.alpha()?l("transparent"):this,s=a[o.cache]||o.to(a._rgba),_=s.slice();return n=n[o.cache],c(o.props,function(e,r){var o=r.idx,a=s[o],l=n[o],u=d[r.type]||{};null!==l&&(null===a?_[o]=l:(u.mod&&(l-a>u.mod/2?a+=u.mod:a-l>u.mod/2&&(a-=u.mod)),_[o]=i((l-a)*t+a,r)))}),this[r](_)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),r=l(t)._rgba;return l(e.map(i,function(e,t){return(1-n)*r[t]+n*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),n=i.pop();return t&&i.push(~~(255*n)),"#"+e.map(i,function(e){return 1===(e=(e||0).toString(16)).length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,n=e[0]/255,r=e[1]/255,o=e[2]/255,a=e[3],s=Math.max(n,r,o),l=Math.min(n,r,o),u=s-l,d=s+l,_=.5*d;return t=l===s?0:n===s?60*(r-o)/u+360:r===s?60*(o-n)/u+120:60*(n-r)/u+240,i=0===u?0:.5>=_?u/d:u/(2-d),[Math.round(t)%360,i,_,null==a?1:a]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],n=e[2],o=e[3],a=.5>=n?n*(1+i):n+i-n*i,s=2*n-a;return[Math.round(255*r(s,a,t+1/3)),Math.round(255*r(s,a,t)),Math.round(255*r(s,a,t-1/3)),o]},c(u,function(n,r){var o=r.props,s=r.cache,u=r.to,d=r.from;l.fn[n]=function(n){if(u&&!this[s]&&(this[s]=u(this._rgba)),n===t)return this[s].slice();var r,a=e.type(n),_="array"===a||"object"===a?n:arguments,g=this[s].slice();return c(o,function(e,t){var n=_["object"===a?e:t.idx];null==n&&(n=g[t.idx]),g[t.idx]=i(n,t)}),d?((r=l(d(g)))[s]=g,r):l(g)},c(o,function(t,i){l.fn[t]||(l.fn[t]=function(r){var o,s=e.type(r),l="alpha"===t?this._hsla?"hsla":"rgba":n,u=this[l](),d=u[i.idx];return"undefined"===s?d:("function"===s&&(r=r.call(this,d),s=e.type(r)),null==r&&i.empty?this:("string"===s&&((o=a.exec(r))&&(r=d+parseFloat(o[2])*("+"===o[1]?1:-1))),u[i.idx]=r,this[l](u)))})})}),l.hook=function(t){var i=t.split(" ");c(i,function(t,i){e.cssHooks[i]={set:function(t,r){var o,a,s="";if("transparent"!==r&&("string"!==e.type(r)||(o=n(r)))){if(r=l(o||r),!_.rgba&&1!==r._rgba[3]){for(a="backgroundColor"===i?t.parentNode:t;(""===s||"transparent"===s)&&a&&a.style;)try{s=e.css(a,"backgroundColor"),a=a.parentNode}catch(e){}r=r.blend(s&&"transparent"!==s?s:"_default")}r=r.toRgbaString()}try{t.style[i]=r}catch(e){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),e.cssHooks.borderColor={expand:function(e){var t={};return c(["Top","Right","Bottom","Left"],function(i,n){t["border"+n+"Color"]=e}),t}},o=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(e){e.mlp={x:0,y:0},e(function t(){try{var i=this===document?e(this):e(this).contents()}catch(e){return!1}i.mousemove(function(t){e.mlp={x:t.pageX,y:t.pageY}}),i.find("iframe").on("load",t)}),e.fn.ismouseover=function(){var t=!1;return this.eq(0).each(function(){var i=e(this).is("iframe")?e(this).contents().find("body"):e(this),n=i.offset();t=n.left<=e.mlp.x&&n.left+i.outerWidth()>e.mlp.x&&n.top<=e.mlp.y&&n.top+i.outerHeight()>e.mlp.y}),t}}(jQuery);var g_ugFunctions=new UGFunctions;function UGThumbsGeneral(){var e,t,i,n,r=this,o=jQuery(r),a=new UniteGalleryMain,s=new UGFunctions;this.type={GET_THUMBS_ALL:"all",GET_THUMBS_RATIO:"ratio",GET_THUMBS_NO_RATIO:"no_ratio",GET_THUMBS_NEW:"new"},this.events={SETOVERSTYLE:"thumbmouseover",SETNORMALSTYLE:"thumbmouseout",SETSELECTEDSTYLE:"thumbsetselected",PLACEIMAGE:"thumbplaceimage",AFTERPLACEIMAGE:"thumb_after_place_image",IMAGELOADERROR:"thumbimageloaderror",THUMB_IMAGE_LOADED:"thumb_image_loaded"};var l={thumb_width:88,thumb_height:50,thumb_fixed_size:!0,thumb_resize_by:"height",thumb_border_effect:!0,thumb_border_width:0,thumb_border_color:"#000000",thumb_over_border_width:0,thumb_over_border_color:"#d9d9d9",thumb_selected_border_width:1,thumb_selected_border_color:"#d9d9d9",thumb_round_corners_radius:0,thumb_color_overlay_effect:!0,thumb_overlay_color:"#000000",thumb_overlay_opacity:.4,thumb_overlay_reverse:!1,thumb_image_overlay_effect:!1,thumb_image_overlay_type:"bw",thumb_transition_duration:200,thumb_transition_easing:"easeOutQuad",thumb_show_loader:!0,thumb_loader_type:"dark",thumb_wrapper_as_link:!1,thumb_link_newpage:!1},u={touchEnabled:!1,num_thumbs_checking:0,customThumbs:!1,funcSetCustomThumbHtml:null,isEffectBorder:!1,isEffectOverlay:!1,isEffectImage:!1,colorOverlayOpacity:1,thumbInnerReduce:0,allowOnResize:!0,classNewThumb:"ug-new-thumb"},d="thumb_size_change";function _(e,t){var r=i[e],o="";0==u.customThumbs&&(o=" ug-thumb-generated");var a="<div class='ug-thumb-wrapper"+o+"' "+("style='z-index:"+(r.index+1)+";'")+"></div>";if(1==l.thumb_wrapper_as_link){var s=r.link;""==r.link&&(s="javascript:void(0)");var d="";1==l.thumb_link_newpage&&r.link&&(d=" target='_blank'");a="<a href='"+s+"'"+d+" class='ug-thumb-wrapper"+o+"'></a>"}var _=jQuery(a),g=r.objThumbImage;if(0==u.customThumbs){if(1==l.thumb_show_loader&&g){var c="ug-thumb-loader-dark";"bright"==l.thumb_loader_type&&(c="ug-thumb-loader-bright"),_.append("<div class='ug-thumb-loader "+c+"'></div>"),_.append("<div class='ug-thumb-error' style='display:none'></div>")}if(g){if(g.addClass("ug-thumb-image"),1==l.thumb_image_overlay_effect){var h=g.clone().appendTo(_);h.addClass("ug-thumb-image-overlay "+t).removeClass("ug-thumb-image"),h.fadeTo(0,0),r.objImageOverlay=h}_.append(g)}}return u.isEffectBorder&&_.append("<div class='ug-thumb-border-overlay'></div>"),u.isEffectOverlay&&_.append("<div class='ug-thumb-overlay'></div>"),n.append(_),u.customThumbs&&u.funcSetCustomThumbHtml(_,r),i[e].objThumbWrapper=_,_}function g(e,t,i,r){var o={width:e+"px",height:t+"px"},a={width:e-u.thumbInnerReduce+"px",height:t-u.thumbInnerReduce+"px"},s=".ug-thumb-loader, .ug-thumb-error, .ug-thumb-border-overlay, .ug-thumb-overlay";i?(!0!==r&&i.css(o),i.find(s).css(a)):(n.children(".ug-thumb-wrapper").css(o),n.find(s).css(a))}function c(e,t,i,n){if(!n)n=!1;a.isFakeFullscreen()&&(n=!0);var r=e.children(".ug-thumb-border-overlay"),o={};o["border-width"]=t+"px",0!=t&&(o["border-color"]=i),n&&!0===n?(r.css(o),0==t?r.hide():r.show()):(0==t?r.stop().fadeOut(l.thumb_transition_duration):r.show().stop().fadeIn(l.thumb_transition_duration),function(e,t){e.stop(!0).animate(t,{duration:l.thumb_transition_duration,easing:l.thumb_transition_easing,queue:!1})}(r,o))}function h(e,t,i){var n=e.children(".ug-thumb-overlay"),r=l.thumb_transition_duration;i&&!0===i&&(r=0),t?n.stop(!0).fadeTo(r,u.colorOverlayOpacity):n.stop(!0).fadeTo(r,0)}function p(e,t,i){var n=e.children("img.ug-thumb-image"),r=e.children("img.ug-thumb-image-overlay"),o=l.thumb_transition_duration;i&&!0===i&&(o=0),t?r.stop(!0).fadeTo(o,1):(n.fadeTo(0,1),r.stop(!0).fadeTo(o,0))}function m(e,t){(u.isEffectBorder&&c(e,l.thumb_selected_border_width,l.thumb_selected_border_color,t),u.isEffectOverlay)&&h(e,1==l.thumb_overlay_reverse,t);u.isEffectImage&&p(e,!1,t),o.trigger(r.events.SETSELECTEDSTYLE,e)}function f(e){1==v(e)?m(e,!0):r.setThumbNormalStyle(e,!0,"redraw")}function b(e,t,i){if(1==l.thumb_fixed_size)s.scaleImageCoverParent(t,e);else{"height"==l.thumb_resize_by?s.scaleImageByHeight(t,l.thumb_height):s.scaleImageByWidth(t,l.thumb_width);var n=s.getElementSize(t);s.placeElement(t,0,0),g(n.width,n.height,e)}e.children(".ug-thumb-loader").hide(),t.show(),0==l.thumb_image_overlay_effect?t.fadeTo(0,1):(1==l.thumb_image_overlay_effect&&function(e){var t=e.siblings(".ug-thumb-image-overlay");if(0==t.length)return!1;var i=s.getElementSize(e),n={width:i.width+"px",height:i.height+"px",left:i.left+"px",top:i.top+"px"};t.css(n),0==u.customThumbs&&t.fadeTo(0,1)}(t),t.fadeTo(0,0),f(e)),o.trigger(r.events.AFTERPLACEIMAGE,e)}function v(e){return!!e.hasClass("ug-thumb-selected")}function y(e,t){t=jQuery(t);r.getItemByThumb(t);var i=s.getElementSize(t);g(i.width,i.height,t,!0),f(t)}function I(e,t){if(!t)t=!1;var i=jQuery(e),n=i.parents(".ug-thumb-wrapper");return 0!=n.parent().length&&(objItem=r.getItemByThumb(n),(1!=objItem.isLoaded||!1!==t)&&(r.triggerImageLoadedEvent(n,i),void(1==u.customThumbs?o.trigger(r.events.PLACEIMAGE,[n,i]):b(n,i,objItem))))}function w(e,t,i){objItem=r.getItemByThumb(t),objItem.isLoaded=!0,objItem.isThumbImageLoaded=!0;var n=s.getImageOriginalSize(i);objItem.thumbWidth=n.width,objItem.thumbHeight=n.height,objItem.thumbRatioByWidth=n.width/n.height,objItem.thumbRatioByHeight=n.height/n.width,t.addClass("ug-thumb-ratio-set")}this.init=function(n,r){e=n.getObjects(),a=n,jQuery(n),t=e.g_objWrapper,i=e.g_arrItems,l=jQuery.extend(l,r),u.isEffectBorder=l.thumb_border_effect,u.isEffectOverlay=l.thumb_color_overlay_effect,u.isEffectImage=l.thumb_image_overlay_effect},this._____________EXTERNAL_SETTERS__________=function(){},this.setHtmlThumbs=function(e,t){if(n=e,1==u.isEffectImage)var i=function(){var e="",t=l.thumb_image_overlay_type.split(",");for(var i in t){var n=t[i];switch(n){case"bw":e+=" ug-bw-effect";break;case"blur":e+=" ug-blur-effect";break;case"sepia":e+=" ug-sepia-effect"}}return e}();if(!0!==t)for(var o=a.getNumItems(),s=0;s<o;s++)_(s,i);else{r.getThumbs().removeClass(u.classNewThumb);var d=a.getNewAddedItemsIndexes();jQuery.each(d,function(e,t){_(t,i).addClass(u.classNewThumb)})}},this.setThumbNormalStyle=function(e,t,i){(1==u.customThumbs&&e.removeClass("ug-thumb-over"),u.isEffectBorder&&c(e,l.thumb_border_width,l.thumb_border_color,t),u.isEffectOverlay)&&h(e,1!=l.thumb_overlay_reverse,t);u.isEffectImage&&p(e,!0,t),o.trigger(r.events.SETNORMALSTYLE,e)},this.setThumbOverStyle=function(e){(1==u.customThumbs&&e.addClass("ug-thumb-over"),u.isEffectBorder&&c(e,l.thumb_over_border_width,l.thumb_over_border_color),u.isEffectOverlay)&&h(e,1==l.thumb_overlay_reverse);1==u.isEffectImage&&p(e,!1),o.trigger(r.events.SETOVERSTYLE,e)},this.setHtmlProperties=function(e){if(!e)e=r.getThumbs();if(0==u.customThumbs){1==l.thumb_fixed_size&&g(l.thumb_width,l.thumb_height,e),function(e){if(l.thumb_round_corners_radius<=0)return!1;var t={"border-radius":l.thumb_round_corners_radius+"px"};e?(e.css(t),e.find(".ug-thumb-border-overlay").css(t)):n.find(".ug-thumb-wrapper, .ug-thumb-wrapper .ug-thumb-border-overlay").css(t)}(e)}if(e.each(function(){f(jQuery(this))}),u.isEffectOverlay&&l.thumb_overlay_color){var t={};if(s.isRgbaSupported()){var i=s.convertHexToRGB(l.thumb_overlay_color,l.thumb_overlay_opacity);t["background-color"]=i}else t["background-color"]=l.thumb_overlay_color,u.colorOverlayOpacity=l.thumb_overlay_opacity;e.find(".ug-thumb-overlay").css(t)}},this.setThumbSelected=function(e){if(1==u.customThumbs&&e.removeClass("ug-thumb-over"),1==v(e))return!0;e.addClass("ug-thumb-selected"),m(e)},this.setThumbUnselected=function(e){e.removeClass("ug-thumb-selected"),r.setThumbNormalStyle(e,!1,"set unselected")},this.setOptions=function(e){l=jQuery.extend(l,e)},this.setThumbInnerReduce=function(e){u.thumbInnerReduce=e},this.setCustomThumbs=function(e,t,i){if(u.customThumbs=!0,"function"!=typeof e)throw new Error("The argument should be function");u.funcSetCustomThumbHtml=e,-1==jQuery.inArray("overlay",t)&&(u.isEffectOverlay=!1),-1==jQuery.inArray("border",t)&&(u.isEffectBorder=!1),u.isEffectImage=!1,i&&!1===i.allow_onresize&&(u.allowOnResize=!1)},this._____________EXTERNAL_GETTERS__________=function(){},this.getOptions=function(){return l},this.getNumThumbs=function(){return i.length},this.getThumbImage=function(e){return e.find(".ug-thumb-image")},this.getThumbByIndex=function(e){var t=r.getThumbs();if(e>=t.length||e<0)throw new Error("Wrong thumb index");return jQuery(t[e])},this.getThumbs=function(e){switch(e){default:case r.type.GET_THUMBS_ALL:var t=n.children(".ug-thumb-wrapper");break;case r.type.GET_THUMBS_NO_RATIO:t=n.children(".ug-thumb-wrapper").not(".ug-thumb-ratio-set");break;case r.type.GET_THUMBS_RATIO:t=n.children(".ug-thumb-wrapper.ug-thumb-ratio-set");break;case r.type.GET_THUMBS_NEW:t=n.children("."+u.classNewThumb)}return t},this.getItemByThumb=function(e){var t=e.data("index");return void 0===t&&(t=e.index()),i[t]},this.isThumbLoaded=function(e){return r.getItemByThumb(e).isLoaded},this.getGlobalThumbSize=function(){return{width:l.thumb_width,height:l.thumb_height}},this._____________EXTERNAL_OTHERS__________=function(){},this.initEvents=function(){1==u.allowOnResize&&t.on(d,y),o.on(r.events.THUMB_IMAGE_LOADED,w),n.on("touchstart",".ug-thumb-wrapper",function(){u.touchEnabled=!0,n.off("mouseenter").off("mouseleave")}),n.on("mouseenter",".ug-thumb-wrapper",function(e){!function(e){if(1==u.touchEnabled)return objThumbs.off("mouseenter").off("mouseleave"),!0;0==v(e)&&r.setThumbOverStyle(e)}(jQuery(this))}),n.on("mouseleave",".ug-thumb-wrapper",function(e){!function(e){if(1==u.touchEnabled)return!0;0==v(e)&&r.setThumbNormalStyle(e,!1)}(jQuery(this))})},this.destroy=function(){n.off("touchstart",".ug-thumb-wrapper"),t.off(d),n.off("mouseenter",".ug-thumb-wrapper"),n.off("mouseleave",".ug-thumb-wrapper"),o.off(r.events.THUMB_IMAGE_LOADED)},this.loadThumbsImages=function(){var e=n.find(".ug-thumb-image");s.checkImagesLoaded(e,null,function(e,t){0==t?I(e,!0):function(e){var t=r.getItemByThumb(e);if(t.isLoaded=!0,t.isThumbImageLoaded=!1,1==u.customThumbs)return o.trigger(r.events.IMAGELOADERROR,e),!0;e.children(".ug-thumb-loader").hide(),e.children(".ug-thumb-error").show()}(jQuery(e).parent())})},this.triggerImageLoadedEvent=function(e,t){o.trigger(r.events.THUMB_IMAGE_LOADED,[e,t])},this.hideThumbs=function(){n.find(".ug-thumb-wrapper").hide()}}function UGThumbsStrip(){var e,t,n,r,o,a,s,l,u=this,d=new UniteGalleryMain,_=new UGFunctions,g=!1,c=new UGThumbsGeneral,h=(_=new UGFunctions,{strip_vertical_type:!1,strip_thumbs_align:"left",strip_space_between_thumbs:6,strip_thumb_touch_sensetivity:15,strip_scroll_to_thumb_duration:500,strip_scroll_to_thumb_easing:"easeOutCubic",strip_control_avia:!0,strip_control_touch:!0,strip_padding_top:0,strip_padding_bottom:0,strip_padding_left:0,strip_padding_right:0}),p={isRunOnce:!1,is_placed:!1,isNotFixedThumbs:!1,handle:null},m={stripSize:0,stripActiveSize:0,stripInnerSize:0,thumbSize:0,thumbSecondSize:0};this.events={STRIP_MOVE:"stripmove",INNER_SIZE_CHANGE:"size_change"};var f={strip_thumbs_align:"top",thumb_resize_by:"width"};function b(){var e=c.getOptions();p.isNotFixedThumbs=!1===e.thumb_fixed_size,g=h.strip_vertical_type}function v(){var t,i,n,r,_;c.setHtmlProperties(),t=a.children(".ug-thumb-wrapper"),i=jQuery(t[0]),n=i.outerWidth(),r=i.outerHeight(),_=c.getOptions(),0==g?(m.thumbSize=n,1==_.thumb_fixed_size?m.thumbSecondSize=r:m.thumbSecondSize=_.thumb_height,y(o.width()),m.stripInnerSize=a.width()):(m.thumbSize=r,1==_.thumb_fixed_size?m.thumbSecondSize=n:m.thumbSecondSize=_.thumb_width,y(o.height()),m.stripInnerSize=a.height()),function(){if(0==g){var e=m.thumbSecondSize,t={};t.height=e+"px";var i={};i.height=e+"px"}else{var n=m.thumbSecondSize,t={};t.width=n+"px";var i={};i.width=n+"px"}o.css(t),a.css(i)}(),I(),0==p.isRunOnce&&(1==h.strip_control_touch&&(l=new UGTouchThumbsControl).init(u),1==h.strip_control_avia&&(s=new UGAviaControl).init(u),P(),c.loadThumbsImages(),c.initEvents(),o.find(".ug-thumb-wrapper").on("click touchend",function(e){!function(e){if(u.isTouchMotionActive()){var t=l.isSignificantPassed();if(1==t)return!0}var i=c.getItemByThumb(e);d.selectItem(i)}(jQuery(this))}),e.on(d.events.ITEM_CHANGE,j),p.isNotFixedThumbs&&jQuery(c).on(c.events.AFTERPLACEIMAGE,x)),p.isRunOnce=!0}function y(e){m.stripSize=e,m.stripActiveSize=0==g?m.stripSize-h.strip_padding_left-h.strip_padding_right:m.stripSize-h.strip_padding_top-h.strip_padding_bottom,m.stripActiveSize<0&&(m.stripActiveSize=0)}function I(){var e,t=a.children(".ug-thumb-wrapper"),n=0,r=0;for(0==g&&(r=h.strip_padding_top),i=0;i<t.length;i++){var o=jQuery(t[i]);if(1==p.isNotFixedThumbs){if(objItem=c.getItemByThumb(o),0==objItem.isLoaded)continue;o.show()}_.placeElement(o,n,r),0==g?n+=o.outerWidth()+h.strip_space_between_thumbs:r+=o.outerHeight()+h.strip_space_between_thumbs}if(0==g)var s=n-h.strip_space_between_thumbs;else s=r-h.strip_space_between_thumbs;e=s,0==g?a.width(e):a.height(e),m.stripInnerSize=e,P(),jQuery(u).trigger(u.events.INNER_SIZE_CHANGE)}function w(e){var t=u.getInnerStripPos()+e;t=u.fixInnerStripLimits(t),u.positionInnerStrip(t,!0)}function E(e){var t=-1*A(e).min;t=u.fixInnerStripLimits(t),u.positionInnerStrip(t,!0)}function T(e){var t=-1*A(e).max+m.stripSize;t=u.fixInnerStripLimits(t),u.positionInnerStrip(t,!0)}function S(e){if(0==C())return!1;var t,i,n=(t={},i=u.getInnerStripPos(),t.minPosThumbs=-1*i+1,t.maxPosThumbs=-1*i+m.stripSize-1,t),r=A(e);if(r.min<n.minPosThumbs){var o=e.prev();o.length?E(o):E(e)}else if(r.max>n.maxPosThumbs){var a=e.next();a.length?T(a):T(e)}}function P(){1==C()?(s&&s.enable(),l&&l.enable()):(s&&s.disable(),l&&l.disable())}function x(){clearTimeout(p.handle),p.handle=setTimeout(function(){I()},50)}function j(){var e=d.getSelectedItem();c.setThumbSelected(e.objThumbWrapper),S(e.objThumbWrapper)}function C(){return m.stripInnerSize>m.stripActiveSize}function A(e){var t={},i=e.position();return 0==g?(t.min=i.left,t.max=i.left+m.thumbSize):(t.min=i.top,t.max=i.top+m.thumbSize),t}this.setHtml=function(e){if(!e){e=n;null!=h.parent_container&&(e=h.parent_container)}e.append("<div class='ug-thumbs-strip'><div class='ug-thumbs-strip-inner'></div></div>"),o=e.children(".ug-thumbs-strip"),a=o.children(".ug-thumbs-strip-inner"),c.setHtmlThumbs(a),1==p.isNotFixedThumbs&&c.hideThumbs()},this.destroy=function(){var t=o.find(".ug-thumb-wrapper");t.off("click"),t.off("touchend"),e.off(d.events.ITEM_CHANGE),jQuery(c).off(c.events.AFTERPLACEIMAGE),l&&l.destroy(),s&&s.destroy(),c.destroy()},this.________EXTERNAL_GENERAL___________=function(){},this.init=function(i,o){!function(i,o){t=i.getObjects(),(d=i).attachThumbsPanel("strip",u),e=jQuery(i),n=t.g_objWrapper,r=t.g_arrItems,h=jQuery.extend(h,o),1==(g=h.strip_vertical_type)&&(h=jQuery.extend(h,f),h=jQuery.extend(h,o),o.thumb_resize_by="width"),c.init(i,o),b()}(i,o)},this.run=function(){v()},this.positionInnerStrip=function(e,t){if(void 0===t)t=!1;if(0==g)var i={left:e+"px"};else i={top:e+"px"};0==t?(a.css(i),u.triggerStripMoveEvent()):(u.triggerStripMoveEvent(),a.stop(!0).animate(i,{duration:h.strip_scroll_to_thumb_duration,easing:h.strip_scroll_to_thumb_easing,queue:!1,progress:function(){u.triggerStripMoveEvent()},always:function(){u.triggerStripMoveEvent()}}))},this.triggerStripMoveEvent=function(){jQuery(u).trigger(u.events.STRIP_MOVE)},this.isTouchMotionActive=function(){return!!l&&l.isTouchActive()},this.isItemThumbVisible=function(e){var t=e.objThumbWrapper,i=t.position(),n=-1*u.getInnerStripPos();if(0==g)var r=n+m.stripSize,o=i.left,a=i.left+t.width();else r=n+m.stripSize,o=i.top,a=i.top+t.height();var s=!1;return a>=n&&o<=r&&(s=!0),s},this.getInnerStripPos=function(){return 0==g?a.position().left:a.position().top},this.getInnerStripLimits=function(){var e={};return e.maxPos=0==g?h.strip_padding_left:h.strip_padding_top,e.minPos=-(m.stripInnerSize-m.stripActiveSize),e},this.fixInnerStripLimits=function(e){var t=u.getInnerStripLimits();return e>t.maxPos&&(e=t.maxPos),e<t.minPos&&(e=t.minPos),e},this.scrollForeward=function(){w(-m.stripSize)},this.scrollBack=function(){w(m.stripSize)},this.________EXTERNAL_SETTERS___________=function(){},this.setOptions=function(e){h=jQuery.extend(h,e),c.setOptions(e),b()},this.setSizeVertical=function(e){if(0==g)throw new Error("setSizeVertical error, the strip size is not vertical");var t=m.thumbSecondSize,i={};i.width=t+"px",i.height=e+"px",o.css(i),y(e);var n={};n.width=t+"px",n.left="0px",n.top="0px",a.css(n),p.is_placed=!0,P()},this.setSizeHorizontal=function(e){if(1==g)throw new Error("setSizeHorizontal error, the strip size is not horizontal");var t=m.thumbSecondSize+h.strip_padding_top+h.strip_padding_bottom,i={};i.width=e+"px",i.height=t+"px",o.css(i),y(e);var n=h.strip_padding_left,r={};r.height=t+"px",r.left=n+"px",r.top="0px",a.css(r),p.is_placed=!0,P()},this.setPosition=function(e,t,i,n){_.placeElement(o,e,t,i,n)},this.resize=function(e){0==g?(o.width(e),m.stripActiveSize=e-h.strip_padding_left-h.strip_padding_right):(o.height(e),m.stripActiveSize=e-h.strip_padding_top-h.strip_padding_bottom),y(e),P(),function(){if(0==C())return!1;var e=u.getInnerStripPos(),t=u.fixInnerStripLimits(e);e!=t&&u.positionInnerStrip(t,!0)}(),function(){if(C())return!1;0==g?_.placeElement(a,h.strip_thumbs_align,0):_.placeElement(a,0,h.strip_thumbs_align)}(),function(){var e=d.getSelectedItem();if(null==e)return!0;var t=e.objThumbWrapper;t&&S(t)}(),s&&s.onResize()},this.setThumbUnselected=function(e){c.setThumbUnselected(e)},this.setCustomThumbs=function(e){c.setCustomThumbs(e)},this.________EXTERNAL_GETTERS___________=function(){},this.getObjects=function(){var t=c.getOptions(),i=jQuery.extend(h,t);return{g_gallery:d,g_objGallery:e,g_objWrapper:n,g_arrItems:r,g_objStrip:o,g_objStripInner:a,g_aviaControl:s,g_touchThumbsControl:l,isVertical:g,g_options:i,g_thumbs:c}},this.getObjThumbs=function(){return c},this.getSelectedThumb=function(){var e=d.getSelectedItemIndex();return-1==e?null:c.getThumbByIndex(e)},this.getSizeAndPosition=function(){return _.getElementSize(o)},this.getHeight=function(){return o.outerHeight()},this.getWidth=function(){return o.outerWidth()},this.getSizes=function(){return m},this.isVertical=function(){return g},this.isPlaced=function(){return p.is_placed},this.isMoveEnabled=function(){return C()}}function UGTouchThumbsControl(){var e,t,i,n,r,o,a=new UGFunctions,s={touch_portion_time:200,thumb_touch_slowFactor:0,minDeltaTime:70,minPath:10,limitsBreakAddition:30,returnAnimateSpeed:500,animationEasing:"easeOutCubic",returnAnimationEasing:"easeOutCubic"},l={touch_active:!1,loop_active:!1,mousePos:0,innerPos:0,startPos:0,startTime:0,lastTime:0,buttonReleaseTime:0,lastPos:0,lastPortionPos:0,lastDeltaTime:0,lastDeltaPos:0,speed:0,handle:"",touchEnabled:!1,isControlEnabled:!0};function u(){var e=jQuery.now(),t={};return t.passedTime=l.lastTime-l.startTime,t.lastActiveTime=e-l.buttonReleaseTime,t.passedDistance=l.lastPos-l.startPos,t.passedDistanceAbs=Math.abs(t.passedDistance),t}function d(e){return 0==o?a.getMousePosition(e).pageX:a.getMousePosition(e).pageY}function _(){var e=jQuery.now();e-l.lastTime>=s.touch_portion_time&&(l.lastDeltaTime=e-l.lastTime,l.lastDeltaTime>s.touch_portion_time&&(l.lastDeltaTime=s.touch_portion_time),l.lastDeltaPos=l.lastPos-l.lastPortionPos,l.lastPortionPos=l.lastPos,l.lastTime=e)}function g(){l.lastPos=e.getInnerStripPos(),e.triggerStripMoveEvent()}function c(t){if(0==l.loop_active)return!0;if(t){d(t);!function(){var t=s.thumb_touch_slowFactor,i=s.minDeltaTime,r=s.minPath,a=e.getInnerStripPos(),u=jQuery.now()-l.lastTime,d=a-l.lastPortionPos;u<i&&l.lastDeltaTime>0&&(u=l.lastDeltaTime,d=l.lastDeltaPos+d),u<i&&(u=i);var _=0;u>0&&(_=d/u);var c=_*_/(2*t)*(d>0?1:-1);Math.abs(c)<=r&&(c=0);var h=e.getInnerStripPos(),p=h+c,m=e.fixInnerStripLimits(p),f=e.getInnerStripLimits(),b=s.limitsBreakAddition,v=!1,y=m;if(p>f.maxPos&&(v=!0,m=b,p<b&&(m=p)),p<f.minPos){v=!0;var I=f.minPos-b;m=I,p>I&&(m=p)}var w=m-h,E=Math.abs(Math.round(_/t));if(0!=c&&(E=E*w/c),h!=m){var T={left:m+"px"};1==o&&(T={top:m+"px"}),n.animate(T,{duration:E,easing:s.animationEasing,queue:!0,progress:g})}if(1==v){var S=s.returnAnimateSpeed,P={left:y+"px"};1==o&&(P={top:y+"px"}),n.animate(P,{duration:S,easing:s.returnAnimationEasing,queue:!0,progress:g})}}()}l.loop_active=!1,l.handle=clearInterval(l.handle)}function h(e){return 0==l.isControlEnabled||(l.buttonReleaseTime=jQuery.now(),0==l.touch_active?(c(e),!0):(e.preventDefault(),l.touch_active=!1,c(e),void i.removeClass("ug-dragging")))}function p(t){if(0==l.isControlEnabled)return!0;t.preventDefault(),l.touch_active=!0;var r=d(t);n.stop(!0),function(t){var i=e.getInnerStripPos();l.mousePos=t,l.innerPos=i,l.lastPortionPos=i,l.lastDeltaTime=0,l.lastDeltaPos=0,l.startTime=jQuery.now(),l.startPos=l.innerPos,l.lastTime=l.startTime,l.lastPos=l.startPos,l.speed=0}(r),function(){if(1==l.loop_active)return!0;l.loop_active=!0,l.handle=setInterval(_,10)}(),i.addClass("ug-dragging")}function m(t){if(0==l.isControlEnabled)return!0;if(0==l.touch_active)return!0;if(t.preventDefault(),0==t.buttons)return l.touch_active=!1,c(t),!0;var i=d(t);l.lastPos=e.getInnerStripPos(),function(t){var i=l.mousePos-t,n=l.innerPos-i,r=e.getInnerStripLimits();if(n>r.maxPos){var o=n-r.maxPos;n=r.maxPos+o/3}n<r.minPos&&(o=r.minPos-n,n=r.minPos-o/3);e.positionInnerStrip(n)}(i),_()}this.enable=function(){l.isControlEnabled=!0},this.disable=function(){l.isControlEnabled=!1},this.init=function(l){e=l,t=l.getObjects(),t.g_gallery,t.g_objGallery,i=t.g_objStrip,n=t.g_objStripInner,r=t.g_options,o=t.isVertical,s.thumb_touch_slowFactor=a.normalizeSetting(5e-5,.01,1,100,r.strip_thumb_touch_sensetivity,!0),i.bind("mousedown touchstart",p),jQuery(window).add("body").bind("mouseup touchend",h),jQuery("body").bind("mousemove touchmove",m)},this.isSignificantPassed=function(){var e=u();return e.passedTime>300||e.passedDistanceAbs>30},this.isTouchActive=function(){return 1==l.touch_active||(1==n.is(":animated")||u().lastActiveTime<50)},this.destroy=function(){i.unbind("mousedown"),i.unbind("touchstart"),jQuery(window).add("body").unbind("mouseup").unbind("touchend"),jQuery("body").unbind("mousemove").unbind("touchmove")}}function UGPanelsBase(){var e,t,i,n,r,o,a,s=new UniteGalleryMain,l=this,u=new UGFunctions;function d(t,n){switch(e.orientation){case"right":case"left":var r={left:t+"px"};break;case"top":case"bottom":r={top:t+"px"}}i.stop(!0).animate(r,{duration:300,easing:"easeInOutQuad",queue:!1,complete:function(){n&&n()}})}function _(t){switch(e.orientation){case"right":case"left":u.placeElement(i,t,null);break;case"top":case"bottom":u.placeElement(i,null,t)}}function g(){r.trigger(t.events.FINISH_MOVE)}this.init=function(i,o,l,u,d){e=o,t=l,s=i,n=u,r=d,a=jQuery(s)},this.setHtml=function(r){if(i=r,"strip"==e.panelType)var a=n.strippanel_enable_handle;else a=n.gridpanel_enable_handle;if(1==a&&((o=new UGPanelHandle).init(t,i,n,e.panelType,s),o.setHtml()),!0===e.isDisabledAtStart){i.append("<div class='ug-overlay-disabled'></div>"),setTimeout(function(){i.children(".ug-overlay-disabled").hide()},e.disabledAtStartTimeout)}},this.placeElements=function(){o&&o.placeHandle()},this.initEvents=function(){o&&(o.initEvents(),a.on(s.events.SLIDER_ACTION_START,function(){o.hideHandle()}),a.on(s.events.SLIDER_ACTION_END,function(){o.showHandle()}))},this.destroy=function(){o&&(o.destroy(),a.off(s.events.SLIDER_ACTION_START),a.off(s.events.SLIDER_ACTION_END))},this.openPanel=function(n){if(!n)n=!1;return!i.is(":animated")&&(0!=e.isClosed&&(e.isClosed=!1,r.trigger(t.events.OPEN_PANEL),void(!1===n?d(e.originalPos,g):(_(e.originalPos),g()))))},this.closePanel=function(n){if(!n)n=!1;if(i.is(":animated"))return!1;if(1==e.isClosed)return!1;var o=l.getClosedPanelDest();e.isClosed=!0,r.trigger(t.events.CLOSE_PANEL),!1===n?d(o,g):(_(o),g())},this.setClosedState=function(i){e.originalPos=i,r.trigger(t.events.CLOSE_PANEL),e.isClosed=!0},this.setOpenedState=function(i){r.trigger(t.events.OPEN_PANEL),e.isClosed=!1},this.getClosedPanelDest=function(){var t,n=u.getElementSize(i);switch(e.orientation){case"left":e.originalPos=n.left,t=-e.panelWidth;break;case"right":e.originalPos=n.left,t=s.getSize().width;break;case"top":e.originalPos=n.top,t=-e.panelHeight;break;case"bottom":e.originalPos=n.top,t=s.getSize().height}return t},this.isPanelClosed=function(){return e.isClosed},this.setDisabledAtStart=function(t){if(t<=0)return!1;e.isDisabledAtStart=!0,e.disabledAtStartTimeout=t}}function UGPanelHandle(){var e,t,i,n=new UGFunctions,r={panel_handle_align:"top",panel_handle_offset:0,panel_handle_skin:0};function o(){i.removeClass("ug-button-hover")}function a(e){if(e.stopPropagation(),e.stopImmediatePropagation(),0==n.validateClickTouchstartEvent(e.type))return!0;t.isPanelClosed()?t.openPanel():t.closePanel()}this.init=function(i,n,o,a,s){switch(t=i,e=n,a){case"grid":r.panel_handle_align=o.gridpanel_handle_align,r.panel_handle_offset=o.gridpanel_handle_offset,r.panel_handle_skin=o.gridpanel_handle_skin;break;case"strip":r.panel_handle_align=o.strippanel_handle_align,r.panel_handle_offset=o.strippanel_handle_offset,r.panel_handle_skin=o.strippanel_handle_skin;break;default:throw new Error("Panel handle error: wrong panel type: "+a)}var l=s.getOptions().gallery_skin;""==r.panel_handle_skin&&(r.panel_handle_skin=l)},this.setHtml=function(){var n="ug-panel-handle-tip";switch(t.getOrientation()){case"right":n+=" ug-handle-tip-left";break;case"left":n+=" ug-handle-tip-right";break;case"bottom":n+=" ug-handle-tip-top";break;case"top":n+=" ug-handle-tip-bottom"}e.append("<div class='"+n+" ug-skin-"+r.panel_handle_skin+"'></div>"),i=e.children(".ug-panel-handle-tip")},this.initEvents=function(){n.addClassOnHover(i),i.bind("click touchstart",a),jQuery(t).on(t.events.OPEN_PANEL,function(){o(),i.removeClass("ug-button-closed")}),jQuery(t).on(t.events.CLOSE_PANEL,function(){o(),i.addClass("ug-button-closed")})},this.destroy=function(){n.destroyButton(i),jQuery(t).off(t.events.OPEN_PANEL),jQuery(t).off(t.events.CLOSE_PANEL)},this.placeHandle=function(){var e=n.getElementSize(i);!function(){switch(t.getOrientation()){case"right":case"left":"top"!=r.panel_handle_align&&"bottom"!=r.panel_handle_align&&(r.panel_handle_align="top");break;case"bottom":"left"!=r.panel_handle_align&&"right"!=r.panel_handle_align&&(r.panel_handle_align="left");break;case"top":"left"!=r.panel_handle_align&&"right"!=r.panel_handle_align&&(r.panel_handle_align="right")}}();var o=t.getOrientation();switch(o){case"left":n.placeElement(i,"right",r.panel_handle_align,-e.width);break;case"right":n.placeElement(i,-e.width,r.panel_handle_align,0,r.panel_handle_offset);break;case"top":n.placeElement(i,r.panel_handle_align,"bottom",r.panel_handle_offset,-e.height);break;case"bottom":n.placeElement(i,r.panel_handle_align,"top",r.panel_handle_offset,-e.height);break;default:throw new Error("Wrong panel orientation: "+o)}},this.hideHandle=function(){1==i.is(":visible")&&i.hide()},this.showHandle=function(){0==i.is(":visible")&&i.show()}}function UGStripPanel(){var e,t,i,n,r,o=this,a=jQuery(this),s=new UniteGalleryMain,l=new UGFunctions,u=new UGThumbsStrip,d=new UGPanelsBase;this.events={FINISH_MOVE:"gridpanel_move_finish",OPEN_PANEL:"open_panel",CLOSE_PANEL:"close_panel"};var _={strippanel_vertical_type:!1,strippanel_padding_top:8,strippanel_padding_bottom:8,strippanel_padding_left:0,strippanel_padding_right:0,strippanel_enable_buttons:!0,strippanel_buttons_skin:"",strippanel_padding_buttons:2,strippanel_buttons_role:"scroll_strip",strippanel_enable_handle:!0,strippanel_handle_align:"top",strippanel_handle_offset:0,strippanel_handle_skin:"",strippanel_background_color:""},g={strip_vertical_type:!0,strippanel_padding_left:8,strippanel_padding_right:8,strippanel_padding_top:0,strippanel_padding_bottom:0},c={strippanel_padding_left:8,strippanel_padding_right:8,strippanel_padding_top:8,strippanel_padding_bottom:8},h={panelType:"strip",panelWidth:0,panelHeight:0,isEventsInited:!1,isClosed:!1,orientation:null,originalPos:null,isFirstRun:!0};function p(){if(1==h.isFirstRun&&0==function(){if(0==_.strippanel_vertical_type){if(0==h.panelWidth)throw new Error("Strip panel error: The width not set, please set width")}else if(0==h.panelHeight)throw new Error("Strip panel error: The height not set, please set height");if(null==h.orientation)throw new Error("Wrong orientation, please set panel orientation before run");return!0}())return!1;u.run(),f(),b(),function(){if(1==h.isEventsInited)return!1;if(h.isEventsInited=!0,n)if(l.addClassOnHover(n,"ug-button-hover"),l.addClassOnHover(r,"ug-button-hover"),l.setButtonOnClick(r,y),l.setButtonOnClick(n,v),"advance_item"!=_.strippanel_buttons_role)jQuery(u).on(u.events.STRIP_MOVE,w),jQuery(u).on(u.events.INNER_SIZE_CHANGE,I),e.on(s.events.SIZE_CHANGE,I);else{var t=s.getOptions();0==t.gallery_carousel&&jQuery(s).on(s.events.ITEM_CHANGE,E)}d.initEvents()}(),h.isFirstRun=!1,I()}function m(e){if(!e)e=t;if(e.append("<div class='ug-strip-panel'></div>"),i=e.children(".ug-strip-panel"),1==_.strippanel_enable_buttons){var o="ug-strip-arrow-left",a="ug-strip-arrow-right";1==_.strippanel_vertical_type&&(o="ug-strip-arrow-up",a="ug-strip-arrow-down"),i.append("<div class='ug-strip-arrow "+o+" ug-skin-"+_.strippanel_buttons_skin+"'><div class='ug-strip-arrow-tip'></div></div>"),i.append("<div class='ug-strip-arrow "+a+" ug-skin-"+_.strippanel_buttons_skin+"'><div class='ug-strip-arrow-tip'></div></div>")}d.setHtml(i),u.setHtml(i),1==_.strippanel_enable_buttons&&(r=i.children("."+o),n=i.children("."+a)),""!=_.strippanel_background_color&&i.css("background-color",_.strippanel_background_color)}function f(){0==_.strippanel_vertical_type?function(){var e=u.getHeight(),t=h.panelWidth;if(n){r.height(e),n.height(e);var o=r.children(".ug-strip-arrow-tip");l.placeElement(o,"center","middle");var a=n.children(".ug-strip-arrow-tip");l.placeElement(a,"center","middle")}var s=e+_.strippanel_padding_top+_.strippanel_padding_bottom;i.width(t),i.height(s),h.panelHeight=s;var d=t-_.strippanel_padding_left-_.strippanel_padding_right;n&&(d=d-2*n.outerWidth()-2*_.strippanel_padding_buttons),u.resize(d)}():function(){var e=u.getWidth(),t=h.panelHeight;if(n){r.width(e),n.width(e);var o=r.children(".ug-strip-arrow-tip");l.placeElement(o,"center","middle");var a=n.children(".ug-strip-arrow-tip");l.placeElement(a,"center","middle")}var s=e+_.strippanel_padding_left+_.strippanel_padding_right;i.width(s),i.height(t),h.panelWidth=s;var d=t-_.strippanel_padding_top-_.strippanel_padding_bottom;n&&(d=d-2*n.outerHeight()-2*_.strippanel_padding_buttons),u.resize(d)}()}function b(){0==_.strippanel_vertical_type?function(){n&&(l.placeElement(r,"left","top",_.strippanel_padding_left,_.strippanel_padding_top),l.placeElement(n,"right","top",_.strippanel_padding_right,_.strippanel_padding_top));var e=_.strippanel_padding_left;n&&(e+=n.outerWidth()+_.strippanel_padding_buttons),u.setPosition(e,_.strippanel_padding_top)}():function(){n&&(l.placeElement(r,"left","top",_.strippanel_padding_left,_.strippanel_padding_top),l.placeElement(n,"left","bottom",_.strippanel_padding_left,_.strippanel_padding_bottom));var e=_.strippanel_padding_top;n&&(e+=n.outerHeight()+_.strippanel_padding_buttons),u.setPosition(_.strippanel_padding_left,e)}(),d.placeElements()}function v(e){if(l.isButtonDisabled(e))return!0;"advance_item"==_.strippanel_buttons_role?s.nextItem():u.scrollForeward()}function y(e){if(l.isButtonDisabled(e))return!0;"advance_item"==_.strippanel_buttons_role?s.prevItem():u.scrollBack()}function I(){if(!n)return!0;if(0==u.isMoveEnabled())return l.disableButton(r),l.disableButton(n),!0;var e=u.getInnerStripLimits(),t=u.getInnerStripPos();t>=e.maxPos?l.disableButton(r):l.enableButton(r),t<=e.minPos?l.disableButton(n):l.enableButton(n)}function w(){I()}function E(){s.isLastItem()?l.disableButton(n):l.enableButton(n),s.isFirstItem()?l.disableButton(r):l.enableButton(r)}this.destroy=function(){n&&(l.destroyButton(n),l.destroyButton(r),jQuery(u).off(u.events.STRIP_MOVE),jQuery(s).off(s.events.ITEM_CHANGE),jQuery(s).off(s.events.SIZE_CHANGE)),d.destroy(),u.destroy()},this.getOrientation=function(){return h.orientation},this.setOrientation=function(e){h.orientation=e},this.init=function(i,n){!function(i,n){s=i,e=jQuery(s);var r=!1;1==(_=jQuery.extend(_,n)).strippanel_vertical_type&&(_=jQuery.extend(_,g),r=!0),0==_.strippanel_enable_buttons&&(_=jQuery.extend(_,c),r=!0),1==r&&(_=jQuery.extend(_,n));var l=s.getOptions().gallery_skin;""==_.strippanel_buttons_skin&&(_.strippanel_buttons_skin=l),t=s.getElement(),d.init(s,h,o,_,a),(u=new UGThumbsStrip).init(s,_)}(i,n)},this.run=function(){p()},this.setHtml=function(e){m(e)},this.getElement=function(){return i},this.getSize=function(){return l.getElementSize(i)},this.setWidth=function(e){h.panelWidth=e},this.setHeight=function(e){h.panelHeight=e},this.resize=function(e){o.setWidth(e),f(),b()},this.__________Functions_From_Base_____=function(){},this.isPanelClosed=function(){return d.isPanelClosed()},this.getClosedPanelDest=function(){return d.getClosedPanelDest()},this.openPanel=function(e){d.openPanel(e)},this.closePanel=function(e){d.closePanel(e)},this.setOpenedState=function(e){d.setOpenedState(e)},this.setClosedState=function(e){d.setClosedState(e)},this.setCustomThumbs=function(e){u.setCustomThumbs(e)},this.setDisabledAtStart=function(e){d.setDisabledAtStart(e)}}function UGGridPanel(){var e,t,i,n,r=this,o=jQuery(this),a=new UniteGalleryMain,s=new UGFunctions,l=new UGThumbsGrid,u=new UGPanelsBase;this.events={FINISH_MOVE:"gridpanel_move_finish",OPEN_PANEL:"open_panel",CLOSE_PANEL:"close_panel"};var d={gridpanel_vertical_scroll:!0,gridpanel_grid_align:"middle",gridpanel_padding_border_top:10,gridpanel_padding_border_bottom:4,gridpanel_padding_border_left:10,gridpanel_padding_border_right:10,gridpanel_arrows_skin:"",gridpanel_arrows_align_vert:"middle",gridpanel_arrows_padding_vert:4,gridpanel_arrows_align_hor:"center",gridpanel_arrows_padding_hor:10,gridpanel_space_between_arrows:20,gridpanel_arrows_always_on:!1,gridpanel_enable_handle:!0,gridpanel_handle_align:"top",gridpanel_handle_offset:0,gridpanel_handle_skin:"",gridpanel_background_color:""},_={gridpanel_grid_align:"middle",gridpanel_padding_border_top:2,gridpanel_padding_border_bottom:2},g={gridpanel_grid_align:"center"},c={panelType:"grid",isHorType:!1,arrowsVisible:!1,panelHeight:0,panelWidth:0,originalPosX:null,isEventsInited:!1,isClosed:!1,orientation:null};function h(){if(null==c.orientation)throw new Error("Wrong orientation, please set panel orientation before run")}function p(){h(),"center"==d.gridpanel_grid_align&&(d.gridpanel_grid_align="middle"),l.run(),function(){var e=!1;if(1==d.gridpanel_arrows_always_on)e=!0;else{var t=l.getNumPanes();t>1&&(e=!0)}1==e?(i.show().fadeTo(0,1),n.show().fadeTo(0,1),c.arrowsVisible=!0):(i.hide(),n.hide(),c.arrowsVisible=!1)}(),function(){var e=l.getSize();1==c.isHorType?c.panelHeight=e.height+d.gridpanel_padding_border_top+d.gridpanel_padding_border_bottom:c.panelWidth=e.width+d.gridpanel_padding_border_left+d.gridpanel_padding_border_right;s.setElementSize(t,c.panelWidth,c.panelHeight)}(),function(){0==c.isHorType?1==d.gridpanel_vertical_scroll?1==c.arrowsVisible?function(){var e,t,r,o,a=s.getElementSize(n),u=l.getSize();switch(d.gridpanel_grid_align){default:case"top":e=d.gridpanel_padding_border_top+a.height+d.gridpanel_arrows_padding_vert;break;case"middle":e="middle";break;case"bottom":e=c.panelHeight-u.height-a.height-d.gridpanel_padding_border_bottom-d.gridpanel_arrows_padding_vert}var _=f(),g=l.getElement();s.placeElement(g,_,e);var u=l.getSize();switch(d.gridpanel_arrows_align_vert){default:case"center":case"middle":t=(u.top-a.height)/2,r=u.bottom+(c.panelHeight-u.bottom-a.height)/2,o=0;break;case"grid":t=u.top-a.height-d.gridpanel_arrows_padding_vert_vert,r=u.bottom+d.gridpanel_arrows_padding_vert,o=0;break;case"border":case"borders":t=d.gridpanel_padding_border_top,r="bottom",o=d.gridpanel_padding_border_bottom}s.placeElement(n,"center",t),s.placeElement(i,"center",r,0,o)}():b():1==c.arrowsVisible?function(){var e,t,r,o=s.getElementSize(n),a=l.getSize(),u=d.gridpanel_padding_border_top;switch(d.gridpanel_grid_align){case"middle":switch(d.gridpanel_arrows_align_vert){default:var _=a.height+d.gridpanel_arrows_padding_vert+o.height;u=(c.panelHeight-_)/2;break;case"border":case"borders":var g=c.panelHeight-o.height-d.gridpanel_padding_border_bottom;u=(g-a.height)/2}break;case"bottom":var _=a.height+o.height+d.gridpanel_arrows_padding_vert;u=c.panelHeight-_-d.gridpanel_padding_border_bottom}var h=l.getElement(),p=f();s.placeElement(h,p,u);var a=l.getSize();switch(d.gridpanel_arrows_align_vert){default:case"center":case"middle":e=a.bottom+(c.panelHeight-a.bottom-o.height)/2,r=0;break;case"grid":e=a.bottom+d.gridpanel_arrows_padding_vert,r=0;break;case"border":case"borders":e="bottom",r=d.gridpanel_padding_border_bottom}t=-o.width/2-d.gridpanel_space_between_arrows/2,s.placeElement(n,"center",e,t,r);var m=Math.abs(t);s.placeElement(i,"center",e,m,r)}():b():1==c.arrowsVisible?function(){var e,t,r,o,a=s.getElementSize(n),u=l.getSize();switch(d.gridpanel_grid_align){default:case"left":e=d.gridpanel_padding_border_left+d.gridpanel_arrows_padding_hor+a.width;break;case"middle":case"center":e="center";break;case"right":e=c.panelWidth-u.width-a.width-d.gridpanel_padding_border_right-d.gridpanel_arrows_padding_hor}var _=l.getElement();switch(s.placeElement(_,e,d.gridpanel_padding_border_top),u=l.getSize(),d.gridpanel_arrows_align_vert){default:case"center":case"middle":o=(u.height-a.height)/2+u.top;break;case"top":o=d.gridpanel_padding_border_top+d.gridpanel_arrows_padding_vert;break;case"bottom":o=c.panelHeight-d.gridpanel_padding_border_bottom-d.gridpanel_arrows_padding_vert-a.height}switch(d.gridpanel_arrows_align_hor){default:case"borders":t=d.gridpanel_padding_border_left,r=c.panelWidth-d.gridpanel_padding_border_right-a.width;break;case"grid":t=u.left-d.gridpanel_arrows_padding_hor-a.width,r=u.right+d.gridpanel_arrows_padding_hor;break;case"center":t=(u.left-a.width)/2,r=u.right+(c.panelWidth-u.right-a.width)/2}s.placeElement(n,t,o),s.placeElement(i,r,o)}():function(){var e,t=l.getSize();switch(d.gridpanel_grid_align){default:case"left":e=d.gridpanel_padding_border_left;break;case"middle":case"center":e="center";break;case"right":e=c.panelWidth-t.width-d.gridpanel_padding_border_right}var i=l.getElement();s.placeElement(i,e,d.gridpanel_padding_border_top)}();u.placeElements()}(),function(){if(1==c.isEventsInited)return!1;c.isEventsInited=!0,n&&(s.addClassOnHover(n),l.attachPrevPaneButton(n));i&&(s.addClassOnHover(i),l.attachNextPaneButton(i));u.initEvents()}()}function m(){e.append("<div class='ug-grid-panel'></div>"),t=e.children(".ug-grid-panel"),c.isHorType?(t.append("<div class='grid-arrow grid-arrow-left-hortype ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),t.append("<div class='grid-arrow grid-arrow-right-hortype ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),n=t.children(".grid-arrow-left-hortype"),i=t.children(".grid-arrow-right-hortype")):0==d.gridpanel_vertical_scroll?(t.append("<div class='grid-arrow grid-arrow-left ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),t.append("<div class='grid-arrow grid-arrow-right ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),n=t.children(".grid-arrow-left"),i=t.children(".grid-arrow-right")):(t.append("<div class='grid-arrow grid-arrow-up ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),t.append("<div class='grid-arrow grid-arrow-down ug-skin-"+d.gridpanel_arrows_skin+"'></div>"),n=t.children(".grid-arrow-up"),i=t.children(".grid-arrow-down")),u.setHtml(t),n.fadeTo(0,0),i.fadeTo(0,0),l.setHtml(t),""!=d.gridpanel_background_color&&t.css("background-color",d.gridpanel_background_color)}function f(){return d.gridpanel_padding_border_left}function b(){var e=d.gridpanel_grid_align,t=0;switch(e){case"top":t=d.gridpanel_padding_border_top;break;case"bottom":t=d.gridpanel_padding_border_bottom}var i=f(),n=l.getElement();s.placeElement(n,i,e,0,t)}this.destroy=function(){n&&s.destroyButton(n),i&&s.destroyButton(i),u.destroy(),l.destroy()},this.getOrientation=function(){return c.orientation},this.setOrientation=function(e){switch(c.orientation=e,e){case"right":case"left":c.isHorType=!1;break;case"top":case"bottom":c.isHorType=!0;break;default:throw new Error("Wrong grid panel orientation: "+e)}},this.setHeight=function(e){if(1==c.isHorType)throw new Error("setHeight is not appliable to this orientatio ("+c.orientation+"). Please use setWidth");c.panelHeight=e;var t,n,r=(t=d.gridpanel_padding_border_top+d.gridpanel_padding_border_bottom,n=c.panelHeight-t,0==d.gridpanel_arrows_always_on&&1==l.getNumPanesEstimationByHeight(n)?n:(t=s.getElementSize(i).height+d.gridpanel_arrows_padding_vert,1==d.gridpanel_vertical_scroll&&(t*=2),t+=d.gridpanel_padding_border_top+d.gridpanel_padding_border_bottom,n=c.panelHeight-t));l.setMaxHeight(r)},this.setWidth=function(e){if(0==c.isHorType)throw new Error("setWidth is not appliable to this orientatio ("+c.orientation+"). Please use setHeight");c.panelWidth=e;var t,n,r=(t=d.gridpanel_padding_border_left+d.gridpanel_padding_border_right,n=c.panelWidth-t,0==d.gridpanel_arrows_always_on&&1==l.getNumPanesEstimationByWidth(n)?n:(t+=2*(s.getElementSize(i).width+d.gridpanel_arrows_padding_hor),n=c.panelWidth-t));l.setMaxWidth(r)},this.init=function(t,i){!function(t,i){a=t,h(),i&&i.vertical_scroll&&(d.gridpanel_vertical_scroll=i.vertical_scroll),d=jQuery.extend(d,i),1==c.isHorType?(d=jQuery.extend(d,g),d=jQuery.extend(d,i)):1==d.gridpanel_vertical_scroll&&(d=jQuery.extend(d,_),(d=jQuery.extend(d,i)).grid_panes_direction="bottom");var n=a.getOptions().gallery_skin;""==d.gridpanel_arrows_skin&&(d.gridpanel_arrows_skin=n);var s=t.getObjects();e=s.g_objWrapper,u.init(a,c,r,d,o),(l=new UGThumbsGrid).init(a,d)}(t,i)},this.setHtml=function(){m()},this.run=function(){p()},this.getElement=function(){return t},this.getSize=function(){return s.getElementSize(t)},this.__________Functions_From_Base_____=function(){},this.isPanelClosed=function(){return u.isPanelClosed()},this.getClosedPanelDest=function(){return u.getClosedPanelDest()},this.openPanel=function(e){u.openPanel(e)},this.closePanel=function(e){u.closePanel(e)},this.setOpenedState=function(e){u.setOpenedState(e)},this.setClosedState=function(e){u.setClosedState(e)},this.setDisabledAtStart=function(e){u.setDisabledAtStart(e)}}function UGThumbsGrid(){var e,t,n,r,o,a,s=this,l=jQuery(this),u=new UniteGalleryMain,d=new UGFunctions,_=new UGThumbsGeneral,g=new UGTileDesign,c={grid_panes_direction:"left",grid_num_cols:2,grid_min_cols:2,grid_num_rows:2,grid_space_between_cols:10,grid_space_between_rows:10,grid_space_between_mobile:10,grid_transition_duration:300,grid_transition_easing:"easeInOutQuad",grid_carousel:!1,grid_padding:0,grid_vertical_scroll_ondrag:!1};this.events={PANE_CHANGE:"pane_change"};var h={eventSizeChange:"thumb_size_change",isHorizontal:!1,isMaxHeight:!1,isMaxWidth:!1,gridHeight:0,gridWidth:0,innerWidth:0,innerHeight:0,numPanes:0,arrPanes:0,numThumbs:0,currentPane:0,numThumbsInPane:0,isNavigationVertical:!1,touchActive:!1,startScrollPos:0,isFirstTimeRun:!0,isTilesMode:!1,storedEventID:"thumbsgrid",tileMaxWidth:null,tileMaxHeight:null,spaceBetweenCols:null,spaceBetweenRows:null};function p(i,o,a){var l;if(t=i.getObjects(),(u=i).attachThumbsPanel("grid",s),e=jQuery(i),n=t.g_objWrapper,r=t.g_arrItems,!0===a&&(h.isTilesMode=!0),h.numThumbs=r.length,l=o,c=jQuery.extend(c,l),_.setOptions(l),h.isNavigationVertical="top"==c.grid_panes_direction||"bottom"==c.grid_panes_direction,h.spaceBetweenCols=c.grid_space_between_cols,h.spaceBetweenRows=c.grid_space_between_rows,1==h.isTilesMode){g.setFixedMode(),g.setApproveClickFunction(j),g.init(i,c);var d=g.getOptions();h.tileMaxHeight=d.tile_height,h.tileMaxWidth=d.tile_width,_=g.getObjThumbs()}else o.thumb_fixed_size=!0,_.init(i,o)}function m(){var t=u.getSelectedItem();(function(){if(0==h.isHorizontal){if(0==h.gridHeight)throw new Error("You must set height before run.")}else if(0==h.gridWidth)throw new Error("You must set width before run.")}(),1==h.isFirstTimeRun)?(!function(){if(0==h.isTilesMode){_.initEvents();var t=o.find(".ug-thumb-wrapper");t.on("click touchend",C),e.on(u.events.ITEM_CHANGE,z)}else g.initEvents();o.bind("mousedown touchstart",A),jQuery("body").bind("mousemove touchmove",M),jQuery(window).add("body").bind("mouseup touchend",O)}(),1==h.isTilesMode?(b(),v(),g.run()):(_.setHtmlProperties(),v(),_.loadThumbsImages())):1==h.isTilesMode&&1==b()&&(v(),g.run());if(0==h.isHorizontal?h.isNavigationVertical?function(){var e=a.children(".ug-thumb-wrapper"),t=0,n=0,r=0,s=0,l=0,u=0;h.innerWidth=0,h.numPanes=1,h.arrPanes=[],h.numThumbsInPane=0,h.arrPanes.push(l);var _=e.length;for(i=0;i<_;i++){var g=jQuery(e[i]);d.placeElement(g,t,n);var p=g.outerWidth(),m=g.outerHeight();t+=p+h.spaceBetweenCols;var f=n+m;f>r&&(r=f),++s>=c.grid_num_cols&&(n+=m+h.spaceBetweenRows,t=l,s=0),1==h.numPanes&&h.numThumbsInPane++,f=n+m;var b=u+h.gridHeight;f>b&&(1==h.isMaxHeight&&1==h.numPanes&&(h.gridHeight=r,o.height(h.gridHeight),b=h.gridHeight),n=b+h.spaceBetweenRows,u=n,t=l=0,s=0,i<_-1&&(h.numPanes++,h.arrPanes.push(n)))}a.height(r),h.innerHeight=r,1==h.isMaxHeight&&1==h.numPanes&&(h.gridHeight=r,o.height(r))}():function(){var e=a.children(".ug-thumb-wrapper"),t=0,n=0,r=0,s=0,l=0,u=0;h.innerWidth=0,h.numPanes=1,h.arrPanes=[],h.numThumbsInPane=0,h.arrPanes.push(s);var _=e.length;for(i=0;i<_;i++){var g=jQuery(e[i]);d.placeElement(g,t,n);var p=g.outerWidth(),m=g.outerHeight();t>l&&(l=t);var f=n+m;f>u&&(u=f);var b=l+p;b>h.innerWidth&&(h.innerWidth=b),t+=p+h.spaceBetweenCols,++r>=c.grid_num_cols&&(n+=m+h.spaceBetweenRows,t=s,r=0),1==h.numPanes&&h.numThumbsInPane++,n+m>h.gridHeight&&(n=0,s=h.innerWidth+h.spaceBetweenCols,t=s,r=0,1==h.isMaxHeight&&1==h.numPanes&&(h.gridHeight=u,o.height(h.gridHeight)),i<_-1&&(h.numPanes++,h.arrPanes.push(s)))}a.width(h.innerWidth),1==h.isMaxHeight&&1==h.numPanes&&(h.gridHeight=u,o.height(u))}():function(){var e=a.children(".ug-thumb-wrapper"),t=c.grid_padding,n=c.grid_padding,r=n,s=t,l=0,u=0,_=0,g=0,p=0;h.innerWidth=0,h.numPanes=1,h.arrPanes=[],h.numThumbsInPane=0,h.arrPanes.push(t-c.grid_padding);var m=e.length;for(i=0;i<m;i++){var f=jQuery(e[i]),b=f.outerWidth(),v=f.outerHeight();s-t+b>h.gridWidth&&(r=0,++p>=c.grid_num_rows?(p=0,t=s,r=n,_=0,1==h.numPanes&&(h.gridWidth=l+c.grid_padding,o.width(h.gridWidth),h.gridHeight=g+c.grid_padding,o.height(h.gridHeight)),h.numPanes++,h.arrPanes.push(t-c.grid_padding)):(s=t,r=_+h.spaceBetweenRows)),d.placeElement(f,s,r);var y=s+b;y>l&&(l=y);var I=r+v;I>_&&(_=I),I>g&&(g=I),I>u&&(u=I);var y=l+b;y>h.innerWidth&&(h.innerWidth=y),s+=b+h.spaceBetweenCols,1==h.numPanes&&h.numThumbsInPane++}h.innerWidth=l+c.grid_padding,h.innerHeight=g+c.grid_padding,a.width(h.innerWidth),a.height(h.innerHeight),1==h.numPanes&&(h.gridWidth=l+c.grid_padding,h.gridHeight=g+c.grid_padding,o.width(h.gridWidth),o.height(h.gridHeight))}(),1==h.isFirstTimeRun&&h.isTilesMode){var r=_.getThumbs();r.each(function(e,t){n.trigger(h.eventSizeChange,jQuery(t))}),r.fadeTo(0,1)}null!=t&&y(t.index),l.trigger(s.events.PANE_CHANGE,h.currentPane),h.isFirstTimeRun=!1}function f(){if(1==h.isTilesMode)var e=g.getGlobalTileSize();else e=_.getGlobalThumbSize();return e}function b(){if(0==h.isTilesMode)throw new Error("Dynamic size can be set only in tiles mode");var e=!1,t=u.isMobileMode(),i=h.spaceBetweenCols;1==t?(h.spaceBetweenCols=c.grid_space_between_mobile,h.spaceBetweenRows=c.grid_space_between_mobile):(h.spaceBetweenCols=c.grid_space_between_cols,h.spaceBetweenRows=c.grid_space_between_rows),h.spaceBetweenCols!=i&&(e=!0);var n=f().width,r=h.tileMaxWidth;return d.getNumItemsInSpace(h.gridWidth,h.tileMaxWidth,h.spaceBetweenCols)<c.grid_min_cols&&(r=d.getItemSizeInSpace(h.gridWidth,c.grid_min_cols,h.spaceBetweenCols)),g.setTileSizeOptions(r),r!=n&&(e=!0),e}function v(){var e,t,i;0==h.isHorizontal?(e=f().width,t=c.grid_num_cols*e+(c.grid_num_cols-1)*h.spaceBetweenCols+2*c.grid_padding,i=h.gridHeight,h.gridWidth=t,d.setElementSize(o,t,i),d.setElementSize(a,t,i),h.innerWidth=t,h.innerHeight=i):function(){var e=f().height,t=h.gridWidth,i=c.grid_num_rows*e+(c.grid_num_rows-1)*h.spaceBetweenRows+2*c.grid_padding;h.gridHeight=i,d.setElementSize(o,t,i),d.setElementSize(a,t,i),h.innerWidth=t,h.innerHeight=i}()}function y(e){var t=P(e);if(-1==t)return!1;s.gotoPane(t,"scroll")}function I(e){if(e>=h.numPanes||e<0)throw new Error("Pane "+index+" doesn't exists.");return!0}function w(e){var t=T(e);if(0==t)return!1;a.stop(!0).animate(t,{duration:c.grid_transition_duration,easing:c.grid_transition_easing,queue:!1})}function E(){w(-h.arrPanes[h.currentPane])}function T(e){var t={};return 1==h.isNavigationVertical?t.top=e+"px":t.left=e+"px",t}function S(){var e=d.getElementSize(a);return 1==h.isNavigationVertical?e.top:e.left}function P(e){return 0==function(e){if(e<0||e>=h.numThumbs)throw new Error("Thumb not exists: "+e);return!0}(e)?-1:Math.floor(e/h.numThumbsInPane)}function x(){var e=d.getStoredEventData(h.storedEventID),t=S();diffPos=Math.abs(e.startInnerPos-t);var i=1==h.isNavigationVertical?h.gridHeight:h.gridWidth,n=Math.round(3*i/8);return diffPos>=n||e.diffTime<300&&diffPos>25}function j(){return 1==h.numPanes||d.isApproveStoredEventClick(h.storedEventID,h.isNavigationVertical)}function C(e){if(1==function(){if(1==h.numPanes)return!1;var e=d.getStoredEventData(h.storedEventID),t=e.diffTime,i=S(),n=Math.abs(i-e.startInnerPos);return n>30||n>5&&t>300}())return!0;var t=jQuery(this),i=_.getItemByThumb(t);u.selectItem(i)}function A(e){if(1==h.numPanes)return!0;if(1==h.touchActive)return!0;0==h.isTilesMode&&e.preventDefault(),h.touchActive=!0;var t={startInnerPos:S()};d.storeEventData(e,h.storedEventID,t)}function M(e){if(0==h.touchActive)return!0;e.preventDefault(),d.updateStoredEventData(e,h.storedEventID);var t=d.getStoredEventData(h.storedEventID,h.isNavigationVertical);if(0!=c.grid_vertical_scroll_ondrag&&1!=h.isNavigationVertical&&"vert"===d.handleScrollTop(h.storedEventID))return!0;var i=t.diffMousePos,n=t.startInnerPos+i,r=i>0?"prev":"next",o=h.arrPanes[h.numPanes-1];0==c.grid_carousel&&n>0&&"prev"==r&&(n/=3),0==c.grid_carousel&&n<-o&&"next"==r&&(n=t.startInnerPos+i/3),function(e){var t=T(e);if(0==t)return!1;a.css(t)}(n)}function O(e){if(0==h.touchActive)return!0;d.updateStoredEventData(e,h.storedEventID);var t=d.getStoredEventData(h.storedEventID,h.isNavigationVertical);if(h.touchActive=!1,0==x())return E(),!0;"next"==(S()-t.startInnerPos>0?"prev":"next")?0==c.grid_carousel&&s.isLastPane()?E():s.nextPane():0==c.grid_carousel&&s.isFirstPane()?E():s.prevPane()}function z(){var e=u.getSelectedItem();_.setThumbSelected(e.objThumbWrapper),y(e.index)}this.destroy=function(){if(0==h.isTilesMode){var t=o.find(".ug-thumb-wrapper");t.off("click"),t.off("touchend"),e.on(u.events.ITEM_CHANGE),_.destroy()}else g.destroy();o.unbind("mousedown"),o.unbind("touchstart"),jQuery("body").unbind("mousemove"),jQuery("body").unbind("touchmove"),jQuery(window).add("body").unbind("touchend"),jQuery(window).add("body").unbind("mouseup"),l.off(s.events.PANE_CHANGE)},this.__________EXTERNAL_GENERAL_________=function(){},this.setThumbUnselected=function(e){_.setThumbUnselected(e)},this.isItemThumbVisible=function(e){return P(e.index)==h.currentPane},this.__________EXTERNAL_API_________=function(){},this.getNumPanesEstimationByHeight=function(e){if(1==h.isTilesMode)var t=c.tile_height;else t=_.getOptions().thumb_height;var i=_.getNumThumbs(),n=Math.ceil(i/c.grid_num_cols),r=n*t+(n-1)*h.spaceBetweenRows;return Math.ceil(r/e)},this.getNumPanesEstimationByWidth=function(e){if(h.isTilesMode)var t=c.tile_width;else t=_.getOptions().thumb_width;var i=_.getNumThumbs(),n=Math.ceil(i/c.grid_num_rows),r=n*t+(n-1)*h.spaceBetweenCols;return Math.ceil(r/e)},this.getHeightEstimationByWidth=function(e){if(0==h.isTilesMode)throw new Error("This function works only with tiles mode");var t=_.getNumThumbs(),i=d.getNumItemsInSpace(e,c.tile_width,h.spaceBetweenCols),n=Math.ceil(t/i);n>c.grid_num_rows&&(n=c.grid_num_rows);var r=d.getSpaceByNumItems(n,c.tile_height,h.spaceBetweenRows);return r+=2*c.grid_padding},this.getElement=function(){return o},this.getSize=function(){return d.getElementSize(o)},this.getNumPanes=function(){return h.numPanes},this.isFirstPane=function(){return 0==h.currentPane},this.isLastPane=function(){return h.currentPane==h.numPanes-1},this.getPaneInfo=function(){return{pane:h.currentPane,total:h.numPanes}},this.getPane=function(){return h.currentPane},this.setWidth=function(e){h.gridWidth=e,h.isHorizontal=!0},this.setMaxWidth=function(e){h.gridWidth=e,h.isMaxWidth=!0,h.isHorizontal=!0},this.setHeight=function(e){h.gridHeight=e,h.isHorizontal=!1},this.setMaxHeight=function(e){h.gridHeight=e,h.isMaxHeight=!0,h.isHorizontal=!1},this.gotoPane=function(e,t){if(0==I(e))return!1;if(e==h.currentPane)return!1;var i=-h.arrPanes[e];h.currentPane=e,w(i),l.trigger(s.events.PANE_CHANGE,e)},this.nextPane=function(){var e=h.currentPane+1;if(e>=h.numPanes){if(0==c.grid_carousel)return!0;e=0}s.gotoPane(e,"next")},this.prevPane=function(){var e=h.currentPane-1;if(e<0&&(e=h.numPanes-1,0==c.grid_carousel))return!1;s.gotoPane(e,"prev")},this.attachNextPaneButton=function(e){if(d.setButtonOnClick(e,s.nextPane),1==c.grid_carousel)return!0;s.isLastPane()&&e.addClass("ug-button-disabled"),l.on(s.events.PANE_CHANGE,function(){s.isLastPane()?e.addClass("ug-button-disabled"):e.removeClass("ug-button-disabled")})},this.attachPrevPaneButton=function(e){if(d.setButtonOnClick(e,s.prevPane),1==c.grid_carousel)return!0;s.isFirstPane()&&e.addClass("ug-button-disabled"),l.on(s.events.PANE_CHANGE,function(){s.isFirstPane()?e.addClass("ug-button-disabled"):e.removeClass("ug-button-disabled")})},this.attachBullets=function(e){e.setActive(h.currentPane),jQuery(e).on(e.events.BULLET_CLICK,function(t,i){s.gotoPane(i,"theme"),e.setActive(i)}),jQuery(s).on(s.events.PANE_CHANGE,function(t,i){e.setActive(i)})},this.getObjTileDesign=function(){return g},this.init=function(e,t,i){p(e,t,i)},this.run=function(){m()},this.setHtml=function(e){!function(e){var t=n;e&&(t=e),t.append("<div class='ug-thumbs-grid'><div class='ug-thumbs-grid-inner'></div></div>"),o=t.children(".ug-thumbs-grid"),a=o.children(".ug-thumbs-grid-inner"),1==h.isTilesMode?g.setHtml(a):_.setHtmlThumbs(a)}(e)}}function UGTileDesign(){var e,t,i=this,n=jQuery(this),r=new UniteGalleryMain,o=new UGFunctions,a=new UGThumbsGeneral;this.resizemode={FULL:"full",WRAPPER_ONLY:"wrapper_only",VISIBLE_ELEMENTS:"visible_elements"},this.sizeby={GLOBAL_RATIO:"global_ratio",TILE_RATIO:"tile_ratio",IMAGE_RATIO:"image_ratio",CUSTOM:"custom"},this.events={TILE_CLICK:"tile_click"};var s={tile_width:250,tile_height:200,tile_size_by:i.sizeby.IMAGE_RATIO,tile_visible_before_image:!1,tile_enable_background:!0,tile_background_color:"#F0F0F0",tile_enable_border:!1,tile_border_width:3,tile_border_color:"#F0F0F0",tile_border_radius:0,tile_enable_outline:!1,tile_outline_color:"#8B8B8B",tile_enable_shadow:!1,tile_shadow_h:1,tile_shadow_v:1,tile_shadow_blur:3,tile_shadow_spread:2,tile_shadow_color:"#8B8B8B",tile_enable_action:!0,tile_as_link:!1,tile_link_newpage:!0,tile_enable_overlay:!0,tile_overlay_opacity:.4,tile_overlay_color:"#000000",tile_enable_icons:!0,tile_show_link_icon:!1,tile_videoplay_icon_always_on:"never",tile_space_between_icons:26,tile_enable_image_effect:!1,tile_image_effect_type:"bw",tile_image_effect_reverse:!1,tile_enable_textpanel:!1,tile_textpanel_source:"title",tile_textpanel_always_on:!1,tile_textpanel_appear_type:"slide",tile_textpanel_position:"inside_bottom",tile_textpanel_offset:0},l={thumb_color_overlay_effect:!0,thumb_overlay_reverse:!0,thumb_image_overlay_effect:!1,tile_textpanel_enable_description:!1,tile_textpanel_bg_opacity:.6,tile_textpanel_padding_top:8,tile_textpanel_padding_bottom:8},u={ratioByHeight:0,ratioByWidth:0,eventSizeChange:"thumb_size_change",funcCustomTileHtml:null,funcCustomPositionElements:null,funcParentApproveClick:null,isSaparateIcons:!1,tileInnerReduce:0,isTextpanelOutside:!1,hasImageContainer:!1,isVideoplayIconAlwaysOn:!1,isTextPanelHidden:!1};function d(e,n){r=e,jQuery(e);var d=r.getObjects();t=d.g_objWrapper,r.getArrItems(),s=jQuery.extend(s,l),s=jQuery.extend(s,n),function(){1==s.tile_enable_overlay?(s.thumb_overlay_opacity=s.tile_overlay_opacity,s.thumb_overlay_color=s.tile_overlay_color):0==s.tile_enable_icons?s.thumb_color_overlay_effect=!1:s.thumb_overlay_opacity=0;s.tile_as_link&&(s.thumb_wrapper_as_link=!0,s.thumb_link_newpage=s.tile_link_newpage);1==s.tile_enable_outline&&0==s.tile_enable_border&&(s.tile_enable_outline=!1);u.tileInnerReduce=0,s.tile_enable_border&&(u.tileInnerReduce=2*s.tile_border_width,a.setThumbInnerReduce(u.tileInnerReduce));if(u.isSaparateIcons=!o.isRgbaSupported(),1==s.tile_enable_textpanel){switch(s.tile_textpanel_position){case"top":s.tile_textpanel_align="top";case"bottom":u.isTextpanelOutside=!0,s.tile_textpanel_always_on=!0,s.tile_textpanel_offset=0;break;case"inside_top":s.tile_textpanel_align="top";break;case"middle":s.tile_textpanel_align="middle",s.tile_textpanel_appear_type="fade"}0==s.tile_textpanel_always_on&&(u.isSaparateIcons=!0)}0!=s.tile_textpanel_offset&&(s.tile_textpanel_appear_type="fade",s.tile_textpanel_margin=s.tile_textpanel_offset);"title_and_desc"==s.tile_textpanel_source&&(s.tile_textpanel_enable_description=!0,s.tile_textpanel_desc_style_as_title=!0)}(),a.init(e,s);var _=["overlay"];u.funcCustomTileHtml&&(_=[]),a.setCustomThumbs(g,_,{allow_onresize:!1});var c=a.getOptions();s=jQuery.extend(s,c),u.ratioByWidth=s.tile_width/s.tile_height,u.ratioByHeight=s.tile_height/s.tile_width,s.tile_size_by==i.sizeby.GLOBAL_RATIO&&u.isTextpanelOutside&&(u.hasImageContainer=!0)}function _(){var e=r.isMobileMode();switch(u.isTextPanelHidden=!1,1==e&&0==s.tile_textpanel_always_on&&(u.isTextPanelHidden=!0),u.isVideoplayIconAlwaysOn=s.tile_videoplay_icon_always_on,s.tile_videoplay_icon_always_on){case"always":u.isVideoplayIconAlwaysOn=!0;break;case"never":u.isVideoplayIconAlwaysOn=!1;break;case"mobile_only":u.isVideoplayIconAlwaysOn=1==e;break;case"desktop_only":u.isVideoplayIconAlwaysOn=0==e}}function g(e,t){if(e.addClass("ug-tile"),u.funcCustomTileHtml)return u.funcCustomTileHtml(e,t),!1;var n="";1==u.hasImageContainer&&(n+="<div class='ug-image-container ug-trans-enabled'>");var a="ug-thumb-image";0!=s.tile_enable_image_effect&&1!=s.tile_image_effect_reverse||(a+=" ug-trans-enabled");var l=o.stripTags(t.title);l=o.htmlentitles(l),n+='<img src="'+o.escapeDoubleSlash(t.urlThumb)+"\" alt='"+l+"' class='"+a+"'>",1==u.hasImageContainer&&(n+="</div>"),e.append(n),s.tile_size_by==i.sizeby.GLOBAL_RATIO&&e.fadeTo(0,0);var d={};if(1==s.tile_enable_background&&(d["background-color"]=s.tile_background_color),1==s.tile_enable_border&&(d["border-width"]=s.tile_border_width+"px",d["border-style"]="solid",d["border-color"]=s.tile_border_color,s.tile_border_radius&&(d["border-radius"]=s.tile_border_radius+"px")),1==s.tile_enable_outline&&(d.outline="1px solid "+s.tile_outline_color),1==s.tile_enable_shadow){var _=s.tile_shadow_h+"px ";_+=s.tile_shadow_v+"px ",_+=s.tile_shadow_blur+"px ",_+=s.tile_shadow_spread+"px ",_+=s.tile_shadow_color,d["box-shadow"]=_}e.css(d);var g="";if(s.tile_enable_icons){if(0==s.tile_as_link&&1==s.tile_enable_action){var c="ug-button-play ug-icon-zoom";"image"!=t.type&&(c="ug-button-play ug-icon-play"),g+="<div class='ug-tile-icon "+c+"' style='display:none'></div>"}if(t.link&&1==s.tile_show_link_icon||1==s.tile_as_link)if(0==s.tile_as_link){var h="";1==s.tile_link_newpage&&(h=" target='_blank'"),g+="<a href='"+t.link+"'"+h+" class='ug-tile-icon ug-icon-link'></a>"}else g+="<div class='ug-tile-icon ug-icon-link' style='display:none'></div>";var m=u.isSaparateIcons;if(0==m&&"image"!=t.type&&1==u.isVideoplayIconAlwaysOn&&(m=!0),m)var f=e;else f=e.children(".ug-thumb-overlay");f.append(g);var b=f.children("."+c);0==b.length?b=null:b.hide();var v=f.children(".ug-icon-link");0==v.length?v=null:v.hide(),v||1!=s.tile_enable_action||e.addClass("ug-tile-clickable")}else 1==s.tile_enable_action&&e.addClass("ug-tile-clickable");if(1==s.tile_enable_image_effect){var y="";0==s.tile_image_effect_reverse&&(y=" ug-trans-enabled");var I="<div class='ug-tile-image-overlay"+y+"' >",w=" ug-"+s.tile_image_effect_type+"-effect";I+='<img src="'+o.escapeDoubleSlash(t.urlThumb)+"\" alt='"+t.title+"' class='"+w+y+"'>",I+="</div>",e.append(I),1==s.tile_image_effect_reverse&&e.children(".ug-tile-image-overlay").fadeTo(0,0)}if(1==s.tile_enable_textpanel){var E=new UGTextPanel;E.init(r,s,"tile");var T="";1!=s.tile_textpanel_always_on&&1!=u.isTextpanelOutside||(T="ug-trans-enabled"),E.appendHTML(e,T);var S=t.title,P="";switch(s.tile_textpanel_source){case"desc":case"description":S=t.description;break;case"desc_title":""!=t.description&&(S=t.description);break;case"title_and_desc":S=t.title,P=t.description}if(E.setTextPlain(S,P),0==s.tile_textpanel_always_on&&E.getElement().fadeTo(0,0),e.data("objTextPanel",E),1==s.tile_textpanel_always_on)p(e).css("z-index",2);if(1==u.isTextpanelOutside){e.append("<div class='ug-tile-cloneswrapper'></div>");var x=e.children(".ug-tile-cloneswrapper"),j=new UGTextPanel;j.init(r,s,"tile"),j.appendHTML(x),j.setTextPlain(S,P),e.data("objTextPanelClone",j)}}null!==t.addHtml&&e.append(t.addHtml)}function c(e){return e.children(".ug-tile-image-overlay")}function h(e){return e.data("objTextPanel")}function p(e){return e.children(".ug-textpanel")}function m(e){if(1==u.isTextpanelOutside)var t=function(e){var t=e.find(".ug-tile-cloneswrapper .ug-textpanel");if(0==t.length)throw new Error("text panel cloned element not found");return t}(e);else t=p(e);return t?o.getElementSize(t).height:0}function f(e){var t=e.find(".ug-icon-link");return 0==t.length?null:t}function b(e){var t=e.find(".ug-button-play");return 0==t.length?null:t}function v(e){return!!e.hasClass("ug-thumb-over")}function y(e){return e.hasClass("ug-tile-clickable")}function I(e){return 1==s.tile_enable_icons&&1==u.isVideoplayIconAlwaysOn&&"image"!=e.type}function w(e,t,n,r){var a=c(e),l=i.getTileImage(e),d=function(e){return e.find(".ug-tile-image-overlay img")}(e);t-=u.tileInnerReduce,n-=u.tileInnerReduce;var _=null;if(1==u.isTextpanelOutside){var g=m(e);if(n-=g,"top"==s.tile_textpanel_position&&(_=g),1==u.hasImageContainer){var h=function(e){return 0==u.hasImageContainer?null:e.children(".ug-image-container")}(e);o.setElementSize(h,t,n),null!==_&&o.placeElement(h,0,_)}}if(0==s.tile_enable_image_effect)o.scaleImageCoverParent(l,t,n),0==u.hasImageContainer&&null!==_&&o.placeElement(l,0,_);else{var p="nothing";!0===r&&0==u.isTextpanelOutside&&(p=1==s.tile_image_effect_reverse?"effect":"image"),"effect"!=p&&(o.setElementSize(a,t,n),null!==_&&o.placeElement(a,0,_),o.scaleImageCoverParent(d,t,n)),"image"!=p&&(1==u.hasImageContainer?o.scaleImageCoverParent(l,t,n):"effect"==p?(o.scaleImageCoverParent(l,t,n),null!==_&&o.placeElement(l,0,_)):o.cloneElementSizeAndPos(d,l,!1,null,_))}}function E(e,t,n,r){var o=null;if(n&&(o=n-u.tileInnerReduce),r&&(r-=u.tileInnerReduce),"clone"==t)return function(e){return e.data("objTextPanelClone")}(e).refresh(!0,!0,o),i.getItemByTile(e).textPanelCloneSizeSet=!0,!1;var a=h(e);if(!a)return!1;var l=null;if(1==u.isTextpanelOutside&&(l=m(e)),a.refresh(!1,!0,o,l),1==s.tile_textpanel_always_on||"fade"==s.tile_textpanel_appear_type)if(1==u.isTextpanelOutside&&r&&"bottom"==s.tile_textpanel_position){var d=r-l;a.positionPanel(d)}else a.positionPanel()}function T(e){i.getItemByTile(e);var t=b(e),n=f(e),r=o.getElementSize(e);w(e,r.width,r.height),1==s.tile_enable_textpanel&&E(e,"regular",r.width,r.height);var a=r.width-u.tileInnerReduce,l=r.height-u.tileInnerReduce,d=0;if(1==u.isTextpanelOutside){var _=m(e);l-=_,"top"==s.tile_textpanel_position&&(d=_)}var g=function(e){return e.children(".ug-thumb-overlay")}(e);if(o.setElementSizeAndPosition(g,0,d,a,l),t||n){var c=0;if(1==s.tile_enable_textpanel&&0==u.isTextPanelHidden&&0==u.isTextpanelOutside){var h=p(e),v=o.getElementSize(h);v.height>0&&(c=Math.floor(v.height/2*-1))}}if(t&&n){var y=o.getElementSize(t),I=o.getElementSize(n),T=s.tile_space_between_icons,S=y.width+T+I.width,P=Math.floor((r.width-S)/2);P<T&&(T=Math.floor((r.width-y.width-I.width)/3),S=y.width+T+I.width,P=Math.floor((r.width-S)/2)),o.placeElement(t,P,"middle",0,c),o.placeElement(n,P+y.width+T,"middle",0,c)}else t&&o.placeElement(t,"center","middle",0,c),n&&o.placeElement(n,"center","middle",0,c);t&&t.show(),n&&n.show()}function S(e,t){i.getItemByTile(e);var n=c(e),r=s.thumb_transition_duration;if(0==s.tile_image_effect_reverse){var o=i.getTileImage(e);t?(o.fadeTo(0,1),n.stop(!0).fadeTo(r,0)):n.stop(!0).fadeTo(r,1)}else t?n.stop(!0).fadeTo(r,1):n.stop(!0).fadeTo(r,0)}function P(e,t){var i=s.thumb_transition_duration,n=p(e);if(!n)return!0;if("slide"==s.tile_textpanel_appear_type){var r=o.getElementSize(n);if(0==r.width)return!1;var a=-r.height,l={},u={},d="bottom";"inside_top"==s.tile_textpanel_position&&(d="top"),l[d]=a+"px",u[d]="0px",1==t?(n.fadeTo(0,1),0==n.is(":animated")&&n.css(l),u.opacity=1,n.stop(!0).animate(u,i)):n.stop(!0).animate(l,i)}else 1==t?n.stop(!0).fadeTo(i,1):n.stop(!0).fadeTo(i,0)}function x(e,t,i){var n=s.thumb_transition_duration;i&&!0===i&&(n=0);var r=b(e),o=f(e),a=t?1:0;r&&r.stop(!0).fadeTo(n,a),o&&o.stop(!0).fadeTo(n,a)}function j(e,t){if(t=jQuery(t),s.tile_enable_image_effect&&S(t,!0),1==s.tile_enable_textpanel&&0==s.tile_textpanel_always_on&&0==u.isTextPanelHidden&&P(t,!0),u.isSaparateIcons&&1==s.tile_enable_icons){var n=1==s.thumb_overlay_reverse;0==I(i.getItemByTile(t))&&x(t,n,!1)}}function C(e,t){if(t=jQuery(t),s.tile_enable_image_effect&&S(t,!1),1==s.tile_enable_textpanel&&0==s.tile_textpanel_always_on&&P(t,!1),1==u.isSaparateIcons&&1==s.tile_enable_icons){var n=1!=s.thumb_overlay_reverse;0==I(i.getItemByTile(t))?x(t,n,!1):x(t,!0,!0)}}function A(e,t,i){if(t=jQuery(t),1==s.tile_visible_before_image&&!0!==t.data("image_placed")&&!0!==i)return!0;T(t),a.setThumbNormalStyle(t)}function M(e,t,i){T(t),i.fadeTo(0,1),t.data("image_placed",!0)}function O(e){if(1==y(e))return n.trigger(i.events.TILE_CLICK,e),!0;var t;0==v(e)&&(t=e,a.getThumbs().not(t).each(function(e,t){a.setThumbNormalStyle(jQuery(t))}),a.setThumbOverStyle(e))}function z(e){var t=jQuery(this),r=t.prop("tagName").toLowerCase(),o=!0;if(u.funcParentApproveClick&&0==u.funcParentApproveClick()&&(o=!1),"a"==r)0==o&&e.preventDefault();else if(0==v(t))1==o&&O(t);else{if(0==y(t))return!0;1==o&&n.trigger(i.events.TILE_CLICK,t)}}function L(e){e.stopPropagation();var t=jQuery(this).parents(".ug-tile"),r=!0;return u.funcParentApproveClick&&0==u.funcParentApproveClick()&&(r=!1),0==v(t)?(O(t),!0):1==r?(n.trigger(i.events.TILE_CLICK,t),!1):void 0}function N(e){var t=jQuery(this).parents(".ug-tile");u.funcParentApproveClick&&0==u.funcParentApproveClick()&&e.preventDefault(),0==v(t)&&0==s.tile_as_link&&(e.preventDefault(),O(t))}this.loadTileImage=function(e){var t=i.getTileImage(e);o.checkImagesLoaded(t,null,function(t,i){M(null,e,jQuery(t))})},this.setHtml=function(t,i){e=t,!0!==i&&_(),a.setHtmlThumbs(t,i)},this.initEvents=function(){a.initEvents(),jQuery(a).on(a.events.SETOVERSTYLE,j),jQuery(a).on(a.events.SETNORMALSTYLE,C),jQuery(a).on(a.events.PLACEIMAGE,M),t.on(u.eventSizeChange,A),e.on("click",".ug-tile",z),e.on("click",".ug-tile .ug-button-play",L),e.on("click",".ug-tile .ug-icon-link",N)},this.destroy=function(){if(e.off("click",".ug-tile"),e.off("click",".ug-tile .ug-button-play"),e.off("click",".ug-tile .ug-icon-link"),jQuery(a).off(a.events.SETOVERSTYLE),jQuery(a).off(a.events.SETNORMALSTYLE),jQuery(a).off(a.events.PLACEIMAGE),t.off(u.eventSizeChange),1==s.tile_enable_textpanel){var i=a.getThumbs();jQuery.each(i,function(e,t){var i=h(jQuery(t));i&&i.destroy()})}a.destroy()},this.init=function(e,t,i){d(e,t)},this.setFixedMode=function(){s.tile_size_by=i.sizeby.GLOBAL_RATIO,s.tile_visible_before_image=!0},this.setApproveClickFunction=function(e){u.funcParentApproveClick=e},this.resizeTile=function(e,t,n,r){if(1==u.isTextpanelOutside&&E(e,"clone",t),t){if(!n)n=i.getTileHeightByWidth(t,e)}else{t=s.tile_width;var n=s.tile_height}switch(o.setElementSize(e,t,n),r){default:case i.resizemode.FULL:i.triggerSizeChangeEvent(e,!0);break;case i.resizemode.WRAPPER_ONLY:return!0;case i.resizemode.VISIBLE_ELEMENTS:if(u.funcCustomTileHtml)return i.triggerSizeChangeEvent(e,!0),!0;w(e,t,n,!0),1==s.tile_enable_textpanel&&1==s.tile_textpanel_always_on&&t&&E(e,"regular",t,n)}},this.resizeAllTiles=function(e,t,n){_();var r=null;if(s.tile_size_by==i.sizeby.GLOBAL_RATIO&&(r=i.getTileHeightByWidth(e)),!n)n=a.getThumbs();n.each(function(n,o){i.resizeTile(jQuery(o),e,r,t)})},this.triggerSizeChangeEvent=function(e,i){if(!e)return!1;if(!i)i=!1;t.trigger(u.eventSizeChange,[e,i])},this.triggerSizeChangeEventAllTiles=function(e){a.getThumbs().each(function(){var t=jQuery(this);i.triggerSizeChangeEvent(t,e)})},this.disableEvents=function(){a.getThumbs().css("pointer-events","none")},this.enableEvents=function(){a.getThumbs().css("pointer-events","auto")},this.setOptions=function(e){s=jQuery.extend(s,e),a.setOptions(e)},this.setTileSizeOptions=function(e){if(s.tile_size_by!==i.sizeby.GLOBAL_RATIO)throw new Error("setNewTileOptions works with global ration only");s.tile_width=e,s.tile_height=Math.floor(e*u.ratioByHeight)},this.setCustomFunctions=function(e,t){u.funcCustomTileHtml=e,u.funcCustomPositionElements=t},this.run=function(e){var t=a.type.GET_THUMBS_ALL;!0===e&&(t=a.type.GET_THUMBS_NEW);var n=a.getThumbs(t);s.tile_size_by==i.sizeby.GLOBAL_RATIO&&i.resizeAllTiles(s.tile_width,i.resizemode.WRAPPER_ONLY,n),1==s.tile_enable_image_effect&&0==s.tile_image_effect_reverse&&n.children(".ug-thumb-image").fadeTo(0,0),a.setHtmlProperties(n),1==s.tile_visible_before_image&&(n.children(".ug-thumb-image").fadeTo(0,0),a.loadThumbsImages())},this._____________EXTERNAL_GETTERS____________=function(){},this.getObjThumbs=function(){return a},this.getOptions=function(){return s},this.getTileImage=function(e){return e.find("img.ug-thumb-image")},this.getItemByTile=function(e){return a.getItemByThumb(e)},this.getTileHeightByWidth=function(e,t){var n=function(e){var t=u.ratioByHeight;switch(s.tile_size_by){default:t=u.ratioByHeight;break;case i.sizeby.IMAGE_RATIO:if(!e)throw new Error("tile should be given for tile ratio");var n=i.getItemByTile(e);if(void 0!==n.thumbRatioByHeight){if(0==n.thumbRatioByHeight)throw trace(n),new Error("the item ratio not inited yet");t=n.thumbRatioByHeight}break;case i.sizeby.CUSTOM:return null}return t}(t);if(null===n)return null;var r=Math.floor((e-u.tileInnerReduce)*n)+u.tileInnerReduce;return t&&1==u.isTextpanelOutside&&s.tile_size_by==i.sizeby.IMAGE_RATIO&&(r+=m(t)),r},this.getTileImageSize=function(e){var t=i.getItemByTile(e);if(!t.thumbWidth||!t.thumbHeight)throw new Error("Can't get image size - image not inited.");return{width:t.thumbWidth,height:t.thumbHeight}},this.getGlobalTileSize=function(){if(s.tile_size_by!=i.sizeby.GLOBAL_RATIO)throw new Error("The size has to be global ratio");return{width:s.tile_width,height:s.tile_height}}}function UGTiles(){var e,t,i,n,r,o=this,a=jQuery(this),s=new UniteGalleryMain,l=new UGFunctions,u=new UGTileDesign,d=new UGThumbsGeneral,_={},g={tiles_type:"columns",tiles_col_width:250,tiles_align:"center",tiles_exact_width:!1,tiles_space_between_cols:3,tiles_space_between_cols_mobile:3,tiles_include_padding:!0,tiles_min_columns:2,tiles_max_columns:0,tiles_keep_order:!1,tiles_set_initial_height:!0,tiles_justified_row_height:150,tiles_justified_space_between:3,tiles_nested_optimal_tile_width:250,tiles_nested_col_width:null,tiles_nested_debug:!1,tiles_enable_transition:!0};this.events={THUMB_SIZE_CHANGE:"thumb_size_change",TILES_FIRST_PLACED:"tiles_first_placed",ALL_TILES_LOADED:"all_tiles_loaded"};var c={isFirstTimeRun:!0,handle:null,isTransActive:!1,isTransInited:!1,isFirstPlaced:!0,isAllLoaded:!1},h={colWidth:null,nestedOptimalCols:5,gridY:0,maxColumns:0,columnsValueToEnableHeightResize:3,resizeLeftRightToColumn:!0,currentItem:0,currentGap:null,optimalTileWidth:null,maxGridY:0};function p(i,n){g_objects=i.getObjects(),s=i,e=jQuery(i),t=g_objects.g_objWrapper,g_objects.g_arrItems,g=jQuery.extend(g,n),function(){g.tiles_min_columns<1&&(g.tiles_min_columns=1);0!=g.tiles_max_columns&&g.tiles_max_columns<g.tiles_min_columns&&(g.tiles_max_columns=g.tiles_min_columns)}(),u.init(i,g),d=u.getObjThumbs()}function m(){if(i.addClass("ug-tiles-rest-mode"),c.isTransInited=!0,1==g.tiles_enable_transition){i.addClass("ug-tiles-transit");var e=u.getOptions();1==e.tile_enable_image_effect&&0==e.tile_image_effect_reverse&&i.addClass("ug-tiles-transit-overlays"),c.isTransActive=!0}}function f(){return l.getElementSize(i).width}function b(){return 0!=c.isTransInited&&(i.addClass("ug-tiles-transition-active"),i.removeClass("ug-tiles-rest-mode"),0!=c.isTransActive&&void u.disableEvents())}function v(){if(0==c.isTransInited)return!1;i.removeClass("ug-tiles-transition-active"),i.addClass("ug-tiles-rest-mode")}function y(){1==c.isTransActive?(setTimeout(function(){u.enableEvents(),u.triggerSizeChangeEventAllTiles(),v()},800),c.handle&&clearTimeout(c.handle),c.handle=setTimeout(function(){v(),u.triggerSizeChangeEventAllTiles(),c.handle=null},2e3)):(u.triggerSizeChangeEventAllTiles(),v())}function I(){_.colWidth=(_.availWidth-_.colGap*(_.numCols-1))/_.numCols,_.colWidth=Math.floor(_.colWidth),_.totalWidth=l.getSpaceByNumItems(_.numCols,_.colWidth,_.colGap)}function w(){if(_.colWidth=g.tiles_col_width,_.minCols=g.tiles_min_columns,_.maxCols=g.tiles_max_columns,0==s.isMobileMode()?_.colGap=g.tiles_space_between_cols:_.colGap=g.tiles_space_between_cols_mobile,_.galleryWidth=f(),_.availWidth=_.galleryWidth,1==g.tiles_include_padding&&(_.availWidth=_.galleryWidth-2*_.colGap),1==g.tiles_exact_width)_.numCols=l.getNumItemsInSpace(_.availWidth,_.colWidth,_.colGap),_.maxCols>0&&_.numCols>_.maxCols&&(_.numCols=_.maxCols),_.numCols<_.minCols?(_.numCols=_.minCols,I()):_.totalWidth=_.numCols*(_.colWidth+_.colGap)-_.colGap;else{var e=l.getNumItemsInSpaceRound(_.availWidth,_.colWidth,_.colGap);e<_.minCols?e=_.minCols:0!=_.maxCols&&e>_.maxCols&&(e=_.maxCols),_.numCols=e,I()}switch(g.tiles_align){case"center":default:_.addX=Math.round((_.galleryWidth-_.totalWidth)/2);break;case"left":_.addX=0;break;case"right":_.addX=_.galleryWidth-_.totalWidth}for(_.arrPosx=[],col=0;col<_.numCols;col++){var t=l.getColX(col,_.colWidth,_.colGap);_.arrPosx[col]=t+_.addX}}function E(){_.maxColHeight=0,_.colHeights=[0]}function T(e,t,n,r){if(null==r)r=function(){var e=0,t=999999999;for(col=0;col<_.numCols;col++){if(null==_.colHeights[col]||0==_.colHeights[col])return col;_.colHeights[col]<t&&(e=col,t=_.colHeights[col])}return e}();var o=0;void 0!==_.colHeights[r]&&(o=_.colHeights[r]);var a=u.getTileHeightByWidth(_.colWidth,e);if(null===a){if(1==g.tiles_enable_transition)throw new Error("Can't know tile height, please turn off transition");a=l.getElementSize(e).height}var s=_.arrPosx[r];l.placeElement(e,s,o);var d=o+a;_.colHeights[r]=d+_.colGap,_.maxColHeight<d&&(_.maxColHeight=d),1==t&&e.show().fadeTo(0,1),1==n&&i.height(_.maxColHeight)}function S(e){e||(e=!1),w(),E();var t=d.getThumbs(d.type.GET_THUMBS_RATIO);b(),u.resizeAllTiles(_.colWidth,u.resizemode.VISIBLE_ELEMENTS,t);for(var n=0;n<t.length;n++){var r=jQuery(t[n]),o=void 0;1==g.tiles_keep_order&&(o=l.getColByIndex(_.numCols,n)),T(r,e,!1,o)}y();var a=i.height();1==c.isTransActive&&a>_.maxColHeight?setTimeout(function(){i.height(_.maxColHeight)},700):i.height(_.maxColHeight)}function P(e,t){if(!0!==t&&0==function(e){var t=e.index();if(!0===s.getItem(t).ordered_placed)return!1;var i=l.getPrevRowSameColIndex(t,_.numCols);return i<0||!0===s.getItem(i).ordered_placed}(e))return!1;var i=e.index(),n=l.getColByIndex(_.numCols,i),r=s.getItem(i);u.resizeTile(e,_.colWidth),T(e,!0,!0,n),r.ordered_placed=!0;var o=s.getNumItems(),a=l.getNextRowSameColIndex(i,_.numCols);if(a>=o)return!1;var g=d.getThumbByIndex(a),c=s.getItem(a);d.isThumbLoaded(g);d.isThumbLoaded(g)&&!c.ordered_placed&&P(g,!0)}function x(){var e=d.getThumbs(d.type.GET_THUMBS_NO_RATIO);if(!e||0==e.length)return!1;if(c.isAllLoaded=!1,1==c.isFirstPlaced){w(),E();var t=Math.abs(_.galleryWidth-_.totalWidth);if(1==g.tiles_set_initial_height&&0==l.isScrollbarExists()&&t<25){e.length;var n=Math.ceil(e.length/_.numCols)*g.tiles_col_width*.75;i.height(n),w()}}e.fadeTo(0,0);var r=e.find("img.ug-thumb-image"),h=_.numCols,p=_.galleryWidth;l.checkImagesLoaded(r,function(){w(),h==_.numCols&&p==_.galleryWidth||S(!1),m(),a.trigger(o.events.ALL_TILES_LOADED)},function(e,t){1==c.isFirstPlaced&&s.triggerEvent(o.events.TILES_FIRST_PLACED),function(e,t){if(1==t)return!1;e=jQuery(e);var i=jQuery(e).parent();d.triggerImageLoadedEvent(i,e),1==g.tiles_keep_order?P(i):(u.resizeTile(i,_.colWidth),T(i,!0,!0))}(e,t)})}function j(){var e=f(),t=d.getThumbs(!0),i=g.tiles_justified_row_height,n=[],r=0,o=g.tiles_justified_space_between,a=t.length;jQuery.each(t,function(e,t){t=jQuery(t);var o=d.getItemByThumb(t),a=o.thumbWidth;o.thumbHeight!==i&&(a=Math.floor(o.thumbRatioByWidth*i)),n[e]=a,r+=a});var s=Math.ceil(r/e);s>a&&(s=a);var l=r/s,u=[],_=0,c=[],h=[],p=0,m=0;jQuery.each(t,function(e,t){var i=n[e];p+i/2>(m+1)*l&&(c[u.length]=_,u.push(h),h=[],_=0,m++),p+=i,_+=i,h.push(t)}),c[u.length]=_,u.push(h);var b=[],v=[],y=0;return jQuery.each(u,function(t,r){r.length;var a=c[t],s=(r.length-1)*o,l=(e-s)/a,u=Math.round(i*l);y+=u,t>0&&(y+=o),v.push(u);var d=u/i,_=[],g=s;jQuery.each(r,function(e,t){var i=jQuery(t).index(),r=n[i],o=Math.round(r*d);_[e]=o,g+=o});var h=g-e;jQuery.each(_,function(e,t){if(0==h)return!1;h<0?(_[e]=t+1,h++):(_[e]=t-1,h--),e==_.length-1&&0!=h&&(_[e]-=h)}),b[t]=_}),{arrRows:u,arrRowWidths:b,arrRowHeights:v,gap:o,totalHeight:y}}function C(e){if(!e)e=!1;var t=f(),n=j();i.height(n.totalHeight),f()!=t&&(n=j()),b();var r=0,o=0;jQuery.each(n.arrRows,function(t,i){var a=n.arrRowWidths[t],s=n.arrRowHeights[t],d=0;jQuery.each(i,function(t,i){var _=jQuery(i),g=s,c=a[t];u.resizeTile(_,c,g,u.resizemode.VISIBLE_ELEMENTS),l.placeElement(_,d,r),(d+=c)>o&&(o=d),d+=n.gap,1==e&&jQuery(i).show()}),r+=s+n.gap}),y()}function A(){var e=f();switch(h.galleryWidth=e,n={},h.colWidth=g.tiles_nested_col_width,h.optimalTileWidth=g.tiles_nested_optimal_tile_width,h.currentGap=g.tiles_space_between_cols,1==s.isMobileMode()&&(h.currentGap=g.tiles_space_between_cols_mobile),null==h.colWidth?h.colWidth=Math.floor(h.optimalTileWidth/h.nestedOptimalCols):h.optimalTileWidth>h.colWidth?h.nestedOptimalCols=Math.ceil(h.optimalTileWidth/h.colWidth):h.nestedOptimalCols=1,h.maxColumns=l.getNumItemsInSpace(e,h.colWidth,h.currentGap),h.colWidth=l.getItemSizeInSpace(e,h.maxColumns,h.currentGap),h.gridY=0,r=[],d.getThumbs(!0).each(function(){var e=function(e){var t,i,n={},r=h.colWidth,o=h.currentGap,a=u.getTileImageSize(e),s=e.index(),l=Math.ceil(function(e){return Math.abs(Math.sin(Math.abs(1e3*Math.sin(e))))}(s)*(1*h.nestedOptimalCols/3)+2*h.nestedOptimalCols/3),d=a.width,_=a.height,g=d/_;d>_?(t=l,0==(i=Math.round(t/g))&&(i=1)):(i=l,0==(t=Math.round(i*g))&&(t=1));return n.dimWidth=t,n.dimHeight=i,n.width=t*r+o*(t-1),n.height=i*r+o*(i-1),n.imgWidth=d,n.imgHeight=_,n.left=0,n.top=0,n}(jQuery(this));r.push(e)}),h.optimalTileWidth>h.colWidth?h.nestedOptimalCols=Math.ceil(h.optimalTileWidth/h.colWidth):h.nestedOptimalCols=1,h.totalWidth=h.maxColumns*(h.colWidth+h.currentGap)-h.currentGap,g.tiles_align){case"center":default:h.addX=Math.round((h.galleryWidth-h.totalWidth)/2);break;case"left":h.addX=0;break;case"right":h.addX=h.galleryWidth-h.totalWidth}h.maxGridY=0}function M(e){var t=f();A(),O();var n=h.maxGridY*(h.colWidth+h.currentGap)-h.currentGap;i.height(n),f()!=t&&(A(),O()),0==g.tiles_nested_debug&&function(e){if(!e)var e=!1;b();for(var t=0;t<r.length;t++)U(t,e);i.height(h.maxColHeight),y()}(e)}function O(e){if(1==g.tiles_nested_debug)return void 0===e&&(e=!0),function(e,t){if(0==t){for(var i=h.currentItem;i<r.length;i++)z(i,!0);h.currentItem=r.length-1}else z(h.currentItem,!0);for(i=0;i<=h.currentItem;i++)U(i,!0);h.currentItem++}(0,e),!1;for(var t=0;t<r.length;t++)z(t,!0)}function z(e,t){if(!t)t=!1;h.maxColHeight=0;for(var i=l.getObjectLength(n),r=h.gridY;r<=i+1;r++){for(var o=0;o<h.maxColumns;o++){if(0==Q(h.gridY)||0==B(h.gridY,o))return void L(e,D(o),o)}h.gridY++}}function L(e,t,i){var o=jQuery.extend(!0,{},r[e]),a=o.dimWidth,s=t-o.dimWidth,l=h.nestedOptimalCols;if(t<=o.dimWidth||s<=.33*l||t<=l)H(e,t);else if(s<=l)l>=4?1==G(Math.floor(t/2),i)?H(e,Math.floor(t/2)+1):H(e,Math.floor(t/2)):H(objImage,t);else if(1==G(a,i))switch(a>=l){case!0:H(e,a-1);break;case!1:H(e,a+1)}var u,d,_,g,c,p,m,f,b,v=function(e,t,i){var r=h.gridY-1,o=0,a=0,s=1,l=[],u=[];if(l.push(e),r>=0){for(a=0;r>=0;){if(o=n[r][i],void 0!==n[r][i-1]&&n[r][i-1]==n[r][i]||void 0!==n[r][i+t]&&n[r][i+t-1]==n[r][i+t]||n[r][i]!=n[r][i+t-1])return u.push(s),u.push(l),u;a!=o&&(s++,l.push(o)),r--,a=o}return u.push(s),u.push(l),u}return[0,[]]}(e,(o=jQuery.extend(!0,{},r[e])).dimWidth,i);if(h.columnsValueToEnableHeightResize<=v[0]&&h.maxColumns>=2*h.nestedOptimalCols){var y=function(e,t){var i=0,r=0,o=t.dimWidth,a=t.dimHeight,s=0,l=0,u=jQuery.map(n,function(e,t){return[e]});if(void 0===u[h.gridY]||void 0===u[h.gridY][e-1])r=0;else for(var d=0;void 0!==n[h.gridY+d]&&-1!=n[h.gridY+d][e-1];)s=n[h.gridY+d][e-2],d++,r++;if(void 0===u[h.gridY]||void 0===u[h.gridY][e+o])i=0;else for(d=0;void 0!==n[h.gridY+d]&&-1!=n[h.gridY+d][e+o];)l=n[h.gridY+d][e+o+1],d++,i++;var _=0,g=0;Math.abs(a-r)<Math.abs(a-i)&&0!=r?(_=r,g=s):0!=i?(_=i,g=l):_=a;return{newHeight:_,idToResize:g}}(i,o),I=k(e,y.newHeight,!0);r[e].dimHeight=I.dimHeight;var w=function(e,t){for(var i=0,n=0,o=[],a=0,s=0,l=0;l<e[1].length;l++){var u=e[1][l],d=r[e[1][l]];if(n+=d.dimHeight,0!=l)i+=d.dimHeight,o.push([u,d.dimHeight]);else{var _=H(u,t,!0);i+=_.dimHeight,o.push([e[1][l],_.dimHeight])}}a=d.left,s=d.top;for(var g=n,c=[],l=o.length-1;l>=0;l--){var h,u=o[l][0];0!=l?(h=Math.max(Math.round(1*n/3),Math.floor(o[l][1]*(n/i))),g-=h,(_=k(u,h,!0)).left=a,_.top=s,c.push({tileID:u,sizes:_}),s+=_.dimHeight):((_=k(u,h=g,!0)).left=a,_.top=s,c.push({tileID:u,sizes:_}))}return c}(v,I.dimWidth),E=!1;(function(e){for(var t=0,i=0,r=0;r<e.length-1;r++){var o=e[r].sizes,a=-1,s=-1;Q(o.top+o.dimHeight)&&h.maxColumns>o.left+o.dimWidth&&(a=n[o.top+o.dimHeight-1][o.left+o.dimWidth],s=n[o.top+o.dimHeight][o.left+o.dimWidth]),a!=s&&t++}for(var r=0;r<e.length-1;r++){var o=e[r].sizes,a=-1,s=-1;Q(o.top+o.dimHeight)&&o.left-1>=0&&(a=n[o.top+o.dimHeight-1][o.left-1],s=n[o.top+o.dimHeight][o.left-1]),a!=s&&i++}return Math.max(i,t)})(w)>=2&&(E=!0),y.newHeight>=o.dimHeight&&(o=k(e,y.newHeight,!0));var T=(u=y.idToResize,d=y.newHeight,_=o.dimHeight,g=r[u],c=g.dimHeight,g.dimWidth,p=g.left,m=g.top,parseInt(m/(h.colWidth+h.currentGap)),parseInt(p/(h.colWidth+h.currentGap)),f=k(u,c-d+_,!0),(b=[]).push({tileID:u,sizes:f}),b);return o.top=h.gridY,o.left=i,T.push({tileID:e,sizes:o}),R(T)<R(w)||1==E?void N(T):void N(w)}o.left=i,o.top=h.gridY,r[e]=o,W(e,o,i,h.gridY),h.maxGridY=o.top+o.dimHeight}function N(e){for(var t=0;t<e.length;t++){var i=e[t].sizes,n=e[t].tileID;r[n]=jQuery.extend(!0,{},i),W(n,i,i.left,i.top)}}function H(e,t,i){i||(i=!1);var n=h.colWidth,o=h.currentGap,a=r[e],s=a.imgWidth/a.imgHeight;if(dimWidth=t,dimHeight=Math.round(dimWidth/s),1==i){var l=jQuery.extend(!0,{},a);return l.dimWidth=dimWidth,l.dimHeight=dimHeight,l.width=dimWidth*n+o*(dimWidth-1),l.height=dimHeight*n+o*(dimHeight-1),l}a.dimWidth=dimWidth,a.dimHeight=dimHeight,a.width=dimWidth*n+o*(dimWidth-1),a.height=dimHeight*n+o*(dimHeight-1)}function k(e,t,i){i||(i=!1);var n=r[e],o=n.dimWidth,a=h.colWidth,s=h.currentGap;if(1==i){var l=jQuery.extend(!0,{},n);return l.dimHeight=t,l.width=o*a+s*(o-1),l.height=t*a+s*(t-1),l}n.dimHeight=t,n.width=o*a+s*(o-1),n.height=t*a+s*(t-1)}function R(e){for(var t=0,i=0,n=0;n<e.length;n++){var o=r[e[n].tileID];if(0==o.dimHeight||0==o.height)return;resizeVal=o.dimWidth/o.dimHeight/(o.imgWidth/o.imgHeight),resizeVal<1&&(resizeVal=1/resizeVal),t+=resizeVal,i++}return t/i}function G(e,t){var i=h.gridY-1;return!(i<=0||0==Q(i))&&n[i][t+e-1]!=n[i][t+e]}function D(e){var t=e,i=0;if(1==Q(h.gridY))for(;0==B(h.gridY,t);)i++,t++;else i=h.maxColumns;return i}function Q(e){return void 0!==n[e]}function W(e,t,i,n){for(var r=0;r<t.dimHeight;r++)for(var o=0;o<t.dimWidth;o++)0==Q(n+r)&&F(n+r),Y(n+r,i+o,e)}function F(e){n[e]=new Object;for(var t=0;t<h.maxColumns;t++)n[e][t]=-1}function B(e,t){return-1!=n[e][t]}function Y(e,t,i){n[e][t]=i}function U(e,t){var i=d.getThumbByIndex(e),n=r[e],o=n.top*(h.colWidth+h.currentGap),a=h.addX+n.left*(h.colWidth+h.currentGap);u.resizeTile(i,n.width,n.height,u.resizemode.VISIBLE_ELEMENTS),l.placeElement(i,a,o),o+n.height>h.maxColHeight&&(h.maxColHeight=o+n.height),1==t&&i.fadeTo(0,1)}function V(){if(1==c.isFirstTimeRun)return!0;if(0==c.isAllLoaded)return!1;switch(g.tiles_type){case"columns":S(!1);break;case"justified":C(!1);break;case"nested":1==s.isMobileMode()?S(!1):M(!1)}}function X(){switch(t.children(".ug-tile").show(),1==c.isFirstTimeRun&&(a.on(o.events.ALL_TILES_LOADED,function(){c.isAllLoaded=!0}),e.on(s.events.SIZE_CHANGE,V),e.on(o.events.TILES_FIRST_PLACED,function(){c.isFirstPlaced=!1}),u.initEvents()),u.run(),g.tiles_type){default:case"columns":x();break;case"justified":i=jQuery(t).find("img.ug-thumb-image"),n=d.getThumbs(),c.isAllLoaded=!1,n.fadeTo(0,0),l.checkImagesLoaded(i,function(){setTimeout(function(){C(!0),n.fadeTo(0,1),s.triggerEvent(o.events.TILES_FIRST_PLACED),m(),a.trigger(o.events.ALL_TILES_LOADED)})},function(e,t){e=jQuery(e);var i=jQuery(e).parent();d.triggerImageLoadedEvent(i,e)});break;case"nested":!function(){var e=jQuery(t).find("img.ug-thumb-image"),i=d.getThumbs();c.isAllLoaded=!1,i.fadeTo(0,0),l.checkImagesLoaded(e,function(){1==s.isMobileMode()?S(!0):M(!0),s.triggerEvent(o.events.TILES_FIRST_PLACED),m(),a.trigger(o.events.ALL_TILES_LOADED)},function(e,t){e=jQuery(e);var i=jQuery(e).parent();d.triggerImageLoadedEvent(i,e)})}()}var i,n;c.isFirstTimeRun=!1}this.destroy=function(){e.off(s.events.SIZE_CHANGE),u.destroy(),e.off(o.events.TILES_FIRST_PLACED)},this.init=function(e,t){p(e,t)},this.setHtml=function(e){!function(e){e||(e=i||t);i=e;var n=g.tiles_type;e.addClass("ug-tiletype-"+n),u.setHtml(e),e.children(".ug-thumb-wrapper").hide()}(e)},this.getObjTileDesign=function(){return u},this.run=function(){X()},this.runNewItems=function(){if(!i)throw new Error("Can't run new items - parent not set");switch(u.setHtml(i,!0),u.run(!0),g.tiles_type){case"columns":x();break;default:case"justified":case"nested":throw new Error("Tiles type: "+g.tiles_type+" not support load more yet")}}}function UGAviaControl(){var e,t,i,n,r,o,a={touchEnabled:!1,isMouseInsideStrip:!1,strip_finalPos:0,handle_timeout:"",isStripMoving:!1,isControlEnabled:!0,maxDpos:1e3};function s(t){if(0==a.isControlEnabled)return!0;if(1==a.touchEnabled)return jQuery("body").off("mousemove"),!0;a.isMouseInsideStrip=i.ismouseover();var s=e.isTouchMotionActive();1==a.isMouseInsideStrip&&0==s?function(e){var t=function(e){return 0==o?function(e){var t=r.strip_padding_left,o=r.strip_padding_right,a=i.width()-t-o,s=n.width();if(a>s)return null;var l=i.offset().left,u=e-l-t,d=r.thumb_width,_=a-r.thumb_width;u<d&&(u=d);u>_&&(u=_);var g=(u-d)/(_-d)*(s-a);return g=-1*Math.round(g)+t}(e):function(e){var t=r.strip_padding_top,o=(r.strip_padding_bottom,i.height()),a=n.height();if(o>a)return null;var s=i.offset().top,l=e-s-t;if(l<0)return null;var u=r.thumb_height,d=o-r.thumb_height;l<u&&(l=u);l>d&&(l=d);var _=(l-u)/(d-u)*(a-o);return _=-1*Math.round(_)+t}(e)}(e);if(null===t)return!1;a.is_strip_moving=!0,a.strip_finalPos=t,function(){if(1==a.isStripMoving)return!1;a.isStripMoving=!0,a.handle_timeout=setInterval(l,10)}()}(function(e){return 0==o?e.pageX:e.pageY}(t)):u()}function l(){if(0==a.is_strip_moving)return!1;var t=a.maxDpos,i=e.getInnerStripPos();Math.floor(i)==Math.floor(a.strip_finalPos)&&u();var n,r=Math.abs(a.strip_finalPos-i);r<1?n=r:(n=r/4)>0&&n<1&&(n=1),a.strip_finalPos<i&&(n*=-1),n>t&&(n=t),n<-t&&(n=-t);var o=i+n;e.positionInnerStrip(o)}function u(){if(0==a.isStripMoving)return!1;a.isStripMoving=!1,a.handle_timeout=clearInterval(a.handle_timeout)}this.enable=function(){a.isControlEnabled=!0},this.disable=function(){a.isControlEnabled=!1},this.onResize=function(){},this.init=function(l){e=l,t=l.getObjects(),t.g_gallery,i=t.g_objStrip,n=t.g_objStripInner,r=t.g_options,o=t.isVertical,jQuery("body").on("touchstart",function(e){if(0==a.isControlEnabled)return!0;a.touchEnabled=!0}),jQuery("body").mousemove(s)},this.destroy=function(){jQuery("body").off("touchstart"),jQuery("body").off("mousemove")}}function UGSlider(){var e,t,i,n,r,o,a,s,l,u,d,_,g,c=this,h=jQuery(c),p=new UniteGalleryMain,m=null,f=null,b=null,v=new UGVideoPlayer,y=new UGFunctions,I=null,w=null;this.events={ITEM_CHANGED:"item_changed",BEFORE_SWITCH_SLIDES:"before_switch",BEFORE_RETURN:"before_return",AFTER_RETURN:"after_return",ZOOM_START:"slider_zoom_start",ZOOM_END:"slider_zoom_end",ZOOMING:"slider_zooming",ZOOM_CHANGE:"slider_zoom_change",START_DRAG:"start_drag",AFTER_DRAG_CHANGE:"after_drag_change",ACTION_START:"action_start",ACTION_END:"action_end",CLICK:"slider_click",TRANSITION_START:"slider_transition_start",TRANSITION_END:"slider_transition_end",AFTER_PUT_IMAGE:"after_put_image",IMAGE_MOUSEENTER:"slider_image_mouseenter",IMAGE_MOUSELEAVE:"slider_image_mouseleave",CURRENTSLIDE_LOAD_START:"slider_current_loadstart",CURRENTSLIDE_LOAD_END:"slider_current_loadend"};var E={slider_scale_mode:"fill",slider_scale_mode_media:"fill",slider_scale_mode_fullscreen:"down",slider_item_padding_top:0,slider_item_padding_bottom:0,slider_item_padding_left:0,slider_item_padding_right:0,slider_background_color:"",slider_background_opacity:1,slider_image_padding_top:0,slider_image_padding_bottom:0,slider_image_padding_left:0,slider_image_padding_right:0,slider_image_border:!1,slider_image_border_width:10,slider_image_border_color:"#ffffff",slider_image_border_radius:0,slider_image_border_maxratio:.35,slider_image_shadow:!1,slider_video_constantsize:!1,slider_video_constantsize_scalemode:"fit",slider_video_constantsize_width:854,slider_video_constantsize_height:480,slider_video_padding_top:0,slider_video_padding_bottom:0,slider_video_padding_left:0,slider_video_padding_right:0,slider_video_enable_closebutton:!0,slider_transition:"slide",slider_transition_speed:300,slider_transition_easing:"easeInOutQuad",slider_control_swipe:!0,slider_control_zoom:!0,slider_zoom_mousewheel:!0,slider_vertical_scroll_ondrag:!1,slider_loader_type:1,slider_loader_color:"white",slider_enable_links:!0,slider_links_newpage:!1,slider_enable_bullets:!1,slider_bullets_skin:"",slider_bullets_space_between:-1,slider_bullets_align_hor:"center",slider_bullets_align_vert:"bottom",slider_bullets_offset_hor:0,slider_bullets_offset_vert:10,slider_enable_arrows:!0,slider_arrows_skin:"",slider_arrow_left_align_hor:"left",slider_arrow_left_align_vert:"middle",slider_arrow_left_offset_hor:20,slider_arrow_left_offset_vert:0,slider_arrow_right_align_hor:"right",slider_arrow_right_align_vert:"middle",slider_arrow_right_offset_hor:20,slider_arrow_right_offset_vert:0,slider_enable_progress_indicator:!0,slider_progress_indicator_type:"pie",slider_progress_indicator_align_hor:"right",slider_progress_indicator_align_vert:"top",slider_progress_indicator_offset_hor:10,slider_progress_indicator_offset_vert:10,slider_enable_play_button:!0,slider_play_button_skin:"",slider_play_button_align_hor:"left",slider_play_button_align_vert:"top",slider_play_button_offset_hor:40,slider_play_button_offset_vert:8,slider_play_button_mobilehide:!1,slider_enable_fullscreen_button:!0,slider_fullscreen_button_skin:"",slider_fullscreen_button_align_hor:"left",slider_fullscreen_button_align_vert:"top",slider_fullscreen_button_offset_hor:11,slider_fullscreen_button_offset_vert:9,slider_fullscreen_button_mobilehide:!1,slider_enable_zoom_panel:!0,slider_zoompanel_skin:"",slider_zoompanel_align_hor:"left",slider_zoompanel_align_vert:"top",slider_zoompanel_offset_hor:12,slider_zoompanel_offset_vert:92,slider_zoompanel_mobilehide:!1,slider_controls_always_on:!1,slider_controls_appear_ontap:!0,slider_controls_appear_duration:300,slider_enable_text_panel:!0,slider_textpanel_always_on:!0,slider_videoplay_button_type:"square"},T={slider_progress_indicator_align_hor:"left",slider_progress_indicator_align_vert:"bottom",slider_progress_indicator_offset_hor:0,slider_progress_indicator_offset_vert:0},S={isRunOnce:!1,isTextPanelSaparateHover:!1,numPrev:1,numCurrent:2,numNext:3,isControlsVisible:!0,currentControlsMode:"image"};function P(i,n,r){p=i,r&&(g=r,n=y.convertCustomPrefixOptions(n,g,"slider")),e=jQuery(i);var o=p.getObjects();if(t=o.g_objWrapper,o.g_objThumbs,n.hasOwnProperty("slider_progress_indicator_type")&&(E.slider_progress_indicator_type=n.slider_progress_indicator_type),"bar"==E.slider_progress_indicator_type&&(E=jQuery.extend(E,T)),n&&c.setOptions(n),function(){var e=p.getOptions(),t=e.gallery_skin;""==E.slider_bullets_skin&&(E.slider_bullets_skin=t);""==E.slider_arrows_skin&&(E.slider_arrows_skin=t);""==E.slider_zoompanel_skin&&(E.slider_zoompanel_skin=t);""==E.slider_play_button_skin&&(E.slider_play_button_skin=t);""==E.slider_fullscreen_button_skin&&(E.slider_fullscreen_button_skin=t);E.video_enable_closebutton=E.slider_video_enable_closebutton,"zoom"!=e.gallery_mousewheel_role&&(E.slider_zoom_mousewheel=!1)}(),1==E.slider_enable_bullets){b=new UGBullets;var a={bullets_skin:E.slider_bullets_skin,bullets_space_between:E.slider_bullets_space_between};b.init(p,a)}E.slider_enable_text_panel&&(w=new UGTextPanel).init(p,E,"slider"),E.slider_enable_zoom_panel&&(_=new UGZoomButtonsPanel).init(c,E);var s=p.getGalleryID();v.init(E,!1,s)}function x(){if(1==S.isRunOnce)return!1;if(S.isRunOnce=!0,E.slider_background_color){var t=E.slider_background_color;1!=E.slider_background_opacity&&(t=y.convertHexToRGB(t,E.slider_background_opacity)),i.css("background-color",t)}else 1!=E.slider_background_opacity&&(t=y.convertHexToRGB("#000000",E.slider_background_opacity),i.css("background-color",t));1==E.slider_control_swipe&&(u=new UGTouchSliderControl).init(c,E),1==E.slider_control_zoom&&(d=new UGZoomSliderControl).init(c,E),w&&w.run(),function(){e.on(p.events.ITEM_IMAGE_UPDATED,se),e.on(p.events.ITEM_CHANGE,K),b&&jQuery(b).on(b.events.BULLET_CLICK,J);1==E.slider_enable_arrows&&(y.addClassOnHover(l,"ug-arrow-hover"),y.addClassOnHover(s,"ug-arrow-hover"),p.setNextButton(l),p.setPrevButton(s));0==E.slider_controls_always_on&&i.hover(ie,ne);i.on("touchend click",$),h.on(c.events.CLICK,ee),w&&1==S.isTextPanelSaparateHover&&i.hover(D,G);m&&(y.addClassOnHover(m,"ug-button-hover"),p.setPlayButton(m));f&&(y.addClassOnHover(f,"ug-button-hover"),p.setFullScreenToggleButton(f));d&&h.on(c.events.ZOOM_CHANGE,te);_&&_.initEvents();v.initEvents(),jQuery(v).on(v.events.SHOW,oe),jQuery(v).on(v.events.HIDE,ae),ue(r),ue(o),ue(a),h.on(c.events.AFTER_PUT_IMAGE,le),i.on("mouseenter",".ug-item-wrapper img",function(e){h.trigger(c.events.IMAGE_MOUSEENTER)}),i.on("mouseleave",".ug-item-wrapper img",function(e){var t=c.isMouseInsideSlideImage(e);0==t&&h.trigger(c.events.IMAGE_MOUSELEAVE)})}()}function j(e,t){var i="ug-type-square";"round"==E.slider_videoplay_button_type&&(i="ug-type-round");var n="";return n+="<div class='ug-slide-wrapper ug-slide"+t+"'>",n+="<div class='ug-item-wrapper'></div>",n+="<div class='ug-slider-preloader "+e+"'></div>",n+="<div class='ug-button-videoplay "+i+"' style='display:none'></div>",n+="</div>"}function C(e){e&&(t=e);var u=function(){var e;switch(E.slider_loader_type){default:case 1:e="ug-loader1";break;case 2:e="ug-loader2";break;case 3:e="ug-loader3";break;case 4:e="ug-loader4";break;case 5:e="ug-loader5";break;case 6:e="ug-loader6";break;case 7:e="ug-loader7";break;case 8:e="ug-loader8";break;case 9:e="ug-loader9"}"black"==E.slider_loader_color&&(e+=" ug-loader-black");return e}(),d=(p.getOptions(),"<div class='ug-slider-wrapper'>");(d+="<div class='ug-slider-inner'>",d+=j(u,1),d+=j(u,2),d+=j(u,3),d+="</div>",1==E.slider_enable_arrows&&(d+="<div class='ug-slider-control ug-arrow-left ug-skin-"+E.slider_arrows_skin+"'></div>",d+="<div class='ug-slider-control ug-arrow-right ug-skin-"+E.slider_arrows_skin+"'></div>"),1==E.slider_enable_play_button&&(d+="<div class='ug-slider-control ug-button-play ug-skin-"+E.slider_play_button_skin+"'></div>"),1==E.slider_enable_fullscreen_button&&(d+="<div class='ug-slider-control ug-button-fullscreen ug-skin-"+E.slider_fullscreen_button_skin+"'></div>"),d+="</div>",t.append(d),i=t.children(".ug-slider-wrapper"),n=i.children(".ug-slider-inner"),r=n.children(".ug-slide1"),o=n.children(".ug-slide2"),a=n.children(".ug-slide3"),r.data("slidenum",1),o.data("slidenum",2),a.data("slidenum",3),b&&b.appendHTML(i),1==E.slider_enable_arrows&&(s=i.children(".ug-arrow-left"),l=i.children(".ug-arrow-right")),1==E.slider_enable_play_button&&(m=i.children(".ug-button-play")),1==E.slider_enable_fullscreen_button&&(f=i.children(".ug-button-fullscreen")),1==E.slider_enable_progress_indicator)&&("bar"==(I=y.initProgressIndicator(E.slider_progress_indicator_type,E,i)).getType()&&"pie"==E.slider_progress_indicator_type&&(E.slider_progress_indicator_type="bar",E=jQuery.extend(E,T)),p.setProgressIndicator(I));1==E.slider_enable_text_panel&&(w.appendHTML(i),0==E.slider_textpanel_always_on&&(w.getElement().hide().data("isHidden",!0),S.isTextPanelSaparateHover=!0));1==E.slider_enable_zoom_panel&&_.appendHTML(i),v.setHtml(n)}function A(e){var t=_e(e);y.placeElementInParentCenter(t);var i=ge(e);y.placeElementInParentCenter(i)}function M(){if(b&&(objBullets=b.getElement(),y.placeElement(objBullets,E.slider_bullets_align_hor,E.slider_bullets_align_vert,E.slider_bullets_offset_hor,E.slider_bullets_offset_vert),y.placeElement(objBullets,E.slider_bullets_align_hor,E.slider_bullets_align_vert,E.slider_bullets_offset_hor,E.slider_bullets_offset_vert)),1==E.slider_enable_arrows&&(y.placeElement(s,E.slider_arrow_left_align_hor,E.slider_arrow_left_align_vert,E.slider_arrow_left_offset_hor,E.slider_arrow_left_offset_vert),y.placeElement(l,E.slider_arrow_right_align_hor,E.slider_arrow_left_align_vert,E.slider_arrow_right_offset_hor,E.slider_arrow_right_offset_vert)),0==E.slider_controls_always_on&&X(!0),I){var e=I.getElement();if("bar"==E.slider_progress_indicator_type){var t=i.width();I.setSize(t),y.placeElement(e,"left",E.slider_progress_indicator_align_vert,0,E.slider_progress_indicator_offset_vert)}else y.placeElement(e,E.slider_progress_indicator_align_hor,E.slider_progress_indicator_align_vert,E.slider_progress_indicator_offset_hor,E.slider_progress_indicator_offset_vert)}w&&w.positionPanel(),function(){m&&y.placeElement(m,E.slider_play_button_align_hor,E.slider_play_button_align_vert,E.slider_play_button_offset_hor,E.slider_play_button_offset_vert);f&&y.placeElement(f,E.slider_fullscreen_button_align_hor,E.slider_fullscreen_button_align_vert,E.slider_fullscreen_button_offset_hor,E.slider_fullscreen_button_offset_vert);if(_){var e=_.getElement();y.placeElement(e,E.slider_zoompanel_align_hor,E.slider_zoompanel_align_vert,E.slider_zoompanel_offset_hor,E.slider_zoompanel_offset_vert)}}(),A(r),A(o),A(a),p.isMobileMode()?(1==E.slider_fullscreen_button_mobilehide&&f&&f.hide(),1==E.slider_play_button_mobilehide&&m&&m.hide(),1==E.slider_zoompanel_mobilehide&&_&&_.getElement().hide()):(1==E.slider_fullscreen_button_mobilehide&&f&&f.show(),1==E.slider_play_button_mobilehide&&m&&m.show(),1==E.slider_zoompanel_mobilehide&&_&&_.getElement().show())}function O(){var e,t,i,r,o=c.getSlidesReference(),a=0;i=c.isSlideHasItem(o.objNextSlide),(r=c.isSlideHasItem(o.objPrevSlide))?(a=o.objPrevSlide.outerWidth(),o.objPrevSlide.css("z-index",1)):o.objPrevSlide.hide(),e=t=a+o.objCurrentSlide.outerWidth(),i?(e=t+o.objNextSlide.outerWidth(),o.objPrevSlide.css("z-index",2)):o.objNextSlide.hide(),o.objCurrentSlide.css("z-index",3),y.placeElement(o.objCurrentSlide,a,0),n.css({left:-a+"px",width:e+"px"}),r&&(y.placeElement(o.objPrevSlide,0,0),y.showElement(o.objPrevSlide)),i&&(y.showElement(o.objNextSlide),y.placeElement(o.objNextSlide,t,0))}function z(e){var t=e.data("index");if(void 0===t||null==t)return!1;var i=p.getItem(t);if(!i)return!1;R(e,i)}function L(e){e.stop(!0).hide(100)}function N(e,t,i){var n={};if(1==E.slider_image_border){n["border-style"]="solid";var r=function(e,t){if((a=E.slider_image_border_width)<=10)return a;var i=y.getElementSize(e),n=i.width,r=i.height;if(t&&(t.hasOwnProperty("imageWidth")&&(n=t.imageWidth),t.hasOwnProperty("imageHeight")&&(r=t.imageHeight)),n<=0)return a;var o=n<r?n:r;if(2*a/o<E.slider_image_border_maxratio)return a;var a=o*E.slider_image_border_maxratio/2;return a=Math.round(a)}(e,i);n["border-width"]=r+"px",n["border-color"]=E.slider_image_border_color,n["border-radius"]=E.slider_image_border_radius}"image"!=t&&1==E.slider_video_constantsize&&(n["background-color"]="#000000"),1==E.slider_image_shadow&&(n["box-shadow"]="3px 3px 10px 0px #353535"),e.css(n)}function H(e,t){var i=E.slider_video_constantsize_width,n=E.slider_video_constantsize_height,r=E.slider_video_constantsize_scalemode;return y.scaleImageExactSizeInParent(e,t.imageWidth,t.imageHeight,i,n,r)}function k(e,t,i){var n=e.children(".ug-item-wrapper"),r=_e(e);if(void 0===t.urlImage||""==t.urlImage)throw new Error("The slide don't have big image defined ( data-image='imageurl' ). Please check gallery items.","showbig");var o=t.urlImage,a=e.data("urlImage");e.data("urlImage",o);var s=c.getScaleMode(e),l=c.getSlideType(e);objPadding=c.getObjImagePadding();var u="";if("string"==typeof t.description&&(u=t.description),a==o&&!0!==i){(_=n.children("img")).attr("alt",u),0!=t.imageWidth&&0!=t.imageHeight||p.checkFillImageSize(_,t);var d={};N(_,l,d="image"!=l&&1==E.slider_video_constantsize?H(_,t):y.scaleImageFitParent(_,t.imageWidth,t.imageHeight,s,objPadding)),h.trigger(c.events.AFTER_PUT_IMAGE,e)}else{var _;if((_=y.placeImageInsideParent(o,n,t.imageWidth,t.imageHeight,s,objPadding)).attr("alt",u),1==t.isBigImageLoaded){if(_.fadeTo(0,1),L(r),"image"!=l&&1==E.slider_video_constantsize)d=H(_,t);else d=y.getImageInsideParentData(n,t.imageWidth,t.imageHeight,s,objPadding);_.css("width",d.imageWidth+"px"),N(_,l,d),h.trigger(c.events.AFTER_PUT_IMAGE,e)}else _.fadeTo(0,0),function(e){e.stop(!0).show(100)}(r),e.data("isLoading",!0),c.isSlideCurrent(e)&&h.trigger(c.events.CURRENTSLIDE_LOAD_START),_.data("itemIndex",t.index),_.on("load",function(){var e=jQuery(this),t=e.data("itemIndex");e.fadeTo(0,1);var i=e.parent().parent(),n=c.getSlideType(i),r=_e(i),o=c.getObjImagePadding(),a=c.getScaleMode(i);L(r),i.data("isLoading",!1),c.isSlideCurrent(i)&&h.trigger(c.events.CURRENTSLIDE_LOAD_END),p.onItemBigImageLoaded(null,e);var s=p.getItem(t),l={};"image"!=n&&1==E.slider_video_constantsize?H(e,s):l=y.scaleImageFitParent(e,s.imageWidth,s.imageHeight,a,o),e.fadeTo(0,1),N(e,n,l),h.trigger(c.events.AFTER_PUT_IMAGE,i)})}}function R(e,t){try{var i=e.children(".ug-item-wrapper");if(null==t)return i.html(""),e.removeData("index"),e.removeData("type"),e.removeData("urlImage"),!1;e.data("index");e.data("index",t.index),e.data("type",t.type),1==E.slider_enable_links&&"image"==t.type&&(t.link?e.addClass("ug-slide-clickable"):e.removeClass("ug-slide-clickable")),k(e,t);var n=ge(e);switch(t.type){case"image":n.hide();break;default:n.show()}}catch(e){throw void 0!==e.fileName&&"showbig"==e.fileName&&p.showErrorMessageReplaceGallery(e.message),i.html(""),new Error(e)}}function G(){if(!w)return!1;if(1==Q())return!1;var e=w.getElement(),t=0;1!=S.isTextPanelSaparateHover&&1!=E.slider_textpanel_always_on||(t=E.slider_controls_appear_duration),e.stop().fadeTo(t,0),e.data("isHidden",!0)}function D(){if(!w)return!1;if(0==Q())return!1;var e=w.getElement(),t=0;1!=S.isTextPanelSaparateHover&&1!=E.slider_textpanel_always_on||(e.show(),w.positionElements(),t=E.slider_controls_appear_duration),e.stop().show().fadeTo(t,1),e.data("isHidden",!1)}function Q(){return!1!==w.getElement().data("isHidden")}function W(){var e=c.getCurrentSlide(),t=c.getSlideImage(e),i=y.getElementSize(e),n=i.left,r=i.top;if(1==E.slider_video_constantsize){var o=y.getElementSize(t);n+=o.left,r+=o.top}else n+=E.slider_video_padding_left,r+=E.slider_video_padding_top;trace("video top: "+r),v.setPosition(n,r)}function F(){var e=E.slider_video_constantsize_width,t=E.slider_video_constantsize_height;v.setSize(e,t),N(v.getObject(),"video")}function B(e,t,i){h.trigger(c.events.TRANSITION_START);var r=E.slider_transition;switch(i&&(r=i),c.stopSlideAction(null,!0),r){default:case"fade":U(t);break;case"slide":!function e(t,i){var r=c.isAnimating();if(1==r)return S.itemWaiting=i,!0;null!=S.itemWaiting&&(S.itemWaiting=null);var o=c.getSlidesReference();switch(t){case"right":R(o.objPrevSlide,i),O();var a=y.getElementSize(o.objPrevSlide),s=-a.left;c.switchSlideNums("right");break;case"left":R(o.objNextSlide,i),O();var l=y.getElementSize(o.objNextSlide),s=-l.left;c.switchSlideNums("left");break;default:throw new Error("wrong direction: "+t)}var u=E.slider_transition_speed;var d=E.slider_transition_easing;var _={duration:u,easing:d,queue:!1,always:function(){if(c.stopSlideAction(),v.hide(),null!=S.itemWaiting){var t=function(e){var t=c.getSlidesReference().objCurrentSlide.data("index"),i=e.index,n="left";t>i&&(n="right");return n}(S.itemWaiting);e(t,S.itemWaiting)}else c.placeNabourItems(),h.trigger(c.events.TRANSITION_END)}};n.animate({left:s+"px"},_)}(e,t);break;case"lightbox_open":U(t,!1,!0)}}function Y(e,t,i){i?e.fadeTo(E.slider_transition_speed,t,i):e.fadeTo(E.slider_transition_speed,t)}function U(e,t,i){if(!t)t=!1;var n=c.getSlidesReference();R(n.objNextSlide,e);var r=y.getElementSize(n.objCurrentSlide);y.placeElement(n.objNextSlide,r.left,r.top);var o=S.numCurrent;if(S.numCurrent=S.numNext,S.numNext=o,h.trigger(c.events.ITEM_CHANGED),n.objNextSlide.stop(!0),n.objCurrentSlide.stop(!0),1==t)n.objCurrentSlide.fadeTo(0,0),n.objNextSlide.fadeTo(0,1),c.placeNabourItems(),h.trigger(c.events.TRANSITION_END),!0!==i&&v.hide();else{if(n.objNextSlide.fadeTo(0,0),Y(n.objCurrentSlide,0,function(){c.placeNabourItems(),h.trigger(c.events.TRANSITION_END),!0!==i&&v.hide()}),1==v.isVisible())Y(v.getObject(),0);Y(n.objNextSlide,1)}}function V(){return i.children(".ug-slider-control")}function X(e){if(0==y.isTimePassed("sliderControlsToggle"))return!1;if(0==S.isControlsVisible)return!1;if(!e)e=!1;var t=V();!0===e?t.stop().fadeTo(0,0).hide():t.stop().fadeTo(E.slider_controls_appear_duration,0,function(){t.hide()}),S.isControlsVisible=!1}function Z(e){if(0==y.isTimePassed("sliderControlsToggle"))return!1;if(1==S.isControlsVisible)return!0;if(!e)e=!1;var t=V();!0===e?t.stop().show():(t.stop().show().fadeTo(0,0),t.fadeTo(E.slider_controls_appear_duration,1)),S.isControlsVisible=!0}function q(e){if(e==S.currentControlsMode)return!1;switch(e){case"image":_&&_.getElement().show();break;case"video":_&&_.getElement().hide();break;default:throw new Error("wrong controld mode: "+e)}S.currentControlsMode=e}function K(e,t,i){var n=p.getSelectedItem();c.setItem(n,!1,i);var r=n.index;b&&b.setActive(r),w&&0==S.isTextPanelSaparateHover&&D(),"image"==n.type?q("image"):q("video")}function J(e,t){p.selectItem(t)}function $(e){if(u&&0==u.isTapEventOccured(e))return!0;h.trigger(c.events.CLICK,e)}function ee(){var e=c.getCurrentSlide().hasClass("ug-slide-clickable"),t=c.getCurrentItem();if(e)return 0==E.slider_links_newpage?location.href=t.link:window.open(t.link,"_blank"),!0;0==E.slider_controls_always_on&&1==E.slider_controls_appear_ontap&&1==c.isCurrentSlideType("image")&&(0==S.isControlsVisible?Z():X(),w&&1==E.slider_textpanel_always_on&&c.isCurrentSlideType("image")&&c.isCurrentSlideImageFit()&&D())}function te(e){w&&c.isCurrentSlideType("image")&&0==c.isCurrentSlideImageFit()&&G()}function ie(){Z()}function ne(){X()}function re(e){var t=e.parent();c.startSlideAction(t)}function oe(){p.isPlayMode()&&p.pausePlaying(),h.trigger(c.events.ACTION_START)}function ae(){p.isPlayMode()&&p.continuePlaying(),h.trigger(c.events.ACTION_END)}function se(e,t,i){r.data("index")==t&&(objItem=p.getItem(t),k(r,objItem,!0)),o.data("index")==t&&(objItem=p.getItem(t),k(o,objItem,!0)),a.data("index")==t&&(objItem=p.getItem(t),k(a,objItem,!0))}function le(e,t){t=jQuery(t);var i=c.getSlideImage(t),n=ge(t),r=y.getElementSize(i);y.placeElement(n,"center","middle",r.left,r.top,i)}function ue(e){var t=ge(e);y.addClassOnHover(t),y.setButtonOnClick(t,re)}function de(e){switch(e){case 1:return r;case 2:return o;case 3:return a;default:throw new Error("wrong num: "+e)}}function _e(e){if(!e)e=c.getCurrentSlide();return e.children(".ug-slider-preloader")}function ge(e){return e.children(".ug-button-videoplay")}function ce(e){if(!e)e=c.getCurrentSlide();var t=e.data("index");return null==t?null:p.getItem(t)}this.switchSlideNums=function(e){switch(h.trigger(c.events.BEFORE_SWITCH_SLIDES),e){case"left":var t=S.numCurrent;S.numCurrent=S.numNext,S.numNext=S.numPrev,S.numPrev=t;break;case"right":t=S.numCurrent;S.numCurrent=S.numPrev,S.numPrev=S.numNext,S.numNext=t;break;default:throw new Error("wrong direction: "+e)}h.trigger(c.events.ITEM_CHANGED)},this.destroy=function(){h.off(c.events.AFTER_PUT_IMAGE),e.off(p.events.ITEM_IMAGE_UPDATED),e.off(p.events.ITEM_CHANGE),b&&jQuery(b).on(b.events.BULLET_CLICK),i.off("mouseenter"),i.off("mouseleave"),i.off("touchend"),i.off("click"),h.off(c.events.CLICK),d&&h.off(c.events.ZOOM_CHANGE),h.off(c.events.BEFORE_SWITCH_SLIDES),jQuery(v).off(v.events.SHOW),jQuery(v).off(v.events.HIDE),v.destroy(),i.off("mouseenter",".ug-item-wrapper img"),i.off("mouseleave",".ug-item-wrapper img")},this.________EXTERNAL_GENERAL___________=function(){},this.init=function(e,t,i){P(e,t,i)},this.getSlideImage=function(e){if(!e)e=c.getCurrentSlide();return e.find(".ug-item-wrapper img")},this.setHtml=function(e){C(e)},this.run=function(){x()},this.isInnerInPlace=function(){var e=c.getSlidesReference();return-y.getElementSize(e.objCurrentSlide).left==y.getElementSize(n).left},this.isAnimating=function(){return n.is(":animated")},this.isSlideCurrent=function(e){var t=e.data("slidenum");return S.numCurrent==t},this.isSlideHasItem=function(e){var t=e.data("index");return null!=t},this.getObjImagePadding=function(){return{padding_top:E.slider_image_padding_top,padding_bottom:E.slider_image_padding_bottom,padding_left:E.slider_image_padding_left,padding_right:E.slider_image_padding_right}},this.getSlidesReference=function(){return{objPrevSlide:de(S.numPrev),objNextSlide:de(S.numNext),objCurrentSlide:de(S.numCurrent)}},this.getCurrentSlide=function(){return c.getSlidesReference().objCurrentSlide},this.getCurrentItemIndex=function(){var e=c.getSlidesReference().objCurrentSlide.data("index");return null==e&&(e=-1),e},this.getCurrentItem=function(){var e=c.getCurrentItemIndex();return-1==e?null:p.getItem(e)},this.getSlideType=function(e){return null==e&&(e=c.getCurrentSlide()),e.data("type")},this.isMouseInsideSlideImage=function(e){var t=c.getSlideImage(),i=y.getMousePosition(e);void 0===i.pageX&&(i=u.getLastMousePos());var n=y.getMouseElementPoint(i,t),r=y.getElementSize(t);return isMouseInside=y.isPointInsideElement(n,r),isMouseInside},this.isCurrentSlideType=function(e){return c.getSlideType()==e},this.isCurrentSlideLoadingImage=function(){return!0===c.getCurrentSlide().data("isLoading")},this.setItem=function(e,t,i){var n=c.getSlidesReference(),r=n.objCurrentSlide.data("index"),o=e.index;if(o==r)return!0;if(null==r)R(n.objCurrentSlide,e),c.placeNabourItems();else{var a="left";p.getNumItems();"next"==i?a="left":"prev"==i||r>o?a="right":r>o&&(a="right"),B(a,e,t)}},this.placeNabourItems=function(){var e=c.getSlidesReference(),t=e.objCurrentSlide.data("index"),i=p.getPrevItem(t),n=p.getNextItem(t);R(e.objNextSlide,n),R(e.objPrevSlide,i),O()},this.________EXTERNAL_API___________=function(){},this.stopSlideAction=function(e,t){e||(e=c.getCurrentSlide()),!0===t?v.pause():v.hide()},this.startSlideAction=function(e){e||(e=c.getCurrentSlide());var t=ce(e);if("image"==t.type)return!0;switch(1==E.slider_video_constantsize&&F(),W(),v.show(),t.type){case"youtube":v.playYoutube(t.videoid,!0,t.video_start);break;case"vimeo":v.playVimeo(t.videoid);break;case"html5video":v.playHtml5Video(t.videoogv,t.videowebm,t.videomp4,t.urlImage);break;case"soundcloud":v.playSoundCloud(t.trackid);break;case"wistia":v.playWistia(t.videoid)}},this.getScaleMode=function(e){if(!e)e=c.getCurrentSlide();return"image"!=c.getSlideType(e)?E.slider_scale_mode_media:E.slider_scale_mode==E.slider_scale_mode_fullscreen?E.slider_scale_mode:1==p.isFullScreen()?E.slider_scale_mode_fullscreen:E.slider_scale_mode},this.getObjects=function(){return{g_objSlider:i,g_objInner:n,g_options:E,g_objZoomSlider:d}},this.getObjZoom=function(){return d},this.getOptions=function(){return E},this.getElement=function(){return i},this.getVideoObject=function(){return v},this.isCurrentSlideImageFit=function(){var e=c.getCurrentSlide();c.getSlideType(e);!function(e,t){null==t&&(t=c.getCurrentSlide());var i=c.getSlideType(t);if(i!=e)throw new Error("Wrong slide type: "+i+", should be: "+e)}("image",e);var t=c.getSlideImage(e);return 0!=t.length&&y.isImageFitParent(t)},this.isCurrentImageInPlace=function(){var e=c.getSlideImage();if(0==e.length)return!1;var t=c.getScaleMode(),i=c.getObjImagePadding(),n=ce(),r=e.parent(),o=y.getImageInsideParentData(r,n.imageWidth,n.imageHeight,t,i),a=y.getElementSize(e),s=!1;return o.imageWidth==a.width&&(s=!0),s},this.isSlideActionActive=function(){return v.isVisible()},this.isSwiping=function(){return!!u&&u.isTouchActive()},this.isPreloading=function(){return!!_e().is(":visible")},this.setOptions=function(e){g&&(e=y.convertCustomPrefixOptions(e,g,"slider")),E=jQuery.extend(E,e)},this.setSize=function(e,t){if(e<0||t<0)return!0;var s={};s.width=e+"px",s.height=t+"px",i.css(s);var l={};l.height=t+"px",l.top="0px",l.left="0px",n.css(l);var u={};u.height=t+"px",u.width=e+"px",r.css(u),o.css(u),a.css(u);var d=e-E.slider_item_padding_left-E.slider_item_padding_right,_=t-E.slider_item_padding_top-E.slider_item_padding_bottom,g={};if(g.width=d+"px",g.height=_+"px",g.top=E.slider_item_padding_top+"px",g.left=E.slider_item_padding_left+"px",i.find(".ug-item-wrapper").css(g),w&&w.setSizeByParent(),M(),z(r),z(o),z(a),O(),"image"!=c.getSlideType()&&1==E.slider_video_constantsize)F();else{var h=e-E.slider_video_padding_left-E.slider_video_padding_right,p=t-E.slider_video_padding_top-E.slider_video_padding_bottom;v.setSize(h,p)}W()},this.refreshSlideItems=function(){if(1==c.isAnimating())return!0;z(r),z(o),z(a),O()},this.isMouseOver=function(){return i.ismouseover()},this.setPosition=function(e,t){y.placeElement(i,e,t)},this.zoomIn=function(){if(!d)return!0;d.zoomIn()},this.zoomOut=function(){if(!d)return!0;d.zoomOut()},this.zoomBack=function(){if(!d)return!0;d.zoomBack()}}function UGTextPanel(){var e,t,i,n,r,o,a,s=this,l=new UGFunctions,u="",d={textpanel_align:"bottom",textpanel_margin:0,textpanel_text_valign:"middle",textpanel_padding_top:10,textpanel_padding_bottom:10,textpanel_height:null,textpanel_padding_title_description:5,textpanel_padding_right:11,textpanel_padding_left:11,textpanel_fade_duration:200,textpanel_enable_title:!0,textpanel_enable_description:!0,textpanel_title_as_link:!1,textpanel_title_link_newtab:!0,textpanel_enable_bg:!0,textpanel_bg_color:"#000000",textpanel_bg_opacity:.4,textpanel_title_color:null,textpanel_title_font_family:null,textpanel_title_text_align:null,textpanel_title_font_size:null,textpanel_title_bold:null,textpanel_css_title:{},textpanel_desc_color:null,textpanel_desc_font_family:null,textpanel_desc_text_align:null,textpanel_desc_font_size:null,textpanel_desc_bold:null,textpanel_css_description:{},textpanel_desc_style_as_title:!1,textpanel_bg_css:{}},_={isFirstTime:!0,setInternalHeight:!0,lastTitleBottom:0,lastDescHeight:0};function g(t,a){if(!a)a=d.textpanel_padding_top;var s=a;if(i){var u=s;if(l.placeElement(i,0,u),1==i.is(":visible")){(s=l.getElementSize(i).bottom)>0&&(_.lastTitleBottom=s)}else{s=20;_.lastTitleBottom>0&&(s=_.lastTitleBottom)}}var g="";if(n&&(g=jQuery.trim(n.text())),""!=g){var c=s;if(i&&(c+=d.textpanel_padding_title_description),l.placeElement(n,0,c),1==jQuery(n).is(":visible")){var h=l.getElementSize(n);s=h.bottom,h.height>0&&(_.lastDescHeight=h.height)}else{var p=16;_.lastDescHeight>0&&(p=_.lastDescHeight),s=c+p}}d.textpanel_height||1!=_.setInternalHeight||function(t,i){if(!i)var i=!1;if(1==i){if(r){var n=r.height();t>n&&r.height(t)}var a={height:t+"px"};e.add(o).animate(a,d.textpanel_fade_duration)}else r&&r.height(t),e.add(o).height(t)}(s+d.textpanel_padding_bottom,t)}function c(){var e=0;if(i&&(e+=i.outerHeight()),n){var t="";n&&(t=jQuery.trim(n.text())),""!=t&&(i&&(e+=d.textpanel_padding_title_description),e+=n.outerHeight())}return e}function h(){if(1==d.textpanel_enable_bg){(r=e.children(".ug-textpanel-bg")).fadeTo(0,d.textpanel_bg_opacity);var t={"background-color":d.textpanel_bg_color};t=jQuery.extend(t,d.textpanel_bg_css),r.css(t)}if(1==d.textpanel_enable_title){i=o.children(".ug-textpanel-title");var a={};null!==d.textpanel_title_color&&(a.color=d.textpanel_title_color),null!==d.textpanel_title_font_family&&(a["font-family"]=d.textpanel_title_font_family),null!==d.textpanel_title_text_align&&(a["text-align"]=d.textpanel_title_text_align),null!==d.textpanel_title_font_size&&(a["font-size"]=d.textpanel_title_font_size+"px"),null!==d.textpanel_title_bold&&(!0===d.textpanel_title_bold?a["font-weight"]="bold":a["font-weight"]="normal"),d.textpanel_css_title&&(a=jQuery.extend(a,d.textpanel_css_title)),i.css(a)}if(1==d.textpanel_enable_description){n=o.children(".ug-textpanel-description");var s={};null!==d.textpanel_desc_color&&(s.color=d.textpanel_desc_color),null!==d.textpanel_desc_font_family&&(s["font-family"]=d.textpanel_desc_font_family),null!==d.textpanel_desc_text_align&&(s["text-align"]=d.textpanel_desc_text_align),null!==d.textpanel_desc_font_size&&(s["font-size"]=d.textpanel_desc_font_size+"px"),null!==d.textpanel_desc_bold&&(!0===d.textpanel_desc_bold?s["font-weight"]="bold":s["font-weight"]="normal"),d.textpanel_css_title&&(s=jQuery.extend(s,d.textpanel_css_description)),n.css(s)}}function p(){var e=a.getSelectedItem();s.setText(e.title,e.description,e.link)}this.positionElements=function(e){if(!d.textpanel_height||"top"==d.textpanel_text_valign)return g(e),!1;switch(d.textpanel_text_valign){default:case"top":g(!1);break;case"bottom":t=c(),g(!1,o.height()-t-d.textpanel_padding_bottom);break;case"center":case"middle":!function(){var e=c();g(!1,(o.height()-e)/2)}()}var t},this.init=function(e,t,i){if(a=e,i&&(u=i,t=l.convertCustomPrefixOptions(t,u,"textpanel")),t&&(d=jQuery.extend(d,t)),0==d.textpanel_enable_title&&0==d.textpanel_enable_description)throw new Error("Textpanel Error: The title or description must be enabled");d.textpanel_height&&d.textpanel_height<0&&(d.textpanel_height=null),1==d.textpanel_desc_style_as_title&&(d.textpanel_desc_color||(d.textpanel_desc_color=d.textpanel_title_color),d.textpanel_desc_bold||(d.textpanel_desc_bold=d.textpanel_title_bold),d.textpanel_desc_font_family||(d.textpanel_desc_font_family=d.textpanel_title_font_family),d.textpanel_desc_font_size||(d.textpanel_desc_font_size=d.textpanel_title_font_size),d.textpanel_desc_text_align||(d.textpanel_desc_text_align=d.textpanel_title_text_align))},this.appendHTML=function(i,n){t=i;var r="<div class='ug-textpanel"+(n=n?" "+n:"")+"'>";1==d.textpanel_enable_bg&&(r+="<div class='ug-textpanel-bg"+n+"'></div>"),r+="<div class='ug-textpanel-textwrapper"+n+"'>",1==d.textpanel_enable_title&&(r+="<div class='ug-textpanel-title"+n+"'></div>"),1==d.textpanel_enable_description&&(r+="<div class='ug-textpanel-description"+n+"'></div>"),r+="</div></div>",i.append(r),e=i.children(".ug-textpanel"),o=e.children(".ug-textpanel-textwrapper"),h()},this.destroy=function(){jQuery(a).off(a.events.ITEM_CHANGE)},this.run=function(){s.setSizeByParent(),jQuery(a).on(a.events.ITEM_CHANGE,p)},this.setPanelSize=function(t,a){if(_.setInternalHeight=!0,a)_.setInternalHeight=!1;else a=80;d.textpanel_height&&(a=d.textpanel_height),e.width(t),e.height(a),r&&(r.width(t),r.height(a));var u=t-d.textpanel_padding_left-d.textpanel_padding_right,g=d.textpanel_padding_left;l.setElementSizeAndPosition(o,g,0,u,a),i&&i.width(u),n&&n.width(u),0==_.isFirstTime&&s.positionElements(!1)},this.setSizeByParent=function(){var e=l.getElementSize(t);s.setPanelSize(e.width)},this.setTextPlain=function(e,t,r){if(1==d.textpanel_title_as_link&&e&&r){var o="";1==d.textpanel_title_link_newtab&&(o+=' target="blank"'),e='<a class="ug-textpanel-link" href="'+r+'" '+o+">"+e+"</a>"}i&&i.html(e),n&&n.html(t)},this.setText=function(e,t,i){1==_.isFirstTime?(s.setTextPlain(e,t,i),_.isFirstTime=!1,s.positionElements(!1)):o.stop().fadeTo(d.textpanel_fade_duration,0,function(){s.setTextPlain(e,t,i),s.positionElements(!0),jQuery(this).fadeTo(d.textpanel_fade_duration,1)})},this.positionPanel=function(t,i){var n={};if(null!=t)n.top=t,n.bottom="auto";else switch(d.textpanel_align){case"top":n.top=d.textpanel_margin+"px";break;case"bottom":n.top="auto",n.bottom=d.textpanel_margin+"px";break;case"middle":n.top=l.getElementRelativePos(e,"middle",d.textpanel_margin)}null!=i&&(n.left=i),e.css(n)},this.setOptions=function(e){u&&(e=l.convertCustomPrefixOptions(e,u,"textpanel")),d=jQuery.extend(d,e)},this.getElement=function(){return e},this.getSize=function(){return l.getElementSize(e)},this.refresh=function(e,t,i,n){h(),i?s.setPanelSize(i,n):s.setSizeByParent(),s.positionElements(!1),!0!==t&&s.positionPanel(),!0===e&&s.show()},this.hide=function(){e.hide()},this.show=function(){e.show()},this.getOptions=function(){return d},this.getOption=function(e){return 0==d.hasOwnProperty(e)?null:d[e]}}function UGZoomButtonsPanel(){var e,t,i,n,r=new UGSlider,o=new UGFunctions,a={slider_zoompanel_skin:""};function s(e){return!e||!!e.hasClass("ug-zoompanel-button-disabled")}function l(e){e&&e.addClass("ug-zoompanel-button-disabled")}function u(e){e&&e.removeClass("ug-zoompanel-button-disabled")}function d(){if(0==r.isCurrentSlideType("image"))return!0;1==r.isCurrentSlideImageFit()?0==s(i)&&(l(i),l(n)):1==s(i)&&(u(i),u(n))}this.init=function(e,t){r=e,t&&(a=jQuery.extend(a,t))},this.appendHTML=function(r){r;var o="<div class='ug-slider-control ug-zoompanel ug-skin-"+a.slider_zoompanel_skin+"'>";o+="<div class='ug-zoompanel-button ug-zoompanel-plus'></div>",o+="<div class='ug-zoompanel-button ug-zoompanel-minus ug-zoompanel-button-disabled'></div>",o+="<div class='ug-zoompanel-button ug-zoompanel-return ug-zoompanel-button-disabled'></div>",o+="</div>",r.append(o),e=r.children(".ug-zoompanel"),t=e.children(".ug-zoompanel-plus"),i=e.children(".ug-zoompanel-minus"),n=e.children(".ug-zoompanel-return")},this.setObjects=function(e,r,o){t=e,n=o,(i=r)&&i.addClass("ug-zoompanel-button-disabled"),n&&n.addClass("ug-zoompanel-button-disabled")},this.getElement=function(){return e},this.initEvents=function(){o.addClassOnHover(t,"ug-button-hover"),o.addClassOnHover(i,"ug-button-hover"),o.addClassOnHover(n,"ug-button-hover"),o.setButtonOnClick(t,function(){if(1==s(t))return!0;r.zoomIn()}),o.setButtonOnClick(i,function(){if(1==s(i))return!0;r.zoomOut()}),o.setButtonOnClick(n,function(){if(1==s(n))return!0;r.zoomBack()}),jQuery(r).on(r.events.ZOOM_CHANGE,d),jQuery(r).on(r.events.ITEM_CHANGED,d)}}function UGBullets(){var e,t,i=this,n=0,r=new UniteGalleryMain,o=new UGFunctions,a={isInited:!1},s={bullets_skin:"",bullets_addclass:"",bullets_space_between:-1};function l(){var i="",r="";-1!=s.bullets_space_between&&(r=" style='margin-left:"+s.bullets_space_between+"px'");for(var o=0;o<n;o++)i+=0==o?"<div class='ug-bullet'></div>":"<div class='ug-bullet'"+r+"></div>";if(e.html(i),!t){var a=e.find(".ug-bullet:first-child");a.length&&(t=a.width())}}function u(e){if(1==i.isActive(e))return!0;var t=e.index();jQuery(i).trigger(i.events.BULLET_CLICK,t)}function d(){var t=e.children(".ug-bullet");o.setButtonOnClick(t,u),t.on("mousedown mouseup",function(e){return!1})}function _(e){if(e<0||e>=n)throw new Error("wrong bullet index: "+e)}function g(){if(1==a.isInited)return!0;throw new Error("The bullets are not inited!")}this.events={BULLET_CLICK:"bullet_click"},this.init=function(e,t,i){r=e,n=i||r.getNumItems(),a.isInited=!0,""==(s=jQuery.extend(s,t)).bullets_skin&&(s.bullets_skin=s.gallery_skin)},this.getBulletsWidth=function(){return 0==n?0:t?n*t+(n-1)*s.bullets_space_between:0},this.appendHTML=function(t){t,g();var i="";""!=s.bullets_addclass&&(i=" "+s.bullets_addclass);var n="<div class='ug-slider-control ug-bullets ug-skin-"+s.bullets_skin+i+"'>";e=jQuery(n+="</div>"),t.append(e),l(),d()},this.updateNumBullets=function(e){n=e,l(),d()},this.getElement=function(){return e},this.setActive=function(t){g(),_(t);var i=e.children(".ug-bullet");i.removeClass("ug-bullet-active"),jQuery(i[t]).addClass("ug-bullet-active"),t},this.isActive=function(t){if(_(t),"number"!=typeof t)var i=t;else i=e.children(".ug-bullet")[t];return!!i.hasClass("ug-bullet-active")},this.getNumBullets=function(){return n}}function UGProgressBar(){var e,t,i=this,n=0,r=new UGFunctions,o={slider_progressbar_color:"#ffffff",slider_progressbar_opacity:.6,slider_progressbar_line_width:5};this.put=function(i,n){n&&(o=jQuery.extend(o,n)),i.append("<div class='ug-progress-bar'><div class='ug-progress-bar-inner'></div></div>"),e=i.children(".ug-progress-bar"),(t=e.children(".ug-progress-bar-inner")).css("background-color",o.slider_progressbar_color),e.height(o.slider_progressbar_line_width),t.height(o.slider_progressbar_line_width),t.width("0%");var r=o.slider_progressbar_opacity,a=t[0];a.style.opacity=r,a.style.filter="alpha(opacity="+100*r+")"},this.putHidden=function(t,n){i.put(t,n),e.hide()},this.getElement=function(){return e},this.setSize=function(n){e.width(n),t.width(n),i.draw()},this.setPosition=function(t,i,n,o){r.placeElement(e,t,i,n,o)},this.draw=function(){var e=100*n;t.width(e+"%")},this.setProgress=function(e){n=r.normalizePercent(e),i.draw()},this.getType=function(){return"bar"}}function UGProgressPie(){var e,t=this,i=!1,n=new UGFunctions,r={slider_progresspie_type_fill:!1,slider_progresspie_color1:"#B5B5B5",slider_progresspie_color2:"#E5E5E5",slider_progresspie_stroke_width:6,slider_progresspie_width:30,slider_progresspie_height:30};function o(t){if(!t)t=0;var n=Math.min(r.slider_progresspie_width,r.slider_progresspie_height)/2,o=e[0].getContext("2d");0==i&&(i=!0,o.rotate(1.5*Math.PI),o.translate(-2*n,0)),o.clearRect(0,0,r.slider_progresspie_width,r.slider_progresspie_height);var a=r.slider_progresspie_width/2,s=r.slider_progresspie_height/2,l=0,u=t*Math.PI*2;if(1==r.slider_progresspie_type_fill)o.beginPath(),o.moveTo(a,s),o.arc(a,s,n,l,u),o.lineTo(a,s),o.fillStyle=r.slider_progresspie_color1,o.fill(),o.closePath();else{o.globalCompositeOperation="source-over",o.beginPath(),o.moveTo(a,s),o.arc(a,s,n,l,u),o.lineTo(a,s),o.fillStyle=r.slider_progresspie_color1,o.fill(),o.closePath(),o.globalCompositeOperation="destination-out";var d=n-r.slider_progresspie_stroke_width;o.beginPath(),o.moveTo(a,s),o.arc(a,s,d,l,u),o.lineTo(a,s),o.fillStyle=r.slider_progresspie_color1,o.fill(),o.closePath()}1==r.slider_progresspie_type_fill&&(l=u,u=2*Math.PI,o.beginPath(),o.arc(a,s,n,l,u),o.lineTo(a,s),o.fillStyle=r.slider_progresspie_color2,o.fill(),o.closePath())}this.put=function(t,i){i&&(r=jQuery.extend(r,i)),t.append("<canvas class='ug-canvas-pie' width='"+r.slider_progresspie_width+"' height='"+r.slider_progresspie_height+"'></canvas>"),e=t.children(".ug-canvas-pie")},this.putHidden=function(i,n){t.put(i,n),o(.1),e.hide()},this.getElement=function(){return e},this.setPosition=function(t,i){n.placeElement(e,t,i)},this.getSize=function(){return{width:r.slider_progresspie_width,height:r.slider_progresspie_height}},this.setProgress=function(e){e=n.normalizePercent(e),e,o(e)},this.getType=function(){return"pie"}}function UGTouchSliderControl(){var e,t,i,n=new UGSlider,r=new UGFunctions,o={slider_transition_continuedrag_speed:250,slider_transition_continuedrag_easing:"linear",slider_transition_return_speed:300,slider_transition_return_easing:"easeInOutQuad"},a={touch_active:!1,startMouseX:0,startMouseY:0,lastMouseX:0,lastMouseY:0,startPosx:0,startTime:0,isInitDataValid:!1,slides:null,lastNumTouches:0,isDragging:!1,storedEventID:"touchSlider",videoStartX:0,isDragVideo:!1,videoObject:null};function s(e){if(!e)e=n.getSlidesReference();return-r.getElementSize(e.objCurrentSlide).left-r.getElementSize(t).left}function l(e){if(1==n.isInnerInPlace())return!1;if(i.trigger(n.events.BEFORE_RETURN),!e)e=n.getSlidesReference();var s=-r.getElementSize(e.objCurrentSlide).left;t.animate({left:s+"px"},{duration:o.slider_transition_return_speed,easing:o.slider_transition_continuedrag_easing,queue:!1,progress:function(e,i,n){if(1==a.isDragVideo){var o=r.getElementSize(t).left-s,l=a.videoStartX+o;a.videoObject.css("left",l)}},complete:function(){i.trigger(n.events.AFTER_RETURN)}})}function u(){var e=n.getSlidesReference(),u=s(e);if(0==u)return!1;var d=u>0?"left":"right",_=!1;switch(d){case"right":if(n.isSlideHasItem(e.objPrevSlide))var g=-r.getElementSize(e.objPrevSlide).left;else _=!0;break;case"left":if(n.isSlideHasItem(e.objNextSlide))g=-r.getElementSize(e.objNextSlide).left;else _=!0}1==_?l(e):t.stop().animate({left:g+"px"},{duration:o.slider_transition_continuedrag_speed,easing:o.slider_transition_continuedrag_easing,queue:!1,progress:function(){if(1==a.isDragVideo){var e=r.getElementSize(t).left-a.startPosx,i=a.videoStartX+e;a.videoObject.css("left",i)}},always:function(){!function(e){n.getVideoObject().hide(),n.switchSlideNums(e),n.placeNabourItems()}(d),i.trigger(n.events.AFTER_DRAG_CHANGE)}})}function d(e){var i=r.getMousePosition(e);a.startMouseX=i.pageX,a.startMouseY=i.pageY,a.lastMouseX=a.startMouseX,a.lastMouseY=a.startMouseY,a.startTime=jQuery.now();var n=r.getArrTouches(e);a.startArrTouches=r.getArrTouchPositions(n);var o=r.getElementSize(t);a.startPosx=o.left,a.isInitDataValid=!0,a.isDragVideo=!1,r.storeEventData(e,a.storedEventID)}function _(e){a.touch_active=!1}function g(e,t){a.touch_active=!0,d(t)}function c(e){return e.preventDefault(),a.isDragging=!1,1==n.isAnimating()&&t.stop(!0,!0),r.getArrTouches(e).length>1?(1==a.touch_active&&_(),!0):1==a.touch_active||void g(0,e)}function h(s){if(0==a.touch_active)return!0;if(0==s.buttons)return _(),u(),!0;r.updateStoredEventData(s,a.storedEventID),s.preventDefault();var l=r.getMousePosition(s);a.lastMouseX=l.pageX,a.lastMouseY=l.pageY;var g=null;1==o.slider_vertical_scroll_ondrag&&(g=r.handleScrollTop(a.storedEventID)),"vert"!==g&&function(r){var o=a.lastMouseX-a.startMouseX;if(0==o)return!0;var s=o<0?"left":"right",l=n.getObjZoom();if(l){if(1==l.isPanEnabled(r,s))return a.isInitDataValid=!1,!0;if(0==a.isInitDataValid)return d(r),!0}var u=a.startPosx+o;o>0&&u>0?u/=3:o<0&&u+t.width()<e.width()&&(u=a.startPosx+o/3);if(0==a.isDragging&&(a.isDragging=!0,i.trigger(n.events.START_DRAG)),t.css("left",u+"px"),1==a.isDragVideo){var _=u-a.startPosx,g=a.videoStartX+_;a.videoObject.css("left",g)}}(s)}function p(e){var t=r.getArrTouches(e).length;if(1==n.isInnerInPlace()&&0==a.touch_active&&0==t)return!0;if(0==t&&1==a.touch_active){_();var i=!1;0==r.wasVerticalScroll(a.storedEventID)&&(i=function(){var e=n.getSlidesReference(),t=s(e),i=Math.round(3*e.objCurrentSlide.width()/8);if(Math.abs(t)>=i)return!0;var r=Math.abs(a.lastMouseX-a.startMouseX);return Math.abs(a.lastMouseY-a.startMouseY),!(r<20)&&jQuery.now()-a.startTime<500}()),1==i?u():l()}else 1==t&&0==a.touch_active&&g(0,e)}this.isTapEventOccured=function(e){var t=r.getArrTouches(e).length;if(0!=t||0!=a.lastNumTouches)return a.lastNumTouches=t,!1;a.lastNumTouches=t;s(n.getSlidesReference());var i=Math.abs(a.lastMouseX-a.startMouseX),o=Math.abs(a.lastMouseY-a.startMouseY),l=jQuery.now()-a.startTime;return i<20&&o<50&&l<500},this.init=function(r,a){n=r,i=jQuery(n),g_objects=r.getObjects(),e=g_objects.g_objSlider,t=g_objects.g_objInner,o=jQuery.extend(o,a),e.bind("mousedown touchstart",c),jQuery("body").bind("mousemove touchmove",h),jQuery(window).add("body").bind("mouseup touchend",p)},this.getLastMousePos=function(){return{pageX:a.lastMouseX,pageY:a.lastMouseY}},this.isTouchActive=function(){return a.touch_active}}function UGZoomSliderControl(){var e,t,i=new UGSlider,n=new UGFunctions,r={slider_zoom_step:1.2,slider_zoom_max_ratio:6,slider_zoom_return_pan_duration:400,slider_zoom_return_pan_easing:"easeOutCubic"},o={isPanActive:!1,startMouseX:0,startMouseY:0,lastMouseX:0,lastMouseY:0,startImageX:0,startImageY:0,panXActive:!1,panYActive:!1,objImage:null,objImageSize:null,objParent:null,objParentSize:null,objSlide:null,storeImageLastTime:0,isZoomActive:!1,startDistance:0,startMiddlePoint:null,imageOrientPoint:null,objFitImageSize:null,isZoomedOnce:!1};function a(n,a){i=n,t=jQuery(i),g_objects=n.getObjects(),e=g_objects.g_objSlider,g_objects.g_objInner,r=jQuery.extend(r,a),e.on("mousewheel",b),e.bind("mousedown touchstart",p),jQuery("body").bind("mousemove touchmove",f),jQuery(window).add("body").bind("mouseup touchend",m),t.bind(i.events.BEFORE_RETURN,function(){h()}),t.bind(i.events.ITEM_CHANGED,function(){o.isZoomedOnce=!1}),t.bind(i.events.ZOOM_CHANGE,function(){o.isZoomedOnce=!0})}function s(){var e=i.getScaleMode();return"down"!=e&&(e="fit"),e}function l(){if((r=jQuery.now())-o.storeImageLastTime<20)return!1;var e=i.getSlidesReference();if(o.objSlide=e.objCurrentSlide,o.objImage=e.objCurrentSlide.find("img"),0==o.objImage.length)return!1;o.objImageSize=n.getElementSize(o.objImage),o.objParent=o.objImage.parent(),o.objParentSize=n.getElementSize(o.objParent);var t=s();objPadding=i.getObjImagePadding(),o.objFitImageSize=n.getImageInsideParentDataByImage(o.objImage,t,objPadding);var r=jQuery.now();return o.storeImageLastTime=r,!0}function u(e,o){var a=i.getSlidesReference().objCurrentSlide.find("img"),l=s();t.trigger(i.events.ZOOM_START);var u=!0,d=i.getObjImagePadding();if("back"==e){var _=n.getImageOriginalSize(a);n.scaleImageFitParent(a,_.width,_.height,l,d)}else{var g="in"==e;u=n.zoomImageInsideParent(a,g,r.slider_zoom_step,o,l,r.slider_zoom_max_ratio,d)}1==u&&(t.trigger(i.events.ZOOMING),t.trigger(i.events.ZOOM_CHANGE),t.trigger(i.events.ZOOM_END))}function d(e,t,i){var r=n.getArrTouches(t);if(!0===i){if(1!=r.length)return!1}else if(r.length>1)return!1;return!!n.isElementBiggerThenParent(e)}function _(e){o.isPanActive=!0,function(e){var t=n.getMousePosition(e);o.startMouseX=t.pageX,o.startMouseY=t.pageY,o.lastMouseX=o.startMouseX,o.lastMouseY=o.startMouseY,o.startImageX=o.objImageSize.left,o.startImageY=o.objImageSize.top,o.panXActive=o.objImageSize.width>o.objParentSize.width,o.panYActive=o.objImageSize.height>o.objParentSize.height}(e)}function g(e){if(0==o.isZoomActive)return!1;2!=n.getArrTouches(e).length&&(o.isZoomActive=!1,t.trigger(i.events.ZOOM_END))}function c(e){if(1==o.isZoomActive)return!0;var r=n.getArrTouches(e);if(2!=r.length)return!0;!function(e){o.isZoomActive=!0,o.startDistance=n.getDistance(e[0].pageX,e[0].pageY,e[1].pageX,e[1].pageY),0==o.startDistance&&(o.startDistance=1),o.startMiddlePoint=n.getMiddlePoint(e[0].pageX,e[0].pageY,e[1].pageX,e[1].pageY),o.objImageSize=n.getElementSize(o.objImage),o.startImageX=o.objImageSize.left,o.startImageY=o.objImageSize.top,o.imageOrientPoint=n.getElementLocalPoint(o.startMiddlePoint,o.objImage),0==n.isPointInsideElement(o.imageOrientPoint,o.objImageSize)&&(o.imageOrientPoint=n.getElementCenterPoint(o.objImage)),t.trigger(i.events.ZOOM_START)}(r)}function h(){if(null==o.objImage||0==o.objImage.length)return!0;if(n.getElementSize(o.objImage).width<o.objFitImageSize.imageWidth){o.objImage.css({position:"absolute",margin:"none"});var e={top:o.objFitImageSize.imageTop+"px",left:o.objFitImageSize.imageLeft+"px",width:o.objFitImageSize.imageWidth+"px",height:o.objFitImageSize.imageHeight+"px"};o.objImage.animate(e,{duration:r.slider_zoom_return_pan_duration,easing:r.slider_zoom_return_pan_easing,queue:!1})}else!function(){var e=!1,t=!1,a=0,s=0,l=n.getElementSize(o.objImage),u=i.getObjImagePadding(),d=n.getElementCenterPosition(o.objImage,u);o.panXActive=o.objImageSize.width>o.objParentSize.width,o.panYActive=o.objImageSize.height>o.objParentSize.height,1==o.panYActive?l.top>0?(s=0,t=!0):l.bottom<o.objParentSize.height&&(s=o.objParentSize.height-l.height,t=!0):l.top!=d.top&&(t=!0,s=d.top),1==o.panXActive?l.left>0?(a=0,e=!0):l.right<o.objParentSize.width&&(a=o.objParentSize.width-l.width,e=!0):l.left!=d.left&&(e=!0,a=d.left);var _={};1==t&&(_.top=s+"px"),1==e&&(_.left=a+"px"),1!=t&&1!=e||o.objImage.animate(_,{duration:r.slider_zoom_return_pan_duration,easing:r.slider_zoom_return_pan_easing,queue:!1})}()}function p(e){if(0==i.isCurrentSlideType("image"))return!0;l();if(null==o.objImage||0==o.objImage.length)return!0;e.preventDefault(),1==!(!o.objImage||!o.objImage.is(":animated"))&&o.objImage.stop(!0),1==o.isZoomActive?g(e):c(e),1==o.isZoomActive?o.isPanActive=!1:1==d(o.objImage,e)&&1==o.isZoomedOnce&&_(e)}function m(e){if(0==i.isCurrentSlideType("image"))return!0;if(1==jQuery(e.target).data("ug-button"))return!1;l();if(null==o.objImage||0==o.objImage.length)return!0;var t=o.isPanActive,n=o.isZoomActive;if(0==i.isInnerInPlace())return o.isZoomActive=!1,o.isPanActive=!1,!0;if(1==o.isZoomActive?g(e):c(e),1==o.isZoomActive)o.isPanActive=!1;else{var r=d(o.objImage,e,!0);1==o.isPanActive?o.isPanActive=!1:1==r&&_(e)}(t||n)&&0==o.isZoomActive&&0==o.isPanActive&&h()}function f(e){if(0==i.isCurrentSlideType("image"))return!0;1==o.isZoomActive?function(e){var a=n.getArrTouches(e),s=n.getDistance(a[0].pageX,a[0].pageY,a[1].pageX,a[1].pageY)/o.startDistance,l=n.getMiddlePoint(a[0].pageX,a[0].pageY,a[1].pageX,a[1].pageY),u=o.objImageSize.width*s,d=o.objImageSize.height*s,_=n.getImageOriginalSize(o.objImage),g=1;if(_.width>0&&(g=u/_.width),g>r.slider_zoom_max_ratio)return!0;panX=-(o.imageOrientPoint.x*s-o.imageOrientPoint.x),panY=-(o.imageOrientPoint.y*s-o.imageOrientPoint.y);var c=l.x-o.startMiddlePoint.x,h=l.y-o.startMiddlePoint.y,p=o.startImageX+panX+c,m=o.startImageY+panY+h;n.setElementSizeAndPosition(o.objImage,p,m,u,d),t.trigger(i.events.ZOOMING),t.trigger(i.events.ZOOM_CHANGE)}(e):1==o.isPanActive&&function(e){if(null==o.objImage||0==o.objImage.length)return!0;var t=n.getMousePosition(e),r=(t.pageX,o.startMouseX,t.pageY,o.startMouseY,t.pageX-o.lastMouseX),a=t.pageY-o.lastMouseY,s=r<0?"left":"right",l=a<0?"up":"down";o.lastMouseX=t.pageX,o.lastMouseY=t.pageY;var u=n.getElementSize(o.objImage);0==o.panYActive?a=0:"down"==l&&u.top>0?a/=3:"up"==l&&u.bottom<o.objParentSize.height&&(a/=3),0==o.panXActive||0==i.isInnerInPlace()?r=0:"right"==s&&u.left>0?r/=3:"left"==s&&u.right<o.objParentSize.width&&(r/=3);var d=u.left+r,_=u.top+a;n.placeElement(o.objImage,d,_)}(e)}function b(e,t,o,a){return 0==r.slider_zoom_mousewheel||(0==i.isCurrentSlideType("image")||(e.preventDefault(),void u(1==t>0?"in":"out",n.getMousePosition(e))))}this.________EXTERNAL_____________=function(){},this.isPanEnabled=function(e,t){if(l(),null==o.objImage||0==o.objImage.length)return!1;if(0==o.isZoomedOnce)return!1;if(0==d(o.objImage,e))return!1;if(0==i.isInnerInPlace())return!1;if("left"==t){if(o.objImageSize.right<=o.objParentSize.width)return!1}else if(o.objImageSize.left>=0)return!1;return!0},this.init=function(e,t){a(e,t)},this.zoomIn=function(){u("in")},this.zoomOut=function(){u("out")},this.zoomBack=function(){u("back")}}function UGWistiaAPI(){this.isAPILoaded=!1;var e,t,i=this,n=jQuery(this),r=!1;function o(){return"undefined"!=typeof Wistia}function a(e,o,a,s,l){t=null,r=!1;var u=e+"_video",d="<div id='"+u+"' class='wistia_embed' style='width:"+a+";height:"+s+";' data-video-width='"+a+"' data-video-height='"+s+"'>&nbsp;</div>";jQuery("#"+e).html(d),t=Wistia.embed(o,{version:"v1",videoWidth:a,videoHeight:s,container:u,autoPlay:l}),r=!0,t.bind("play",function(){n.trigger(i.events.START_PLAYING)}),t.bind("pause",function(){n.trigger(i.events.STOP_PLAYING)}),t.bind("end",function(){n.trigger(i.events.STOP_PLAYING),n.trigger(i.events.VIDEO_ENDED)})}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(e){return 1==g_ugWistiaAPI.isAPILoaded||(o()?(g_ugWistiaAPI.isAPILoaded=!0,!0):(!0!==e&&g_ugFunctions.loadJs("fast.wistia.com/assets/external/E-v1.js",!0),void(g_ugWistiaAPI.isAPILoaded=!0)))},this.doCommand=function(e){if(null==t)return!1;if(0==r)return!1;switch(e){case"play":t.play();break;case"pause":t.pause()}},this.pause=function(){i.doCommand("pause")},this.play=function(){i.doCommand("play")},this.putVideo=function(t,i,n,r,s,l){if(o())return a(t,i,n,r,s),!0;this.loadAPI(),e=setInterval(function(){o()&&(a(t,i,n,r,s),clearInterval(e))},500)},this.isPlayerReady=function(){return!(!r||!t)}}function UGSoundCloudAPI(){this.isAPILoaded=!1;var e,t,i,n=this,r=jQuery(this);function o(){return"undefined"!=typeof SC}function a(e,o,a,s,l){t=null,g_isPlayerReady=!1;var u=e+"_iframe",d=location.protocol+"//w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/"+o;d+="&amp;buying=false&amp;liking=false&amp;download=false&amp;sharing=false&amp;show_artwork=true&show_comments=false&amp;show_playcount=true&amp;show_user=false&amp;hide_related=true&amp;visual=true&amp;start_track=0&amp;callback=true";var _="<iframe id='"+u+"' src="+(d+=!0===l?"&amp;auto_play=true":"&amp;auto_play=false")+" width='"+a+"' height='"+s+"' frameborder='0' scrolling='no' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";jQuery("#"+e).html(_),(t=SC.Widget(u)).bind(SC.Widget.Events.READY,function(){t&&(g_isPlayerReady=!0,t.bind(SC.Widget.Events.PLAY,function(){r.trigger(n.events.START_PLAYING)}),t.bind(SC.Widget.Events.PAUSE,function(){r.trigger(n.events.STOP_PLAYING)}),t.bind(SC.Widget.Events.FINISH,function(){r.trigger(n.events.STOP_PLAYING),r.trigger(n.events.VIDEO_ENDED)}))}),i=e}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(e){return 1==g_ugSoundCloudAPI.isAPILoaded||(o()?(g_ugSoundCloudAPI.isAPILoaded=!0,!0):(!0!==e&&g_ugFunctions.loadJs("w.soundcloud.com/player/api.js",!0),void(g_ugSoundCloudAPI.isAPILoaded=!0)))},this.putSound=function(t,i,n,r,s){if(o())return a(t,i,n,r,s),!0;this.loadAPI(),e=setInterval(function(){o()&&(a(t,i,n,r,s),clearInterval(e))},500)},this.doCommand=function(e){if(null==t)return!1;if(0==g_isPlayerReady)return!1;switch(e){case"play":t.play();break;case"pause":t.pause()}},this.pause=function(){n.doCommand("pause")},this.play=function(){n.doCommand("play")},this.destroy=function(){g_isPlayerReady=!1,t=null,i&&(jQuery("#"+i).html(""),i=null)}}function UGHtml5MediaAPI(){this.isAPILoaded=!1;var e,t,i=this,n=jQuery(this);function r(){return"undefined"!=typeof mejs}function o(e,r,o,a,s){t=null,g_isPlayerReady=!1;var l=location.protocol+"//cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/flashmediaelement-cdn.swf",u=location.protocol+"//cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/silverlightmediaelement.xap",d=e+"_video",_="";s&&!0===s&&(_="autoplay='autoplay'");var g="";r.posterImage&&(g="poster='"+r.posterImage+"'");var c="<video id='"+d+"' width='"+o+"' height='"+a+"' controls='controls' preload='none' "+_+" "+g+">";""!=r.mp4&&(c+="<source type='video/mp4' src='"+r.mp4+"' />"),""!=r.webm&&(c+="<source type='video/webm' src='"+r.webm+"' />"),""!=r.ogv&&(c+="<source type='video/ogg' src='"+r.ogv+"' />"),c+="<object width='"+o+"' height='"+a+"' type='application/x-shockwave-flash' data='"+l+"'>",c+="<param name='movie' value='"+l+"' />",c+="<param name='flashvars' value='controls=true&file="+r.mp4+"' />",c+="</object>",c+="</video>",jQuery("#"+e).html(c),new MediaElement(d,{enablePluginDebug:!1,flashName:l,silverlightName:u,success:function(e,r){g_isPlayerReady=!0,t=e,0==s&&t.pause(),g_ugFunctions.addEvent(t,"play",function(){n.trigger(i.events.START_PLAYING)}),g_ugFunctions.addEvent(t,"pause",function(){n.trigger(i.events.STOP_PLAYING)}),g_ugFunctions.addEvent(t,"ended",function(){n.trigger(i.events.STOP_PLAYING),n.trigger(i.events.VIDEO_ENDED)})},error:function(e){trace(e)}})}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(e){return 1==g_ugHtml5MediaAPI.isAPILoaded||(r()?(g_ugHtml5MediaAPI.isAPILoaded=!0,!0):(!0!==e&&(g_ugFunctions.loadJs("cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/mediaelement.min.js",!0),g_ugFunctions.loadCss("cdnjs.cloudflare.com/ajax/libs/mediaelement/2.18.1/mediaelementplayer.min.css",!0)),void(g_ugHtml5MediaAPI.isAPILoaded=!0)))},this.putVideo=function(t,i,n,a,s){if(r())return o(t,i,n,a,s),!0;this.loadAPI(),e=setInterval(function(){r()&&(o(t,i,n,a,s),clearInterval(e))},500)},this.doCommand=function(e){if(null==t)return!1;if(0==g_isPlayerReady)return!1;switch(e){case"play":t.play();break;case"pause":t.pause()}},this.pause=function(){i.doCommand("pause")},this.play=function(){i.doCommand("play")}}function UGVimeoAPI(){this.isAPILoaded=!1;var e,t,i=this,n=jQuery(this),r=null,o=!1,a=!1;function s(){return"undefined"!=typeof Froogaloop}function l(e,s,l,u,d){r=null,o=!1;var _=location.protocol+"//player.vimeo.com/video/"+s+"?api=1";!0===d&&(_+="&amp;byline=0&amp;autoplay=1&amp;title=0&amp;portrait=0");var g="<iframe src="+_+" width='"+l+"' height='"+u+"' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";jQuery("#"+e).html(g);var c=jQuery("#"+e+" iframe")[0];(r=Froogaloop(c)).addEvent("ready",function(){r&&(o=!0,function(){if(!r)return!1;r.addEvent("cuechange",function(){1==a&&i.play()}),r.addEvent("play",function(){n.trigger(i.events.START_PLAYING)}),r.addEvent("pause",function(){n.trigger(i.events.STOP_PLAYING)}),r.addEvent("finish",function(){n.trigger(i.events.STOP_PLAYING),n.trigger(i.events.VIDEO_ENDED)})}())}),t=e}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.loadAPI=function(e){return 1==g_ugVimeoAPI.isAPILoaded||(s()?(g_ugVimeoAPI.isAPILoaded=!0,!0):(!0!==e&&g_ugFunctions.loadJs("f.vimeocdn.com/js/froogaloop2.min.js",!0),void(g_ugVimeoAPI.isAPILoaded=!0)))},this.doCommand=function(e){return null!=r&&(0!=o&&void r.api(e))},this.pause=function(){i.doCommand("pause")},this.play=function(){i.doCommand("play")},this.destroy=function(){r&&(r.api("unload"),r=null,o=!1),t&&jQuery("#"+t).html("")},this.putVideo=function(t,i,n,r,o){if(s())return l(t,i,n,r,o),!0;this.loadAPI(),e=setInterval(function(){s()&&(l(t,i,n,r,o),clearInterval(e))},500)},this.isPlayerReady=function(){return!(!o||!r)},this.changeVideo=function(e,t){if(0==i.isPlayerReady())return!1;a=t,r.api("loadVideo",e)},this.getVideoImages=function(e,t,i){var n=location.protocol+"//vimeo.com/api/v2/video/"+e+".json";jQuery.get(n,{},function(e){var n={};n.preview=e[0].thumbnail_large,n.thumb=e[0].thumbnail_medium,i(t,n)})}}function UGYoutubeAPI(){this.isAPILoaded=!1;var e,t,i=this,n=null,r=!1,o=jQuery(this),a=-1,s=new UGFunctions,l={video_youtube_showinfo:!0};function u(e,i,o,a,u,d){n&&r&&n.destroy();var c={controls:1,showinfo:l.video_youtube_showinfo,start:0,rel:0};!0===u&&(c.autoplay=1);var h=s.getVal(d,"start");h&&jQuery.isNumeric(h)&&(c.start=h),r=!1,n=new YT.Player(e,{height:a,width:o,videoId:i,playerVars:c,events:{onReady:_,onStateChange:g}}),t=e}function d(){return"undefined"!=typeof YT&&void 0!==YT.Player}function _(){r=!0}function g(){if("function"!=typeof n.getPlayerState)return trace("Youtube API error: can't get player state"),!1;var e=n.getPlayerState();switch(e){case YT.PlayerState.PLAYING:o.trigger(i.events.START_PLAYING);break;case YT.PlayerState.ENDED:o.trigger(i.events.STOP_PLAYING),o.trigger(i.events.VIDEO_ENDED);break;default:a==YT.PlayerState.PLAYING&&o.trigger(i.events.STOP_PLAYING)}a=e}this.events={START_PLAYING:"start_playing",STOP_PLAYING:"stop_playing",VIDEO_ENDED:"video_ended"},this.setOptions=function(e){l=jQuery.extend(l,e)},this.putVideo=function(t,i,n,r,o,a){if(d())return u(t,i,n,r,o,a),!0;this.loadAPI(),e=setInterval(function(){d()&&(u(t,i,n,r,o,a),clearInterval(e))},500)},this.loadAPI=function(e){return 1==g_ugYoutubeAPI.isAPILoaded||("undefined"!=typeof YT?(g_ugYoutubeAPI.isAPILoaded=!0,!0):(!0!==e&&g_ugFunctions.loadJs("https://www.youtube.com/player_api",!1),void(g_ugYoutubeAPI.isAPILoaded=!0)))},this.doCommand=function(e,t){if(!n)return!0;if(0==r)return!1;switch(e){case"play":if("function"!=typeof n.playVideo)return!1;n.playVideo();break;case"pause":if("function"!=typeof n.pauseVideo)return!1;n.pauseVideo();break;case"seek":if("function"!=typeof n.seekTo)return!1;n.seekTo(t);break;case"stopToBeginning":var i=n.getPlayerState();switch(n.pauseVideo(),i){case YT.PlayerState.PLAYING:case YT.PlayerState.ENDED:case YT.PlayerState.PAUSED:n.seekTo(0)}}},this.play=function(){i.doCommand("play")},this.pause=function(){i.doCommand("pause")},this.destroy=function(){try{n&&(r=!1,n.clearVideo(),n.destroy())}catch(e){jQuery("#"+t).html("")}},this.stopToBeginning=function(){i.doCommand("stopToBeginning")},this.changeVideo=function(e,t){if(0==i.isPlayerReady())return!1;t&&1==t?n.loadVideoById(e,0,"large"):n.cueVideoById(e,0,"large")},this.isPlayerReady=function(){return!(!r||!n)},this.getVideoImages=function(e){var t={};return t.preview="https://i.ytimg.com/vi/"+e+"/sddefault.jpg",t.thumb="https://i.ytimg.com/vi/"+e+"/default.jpg",t}}function UGVideoPlayer(){var e,t,i,n,r,o,a,s,l=this,u=jQuery(this),d=new UGFunctions,_=new UGYoutubeAPI,g=new UGVimeoAPI,c=new UGHtml5MediaAPI,h=new UGSoundCloudAPI,p=new UGWistiaAPI,m=null,f={video_enable_closebutton:!0};this.events={SHOW:"video_show",HIDE:"video_hide",PLAY_START:"video_play_start",PLAY_STOP:"video_play_stop",VIDEO_ENDED:"video_ended"};var b={standAloneMode:!1,youtubeInnerID:"",vimeoPlayerID:"",html5PlayerID:"",wistiaPlayerID:"",soundCloudPlayerID:""};function v(){l.hide()}function y(){u.trigger(l.events.PLAY_START),o&&o.hide()}function I(){u.trigger(l.events.PLAY_STOP),o&&o.show()}function w(){u.trigger(l.events.VIDEO_ENDED)}function E(e){var t=["youtube","vimeo","html5","soundcloud","wistia"];for(var o in t){var l=t[o];if(l!=e)switch(l){case"youtube":_.pause(),_.destroy(),i.hide();break;case"vimeo":g.pause(),g.destroy(),n.hide();break;case"html5":c.pause(),r.hide();break;case"soundcloud":h.pause(),h.destroy(),a.hide();break;case"wistia":p.pause(),s.hide()}}}this.init=function(t,i,n){if(!(e=n))throw new Error("missing gallery ID for video player, it's a must!");f=jQuery.extend(f,t),_.setOptions(f),i&&1==i&&(b.standAloneMode=!0)},this.setHtml=function(l){b.youtubeInnerID=e+"_youtube_inner",b.vimeoPlayerID=e+"_videoplayer_vimeo",b.html5PlayerID=e+"_videoplayer_html5",b.wistiaPlayerID=e+"_videoplayer_wistia",b.soundCloudPlayerID=e+"_videoplayer_soundcloud";var u="<div class='ug-videoplayer' style='display:none'>";u+="<div class='ug-videoplayer-wrapper ug-videoplayer-youtube' style='display:none'><div id='"+b.youtubeInnerID+"'></div></div>",u+="<div id='"+b.vimeoPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-vimeo' style='display:none'></div>",u+="<div id='"+b.html5PlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-html5'></div>",u+="<div id='"+b.soundCloudPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-soundcloud'></div>",u+="<div id='"+b.wistiaPlayerID+"' class='ug-videoplayer-wrapper ug-videoplayer-wistia'></div>",0==b.standAloneMode&&1==f.video_enable_closebutton&&(u+="<div class='ug-videoplayer-button-close'></div>"),u+="</div>",l.append(u),t=l.children(".ug-videoplayer"),i=t.children(".ug-videoplayer-youtube"),n=t.children(".ug-videoplayer-vimeo"),r=t.children(".ug-videoplayer-html5"),a=t.children(".ug-videoplayer-soundcloud"),s=t.children(".ug-videoplayer-wistia"),0==b.standAloneMode&&1==f.video_enable_closebutton&&(o=t.children(".ug-videoplayer-button-close"))},this.destroy=function(){o&&(o.off("click"),o.off("touchend")),jQuery(_).off(_.events.START_PLAYING),jQuery(_).off(_.events.STOP_PLAYING),jQuery(g).off(g.events.START_PLAYING),jQuery(g).off(g.events.STOP_PLAYING),jQuery(c).off(c.events.START_PLAYING),jQuery(c).off(c.events.STOP_PLAYING),jQuery(h).off(h.events.START_PLAYING,y),jQuery(h).off(h.events.STOP_PLAYING,I),jQuery(p).off(p.events.START_PLAYING,y),jQuery(p).off(p.events.STOP_PLAYING,I),m=null},this.initEvents=function(){o&&(d.setButtonMobileReady(o),d.setButtonOnClick(o,v)),jQuery(_).on(_.events.START_PLAYING,y),jQuery(_).on(_.events.STOP_PLAYING,I),jQuery(_).on(_.events.VIDEO_ENDED,w),jQuery(g).on(g.events.START_PLAYING,y),jQuery(g).on(g.events.STOP_PLAYING,I),jQuery(g).on(g.events.VIDEO_ENDED,w),jQuery(c).on(c.events.START_PLAYING,y),jQuery(c).on(c.events.STOP_PLAYING,I),jQuery(c).on(c.events.VIDEO_ENDED,w),jQuery(h).on(h.events.START_PLAYING,y),jQuery(h).on(h.events.STOP_PLAYING,I),jQuery(h).on(h.events.VIDEO_ENDED,w),jQuery(p).on(p.events.START_PLAYING,y),jQuery(p).on(p.events.STOP_PLAYING,I),jQuery(p).on(p.events.VIDEO_ENDED,w)},this.setSize=function(e,i){d.setElementSize(t,e,i),o&&d.placeElement(o,"right","top")},this.setPosition=function(e,i){d.placeElement(t,e,i)},this.getObject=function(){return t},this.show=function(){if(1==l.isVisible())return!0;t.show(),t.fadeTo(0,1),o&&o.show(),u.trigger(l.events.SHOW)},this.hide=function(){if(0==l.isVisible())return!0;E(),m=null,t.hide(),u.trigger(l.events.HIDE)},this.getActiveAPI=function(){switch(m){case"youtube":return _;case"vimeo":return g;case"wistia":return p;case"soundcloud":return h;case"html5":return c;default:return null}},this.pause=function(){var e=l.getActiveAPI();if(null==e)return!1;"function"==typeof e.pause&&e.pause()},this.isVisible=function(){return t.is(":visible")},this.playYoutube=function(e,t,n){if(void 0===t)t=!0;if(!n)n=null;E("youtube"),i.show(),0==i.children("#"+b.youtubeInnerID).length&&i.append("<div id='"+b.youtubeInnerID+"'></div>");var r={};n&&(r.start=n),1==_.isPlayerReady()&&1==b.standAloneMode?_.changeVideo(e,t):_.putVideo(b.youtubeInnerID,e,"100%","100%",t,r),m="youtube"},this.playVimeo=function(e,t){if(void 0===t)t=!0;E("vimeo"),n.show(),g.putVideo(b.vimeoPlayerID,e,"100%","100%",t),m="vimeo"},this.playHtml5Video=function(e,t,i,n,o){if(void 0===o)o=!0;E("html5"),r.show();var a={ogv:e,webm:t,mp4:i,posterImage:n};c.putVideo(b.html5PlayerID,a,"100%","100%",o),m="html5"},this.playSoundCloud=function(e,t){if(void 0===t)t=!0;E("soundcloud"),a.show(),h.putSound(b.soundCloudPlayerID,e,"100%","100%",t),m="soundcloud"},this.playWistia=function(e,t){if(void 0===t)t=!0;E("wistia"),s.show(),p.putVideo(b.wistiaPlayerID,e,"100%","100%",t),m="wistia"}}var g_ugYoutubeAPI=new UGYoutubeAPI,g_ugVimeoAPI=new UGVimeoAPI,g_ugHtml5MediaAPI=new UGHtml5MediaAPI,g_ugSoundCloudAPI=new UGSoundCloudAPI,g_ugWistiaAPI=new UGWistiaAPI;function ugCheckForMinJQueryVersion(){if(0==g_ugFunctions.checkMinJqueryVersion("1.8.0"))throw new Error("The gallery can run from jquery 1.8 You have jQuery "+jQuery.fn.jquery+" Please update your jQuery library.")}function ugCheckForErrors(e,t){try{"jquery"==t?(!function(){if("undefined"==typeof jQuery)throw new Error("jQuery library not included")}(),ugCheckForMinJQueryVersion()):(ugCheckForMinJQueryVersion(),function(){if("function"==typeof jQuery.fn.unitegallery)return!0;var e="You have some jquery.js library include that comes after the gallery files js include.";throw e+="<br> This include eliminates the gallery libraries, and make it not work.","cms"==t?(e+="<br><br> To fix it you can:<br>&nbsp;&nbsp;&nbsp; 1. In the Gallery Settings -> Troubleshooting set option: <strong><b>Put JS Includes To Body</b></strong> option to true.",e+="<br>&nbsp;&nbsp;&nbsp; 2. Find the double jquery.js include and remove it."):e+="<br><br> Please find and remove this jquery.js include and the gallery will work. <br> * There should be only one jquery.js include before all other js includes in the page.",new Error(e)}())}catch(r){var i=r.message;if(i="<div style='font-size:16px;color:#BC0C06;max-width:900px;border:1px solid red;padding:10px;'>"+(i="Unite Gallery Error: "+i)+"</div>","jquery"==t){var n=document.getElementById(e);n.innerHTML=i,n.style.display="block"}else jQuery(e).show().html(i);return!1}return!0}function UniteGalleryMain(){var t=this,g_galleryID,g_objGallery=jQuery(t),g_objWrapper,g_objParent,g_objThumbs,g_objSlider,g_objLightbox,g_functions=new UGFunctions,g_objTabs,g_objLoadMore,g_arrItems=[],g_numItems,g_selectedItem=null,g_selectedItemIndex=-1,g_objTheme,g_objCache={};this.events={ITEM_CHANGE:"item_change",SIZE_CHANGE:"size_change",ENTER_FULLSCREEN:"enter_fullscreen",EXIT_FULLSCREEN:"exit_fullscreen",START_PLAY:"start_play",STOP_PLAY:"stop_play",PAUSE_PLAYING:"pause_playing",CONTINUE_PLAYING:"continue_playing",SLIDER_ACTION_START:"slider_action_start",SLIDER_ACTION_END:"slider_action_end",ITEM_IMAGE_UPDATED:"item_image_updated",GALLERY_KEYPRESS:"gallery_keypress",GALLERY_BEFORE_REQUEST_ITEMS:"gallery_before_request_items",OPEN_LIGHTBOX:"open_lightbox",CLOSE_LIGHTBOX:"close_lightbox"};var g_options={gallery_width:900,gallery_height:500,gallery_min_width:150,gallery_min_height:100,gallery_theme:"default",gallery_skin:"default",gallery_images_preload_type:"minimal",gallery_autoplay:!1,gallery_play_interval:3e3,gallery_pause_on_mouseover:!0,gallery_mousewheel_role:"zoom",gallery_control_keyboard:!0,gallery_carousel:!0,gallery_preserve_ratio:!0,gallery_background_color:"",gallery_debug_errors:!1,gallery_shuffle:!1,gallery_urlajax:null,gallery_enable_tabs:!1,gallery_enable_loadmore:!1,gallery_enable_cache:!0,gallery_initial_catid:"",load_api_externally:!1},g_temp={objCustomOptions:{},isAllItemsPreloaded:!1,isFreestyleMode:!1,lastWidth:0,lastHeigh:0,handleResize:null,isInited:!1,isPlayMode:!1,isPlayModePaused:!1,playTimePassed:0,playTimeLastStep:0,playHandle:"",playStepInterval:33,objProgress:null,isFakeFullscreen:!1,thumbsType:null,isYoutubePresent:!1,isVimeoPresent:!1,isHtml5VideoPresent:!1,isSoundCloudPresent:!1,isWistiaPresent:!1,resizeDelay:100,isRunFirstTime:!0,originalOptions:{},funcCustomHeight:null};function __________INIT_GALLERY_______(){}function getThemeFunction(e){var t=e;return-1==t.indexOf("UGTheme_")&&(t="UGTheme_"+t),t}function initTheme(objCustomOptions){if(objCustomOptions.hasOwnProperty("gallery_theme"))g_options.gallery_theme=objCustomOptions.gallery_theme;else{var defaultTheme=g_options.gallery_theme;0==g_ugFunctions.isThemeRegistered(defaultTheme)&&(g_options.gallery_theme=g_ugFunctions.getFirstRegisteredTheme())}var themeFunction=getThemeFunction(g_options.gallery_theme);try{g_options.gallery_theme=eval(themeFunction)}catch(e){}g_options.gallery_theme=eval(themeFunction),g_objTheme=new g_options.gallery_theme,g_objTheme.init(t,objCustomOptions)}function resetOptions(){g_options=jQuery.extend({},g_temp.originalOptions),g_selectedItemIndex=-1,g_selectedItem=null,g_objSlider=void 0,g_objThumbs=void 0,g_objLightbox=void 0}function checkForStartupErrors(){try{ugCheckForMinJQueryVersion()}catch(e){throwErrorShowMessage(e.message)}"object"==typeof g_objWrapper.outerWidth()&&throwErrorShowMessage("You have some buggy script. most chances jquery-ui.js that destroy jquery outerWidth, outerHeight functions. The gallery can't run. Please update jquery-ui.js to latest version."),setTimeout(function(){ugCheckForErrors(g_galleryID,"cms")},5e3)}function runGallery(e,i,n,r){var o="object"==typeof i;if(o&&(g_temp.objCustomOptions=i),1==g_temp.isRunFirstTime){if(g_galleryID=e,0==(g_objWrapper=jQuery(g_galleryID)).length)return trace("div with id: "+g_galleryID+" not found"),!1;g_objParent=g_objWrapper.parent(),checkForStartupErrors(),g_temp.originalOptions=jQuery.extend({},g_options),o&&(g_options=jQuery.extend(g_options,i)),1==g_options.gallery_enable_cache&&g_options.gallery_initial_catid&&cacheItems(g_options.gallery_initial_catid),t.setSizeClass(),fillItemsArray(g_objWrapper.children()),loadAPIs(),g_objWrapper.find("img").fadeTo(0,0).hide(),g_objWrapper.show(),clearInitData()}else if(t.destroy(),resetOptions(),g_options=jQuery.extend(g_options,g_temp.objCustomOptions),n){if(r&&1==g_options.gallery_enable_cache&&cacheItems(r,n),"noitems"==n)return showErrorMessage("No items in this category",""),!1;g_objWrapper.html(n),fillItemsArray(g_objWrapper.children()),loadAPIs(),g_objWrapper.children().fadeTo(0,0).hide(),g_objWrapper.show(),clearInitData()}1==g_temp.isRunFirstTime&&1==g_options.gallery_enable_tabs&&(g_objTabs=new UGTabs).init(t,g_options),1==g_temp.isRunFirstTime&&1==g_options.gallery_enable_loadmore&&(g_objLoadMore=new UGLoadMore).init(t,g_options),o&&modifyInitParams(g_temp.objCustomOptions),validateParams(),1==g_options.gallery_shuffle&&t.shuffleItems(),initTheme(g_temp.objCustomOptions),setGalleryHtml(),setHtmlObjectsProperties(),0==g_objWrapper.width()?g_functions.waitForWidth(g_objWrapper,runGalleryActually):runGalleryActually()}function runGalleryActually(){t.setSizeClass(),0==g_temp.isFreestyleMode&&1==g_options.gallery_preserve_ratio&&setHeightByOriginalRatio(),g_objTheme.run(),g_objTabs&&g_temp.isRunFirstTime&&g_objTabs.run(),preloadBigImages(),initEvents(),g_numItems>0&&t.selectItem(0),1==g_options.gallery_autoplay&&t.startPlayMode(),g_temp.isRunFirstTime=!1}function showErrorMessage(e,t){if(void 0===t)t="<b>Unite Gallery Error: </b>";else t="<b>"+t+": </b>";var i="<div class='ug-error-message-wrapper'><div class='ug-error-message'>"+(e=t+e)+"</div></div>";g_objWrapper.children().remove(),g_objWrapper.html(i),g_objWrapper.show()}function throwErrorShowMessage(e){throw showErrorMessage(e),new Error(e)}function modifyInitParams(){g_options.gallery_images_preload_type||(g_options.gallery_images_preload_type="minimal"),(null==g_options.gallery_min_height||g_options.gallery_height<g_options.gallery_min_height)&&(g_options.gallery_min_height=0),(null==g_options.gallery_min_width||g_options.gallery_width<g_options.gallery_min_width)&&(g_options.gallery_min_width=0)}function validateParams(){if(!g_options.gallery_theme)throw new Error("The gallery can't run without theme");if(jQuery.isNumeric(g_options.gallery_height)&&g_options.gallery_height<g_options.gallery_min_height)throw new Error("The <b>gallery_height</b> option must be bigger then <b>gallery_min_height option</b>");if(g_options.gallery_width<g_options.gallery_min_width)throw new Error("The <b>gallery_width</b> option must be bigger then <b>gallery_min_width option</b>")}function setGalleryHtml(){g_objWrapper.addClass("ug-gallery-wrapper"),g_objWrapper.append("<div class='ug-overlay-disabled' style='display:none'></div>"),t.setSizeClass()}function clearInitData(){g_objWrapper.children().remove()}function storeLastSize(){var e=t.getSize();g_temp.lastWidth=e.width,g_temp.lastHeight=e.height}function setHeightByOriginalRatio(){var e=t.getSize();if(e.width/e.height!=e.orig_ratio){var i=e.width/e.orig_ratio;(i=Math.round(i))<g_options.gallery_min_height&&(i=g_options.gallery_min_height),g_objWrapper.height(i)}}function setHtmlObjectsProperties(){var e={"max-width":g_functions.getCssSizeParam(g_options.gallery_width),"min-width":g_functions.getCssSizeParam(g_options.gallery_min_width)};if(0==g_temp.isFreestyleMode){var t=g_functions.getCssSizeParam(g_options.gallery_height);e.height=t}else e.overflow="visible";g_options.gallery_background_color&&(e["background-color"]=g_options.gallery_background_color),g_objWrapper.css(e)}function fillItemByChild(e){var i=t.isMobileMode();if("noscript"==(a=e.prop("tagName").toLowerCase()))return null;if("picture"==a){var n=e.find("img");if(0==n.length)return null;e=n,a="img"}var r=e.data("lazy-src");r&&e.attr("src",r);var o="";if("a"==a){o=e.attr("href");var a=(e=e.children("img:first-child")).prop("tagName").toLowerCase()}var s=e.data("type");null==s&&(s="image");var l={};if(l.type=s,"img"==a){if(!(u=e.data("lazyload-src")))var u=e.data("lazy-src");u&&""!=u&&(e.attr("src",u),jQuery.removeData(e,"lazyload-src"));var d=e.data("image"),_=e.data("thumb"),g=e.data("title");void 0===d&&(d=null),void 0===_&&(_=null);var c=e.attr("src");d||(d=c),_||(_=c),_||(_=d),d||(d=_),l.urlThumb=_,l.urlImage=d,l.title=e.attr("alt"),g&&(l.title=g),l.objThumbImage=e,l.objThumbImage.attr("src",l.urlThumb)}else{if("image"==s)throw trace("Problematic gallery item found:"),trace(e),trace("Please look for some third party js script that could add this item to the gallery"),new Error("The item should not be image type");l.urlThumb=e.data("thumb"),l.title=e.data("title"),l.objThumbImage=null,l.urlImage=e.data("image")}if(1==i){var h=e.data("thumb-mobile");void 0!==h&&""!=h&&(l.urlThumb=h,"img"==a&&e.attr("src",l.urlThumb));var p=e.data("image-mobile");void 0!==p&&""!=p&&(l.urlImage=p)}l.link=o,l.description=e.attr("title"),l.description||(l.description=e.data("description")),l.description||(l.description=""),l.isNewAdded=!1,l.isLoaded=!1,l.isThumbImageLoaded=!1,l.objPreloadImage=null,l.isBigImageLoadStarted=!1,l.isBigImageLoaded=!1,l.isBigImageLoadError=!1,l.imageWidth=0,l.imageHeight=0,l.thumbWidth=0,l.thumbHeight=0,l.thumbRatioByWidth=0,l.thumbRatioByHeight=0;var m=e.data("width"),f=e.data("height");m&&"number"==typeof m&&f&&"number"==typeof f&&(l.thumbWidth=m,l.thumbHeight=f,l.thumbRatioByWidth=m/f,l.thumbRatioByHeight=f/m),l.addHtml=null;var b=null==l.urlImage||""==l.urlImage,v=null==l.urlThumb||""==l.urlThumb;switch(l.type){case"youtube":if(l.videoid=e.data("videoid"),l.video_start=e.data("start"),b||v){var y=g_ugYoutubeAPI.getVideoImages(l.videoid);b&&(l.urlImage=y.preview),v&&(l.urlThumb=y.thumb,"img"==a&&e.attr("src",l.urlThumb))}g_temp.isYoutubePresent=!0;break;case"vimeo":l.videoid=e.data("videoid"),g_temp.isVimeoPresent=!0;break;case"html5video":l.videoogv=e.data("videoogv"),l.videowebm=e.data("videowebm"),l.videomp4=e.data("videomp4"),g_temp.isHtml5VideoPresent=!0;break;case"soundcloud":l.trackid=e.data("trackid"),g_temp.isSoundCloudPresent=!0;break;case"wistia":l.videoid=e.data("videoid"),g_temp.isWistiaPresent=!0;break;case"custom":var I=e.children("img");I.length&&(I=jQuery(I[0]),l.urlThumb=I.attr("src"),l.title=I.attr("alt"),l.objThumbImage=I);var w=e.children().not("img:first-child");w.length&&(l.addHtml=w.clone())}return l.objThumbImage&&(l.objThumbImage.removeAttr("data-description",""),l.objThumbImage.removeAttr("data-image",""),l.objThumbImage.removeAttr("data-thumb",""),l.objThumbImage.removeAttr("title","")),l}function fillItemsArray(e,t){if(!0!==t)g_arrItems=[];else for(var i=0;i<g_numItems;i++)g_arrItems[i].isNewAdded=!1;for(i=0;i<e.length;i++){var n=jQuery(e[i]),r=fillItemByChild(n);null!==r?(numIndex=g_arrItems.length,r.index=numIndex,!0===t&&(r.isNewAdded=!0),g_arrItems.push(r)):n.remove()}g_numItems=g_arrItems.length}function loadAPIs(){var e=g_options.load_api_externally;g_temp.isYoutubePresent&&g_ugYoutubeAPI.loadAPI(e),g_temp.isVimeoPresent&&g_ugVimeoAPI.loadAPI(e),g_temp.isHtml5VideoPresent&&g_ugHtml5MediaAPI.loadAPI(e),g_temp.isSoundCloudPresent&&g_ugSoundCloudAPI.loadAPI(e),g_temp.isWistiaPresent&&g_ugWistiaAPI.loadAPI(e)}function preloadBigImages(){if("visible"!=g_options.gallery_images_preload_type||g_objThumbs||(g_options.gallery_images_preload_type="minimal"),1==g_temp.isAllItemsPreloaded)return!0;switch(g_options.gallery_images_preload_type){default:case"minimal":break;case"all":jQuery(g_arrItems).each(function(){preloadItemImage(this)});break;case"visible":jQuery(g_arrItems).each(function(){1==g_objThumbs.isItemThumbVisible(this)&&preloadItemImage(this)})}}function checkPreloadItemImage(e){if(1==e.isBigImageLoadStarted||1==e.isBigImageLoaded||1==e.isBigImageLoadError)return!1;switch(g_options.gallery_images_preload_type){default:case"minimal":break;case"all":preloadItemImage(e);break;case"visible":1==g_objThumbs.isItemThumbVisible(e)&&preloadItemImage(e)}}function preloadItemImage(e){if(1==e.isBigImageLoadStarted||1==e.isBigImageLoaded||1==e.isBigImageLoadError)return!0;var i=e.urlImage;if(""==i||null==i)return e.isBigImageLoadError=!0,!1;e.isBigImageLoadStarted=!0,e.objPreloadImage=jQuery("<img/>").attr("src",i),e.objPreloadImage.data("itemIndex",e.index),e.objPreloadImage.on("load",t.onItemBigImageLoaded),e.objPreloadImage.on("error",function(){var e=jQuery(this).data("itemIndex"),i=g_arrItems[e];i.isBigImageLoadError=!0,i.isBigImageLoaded=!1;var n=jQuery(this).attr("src");console.log("Can't load image: "+n),g_objGallery.trigger(t.events.ITEM_IMAGE_UPDATED,[e,i.urlImage]),i.objThumbImage.attr("src",i.urlThumb)}),checkAllItemsStartedPreloading()}function preloadNearBigImages(e){if(1==g_temp.isAllItemsPreloaded)return!1;if(!e)e=g_selectedItem;if(!e)return!0;var t=e.index,i=t-1,n=t+1;i>0&&preloadItemImage(g_arrItems[i]),n<g_numItems&&preloadItemImage(g_arrItems[n])}function checkAllItemsStartedPreloading(){if(1==g_temp.isAllItemsPreloaded)return!1;for(var e in g_arrItems)if(0==g_arrItems[e].isBigImageLoadStarted)return!1;g_temp.isAllItemsPreloaded=!0}function __________END_INIT_GALLERY_______(){}function __________EVENTS_____________(){}function onSliderMouseEnter(e){1==g_options.gallery_pause_on_mouseover&&0==t.isFullScreen()&&1==g_temp.isPlayMode&&g_objSlider&&0==g_objSlider.isSlideActionActive()&&t.pausePlaying()}function onSliderMouseLeave(e){1==g_options.gallery_pause_on_mouseover&&1==g_temp.isPlayMode&&g_objSlider&&0==g_objSlider.isSlideActionActive()&&(0==g_objSlider.isCurrentSlideLoadingImage()&&t.continuePlaying())}function isThisGalleryForKeyAction(){if(!window.ugArrGalleriesObjects)return!0;window.ugArrGalleriesObjects.length;if(1==window.ugArrGalleriesObjects.length)return!0;var e,i=0,n=t.getGalleryID();return jQuery.each(window.ugArrGalleriesObjects,function(t,r){var o=r.getGalleryID(),a=r.getKeyPressScore();a>i&&(i=a),o==n&&(e=a)}),e==i}function onKeyPress(e){var i=jQuery(e.target);if(i.is("textarea")||i.is("select")||i.is("input"))return!0;var n=e.charCode?e.charCode:e.keyCode?e.keyCode:e.which?e.which:0,r=!1;switch(n){case 39:1==isThisGalleryForKeyAction()&&(t.nextItem(),r=!0);break;case 37:1==isThisGalleryForKeyAction()&&(t.prevItem(),r=!0);break;default:r=!1}1==r&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()),g_objGallery.trigger(t.events.GALLERY_KEYPRESS,[n,e])}function onGalleryResized(){var e;if(0==(e=t.getSize()).width)return!0;if(t.setSizeClass(),(e=t.getSize()).width!=g_temp.lastWidth||0==g_temp.isFreestyleMode&&e.height!=g_temp.lastHeight){var i=!1;if(g_temp.funcCustomHeight){var n=g_temp.funcCustomHeight(e);n&&(g_objWrapper.height(n),i=!0)}0==i&&1==g_options.gallery_preserve_ratio&&0==g_temp.isFreestyleMode&&setHeightByOriginalRatio(),storeLastSize(),g_objGallery.trigger(t.events.SIZE_CHANGE)}}function onThumbsChange(e){"visible"==g_options.gallery_images_preload_type&&0==g_temp.isAllItemsPreloaded&&preloadBigImages()}function onFullScreenChange(){var e=g_functions.isFullScreen(),i=e?t.events.ENTER_FULLSCREEN:t.events.EXIT_FULLSCREEN,n=g_functions.getGlobalData("fullscreenID");if(g_galleryID!==n)return!0;e?g_objWrapper.addClass("ug-fullscreen"):g_objWrapper.removeClass("ug-fullscreen"),g_objGallery.trigger(i),onGalleryResized()}function onItemImageUpdated(e,i){checkPreloadItemImage(t.getItem(i))}function onCurrentSlideImageLoadEnd(){1==t.isPlayMode()&&t.continuePlaying()}function initEvents(){if(g_objWrapper.on("dragstart",function(e){e.preventDefault()}),g_objGallery.on(t.events.ITEM_IMAGE_UPDATED,onItemImageUpdated),g_objThumbs)switch(g_temp.thumbsType){case"strip":jQuery(g_objThumbs).on(g_objThumbs.events.STRIP_MOVE,onThumbsChange);break;case"grid":jQuery(g_objThumbs).on(g_objThumbs.events.PANE_CHANGE,onThumbsChange)}if("advance"==g_options.gallery_mousewheel_role&&0==g_temp.isFreestyleMode&&g_objWrapper.on("mousewheel",t.onGalleryMouseWheel),storeLastSize(),jQuery(window).resize(function(){g_objWrapper.css("width","auto"),g_functions.whenContiniousEventOver("gallery_resize",onGalleryResized,g_temp.resizeDelay)}),setTimeout(function(){setInterval(onGalleryResized,2e3)},1e4),g_functions.addFullScreenChangeEvent(onFullScreenChange),g_objSlider){if(jQuery(g_objSlider).on(g_objSlider.events.ITEM_CHANGED,function(){var e=g_objSlider.getCurrentItemIndex();-1!=e&&t.selectItem(e)}),1==g_options.gallery_pause_on_mouseover)g_objSlider.getElement().hover(onSliderMouseEnter,onSliderMouseLeave),g_objGallery.on(t.events.ENTER_FULLSCREEN,function(){onSliderMouseLeave()});retriggerEvent(g_objSlider,g_objSlider.events.ACTION_START,t.events.SLIDER_ACTION_START),retriggerEvent(g_objSlider,g_objSlider.events.ACTION_END,t.events.SLIDER_ACTION_END),jQuery(g_objSlider).on(g_objSlider.events.CURRENTSLIDE_LOAD_END,onCurrentSlideImageLoadEnd)}1==g_options.gallery_control_keyboard&&jQuery(document).keydown(onKeyPress)}function __________GENERAL_______(){}function cacheItems(e,t){if(t)"noitems"!=(i=t)&&(i=jQuery(t).clone());else var i=g_objWrapper.children().clone();g_objCache[e]=i}function removeAllSizeClasses(e){e||(e=g_objWrapper),e.removeClass("ug-under-480"),e.removeClass("ug-under-780"),e.removeClass("ug-under-960")}function retriggerEvent(e,t,i){jQuery(e).on(t,function(e){g_objGallery.trigger(i,[this])})}function advanceNextStep(){var e=jQuery.now(),i=e-g_temp.playTimeLastStep;if(g_temp.playTimeLastStep=e,0==t.isGalleryVisible())return!1;if(g_temp.playTimePassed+=i,g_temp.objProgress){var n=g_temp.playTimePassed/g_options.gallery_play_interval;g_temp.objProgress.setProgress(n)}g_temp.playTimePassed>=g_options.gallery_play_interval&&(t.nextItem(),g_temp.playTimePassed=0)}function unselectSeletedItem(){if(null==g_selectedItem)return!0;g_objThumbs&&g_objThumbs.setThumbUnselected(g_selectedItem.objThumbWrapper),g_selectedItem=null,g_selectedItemIndex=-1}function toFakeFullScreen(){jQuery("body").addClass("ug-body-fullscreen"),g_objWrapper.addClass("ug-fake-fullscreen"),g_temp.isFakeFullscreen=!0,g_objGallery.trigger(t.events.ENTER_FULLSCREEN),g_objGallery.trigger(t.events.SIZE_CHANGE)}function exitFakeFullscreen(){jQuery("body").removeClass("ug-body-fullscreen"),g_objWrapper.removeClass("ug-fake-fullscreen"),g_temp.isFakeFullscreen=!1,g_objGallery.trigger(t.events.EXIT_FULLSCREEN),g_objGallery.trigger(t.events.SIZE_CHANGE)}this.onItemBigImageLoaded=function(e,t){if(!t)t=jQuery(this);var i=t.data("itemIndex"),n=g_arrItems[i];n.isBigImageLoaded=!0;var r=g_functions.getImageOriginalSize(t);n.imageWidth=r.width,n.imageHeight=r.height},this.checkFillImageSize=function(e,t){if(!t){var i=e.data("itemIndex");if(void 0===i)throw new Error("Wrong image given to gallery.checkFillImageSize");t=g_arrItems[i]}var n=g_functions.getImageOriginalSize(e);t.imageWidth=n.width,t.imageHeight=n.height},this.setFreestyleMode=function(){g_temp.isFreestyleMode=!0},this.attachThumbsPanel=function(e,t){g_temp.thumbsType=e,g_objThumbs=t},this.initSlider=function(e,i){if(!e)e={};e=jQuery.extend(g_temp.objCustomOptions,e),(g_objSlider=new UGSlider).init(t,e,i)},this.onGalleryMouseWheel=function(e,i,n,r){e.preventDefault(),i>0?t.prevItem():t.nextItem()},this.getKeyPressScore=function(){if(t.isGalleryInsideScreen())return 1;if(g_objLightbox&&1==g_objLightbox.isOpened())return 2;return 0},this.getGalleryID=function(){return g_galleryID},this.destroy=function(){if(g_objWrapper.off("dragstart"),g_objGallery.off(t.events.ITEM_IMAGE_UPDATED),g_objThumbs)switch(g_temp.thumbsType){case"strip":jQuery(g_objThumbs).off(g_objThumbs.events.STRIP_MOVE);break;case"grid":jQuery(g_objThumbs).off(g_objThumbs.events.PANE_CHANGE)}if(g_objWrapper.off("mousewheel"),jQuery(window).off("resize"),g_functions.destroyFullScreenChangeEvent(),g_objSlider){jQuery(g_objSlider).off(g_objSlider.events.ITEM_CHANGED);var e=g_objSlider.getElement();e.off("mouseenter"),e.off("mouseleave"),g_objGallery.off(t.events.ENTER_FULLSCREEN),jQuery(g_objSlider).off(g_objSlider.events.ACTION_START),jQuery(g_objSlider).off(g_objSlider.events.ACTION_END),jQuery(g_objSlider).off(g_objSlider.events.CURRENTSLIDE_LOAD_END)}1==g_options.gallery_control_keyboard&&jQuery(document).off("keydown"),g_objTheme&&"function"==typeof g_objTheme.destroy&&g_objTheme.destroy(),g_objWrapper.html("")},this.getArrItems=function(){return g_arrItems},this.getObjects=function(){return{g_galleryID:g_galleryID,g_objWrapper:g_objWrapper,g_objThumbs:g_objThumbs,g_objSlider:g_objSlider,g_options:g_options,g_arrItems:g_arrItems,g_numItems:g_numItems}},this.getObjSlider=function(){return g_objSlider},this.getItem=function(e){if(e<0)throw new Error("item with index: "+e+" not found");if(e>=g_numItems)throw new Error("item with index: "+e+" not found");return g_arrItems[e]},this.getWidth=function(){return t.getSize().width},this.getHeight=function(){return t.getSize().height},this.getSize=function(){var e=g_functions.getElementSize(g_objWrapper);return e.orig_width=g_options.gallery_width,e.orig_height=g_options.gallery_height,e.orig_ratio=e.orig_width/e.orig_height,e},this.getGalleryID=function(){return g_galleryID.replace("#","")},this.getNextItem=function(e,t){"object"==typeof e&&(e=e.index);var i=e+1;if(!0!==t&&1==g_numItems)return null;if(i>=g_numItems){if(1!=g_options.gallery_carousel&&!0!==t)return null;i=0}return g_arrItems[i]},this.getPrevItem=function(e){"object"==typeof e&&(e=e.index);var t=e-1;if(t<0){if(1!=g_options.gallery_carousel&&!0!==forceCarousel)return null;t=g_numItems-1}return g_arrItems[t]},this.getSelectedItem=function(){return g_selectedItem},this.getSelectedItemIndex=function(){return g_selectedItemIndex},this.getNumItems=function(){return g_numItems},this.isLastItem=function(){return g_selectedItemIndex==g_numItems-1},this.isFirstItem=function(){return 0==g_selectedItemIndex},this.getOptions=function(){return g_options},this.getElement=function(){return g_objWrapper},this.___________SET_CONTROLS___________=function(){},this.setNextButton=function(e){e.data("ug-button",!0),g_functions.setButtonOnClick(e,t.nextItem)},this.setPrevButton=function(e){e.data("ug-button",!0),g_functions.setButtonOnClick(e,t.prevItem)},this.setFullScreenToggleButton=function(e){e.data("ug-button",!0),g_functions.setButtonOnTap(e,t.toggleFullscreen),g_objGallery.on(t.events.ENTER_FULLSCREEN,function(){e.addClass("ug-fullscreenmode")}),g_objGallery.on(t.events.EXIT_FULLSCREEN,function(){e.removeClass("ug-fullscreenmode")})},this.destroyFullscreenButton=function(e){g_functions.destroyButton(e),g_objGallery.off(t.events.ENTER_FULLSCREEN),g_objGallery.off(t.events.EXIT_FULLSCREEN)},this.setPlayButton=function(e){e.data("ug-button",!0),g_functions.setButtonOnClick(e,t.togglePlayMode),g_objGallery.on(t.events.START_PLAY,function(){e.addClass("ug-stop-mode")}),g_objGallery.on(t.events.STOP_PLAY,function(){e.removeClass("ug-stop-mode")})},this.destroyPlayButton=function(e){g_functions.destroyButton(e),g_objGallery.off(t.events.START_PLAY),g_objGallery.off(t.events.STOP_PLAY)},this.setProgressIndicator=function(e){g_temp.objProgress=e},this.setTextContainers=function(e,i){g_objGallery.on(t.events.ITEM_CHANGE,function(){var n=t.getSelectedItem();e.html(n.title),i.html(n.description)})},this.showDisabledOverlay=function(){g_objWrapper.children(".ug-overlay-disabled").show()},this.hideDisabledOverlay=function(){g_objWrapper.children(".ug-overlay-disabled").hide()},this.___________END_SET_CONTROLS___________=function(){},this.___________PLAY_MODE___________=function(){},this.startPlayMode=function(){if(g_temp.isPlayMode=!0,g_temp.isPlayModePaused=!1,g_temp.playTimePassed=0,g_temp.playTimeLastStep=jQuery.now(),g_temp.playHandle=setInterval(advanceNextStep,g_temp.playStepInterval),g_temp.objProgress){var e=g_temp.objProgress.getElement();g_temp.objProgress.setProgress(0),e.show()}g_objGallery.trigger(t.events.START_PLAY),g_objSlider&&1==g_objSlider.isCurrentSlideLoadingImage()&&t.pausePlaying()},this.resetPlaying=function(){if(0==g_temp.isPlayMode)return!0;g_temp.playTimePassed=0,g_temp.playTimeLastStep=jQuery.now()},this.pausePlaying=function(){if(1==g_temp.isPlayModePaused)return!0;g_temp.isPlayModePaused=!0,clearInterval(g_temp.playHandle),g_objGallery.trigger(t.events.PAUSE_PLAYING)},this.continuePlaying=function(){if(0==g_temp.isPlayModePaused)return!0;g_temp.isPlayModePaused=!1,g_temp.playTimeLastStep=jQuery.now(),g_temp.playHandle=setInterval(advanceNextStep,g_temp.playStepInterval)},this.stopPlayMode=function(){(g_temp.isPlayMode=!1,clearInterval(g_temp.playHandle),g_temp.playTimePassed=0,g_temp.objProgress)&&g_temp.objProgress.getElement().hide();g_objGallery.trigger(t.events.STOP_PLAY)},this.isPlayMode=function(){return g_temp.isPlayMode},this.togglePlayMode=function(){0==t.isPlayMode()?t.startPlayMode():t.stopPlayMode()},this.___________GENERAL_EXTERNAL___________=function(){},this.getCurrentNumItem=function(){return g_selectedItemIndex},this.shuffleItems=function(){for(var e in g_arrItems=g_functions.arrayShuffle(g_arrItems))g_arrItems[e].index=parseInt(e)},this.setOptions=function(e){g_options=jQuery.extend(g_options,e)},this.selectItem=function(e,i){"number"==typeof e&&(e=t.getItem(e));var n=e.index;if(n==g_selectedItemIndex)return!0;(unselectSeletedItem(),g_selectedItem=e,g_selectedItemIndex=n,g_objGallery.trigger(t.events.ITEM_CHANGE,[e,i]),1==g_temp.isPlayMode)&&(t.resetPlaying(),1==g_objSlider.isCurrentSlideLoadingImage()&&t.pausePlaying())},this.nextItem=function(){var e=g_selectedItemIndex+1;return 0==g_numItems||(0==g_options.gallery_carousel&&e>=g_numItems||(e>=g_numItems&&(e=0),void t.selectItem(e,"next")))},this.prevItem=function(){var e=g_selectedItemIndex-1;return-1==g_selectedItemIndex&&(e=0),0==g_numItems||(0==g_options.gallery_carousel&&e<0||(e<0&&(e=g_numItems-1),void t.selectItem(e,"prev")))},this.isFullScreen=function(){return 1==g_temp.isFakeFullscreen||1==g_functions.isFullScreen()},this.isFakeFullscreen=function(){return g_temp.isFakeFullscreen},this.toFullScreen=function(){g_functions.setGlobalData("fullscreenID",g_galleryID);var e=g_objWrapper.get(0);0==g_functions.toFullscreen(e)&&toFakeFullScreen()},this.exitFullScreen=function(){1==g_temp.isFakeFullscreen?exitFakeFullscreen():g_functions.exitFullscreen()},this.toggleFullscreen=function(){0==t.isFullScreen()?t.toFullScreen():t.exitFullScreen()},this.resize=function(e,t,i){g_objWrapper.css("width","auto"),g_objWrapper.css("max-width",e+"px"),t&&g_objWrapper.height(t),i||!0===i||onGalleryResized()},this.setSizeClass=function(e,i){if(!e)e=g_objWrapper;if(!i)i=t.getSize().width;if(0==i)i=jQuery(window).width();var n="";if(i<=480?n="ug-under-480":i<=780?n="ug-under-780":i<960&&(n="ug-under-960"),1==e.hasClass(n))return!0;removeAllSizeClasses(e),""!=n&&e.addClass(n)},this.isMobileMode=function(){return!!g_objWrapper.hasClass("ug-under-480")},this.isSmallWindow=function(){var e=jQuery(window).width();return!e||e<=480},this.isGalleryVisible=function(){return g_objWrapper.is(":visible")},this.isGalleryInsideScreen=function(){return 1!=g_temp.isFreestyleMode&&(!!g_objSlider&&g_functions.isElementInsideScreen(g_objWrapper))},this.changeItems=function(e,t){if(!e)e="noitems";runGallery(g_galleryID,"nochange",e,t)},this.addItems=function(e){if(!e||0==e.length)return!1;var t=g_objWrapper.children(".ug-newitems-wrapper");if(0==t.length&&g_objWrapper.append("<div class='ug-newitems-wrapper' style='display:none'></div>"),(t=g_objWrapper.children(".ug-newitems-wrapper")).append(e),fillItemsArray(jQuery(t.children()),!0),loadAPIs(),!g_objTheme||"function"!=typeof g_objTheme.addItems)throw new Error("addItems function not found in the theme");t.remove(),g_objTheme.addItems()},this.getNewAddedItemsIndexes=function(){var e=[];return jQuery.each(g_arrItems,function(t,i){1==i.isNewAdded&&e.push(t)}),e},this.showErrorMessageReplaceGallery=function(e){showErrorMessage(e)},this.setFuncCustomHeight=function(e){g_temp.funcCustomHeight=e},this.setObjLightbox=function(e){g_objLightbox=e},this.__________EXTERNAL_EVENTS_______=function(){},this.triggerEvent=function(e,t){t?("array"!=jQuery.type(t)&&(t=[t]),g_objGallery.trigger(e,t)):g_objGallery.trigger(e)},this.onEvent=function(e,t){g_objGallery.on(e,t)},this.destroyEvent=function(e){g_objGallery.off(e)},this.__________AJAX_REQUEST_______=function(){},this.ajaxRequest=function(e,t,i,n){if(!i||"function"!=typeof i)throw new Error("ajaxRequest error: success function should be passed");var r=g_options.gallery_urlajax;if(!r||""==r)throw new Error("ajaxRequest error: Ajax url don't passed");if(void 0===t)t={};var o={action:"unitegallery_ajax_action",client_action:e,galleryID:g_galleryID,data:t};jQuery.ajax({type:"post",url:g_options.gallery_urlajax,dataType:"json",data:o,success:function(e){if(!e)throw new Error("Empty ajax response!");if(-1==e||0===e)throw new Error("ajax error!!!");if(void 0===e.success)throw new Error("ajax error!!!");if(0==e.success)return showErrorMessage(e.message,"ajax error"),!1;i(e)},error:function(e,t,i){console.log("Ajax Error!!! "+t),responseText=e.responseText,n&&"function"==typeof n?n(responseText):trace(responseText)}})},this.requestNewItems=function(e,i,n){var r=g_options.gallery_enable_cache;if(n||(n=e),1==i&&(r=!1),1==r&&g_objCache.hasOwnProperty(n)){var o=g_objCache[n];t.changeItems(o,n)}else g_objGallery.trigger(t.events.GALLERY_BEFORE_REQUEST_ITEMS),t.ajaxRequest("front_get_cat_items",{catid:e},function(e){var i=e.html;t.changeItems(i,n)})},this.run=function(e,t){if(t&&t.hasOwnProperty("gallery_debug_errors")&&(g_options.gallery_debug_errors=t.gallery_debug_errors),1==g_options.gallery_debug_errors)try{runGallery(e,t)}catch(e){if("object"==typeof e){var i=e.message,n=e.lineNumber,r=e.fileName;e.stack;i+=" <br><br> in file: "+r,i+=" <b> line "+n+"</b>",trace(e)}else i=e;showErrorMessage(i=i.replace("Error:",""))}else runGallery(e,t)}}function UGLightbox(){var e,t,i,n,r,o,a,s,l=this,u=jQuery(this),d=new UniteGalleryMain,_=new UGSlider,g=new UGFunctions,c=new UGTextPanel,h={lightbox_type:"wide",lightbox_show_textpanel:!0,lightbox_textpanel_width:550,lightbox_hide_arrows_onvideoplay:!0,lightbox_arrows_position:"sides",lightbox_arrows_offset:10,lightbox_arrows_inside_offset:10,lightbox_arrows_inside_alwayson:!1,lightbox_overlay_color:null,lightbox_overlay_opacity:1,lightbox_top_panel_opacity:null,lightbox_show_numbers:!0,lightbox_numbers_size:null,lightbox_numbers_color:null,lightbox_numbers_padding_top:null,lightbox_numbers_padding_right:null,lightbox_compact_closebutton_offsetx:1,lightbox_compact_closebutton_offsety:1,lightbox_close_on_emptyspace:!0};this.events={LIGHTBOX_INIT:"lightbox_init"};var p={topPanelHeight:44,initTextPanelHeight:26,isOpened:!1,isRightNowOpened:!1,putSlider:!0,isCompact:!1,fadeDuration:300,positionFrom:null,textPanelTop:null,textPanelLeft:null,isArrowsInside:!1,isArrowsOnHoverMode:!1,lastMouseX:null,lastMouseY:null,originalOptions:null,isSliderChangedOnce:!1,isTopPanelEnabled:!0},m={lightbox_slider_controls_always_on:!0,lightbox_slider_enable_bullets:!1,lightbox_slider_enable_arrows:!1,lightbox_slider_enable_progress_indicator:!1,lightbox_slider_enable_play_button:!1,lightbox_slider_enable_fullscreen_button:!1,lightbox_slider_enable_zoom_panel:!1,lightbox_slider_enable_text_panel:!1,lightbox_slider_scale_mode_media:"down",lightbox_slider_scale_mode:"down",lightbox_slider_loader_type:3,lightbox_slider_loader_color:"black",lightbox_slider_transition:"fade",lightbox_slider_image_padding_top:p.topPanelHeight,lightbox_slider_image_padding_bottom:0,lightbox_slider_video_padding_top:38,lightbox_slider_video_padding_bottom:0,lightbox_textpanel_align:"middle",lightbox_textpanel_padding_top:5,lightbox_textpanel_padding_bottom:5,slider_video_constantsize:!1,lightbox_slider_image_border:!1,lightbox_textpanel_enable_title:!0,lightbox_textpanel_enable_description:!1,lightbox_textpanel_desc_style_as_title:!0,lightbox_textpanel_enable_bg:!1,video_enable_closebutton:!1,lightbox_slider_video_enable_closebutton:!1,video_youtube_showinfo:!1,lightbox_slider_enable_links:!1},f={lightbox_overlay_opacity:.6,lightbox_slider_image_border:!0,lightbox_slider_image_shadow:!0,lightbox_slider_image_padding_top:30,lightbox_slider_image_padding_bottom:30,slider_video_constantsize:!0,lightbox_textpanel_align:"bottom",lightbox_textpanel_title_text_align:"left",lightbox_textpanel_desc_text_align:"left",lightbox_textpanel_padding_left:10,lightbox_textpanel_padding_right:10};function b(){1==p.isCompact&&1==h.lightbox_show_textpanel&&(h.lightbox_slider_image_padding_bottom=p.initTextPanelHeight),1==p.isCompact&&"inside"==h.lightbox_arrows_position&&(p.isArrowsInside=!0),1==p.isArrowsInside&&0==h.lightbox_arrows_inside_alwayson&&(p.isArrowsOnHoverMode=!0),0==h.lightbox_show_textpanel&&(p.isTopPanelEnabled=!1,p.topPanelHeight=0,h.lightbox_slider_image_padding_top=0)}function v(e){if(!_)return!0;var t={slider_image_padding_top:e};_.setOptions(t),_.refreshSlideItems()}function y(e){if(!s)return!1;if(!c)return!1;var t=s.height();if(0==t)return!1;if(0==s.is(":visible"))return!1;var i=t,n=c.getSize().height;t!=p.topPanelHeight&&(i=p.topPanelHeight),n>i&&(i=n),t!=i&&(s.height(i),_&&0==_.isAnimating()&&v(i))}function I(e){if(0==p.isOpened)return!1;if(!c)return!1;if(!_)return!1;var i=g.getElementSize(t),n=c.getSize();if(0==n.width||n.height>120)return!1;if(!e){var r=_.getSlideImage();e=g.getElementSize(r)}if(0==e.height||0==e.width)return!1;if(e.bottom+n.height<i.height)return!1;var o=_.getOptions(),a=n.height;if(a!=o.slider_image_padding_bottom){var s={slider_image_padding_bottom:a};if(0==_.isAnimating())return _.setOptions(s),_.refreshSlideItems(),!0}return!1}function w(e){g.getElementSize(t);var i=_.getSlideImage(),n=g.getElementSize(i);if(0==n.width)return!1;p.textPanelLeft=n.left,p.textPanelTop=n.bottom;var r=n.width;if(a){var o=g.getElementSize(a);r-=o.width;var s=n.right-o.width;g.placeElement(a,s,p.textPanelTop)}c&&(c.show(),c.refresh(!0,!0,r),function(e,t){if(!e){var i=_.getSlideImage();e=g.getElementSize(i)}p.textPanelTop=e.bottom,!0===t&&c.positionPanel(p.textPanelTop,p.textPanelLeft)}(n)),0==I(n)&&(p.positionFrom="handleCompactTextpanelSizes",c&&(c.positionPanel(p.textPanelTop,p.textPanelLeft),!0===e&&(e(),H())))}function E(){return 0==_.isCurrentSlideType("image")||1==_.isCurrentImageInPlace()}function T(e,t){if(0==p.isArrowsInside)return!1;if(!n)return!1;var i=E();if(n.show(),r.show(),p.positionFrom="positionArrowsInside",1==p.isArrowsOnHoverMode&&1==i&&0==A()&&M(!0),0==i)var o=g.getElementRelativePos(n,"left",h.lightbox_arrows_offset),a=g.getElementRelativePos(n,"middle"),s=g.getElementRelativePos(r,"right",h.lightbox_arrows_offset),l=a;else{var u=_.getSlideImage(),d=g.getElementSize(u);g.getElementSize(_.getElement()),o=g.getElementRelativePos(n,"left",0,u)+d.left+h.lightbox_arrows_inside_offset,a=g.getElementRelativePos(n,"middle",0,u)+d.top,s=g.getElementRelativePos(n,"right",0,u)+d.left-h.lightbox_arrows_inside_offset,l=a}if(!0===t){var c={left:o,top:a},m={left:s,top:l};n.stop().animate(c,{duration:p.fadeDuration}),r.stop().animate(m,{duration:p.fadeDuration})}else n.stop(),r.stop(),g.placeElement(n,o,a),g.placeElement(r,s,l);1==e&&O(t)}function S(e,i){p.positionFrom=null;var n=E(),r=g.getElementRelativePos(o,"right",2,t);if(0==n)var a=2,s=r;else{var l=_.getSlideImage(),u=g.getElementSize(l),d=g.getElementSize(_.getElement()),c=g.getElementSize(o);d.top==d.height&&(d.top=0);s=d.left+u.right-c.width/2+h.lightbox_compact_closebutton_offsetx;(a=d.top+u.top-c.height/2-h.lightbox_compact_closebutton_offsety)<2&&(a=2),s>r&&(s=r)}if(!0===i){var m={left:s,top:a};o.stop().animate(m,{duration:p.fadeDuration})}else o.stop(),g.placeElement(o,s,a);!0===e&&function(e){!0!==e&&o.stop();o.fadeTo(p.fadeDuration,1)}(i)}function P(){o&&o.stop().fadeTo(p.fadeDuration,0),j(),C(),p.positionFrom="hideCompactElements",1==p.isArrowsInside&&M()}function x(){var e=g.getElementSize(t);s&&g.setElementSizeAndPosition(s,0,0,e.width,p.topPanelHeight),n&&0==p.isArrowsInside&&(1==h.lightbox_hide_arrows_onvideoplay&&(n.show(),r.show()),g.placeElement(n,"left","middle",h.lightbox_arrows_offset),g.placeElement(r,"right","middle",h.lightbox_arrows_offset)),0==p.isCompact&&g.placeElement(o,"right","top",2,2),c&&(p.positionFrom="positionElements",0==p.isCompact?function(e){var t={},i=h.lightbox_textpanel_width;i>e.width-47-40?(t.textpanel_padding_left=47,t.textpanel_padding_right=40,t.textpanel_title_text_align="center",t.textpanel_desc_text_align="center"):(t.textpanel_padding_left=Math.floor((e.width-i)/2),t.textpanel_padding_right=t.textpanel_padding_left,t.textpanel_title_text_align="left",t.textpanel_desc_text_align="left",h.lightbox_textpanel_title_text_align&&(t.textpanel_title_text_align=h.lightbox_textpanel_desc_text_align),h.lightbox_textpanel_desc_text_align&&(t.textpanel_desc_text_align=h.lightbox_textpanel_desc_text_align)),c.setOptions(t),c.refresh(!0,!0),y(),c.positionPanel()}(e):(N(),H()));var i=e.width,a=e.height;if(_){if(s){var l={slider_image_padding_top:s.height()};_.setOptions(l)}_.setSize(i,a),_.setPosition(0,0)}}function j(){c&&c.getElement().stop().fadeTo(p.fadeDuration,0)}function C(){a&&a.stop().fadeTo(p.fadeDuration,0)}function A(){if(!p.lastMouseX)return!0;var e={pageX:p.lastMouseX,pageY:p.lastMouseY};return _.isMouseInsideSlideImage(e)}function M(e,t){return!!n&&(1==p.isArrowsOnHoverMode&&!1===t?(A(),!0):void(!0===e?(n.stop().fadeTo(0,0),r.stop().fadeTo(0,0)):(n.stop().fadeTo(p.fadeDuration,0),r.stop().fadeTo(p.fadeDuration,0))))}function O(e,t){return!!n&&(1==p.isArrowsOnHoverMode&&!0!==t&&1==E()||(1==_.isSwiping()||(!0!==e&&(n.stop(),r.stop()),n.fadeTo(p.fadeDuration,1),void r.fadeTo(p.fadeDuration,1))))}function z(e){if(!c)return!1;if(!e)e=_.getCurrentItem();c.setTextPlain(e.title,e.description)}function L(e){if(!a)return!1;if(!e)e=_.getCurrentItem();var t=d.getNumItems(),i=e.index+1;a.html(i+" / "+t)}function N(){if(!c)return!1;c.getElement().show().stop().fadeTo(p.fadeDuration,1)}function H(){a&&a.stop().fadeTo(p.fadeDuration,1)}function k(){if(0==p.isCompact)return!0;P()}function R(){if(0==p.isCompact)return!0;(p.positionFrom="onZoomChange",S(!1,!0),T(!1,!0),1==p.isCompact)&&(0==(_.isCurrentSlideType("image")&&1==_.isCurrentImageInPlace())?(j(),C()):(p.positionFrom="onZoomChange",N(),H()))}function G(){if(0==p.isCompact)return!0;p.positionFrom="onSliderAfterReturn",S(!0),T(!0),0==I()&&w(),N(),H()}function D(e,t){return t=jQuery(t),0==p.isCompact||(0==_.isSlideCurrent(t)||(p.positionFrom="onSliderAfterPutImage",S(!0),T(!0),void w()))}function Q(){var e=_.getOptions().slider_image_padding_top;if(s){var t=s.height();t!=e&&v(t)}if(1==p.isCompact){if(z(),L(),p.positionFrom="onSliderTransitionEnd",S(!0),T(!0),0==_.isSlideActionActive())0==I()&&w();N(),H()}}function W(e,t){0==p.isCompact?(a&&L(t),c&&(z(t),0==p.isRightNowOpened&&(c.positionElements(!1),y(),c.positionPanel()))):0==_.isAnimating()&&(c&&z(t),a&&L(t)),0==p.isSliderChangedOnce&&(p.isSliderChangedOnce=!0,u.trigger(l.events.LIGHTBOX_INIT))}function F(e,t){if("image"!=_.getSlideType()&&0==p.isCompact&&_.isSlideActionActive())return!0;if(1==_.isPreloading())return l.close("slider"),!0;1==h.lightbox_close_on_emptyspace&&(0==_.isMouseInsideSlideImage(t)&&l.close("slider_inside"))}function B(){x()}function Y(){s?function(){if(!s)return!1;s.hide()}():a&&a.hide(),n&&1==h.lightbox_hide_arrows_onvideoplay&&(n.hide(),r.hide())}function U(){s?(!function(){if(!s)return!1;s.show()}(),y()):a&&a.show(),n&&1==h.lightbox_hide_arrows_onvideoplay&&(n.show(),r.show())}function V(e,t,i){var n=!1;switch(t){case 27:1==p.isOpened&&l.close("keypress");break;case 38:case 40:case 33:case 34:n=!0}1==p.isOpened&&1==n&&i.preventDefault()}function X(){1==p.isArrowsOnHoverMode&&O(!1,!0)}function Z(e){p.positionFrom="hideCompactElements",1==p.isArrowsOnHoverMode&&1==E()&&M(!1,!0)}function q(e){p.lastMouseX=e.pageX,p.lastMouseY=e.pageY,1==(!n||0==n.is(":visible")||1!=n.css("opacity"))&&A()&&0==_.isAnimating()&&(p.positionFrom="onMouseMove",n&&0==n.is(":animated")&&O(!1,!0))}function K(e,t,i,n){if(0==p.isOpened)return!0;switch(h.gallery_mousewheel_role){default:case"zoom":"image"!=_.getSlideType()&&e.preventDefault();break;case"none":e.preventDefault();break;case"advance":d.onGalleryMouseWheel(e,t,i,n)}}this.destroy=function(){if(jQuery(document).unbind("mousemove"),i.off("touchstart"),i.off("touchend"),o.off("click"),e.off(d.events.ITEM_CHANGE),_){jQuery(_).off(_.events.TRANSITION_END),jQuery(_).off(_.events.CLICK),jQuery(_).off(_.events.START_DRAG),jQuery(_).off(_.events.TRANSITION_START),jQuery(_).off(_.events.AFTER_DRAG_CHANGE),jQuery(_).off(_.events.AFTER_RETURN);var n=_.getVideoObject();jQuery(n).off(n.events.PLAY_START),jQuery(n).off(n.events.PLAY_STOP),jQuery(_).on(_.events.IMAGE_MOUSEENTER,X),jQuery(_).on(_.events.IMAGE_MOUSELEAVE,Z),_.destroy()}jQuery(window).unbind("resize"),e.off(d.events.GALLERY_KEYPRESS,V),t.off("mousewheel"),t.remove()},this.isOpened=function(){return p.isOpened},this.open=function(s){var l=d.getItem(s);(p.isOpened=!0,p.isRightNowOpened=!0,setTimeout(function(){p.isRightNowOpened=!1},100),_&&_.setItem(l,"lightbox_open"),c&&c.setTextPlain(l.title,l.description),i.stop().fadeTo(0,0),t.show(),t.fadeTo(0,1),i.stop().fadeTo(p.fadeDuration,h.lightbox_overlay_opacity),x(),1==p.isCompact)&&(1==_.isPreloading()?(o&&o.hide(),n&&1==p.isArrowsInside&&(n.hide(),r.hide()),a&&a.hide(),c&&c.hide()):1==p.isArrowsInside&&(n.hide(),r.hide()));_&&_.startSlideAction(),e.trigger(d.events.OPEN_LIGHTBOX,l)},this.close=function(i){p.isOpened=!1,1==p.isCompact&&P(),_&&_.stopSlideAction(),"image"!=_.getSlideType()?t.hide():t.fadeTo(p.fadeDuration,0,function(){t.hide()}),e.trigger(d.events.CLOSE_LIGHTBOX)},this.init=function(t,i){!function(t,i){d=t,e=jQuery(t),d.setObjLightbox(l),h=jQuery.extend(h,m),h=jQuery.extend(h,i),p.originalOptions=jQuery.extend({},h),"compact"==h.lightbox_type&&(p.isCompact=!0,h=jQuery.extend(h,f),h=jQuery.extend(h,i)),b(),1==p.putSlider?(d.initSlider(h,"lightbox"),g_objects=t.getObjects(),_=g_objects.g_objSlider):_=null,1==h.lightbox_show_textpanel?c.init(d,h,"lightbox"):c=null}(t,i)},this.putHtml=function(){var e,l;d.isSmallWindow()&&1==p.isCompact&&(p.isCompact=!1,b(),p.isArrowsInside=!1,p.isArrowsOnHoverMode=!1,(h=jQuery.extend({},p.originalOptions)).lightbox_arrows_position="sides",_.setOptions(h)),e="",l="",1==p.isCompact&&(l=" ug-lightbox-compact"),e+="<div class='ug-gallery-wrapper ug-lightbox"+l+"' >",e+="<div class='ug-lightbox-overlay'></div>",0==p.isCompact&&p.isTopPanelEnabled?(e+="<div class='ug-lightbox-top-panel'>",e+="<div class='ug-lightbox-top-panel-overlay'></div>",h.lightbox_show_numbers&&(e+="<div class='ug-lightbox-numbers'></div>"),e+="</div>"):h.lightbox_show_numbers&&(e+="<div class='ug-lightbox-numbers'></div>"),e+="<div href=\"javascript:void(0)\" class='ug-lightbox-button-close'></div>",e+="<div class='ug-lightbox-arrow-left'></div>",e+="<div class='ug-lightbox-arrow-right'></div>",e+="</div>",t=jQuery(e),jQuery("body").append(t),_&&_.setHtml(t),i=t.children(".ug-lightbox-overlay"),0==p.isCompact&&1==p.isTopPanelEnabled&&0==(s=t.children(".ug-lightbox-top-panel")).length&&(s=null),o=t.find(".ug-lightbox-button-close"),h.lightbox_show_numbers&&(a=t.find(".ug-lightbox-numbers")),n=t.children(".ug-lightbox-arrow-left"),r=t.children(".ug-lightbox-arrow-right"),c&&(s?c.appendHTML(s):c.appendHTML(t))},this.run=function(){!function(){if(null!==h.lightbox_overlay_color&&i.css("background-color",h.lightbox_overlay_color),null!==h.lightbox_overlay_opacity&&i.fadeTo(0,h.lightbox_overlay_opacity),s&&null!==h.lightbox_top_panel_opacity&&s.children(".ug-lightbox-top-panel-overlay").fadeTo(0,h.lightbox_top_panel_opacity),a){var e={};null!==h.lightbox_numbers_size&&(e["font-size"]=h.lightbox_numbers_size+"px"),h.lightbox_numbers_color&&(e.color=h.lightbox_numbers_color),null!==h.lightbox_numbers_padding_right&&(e["padding-right"]=h.lightbox_numbers_padding_right+"px"),null!==h.lightbox_numbers_padding_top&&(e["padding-top"]=h.lightbox_numbers_padding_top+"px"),a.css(e)}}(),_&&_.run(),function(){if(i.on("touchstart",function(e){e.preventDefault()}),i.on("touchend",function(e){l.close("overlay")}),g.addClassOnHover(r,"ug-arrow-hover"),g.addClassOnHover(n,"ug-arrow-hover"),g.addClassOnHover(o),d.setNextButton(r),d.setPrevButton(n),o.on("click",function(){l.close("button")}),e.on(d.events.ITEM_CHANGE,W),_){jQuery(_).on(_.events.TRANSITION_END,Q),jQuery(_).on(_.events.CLICK,F);var a=_.getVideoObject();jQuery(a).on(a.events.PLAY_START,Y),jQuery(a).on(a.events.PLAY_STOP,U),jQuery(_).on(_.events.START_DRAG,k),jQuery(_).on(_.events.TRANSITION_START,k),jQuery(_).on(_.events.AFTER_DRAG_CHANGE,G),jQuery(_).on(_.events.AFTER_RETURN,G),jQuery(_).on(_.events.AFTER_PUT_IMAGE,D),jQuery(_).on(_.events.ZOOM_CHANGE,R),jQuery(_).on(_.events.IMAGE_MOUSEENTER,X),jQuery(_).on(_.events.IMAGE_MOUSELEAVE,Z)}jQuery(window).resize(function(){if(0==p.isOpened)return!0;g.whenContiniousEventOver("lightbox_resize",B,100)}),e.on(d.events.GALLERY_KEYPRESS,V),1==p.isArrowsOnHoverMode&&jQuery(document).bind("mousemove",q),t.on("mousewheel",K)}()}}function UGCarousel(){var e,t,i,n,r=this,o=jQuery(this),a=new UniteGalleryMain,s=new UGFunctions,l=new UGTileDesign,u=new UGThumbsGeneral,d={carousel_padding:8,carousel_space_between_tiles:20,carousel_navigation_numtiles:3,carousel_scroll_duration:500,carousel_scroll_easing:"easeOutCubic",carousel_autoplay:!0,carousel_autoplay_timeout:3e3,carousel_autoplay_direction:"right",carousel_autoplay_pause_onhover:!0,carousel_vertical_scroll_ondrag:!1};this.events={START_PLAY:"carousel_start_play",PAUSE_PLAY:"carousel_pause_play",STOP_PLAY:"carousel_stop_play"};var _={eventSizeChange:"thumb_size_change",isFirstTimeRun:!0,carouselMaxWidth:null,tileWidth:0,initTileWidth:0,initTileHeight:0,sideSpace:1500,spaceActionSize:500,numCurrent:0,touchActive:!1,startInnerPos:0,lastTime:0,startTime:0,startMousePos:0,lastMousePos:0,scrollShortDuration:200,scrollShortEasing:"easeOutQuad",handle:null,isPlayMode:!1,isPaused:!1,storedEventID:"carousel"};function g(e,t){if(!t)t=_.initTileHeight/_.initTileWidth*e;_.tileWidth=e;var i={tile_width:e,tile_height:t};l.setOptions(i),d.tile_width=e,d.tile_height=t,l.resizeAllTiles(e),I(!0)}function c(){if(null===_.carouselMaxWidth)throw new Error("The carousel width not set");if(_.tileWidth<_.initTileWidth){(a=_.carouselMaxWidth-2*d.carousel_padding)>_.initTileWidth&&(a=_.initTileWidth),g(a);var o=s.getNumItemsInSpace(_.carouselMaxWidth,a,d.carousel_space_between_tiles)}else{var a;if((o=s.getNumItemsInSpace(_.carouselMaxWidth,_.tileWidth,d.carousel_space_between_tiles))<=0)o=1,g(a=_.carouselMaxWidth-2*d.carousel_padding)}var u=s.getSpaceByNumItems(o,_.tileWidth,d.carousel_space_between_tiles);u+=2*d.carousel_padding,i.width(u),1==_.isFirstTimeRun?(l.initEvents(),i.bind("mousedown touchstart",C),jQuery("body").bind("mousemove touchmove",A),jQuery(window).add("body").bind("mouseup touchend",M),i.hover(O,z),l.run(),jQuery.each(t,function(t,i){i.objThumbWrapper.data("index",t),e.trigger(_.eventSizeChange,[i.objThumbWrapper,!0]),i.objTileOriginal=i.objThumbWrapper.clone(!0,!0)}),I(!0),1==d.carousel_autoplay&&r.startAutoplay()):(1==d.carousel_autoplay&&r.pauseAutoplay(),S(0,!1),1==d.carousel_autoplay&&r.startAutoplay()),s.placeElement(n,0,d.carousel_padding),x(),_.isFirstTimeRun=!1}function h(){return s.getElementSize(n).left}function p(e){return s.getMousePosition(e).pageX}function m(){return n.children(".ug-thumb-wrapper")}function f(e){return s.getNumItemsInSpace(e,_.tileWidth,d.carousel_space_between_tiles)}function b(){return m().length}function v(e){w(e);var t=m();return jQuery(t[e])}function y(){return f(s.getElementSize(i).width)}function I(e){if(!e)e=!1;var t,r=m(),o=0,a=0;return jQuery.each(r,function(e,i){i=jQuery(i),s.placeElement(i,o,0);var n=s.getElementSize(i);o+=n.width+d.carousel_space_between_tiles,a=Math.max(a,n.height),e==r.length-1&&(t=n.right)}),n.width(t),a+=2*d.carousel_padding,!0===e&&(n.height(a),i.height(a)),S(_.numCurrent,!1),t}function w(e){if(e>m().length-1)throw new Error("Wrogn tile number: "+e)}function E(t,i){if("left"==i)var r=n.children(".ug-thumb-wrapper").first();else r=n.children(".ug-thumb-wrapper").last();var o=function(e,t,i){var n=e.data("index");if(null==n)throw new Error("every tile should have index!");for(var r=[],o=0;o<t;o++){if("prev"==i)var s=a.getPrevItem(n,!0);else s=a.getNextItem(n,!0);if(!s)throw new Error("the item to add is empty");var l=s.objTileOriginal.clone(!0,!0);n=s.index,l.addClass("cloned"),r.push(l)}return r}(r,t,"left"==i?"prev":"next");jQuery.each(o,function(t,r){"left"==i?n.prepend(r):n.append(r),e.trigger(_.eventSizeChange,r),l.loadTileImage(r)})}function T(e,t){w(n);for(var i=m(),n=i.length,r=0;r<e;r++)"left"==t?jQuery(i[r]).remove():jQuery(i[n-1-r]).remove()}function S(e,t,i){if(void 0===t){t=!0;if(n.is(":animated"))return!0}var r=v(e),o={left:-s.getElementSize(r).left+d.carousel_padding+"px"};if(!0===t){var a=d.carousel_scroll_duration,l=d.carousel_scroll_easing;!0===i&&(a=_.scrollShortDuration,l=_.scrollShortEasing),n.stop(!0).animate(o,{duration:a,easing:l,queue:!1,complete:function(){_.numCurrent=e,x()}})}else _.numCurrent=e,n.css(o)}function P(){var e,t,i,n;S((e=-h(),t=f(e),i=s.getElementSize(v(t)).left,n=s.getElementSize(v(t+1)).left,Math.abs(i-e)<Math.abs(n-e)?t:t+1),!0,!0)}function x(){var e,t=(e=-h(),_.sideSpace-e),r=function(){var e=s.getElementSize(i),t=s.getElementSize(n),r=t.width-e.width+t.left;return _.sideSpace-r}(),o=0,a=0,l=0,u=0,d=b();if(t>_.spaceActionSize)E(o=f(t),"left"),_.numCurrent+=o;else if(t<-_.spaceActionSize){T(l=f(Math.abs(t)),"left"),_.numCurrent-=l}if(r>_.spaceActionSize?E(a=f(r),"right"):r<-_.spaceActionSize&&T(u=f(Math.abs(r)),"right"),u>d)throw new Error("Can't remove more then num tiles");var g=!1;return(o||a||l||u)&&(I(),g=!0),g}function j(){"left"==d.carousel_autoplay_direction?r.scrollRight(1):r.scrollLeft(1)}function C(e){if(1==_.touchActive)return!0;_.touchActive=!0,r.pauseAutoplay(),_.startTime=jQuery.now(),_.startMousePos=p(e),_.startInnerPos=h(),_.lastTime=_.startTime,_.lastMousePos=_.startMousePos,s.storeEventData(e,_.storedEventID)}function A(e){if(0==_.touchActive)return!0;s.updateStoredEventData(e,_.storedEventID),e.preventDefault();var t=null;if(1==d.carousel_vertical_scroll_ondrag&&(t=s.handleScrollTop(_.storedEventID)),"vert"===t)return!0;_.lastMousePos=p(e);var i,r=_.lastMousePos-_.startMousePos,o=_.startInnerPos+r,a=r>0?"prev":"next";o>0&&"prev"==a&&(o/=3),o<-s.getElementSize(n).width&&"next"==a&&(o=_.startInnerPos+r/3),i={left:o+"px"},n.css(i)}function M(e){if(0==_.touchActive)return!0;_.touchActive=!1,P(),r.unpauseAutoplay()}function O(e){if(0==d.carousel_autoplay_pause_onhover)return!0;1==_.isPlayMode&&0==_.isPaused&&r.pauseAutoplay()}function z(e){if(0==d.carousel_autoplay_pause_onhover)return!0;r.unpauseAutoplay()}function L(){var e=_.lastTime-_.startTime,t=Math.abs(_.lastMousePos-_.startMousePos);return!(e>300)&&!(t>30)}this.startAutoplay=function(){_.isPlayMode=!0,_.isPaused=!1,o.trigger(r.events.START_PLAY),_.handle&&clearInterval(_.handle),_.handle=setInterval(j,d.carousel_autoplay_timeout)},this.unpauseAutoplay=function(){return 0==_.isPlayMode||(0==_.isPaused||void r.startAutoplay())},this.pauseAutoplay=function(){if(0==_.isPlayMode)return!0;_.isPaused=!0,_.handle&&clearInterval(_.handle),o.trigger(r.events.PAUSE_PLAY)},this.stopAutoplay=function(){if(0==_.isPlayMode)return!0;_.isPaused=!1,_.isPlayMode=!1,_.handle&&clearInterval(_.handle),o.trigger(r.events.STOP_PLAY)},this.destroy=function(){_.handle&&clearInterval(_.handle),o.off(r.events.START_PLAY),o.off(r.events.STOP_PLAY),i.unbind("mousedown"),i.unbind("touchstart"),jQuery("body").unbind("mousemove"),jQuery("body").unbind("touchmove"),jQuery(window).add("body").unbind("mouseup").unbind("touchend"),i.off("mouseenter").off("mouseleave"),l.destroy()},this.init=function(i,n,r){r&&this.setMaxWidth(r),function(i,n){g_objects=i.getObjects(),a=i,jQuery(i),e=g_objects.g_objWrapper,t=g_objects.g_arrItems,d=jQuery.extend(d,n),l.setFixedMode(),l.setApproveClickFunction(L),l.init(i,d),u=l.getObjThumbs(),d=l.getOptions(),_.initTileWidth=d.tile_width,_.initTileHeight=d.tile_height,_.tileWidth=d.tile_width}(i,n)},this.setMaxWidth=function(e){_.carouselMaxWidth=e},this.setHtml=function(t){!function(t){t||(t=e);e.append("<div class='ug-carousel-wrapper'><div class='ug-carousel-inner'></div></div>"),i=e.children(".ug-carousel-wrapper"),n=i.children(".ug-carousel-inner"),l.setHtml(n),u.getThumbs().fadeTo(0,1)}(t)},this.getElement=function(){return i},this.getObjTileDesign=function(){return l},this.getEstimatedHeight=function(){return d.tile_height+2*d.carousel_padding},this.run=function(){c()},this.scrollRight=function(e){if(!e||"object"==typeof e)e=d.carousel_navigation_numtiles;var t=y();e>t&&(e=t);var i=_.numCurrent-e;i<=0&&(i=0),S(i)},this.scrollLeft=function(e){if(!e||"object"==typeof e)e=d.carousel_navigation_numtiles;var t=y();e>t&&(e=t);var i=b(),n=_.numCurrent+e;n>=i&&(n=i-1),S(n)},this.setScrollLeftButton=function(e){s.setButtonMobileReady(e),s.setButtonOnClick(e,r.scrollLeft)},this.setScrollRightButton=function(e){s.setButtonMobileReady(e),s.setButtonOnClick(e,r.scrollRight)},this.setPlayPauseButton=function(e){s.setButtonMobileReady(e),1==_.isPlayMode&&0==_.isPaused&&e.addClass("ug-pause-icon"),o.on(r.events.START_PLAY,function(){e.addClass("ug-pause-icon")}),o.on(r.events.STOP_PLAY,function(){e.removeClass("ug-pause-icon")}),s.setButtonOnClick(e,function(){0==_.isPlayMode||1==_.isPaused?r.startAutoplay():r.stopAutoplay()})}}function UGLoadMore(){jQuery(this);var e,t,i,n,r=new UniteGalleryMain,o=(new UGFunctions,{isInited:!1}),a={loadmore_container:"ug_loadmore_wrapper"};function s(){e.show()}function l(){t.hide(),i.show();var o={numitems:r.getNumItems()};r.ajaxRequest("front_loadmore",o,function(n){i.hide();var o=n.html_items;1==n.show_loadmore?(t.blur().show(),i.hide()):e.hide(),r.addItems(o)},function(e){e="Ajax Error!"+e,i.hide(),n.show(),n.html(e)})}this.events={},this.destroy=function(){if(0==o.isInited)return!1},this.init=function(u,d){if(r=u,jQuery(r),a=jQuery.extend(a,d),0!=(e=jQuery("#"+a.loadmore_container)).length&&0!=(t=e.find(".ug-loadmore-button")).length&&0!=(i=e.find(".ug-loadmore-loader")).length&&0!=(n=e.find(".ug-loadmore-error")).length&&(o.isInited=!0),0==o.isInited)return trace("load more not inited, something is wrong"),!1;r.onEvent("tiles_first_placed",s),t.click(l)}}function UGTabs(){jQuery(this);var e,t,i=new UniteGalleryMain,n=(new UGFunctions,{tabs_type:"tabs",tabs_container:"#ug_tabs",tabs_class_selected:"ug-tab-selected"});function r(){"select"==n.tabs_type?t.change(s):e.click(a)}function o(e){i.requestNewItems(e)}function a(){var t=n.tabs_class_selected,i=jQuery(this);if(i.hasClass(t))return!0;e.not(i).removeClass(t),i.addClass(t);var r=i.data("catid");if(!r)return!0;o(r)}function s(){var e=jQuery(this).val();if(!e)return!0;o(e)}this.events={},this.destroy=function(){t&&t.off("change"),e&&e.off("click")},this.init=function(r,o){!function(r,o){i=r,jQuery(i),"select"==(n=jQuery.extend(n,o)).tabs_type?t=jQuery(n.tabs_container):e=jQuery(n.tabs_container+" .ug-tab")}(r,o)},this.run=function(){r()}}function UG_API(e){var t,i=this,n=(jQuery(i),new UniteGalleryMain),r=[];function o(e){var t={index:e.index,title:e.title,description:e.description,urlImage:e.urlImage,urlThumb:e.urlThumb},i=e.objThumbImage.data();for(var n in i){switch(n){case"image":case"description":continue}t[n]=i[n]}return t}n=e,t=jQuery(e),this.events={API_INIT_FUNCTIONS:"api_init",API_ON_EVENT:"api_on_event"},this.on=function(e,a,s){switch(!0!==s&&r.push({event:e,func:a}),e){case"item_change":t.on(n.events.ITEM_CHANGE,function(){var e=o(n.getSelectedItem());a(e.index,e)});break;case"resize":t.on(n.events.SIZE_CHANGE,a);break;case"enter_fullscreen":t.on(n.events.ENTER_FULLSCREEN,a);break;case"exit_fullscreen":t.on(n.events.EXIT_FULLSCREEN,a);break;case"play":t.on(n.events.START_PLAY,a);break;case"stop":t.on(n.events.STOP_PLAY,a);break;case"pause":t.on(n.events.PAUSE_PLAYING,a);break;case"continue":t.on(n.events.CONTINUE_PLAYING,a);break;case"open_lightbox":t.on(n.events.OPEN_LIGHTBOX,a);break;case"close_lightbox":t.on(n.events.CLOSE_LIGHTBOX,a);break;default:console&&console.log("wrong api event: "+e)}t.trigger(i.events.API_ON_EVENT,[e,a])},this.play=function(){n.startPlayMode()},this.stop=function(){n.stopPlayMode()},this.togglePlay=function(){n.togglePlayMode()},this.enterFullscreen=function(){n.toFullScreen()},this.exitFullscreen=function(){n.exitFullScreen()},this.toggleFullscreen=function(){n.toggleFullscreen()},this.resetZoom=function(){var e=n.getObjSlider();if(!e)return!1;e.zoomBack()},this.zoomIn=function(){var e=n.getObjSlider();if(!e)return!1;e.zoomIn()},this.zoomOut=function(){var e=n.getObjSlider();if(!e)return!1;e.zoomOut()},this.nextItem=function(){n.nextItem()},this.prevItem=function(){n.prevItem()},this.selectItem=function(e){n.selectItem(e)},this.resize=function(e,t){t?n.resize(e,t):n.resize(e)},this.getItem=function(e){return o(n.getItem(e))},this.getNumItems=function(){return n.getNumItems()},this.getNumCurrent=function(){return n.getCurrentNumItem()},this.reloadGallery=function(e){if(!e)e={};n.run(null,e),r.map(function(e){i.on(e.event,e.func,!0)})},this.changeItems=function(e){n.changeItems(e)},this.addItems=function(e){n.addItems(e)},this.destroy=function(){n.destroy()},t.trigger(i.events.API_INIT_FUNCTIONS,i)}jQuery.fn.unitegallery=function(e){var t="#"+jQuery(this).attr("id");if(!e)e={};var i=new UniteGalleryMain;return i.run(t,e),void 0===window.ugArrGalleriesObjects&&(window.ugArrGalleriesObjects=[]),window.ugArrGalleriesObjects.push(i),new UG_API(i)};
images/gallery1.jpg ADDED
Binary file
images/gallery2.jpg ADDED
Binary file
images/gallery3.jpg ADDED
Binary file
images/gallery4.jpg ADDED
Binary file
images/gallery5.jpg ADDED
Binary file
images/gallery6.jpg ADDED
Binary file
inc_php/framework/functions.class.php CHANGED
@@ -578,6 +578,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
578
  return($arrOutput);
579
  }
580
 
 
581
  /**
582
  * add first value to array
583
  */
@@ -587,7 +588,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
587
 
588
  return($arr);
589
  }
590
-
591
 
592
  /**
593
  *
578
  return($arrOutput);
579
  }
580
 
581
+
582
  /**
583
  * add first value to array
584
  */
588
 
589
  return($arr);
590
  }
591
+
592
 
593
  /**
594
  *
inc_php/unitecreator_addon.class.php CHANGED
@@ -433,7 +433,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
433
  * get the items type on init
434
  */
435
  private function initItemsType(){
436
-
437
  foreach($this->paramsItems as $param){
438
  $type = UniteFunctionsUC::getVal($param, "type");
439
  if($type == "uc_imagebase")
@@ -492,6 +492,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
492
  foreach($this->params as $param){
493
 
494
  $type = UniteFunctionsUC::getVal($param, "type");
 
495
  switch($type){
496
  case UniteCreatorDialogParam::PARAM_POSTS_LIST:
497
  return("post");
@@ -506,13 +507,13 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
506
  return self::ITEMS_TYPE_DATASET;
507
  break;
508
  case UniteCreatorDialogParam::PARAM_LISTING:
509
-
510
- if($this->operationType != self::OPERATION_EDIT){
511
-
512
- $useFor = UniteFunctionsUC::getVal($param, "use_for");
513
- if($useFor == "gallery")
514
- return(self::ITEMS_TYPE_IMAGE);
515
- }
516
 
517
  break;
518
  }
@@ -532,12 +533,15 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
532
  $specialType = $this->getItemsSpecialType();
533
 
534
  $this->specialType = $specialType;
535
-
536
  if(!empty($specialType)){
537
 
538
  $this->itemsType = $specialType;
539
 
540
- if($specialType == self::ITEMS_TYPE_FORM || $specialType == self::ITEMS_TYPE_DATASET || $specialType == self::ITEMS_TYPE_IMAGE){
 
 
 
541
 
542
  $this->hasItems = true;
543
 
@@ -1757,28 +1761,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1757
  }
1758
 
1759
  private function a______GET_HTML______(){}
1760
-
1761
- /**
1762
- * return true if it has dynamic param with gallery
1763
- */
1764
- private function hasDynamicGallery(){
1765
-
1766
- $paramDynamic = $this->getParamByType(UniteCreatorDialogParam::PARAM_LISTING);
1767
-
1768
- if(empty($paramDynamic))
1769
- return(false);
1770
 
1771
- $useFor = UniteFunctionsUC::getVal($paramDynamic, "use_for");
1772
-
1773
- switch($useFor){
1774
- case "gallery":
1775
- return(true);
1776
- break;
1777
- }
1778
-
1779
- return(false);
1780
- }
1781
-
1782
 
1783
 
1784
  /**
433
  * get the items type on init
434
  */
435
  private function initItemsType(){
436
+
437
  foreach($this->paramsItems as $param){
438
  $type = UniteFunctionsUC::getVal($param, "type");
439
  if($type == "uc_imagebase")
492
  foreach($this->params as $param){
493
 
494
  $type = UniteFunctionsUC::getVal($param, "type");
495
+
496
  switch($type){
497
  case UniteCreatorDialogParam::PARAM_POSTS_LIST:
498
  return("post");
507
  return self::ITEMS_TYPE_DATASET;
508
  break;
509
  case UniteCreatorDialogParam::PARAM_LISTING:
510
+
511
+ $useFor = UniteFunctionsUC::getVal($param, "use_for");
512
+
513
+ if($useFor == "remote")
514
+ continue(2);
515
+
516
+ return("listing");
517
 
518
  break;
519
  }
533
  $specialType = $this->getItemsSpecialType();
534
 
535
  $this->specialType = $specialType;
536
+
537
  if(!empty($specialType)){
538
 
539
  $this->itemsType = $specialType;
540
 
541
+ if($specialType == self::ITEMS_TYPE_FORM ||
542
+ $specialType == self::ITEMS_TYPE_DATASET ||
543
+ $specialType == "listing" ||
544
+ $specialType == self::ITEMS_TYPE_IMAGE){
545
 
546
  $this->hasItems = true;
547
 
1761
  }
1762
 
1763
  private function a______GET_HTML______(){}
 
 
 
 
 
 
 
 
 
 
1764
 
 
 
 
 
 
 
 
 
 
 
 
1765
 
1766
 
1767
  /**
inc_php/unitecreator_addon_validator.class.php CHANGED
@@ -209,6 +209,7 @@ class UniteCreatorAddonValidator{
209
  protected function validateRegularAddon(){
210
 
211
  //check if missing default image
 
212
  $isMissingDefaluts = $this->isAddonMissingDefaults();
213
  if($isMissingDefaluts == true)
214
  $this->arrMessages[] = __("Missing Default Items!","unlimited-elements-for-elementor");
@@ -217,6 +218,7 @@ class UniteCreatorAddonValidator{
217
  $isMissingDefalutImage = $this->isAddonMissingImageUrl();
218
  if($isMissingDefalutImage == true)
219
  $this->arrMessages[] = __("Missing Default Image!","unlimited-elements-for-elementor");
 
220
 
221
  $hasNonExistingIncludes = $this->isHasNonExistingIncludes();
222
  if($hasNonExistingIncludes == true)
209
  protected function validateRegularAddon(){
210
 
211
  //check if missing default image
212
+ /*
213
  $isMissingDefaluts = $this->isAddonMissingDefaults();
214
  if($isMissingDefaluts == true)
215
  $this->arrMessages[] = __("Missing Default Items!","unlimited-elements-for-elementor");
218
  $isMissingDefalutImage = $this->isAddonMissingImageUrl();
219
  if($isMissingDefalutImage == true)
220
  $this->arrMessages[] = __("Missing Default Image!","unlimited-elements-for-elementor");
221
+ */
222
 
223
  $hasNonExistingIncludes = $this->isHasNonExistingIncludes();
224
  if($hasNonExistingIncludes == true)
inc_php/unitecreator_dialog_param.class.php CHANGED
@@ -377,6 +377,16 @@ class UniteCreatorDialogParamWork{
377
  */
378
  protected function putDefaultValueParam($isTextarea = false, $class="", $addStyleChekbox = false, $useFor = ""){
379
 
 
 
 
 
 
 
 
 
 
 
380
  //disable in form item mode
381
  $putTextareaText = true;
382
 
@@ -430,6 +440,34 @@ class UniteCreatorDialogParamWork{
430
  if($this->type == self::TYPE_FORM_ITEM)
431
  $this->putFormItemInputs();
432
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  <?php
434
  }
435
 
@@ -832,16 +870,24 @@ class UniteCreatorDialogParamWork{
832
  $this->putCheckbox("gallery_enable_video", __("Enable Video Items", "unlimited-elements-for-elementor"));
833
 
834
  ?>
 
 
 
835
  </div>
836
 
837
  <!-- Template -->
838
 
839
- <div class="uc-listing-param-options" data-control="template">
840
  <?php
841
-
842
- $this->putCheckbox("enable_pagination", __("Enable Pagination", "unlimited-elements-for-elementor"));
 
 
843
 
 
 
844
  ?>
 
845
  </div>
846
 
847
  <!-- Remote -->
@@ -1017,6 +1063,36 @@ class UniteCreatorDialogParamWork{
1017
 
1018
  private function a___________DROPDOWN_PARAM________(){}
1019
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1020
  /**
1021
  * put drop down param
1022
  */
@@ -1033,6 +1109,8 @@ class UniteCreatorDialogParamWork{
1033
 
1034
  $this->putDropdownItems(true);
1035
 
 
 
1036
  }
1037
 
1038
  /**
@@ -1318,7 +1396,7 @@ class UniteCreatorDialogParamWork{
1318
 
1319
  switch($paramType){
1320
  case "uc_textfield":
1321
- $this->putDefaultValueParam(false, "", true);
1322
  break;
1323
  case "uc_number":
1324
  $this->putNumberParam();
377
  */
378
  protected function putDefaultValueParam($isTextarea = false, $class="", $addStyleChekbox = false, $useFor = ""){
379
 
380
+ $addDynamic = false;
381
+ $addPlaceholder = false;
382
+
383
+ switch($useFor){
384
+ case "textbox":
385
+ $addDynamic = true;
386
+ $addPlaceholder = true;
387
+ break;
388
+ }
389
+
390
  //disable in form item mode
391
  $putTextareaText = true;
392
 
440
  if($this->type == self::TYPE_FORM_ITEM)
441
  $this->putFormItemInputs();
442
  ?>
443
+
444
+ <?php if($addDynamic == true || $addPlaceholder == true):?>
445
+
446
+ <div class="unite-inputs-sap"></div>
447
+ <hr>
448
+
449
+ <?php endif?>
450
+
451
+
452
+ <?php if($addPlaceholder):?>
453
+ <div class="unite-inputs-sap"></div>
454
+
455
+ <div class="unite-inputs-label">
456
+ <?php _e("Placeholder Text","unlimited-elements-for-elementor")?>:
457
+ </div>
458
+
459
+ <input type="text" name="placeholder" <?php echo $strClass?> value="">
460
+
461
+ <?php endif?>
462
+
463
+ <?php if($addDynamic == true):?>
464
+ <div class="unite-inputs-sap"></div>
465
+
466
+ <?php $this->putCheckbox("disable_dynamic", __("Disable Dynamic Icon","unlimited-elements-for-elementor"))?>
467
+
468
+ <?php endif?>
469
+
470
+
471
  <?php
472
  }
473
 
870
  $this->putCheckbox("gallery_enable_video", __("Enable Video Items", "unlimited-elements-for-elementor"));
871
 
872
  ?>
873
+
874
+ <div class="unite-inputs-sap"></div>
875
+
876
  </div>
877
 
878
  <!-- Template -->
879
 
880
+ <div class="uc-listing-param-options" data-control="template,gallery">
881
  <?php
882
+ $this->putCheckbox("enable_pagination", __("Add Pagination", "unlimited-elements-for-elementor"));
883
+ ?>
884
+
885
+ <div class="unite-inputs-sap"></div>
886
 
887
+ <?php
888
+ $this->putCheckbox("enable_ajax", __("Add Filtering", "unlimited-elements-for-elementor"));
889
  ?>
890
+
891
  </div>
892
 
893
  <!-- Remote -->
1063
 
1064
  private function a___________DROPDOWN_PARAM________(){}
1065
 
1066
+ /**
1067
+ * php filter options
1068
+ */
1069
+ protected function addPHPFilterOptions($type){
1070
+ ?>
1071
+
1072
+ <div class="unite-inputs-sap"></div>
1073
+
1074
+ <hr>
1075
+
1076
+ <div class="unite-inputs-sap"></div>
1077
+
1078
+ <div class="unite-inputs-label">
1079
+ <?php esc_html_e("PHP Filter Name", "unlimited-elements-for-elementor")?>
1080
+ </div>
1081
+
1082
+ <input type="text" name="php_filter_name" class="input-regular" value="">
1083
+
1084
+ <div class="unite-dialog-description-left">
1085
+ <?php _e("* With this setting you can set or modify dropdown items in php.", "unlimited-elements-for-elementor")?>
1086
+
1087
+ <a href="https://unlimited-elements.com/docs/modify-dropdown-items-with-php/" target="_blank"><?php _e("instructions","unlimited-elements-for-elementor")?></a>
1088
+
1089
+ </div>
1090
+
1091
+
1092
+ <?php
1093
+ }
1094
+
1095
+
1096
  /**
1097
  * put drop down param
1098
  */
1109
 
1110
  $this->putDropdownItems(true);
1111
 
1112
+ $this->addPHPFilterOptions("dropdown");
1113
+
1114
  }
1115
 
1116
  /**
1396
 
1397
  switch($paramType){
1398
  case "uc_textfield":
1399
+ $this->putDefaultValueParam(false, "", true, "textbox");
1400
  break;
1401
  case "uc_number":
1402
  $this->putNumberParam();
inc_php/unitecreator_filters_process.class.php CHANGED
@@ -47,7 +47,7 @@ class UniteCreatorFiltersProcess{
47
  return(false);
48
  }
49
 
50
-
51
  /**
52
  * get fitler url from the given slugs
53
  */
@@ -588,75 +588,10 @@ class UniteCreatorFiltersProcess{
588
  }
589
 
590
 
591
- //skip modify clauses in case of main query
592
- if($isMainQuery == false)
593
- return($args);
594
-
595
-
596
- $postType = UniteFunctionsUC::getVal($args, "post_type");
597
-
598
- //add additional filters in post clauses in some cases
599
- switch($postType){
600
- case "product":
601
- self::$lastArgs = $args;
602
- add_filter( 'posts_clauses', array( $this, 'modifyWCQuery' ), 10, 2 );
603
- break;
604
- }
605
-
606
  return($args);
607
  }
608
 
609
- /**
610
- * before get posts
611
- */
612
- public function modifyWCQuery($arrClauses){
613
-
614
-
615
- if(empty(self::$lastArgs))
616
- return($arrClauses);
617
-
618
- $args = self::$lastArgs;
619
-
620
- $postType = UniteFunctionsUC::getVal($args, "post_type");
621
-
622
- if($postType != "product")
623
- return($arrClauses);
624
-
625
- $orderBY = UniteFunctionsUC::getVal($args, "orderby");
626
- $dir = UniteFunctionsUC::getVal($args, "order", "DESC");
627
-
628
- if(empty($orderBY))
629
- return($arrClauses);
630
-
631
- //add code filter by orderby
632
-
633
- if(class_exists("WC_Query") == false)
634
- return($arrClauses);
635
-
636
- $objQuery = new WC_Query();
637
-
638
- switch($orderBY){
639
- case "price":
640
- if($dir == "DESC")
641
- $arrClauses = $objQuery->order_by_price_desc_post_clauses($arrClauses);
642
- else
643
- $arrClauses = $objQuery->order_by_price_asc_post_clauses($arrClauses);
644
-
645
- break;
646
- case 'popularity':
647
- $arrClauses = $objQuery->order_by_popularity_post_clauses($arrClauses);
648
- break;
649
- case 'rating':
650
- $arrClauses = $objQuery->order_by_rating_post_clauses($arrClauses);
651
- break;
652
- }
653
-
654
- remove_filter( 'posts_clauses', array( $this, 'modifyWCQuery' ), 10, 2 );
655
-
656
- return($arrClauses);
657
- }
658
 
659
-
660
  private function _______AJAX__________(){}
661
 
662
  /**
@@ -677,14 +612,19 @@ class UniteCreatorFiltersProcess{
677
  * if it's have post list and has option that enable ajax
678
  */
679
  private function validateAddonAjaxReady($addon, $arrSettingsValues){
680
-
681
  $paramPostList = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
682
 
 
 
 
 
 
683
  if(empty($paramPostList))
684
  UniteFunctionsUC::throwError("Widget not ready for ajax");
685
-
686
  $postListName = UniteFunctionsUC::getVal($paramPostList, "name");
687
-
688
  $isAjaxReady = UniteFunctionsUC::getVal($arrSettingsValues, $postListName."_isajax");
689
  $isAjaxReady = UniteFunctionsUC::strToBool($isAjaxReady);
690
 
@@ -764,7 +704,7 @@ class UniteCreatorFiltersProcess{
764
 
765
  $arrSettingsValues = $this->modifySettingsValues($arrSettingsValues, $postListName);
766
  }
767
-
768
  $addon->setParamsValues($arrSettingsValues);
769
 
770
 
@@ -783,13 +723,14 @@ class UniteCreatorFiltersProcess{
783
 
784
  //get only items
785
  if($isGrid == true){
786
- $htmlGridItems = $objOutput->getHtmlItems();
787
- $output["html"] = $htmlGridItems;
788
- }
789
-
790
- //get output of the html template
791
- if($isGrid == false){
792
 
 
 
 
 
 
793
  $htmlBody = $objOutput->getHtmlOnly();
794
 
795
  $htmlBody = $this->processAjaxHtmlOutput($htmlBody);
@@ -797,6 +738,7 @@ class UniteCreatorFiltersProcess{
797
  $output["html"] = $htmlBody;
798
  }
799
 
 
800
  if(!empty($htmlDebug))
801
  $output["html_debug"] = $htmlDebug;
802
 
@@ -951,6 +893,7 @@ class UniteCreatorFiltersProcess{
951
  $testTermIDs = UniteFunctionsUC::getPostGetVariable("testtermids","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
952
  UniteFunctionsUC::validateIDsList($testTermIDs);
953
 
 
954
  //replace terms mode
955
  $isModeReplace = UniteFunctionsUC::getPostGetVariable("ucreplace","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
956
  $isModeReplace = UniteFunctionsUC::strToBool($isModeReplace);
@@ -988,11 +931,12 @@ class UniteCreatorFiltersProcess{
988
  $arrFoundTermIDs = $this->modifyFoundTermsIDs($arrFoundTermIDs);
989
 
990
  //set the test term id's for the output
991
- GlobalsProviderUC::$arrTestTermIDs = $arrFoundTermIDs;
992
  }
993
-
994
-
995
  $htmlGridItems = UniteFunctionsUC::getVal($arrHtmlWidget, "html");
 
 
996
  $htmlDebug = UniteFunctionsUC::getVal($arrHtmlWidget, "html_debug");
997
 
998
  $addWidgetsHTML = $this->getContentWidgetsHTML($arrContent, $addElIDs);
@@ -1002,10 +946,16 @@ class UniteCreatorFiltersProcess{
1002
 
1003
  if(!empty($htmlDebug))
1004
  $outputData["html_debug"] = $htmlDebug;
1005
-
1006
- if($isModeFiltersInit == false)
1007
- $outputData["html_items"] = $htmlGridItems;
1008
 
 
 
 
 
 
 
 
 
 
1009
  if(!empty($addWidgetsHTML))
1010
  $outputData["html_widgets"] = $addWidgetsHTML;
1011
 
@@ -1142,19 +1092,10 @@ class UniteCreatorFiltersProcess{
1142
  echo $html;
1143
  }
1144
 
1145
-
1146
-
1147
  /**
1148
- * add widget variables
1149
- * uc_listing_addclass, uc_listing_attributes
1150
  */
1151
- public function addWidgetFilterableVariables($data, $addon){
1152
-
1153
- $param = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
1154
-
1155
- $postListName = UniteFunctionsUC::getVal($param, "name");
1156
-
1157
- $dataPosts = UniteFunctionsUC::getVal($data, $postListName);
1158
 
1159
  //check if ajax related
1160
  $isAjax = UniteFunctionsUC::getVal($dataPosts, $postListName."_isajax");
@@ -1163,9 +1104,6 @@ class UniteCreatorFiltersProcess{
1163
  if($isAjax == false)
1164
  return($data);
1165
 
1166
- if(empty($param))
1167
- return($data);
1168
-
1169
  $filterBehavoiur = UniteFunctionsUC::getVal($dataPosts, $postListName."_ajax_seturl");
1170
 
1171
  //check if ajax
@@ -1182,9 +1120,33 @@ class UniteCreatorFiltersProcess{
1182
  $data["uc_filtering_addclass"] = " uc-filterable-grid";
1183
 
1184
  return($data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1185
  }
1186
 
1187
 
 
 
1188
  /**
1189
  * get filters attributes
1190
  */
@@ -1377,7 +1339,7 @@ class UniteCreatorFiltersProcess{
1377
  /**
1378
  * modify the terms for init after
1379
  */
1380
- private function modifyOutputTerms_forInitAfter($arrTerms){
1381
 
1382
  if(GlobalsProviderUC::$arrTestTermIDs === null)
1383
  return($arrTerms);
@@ -1487,14 +1449,12 @@ class UniteCreatorFiltersProcess{
1487
  */
1488
  public function addEditorFilterArguments($data){
1489
 
 
1490
  //add the filter related js and css includes
1491
  $this->includeClientSideScripts();
1492
 
1493
  $isInitAfter = UniteFunctionsUC::getVal($data, "init_after");
1494
  $isInitAfter = UniteFunctionsUC::strToBool($isInitAfter);
1495
-
1496
- $isMainFilter = UniteFunctionsUC::getVal($data, "is_main");
1497
- $isMainFilter = UniteFunctionsUC::strToBool($isMainFilter);
1498
 
1499
  $isReplaceTerms = UniteFunctionsUC::getVal($data, "replace_terms");
1500
  $isReplaceTerms = UniteFunctionsUC::strToBool($isReplaceTerms);
@@ -1502,7 +1462,10 @@ class UniteCreatorFiltersProcess{
1502
  $limitGrayedItems = UniteFunctionsUC::getVal($data, "load_limit_grayed");
1503
  $limitGrayedItems = (int)$limitGrayedItems;
1504
 
1505
-
 
 
 
1506
  $attributes = "";
1507
  $style = "";
1508
  $addClass = " uc-grid-filter";
@@ -1515,8 +1478,7 @@ class UniteCreatorFiltersProcess{
1515
 
1516
  if($isUnderAjax == true)
1517
  $isFirstLoad = false;
1518
-
1519
-
1520
  if($isInitAfter == true){
1521
 
1522
  $attributes = " data-initafter=\"true\"";
@@ -1529,18 +1491,22 @@ class UniteCreatorFiltersProcess{
1529
  $isFirstLoad = true;
1530
  }
1531
 
 
 
 
 
 
1532
  if($isInsideEditor == true)
1533
  $isFirstLoad = true;
1534
 
1535
  //main filter
1536
 
1537
- if($isMainFilter == true)
1538
- $attributes .= " data-ismain=\"true\"";
1539
 
1540
  if($isReplaceTerms == true)
1541
  $attributes .= " data-replace-mode=\"true\"";
1542
 
1543
-
1544
  $data["filter_isajax"] = $isUnderAjax?"yes":"no";
1545
  $data["filter_attributes"] = $attributes;
1546
  $data["filter_style"] = $style;
@@ -1552,12 +1518,9 @@ class UniteCreatorFiltersProcess{
1552
 
1553
  $arrTerms = UniteFunctionsUC::getVal($data, "taxonomy");
1554
 
1555
- if($isInitAfter == true){
1556
- $arrTerms = $this->modifyOutputTerms_forInitAfter($arrTerms, $isInitAfter, $isFirstLoad);
1557
- }
1558
 
1559
  //modify the selected class
1560
-
1561
  $arrTerms = $this->modifyOutputTerms_modifySelected($arrTerms, $data);
1562
 
1563
  //on init mode - modify selected and grayed loader
47
  return(false);
48
  }
49
 
50
+
51
  /**
52
  * get fitler url from the given slugs
53
  */
588
  }
589
 
590
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
591
  return($args);
592
  }
593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
 
 
595
  private function _______AJAX__________(){}
596
 
597
  /**
612
  * if it's have post list and has option that enable ajax
613
  */
614
  private function validateAddonAjaxReady($addon, $arrSettingsValues){
615
+
616
  $paramPostList = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
617
 
618
+ $paramListing = $addon->getParamByType(UniteCreatorDialogParam::PARAM_LISTING);
619
+
620
+ if(empty($paramPostList) && !empty($paramListing))
621
+ $paramPostList = $paramListing;
622
+
623
  if(empty($paramPostList))
624
  UniteFunctionsUC::throwError("Widget not ready for ajax");
625
+
626
  $postListName = UniteFunctionsUC::getVal($paramPostList, "name");
627
+
628
  $isAjaxReady = UniteFunctionsUC::getVal($arrSettingsValues, $postListName."_isajax");
629
  $isAjaxReady = UniteFunctionsUC::strToBool($isAjaxReady);
630
 
704
 
705
  $arrSettingsValues = $this->modifySettingsValues($arrSettingsValues, $postListName);
706
  }
707
+
708
  $addon->setParamsValues($arrSettingsValues);
709
 
710
 
723
 
724
  //get only items
725
  if($isGrid == true){
726
+
727
+ $arrHtml = $objOutput->getHtmlItems();
 
 
 
 
728
 
729
+ $output["html"] = UniteFunctionsUC::getVal($arrHtml, "html_items1");
730
+ $output["html2"] = UniteFunctionsUC::getVal($arrHtml, "html_items2");
731
+
732
+ }else{ //not a grid - output of html template
733
+
734
  $htmlBody = $objOutput->getHtmlOnly();
735
 
736
  $htmlBody = $this->processAjaxHtmlOutput($htmlBody);
738
  $output["html"] = $htmlBody;
739
  }
740
 
741
+
742
  if(!empty($htmlDebug))
743
  $output["html_debug"] = $htmlDebug;
744
 
893
  $testTermIDs = UniteFunctionsUC::getPostGetVariable("testtermids","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
894
  UniteFunctionsUC::validateIDsList($testTermIDs);
895
 
896
+
897
  //replace terms mode
898
  $isModeReplace = UniteFunctionsUC::getPostGetVariable("ucreplace","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
899
  $isModeReplace = UniteFunctionsUC::strToBool($isModeReplace);
931
  $arrFoundTermIDs = $this->modifyFoundTermsIDs($arrFoundTermIDs);
932
 
933
  //set the test term id's for the output
934
+ GlobalsProviderUC::$arrTestTermIDs = $arrFoundTermIDs;
935
  }
936
+
 
937
  $htmlGridItems = UniteFunctionsUC::getVal($arrHtmlWidget, "html");
938
+ $htmlGridItems2 = UniteFunctionsUC::getVal($arrHtmlWidget, "html2");
939
+
940
  $htmlDebug = UniteFunctionsUC::getVal($arrHtmlWidget, "html_debug");
941
 
942
  $addWidgetsHTML = $this->getContentWidgetsHTML($arrContent, $addElIDs);
946
 
947
  if(!empty($htmlDebug))
948
  $outputData["html_debug"] = $htmlDebug;
 
 
 
949
 
950
+ if($isModeFiltersInit == false){
951
+ $outputData["html_items"] = $htmlGridItems;
952
+
953
+ $htmlGridItems2 = trim($htmlGridItems2);
954
+
955
+ if(!empty($htmlGridItems2))
956
+ $outputData["html_items2"] = $htmlGridItems2;
957
+ }
958
+
959
  if(!empty($addWidgetsHTML))
960
  $outputData["html_widgets"] = $addWidgetsHTML;
961
 
1092
  echo $html;
1093
  }
1094
 
 
 
1095
  /**
1096
+ * add values to settings from data
 
1097
  */
1098
+ public function addWidgetFilterableVarsFromData($data, $dataPosts, $postListName){
 
 
 
 
 
 
1099
 
1100
  //check if ajax related
1101
  $isAjax = UniteFunctionsUC::getVal($dataPosts, $postListName."_isajax");
1104
  if($isAjax == false)
1105
  return($data);
1106
 
 
 
 
1107
  $filterBehavoiur = UniteFunctionsUC::getVal($dataPosts, $postListName."_ajax_seturl");
1108
 
1109
  //check if ajax
1120
  $data["uc_filtering_addclass"] = " uc-filterable-grid";
1121
 
1122
  return($data);
1123
+
1124
+
1125
+ }
1126
+
1127
+ /**
1128
+ * add widget variables
1129
+ * uc_listing_addclass, uc_listing_attributes
1130
+ */
1131
+ public function addWidgetFilterableVariables($data, $addon){
1132
+
1133
+ $param = $addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
1134
+
1135
+ if(empty($param))
1136
+ return($data);
1137
+
1138
+ $postListName = UniteFunctionsUC::getVal($param, "name");
1139
+
1140
+ $dataPosts = UniteFunctionsUC::getVal($data, $postListName);
1141
+
1142
+ $data = $this->addWidgetFilterableVarsFromData($data, $dataPosts, $postListName);
1143
+
1144
+ return($data);
1145
  }
1146
 
1147
 
1148
+
1149
+
1150
  /**
1151
  * get filters attributes
1152
  */
1339
  /**
1340
  * modify the terms for init after
1341
  */
1342
+ private function modifyOutputTerms_setNumPosts($arrTerms){
1343
 
1344
  if(GlobalsProviderUC::$arrTestTermIDs === null)
1345
  return($arrTerms);
1449
  */
1450
  public function addEditorFilterArguments($data){
1451
 
1452
+
1453
  //add the filter related js and css includes
1454
  $this->includeClientSideScripts();
1455
 
1456
  $isInitAfter = UniteFunctionsUC::getVal($data, "init_after");
1457
  $isInitAfter = UniteFunctionsUC::strToBool($isInitAfter);
 
 
 
1458
 
1459
  $isReplaceTerms = UniteFunctionsUC::getVal($data, "replace_terms");
1460
  $isReplaceTerms = UniteFunctionsUC::strToBool($isReplaceTerms);
1462
  $limitGrayedItems = UniteFunctionsUC::getVal($data, "load_limit_grayed");
1463
  $limitGrayedItems = (int)$limitGrayedItems;
1464
 
1465
+ $filterRole = UniteFunctionsUC::getVal($data, "filter_role");
1466
+ if($filterRole == "single")
1467
+ $filterRole = null;
1468
+
1469
  $attributes = "";
1470
  $style = "";
1471
  $addClass = " uc-grid-filter";
1478
 
1479
  if($isUnderAjax == true)
1480
  $isFirstLoad = false;
1481
+
 
1482
  if($isInitAfter == true){
1483
 
1484
  $attributes = " data-initafter=\"true\"";
1491
  $isFirstLoad = true;
1492
  }
1493
 
1494
+ //hide child filter at start
1495
+ if($filterRole == "child" && $isUnderAjax == false && $isInsideEditor == false){
1496
+ $addClass .= " uc-filter-initing uc-initing-filter-hidden";
1497
+ }
1498
+
1499
  if($isInsideEditor == true)
1500
  $isFirstLoad = true;
1501
 
1502
  //main filter
1503
 
1504
+ if(!empty($filterRole))
1505
+ $attributes .= " data-role=\"{$filterRole}\"";
1506
 
1507
  if($isReplaceTerms == true)
1508
  $attributes .= " data-replace-mode=\"true\"";
1509
 
 
1510
  $data["filter_isajax"] = $isUnderAjax?"yes":"no";
1511
  $data["filter_attributes"] = $attributes;
1512
  $data["filter_style"] = $style;
1518
 
1519
  $arrTerms = UniteFunctionsUC::getVal($data, "taxonomy");
1520
 
1521
+ $arrTerms = $this->modifyOutputTerms_setNumPosts($arrTerms, $isInitAfter, $isFirstLoad);
 
 
1522
 
1523
  //modify the selected class
 
1524
  $arrTerms = $this->modifyOutputTerms_modifySelected($arrTerms, $data);
1525
 
1526
  //on init mode - modify selected and grayed loader
inc_php/unitecreator_helper.class.php CHANGED
@@ -1405,7 +1405,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1405
  * add remote script
1406
  */
1407
  public static function addRemoteControlsScript(){
1408
-
 
 
1409
  $urlFiltersJS = GlobalsUC::$url_assets_libraries."remote/ue-remote-controls.js";
1410
  HelperUC::addScriptAbsoluteUrl($urlFiltersJS, "ue_remote_controls");
1411
 
1405
  * add remote script
1406
  */
1407
  public static function addRemoteControlsScript(){
1408
+
1409
+ UniteProviderFunctionsUC::addAdminJQueryInclude();
1410
+
1411
  $urlFiltersJS = GlobalsUC::$url_assets_libraries."remote/ue-remote-controls.js";
1412
  HelperUC::addScriptAbsoluteUrl($urlFiltersJS, "ue_remote_controls");
1413
 
inc_php/unitecreator_helperhtml.class.php CHANGED
@@ -417,6 +417,40 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
417
  return self::getHtmlIncludes("js", $arrJsIncludes, $tab);
418
  }
419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
  protected function z_________PUTTERS_______(){}
422
 
417
  return self::getHtmlIncludes("js", $arrJsIncludes, $tab);
418
  }
419
 
420
+ /**
421
+ * get array table html
422
+ */
423
+ public static function getHtmlArrayTable($arr, $emptyText = ""){
424
+
425
+ if(empty($arr))
426
+ return($emptyText);
427
+
428
+ $html = "";
429
+ foreach($arr as $key=>$value){
430
+
431
+ $isArray = is_array($value);
432
+
433
+ if($isArray == true){
434
+ $html .= "$key:";
435
+ $html .= "<pre>";
436
+ $html .= print_r($value, true);
437
+ $html .= "</pre>";
438
+ }
439
+ else{
440
+
441
+ $firstLetter = $key[0]; //for post meta
442
+
443
+ if($firstLetter == "_")
444
+ $html .= "$key: $value \n";
445
+ else
446
+ $html .= "<b>$key</b>: $value \n";
447
+
448
+ }
449
+
450
+ }
451
+
452
+ return($html);
453
+ }
454
 
455
  protected function z_________PUTTERS_______(){}
456
 
inc_php/unitecreator_operations.class.php CHANGED
@@ -462,6 +462,30 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
462
  return($response);
463
  }
464
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
  private function a____________DATE____________(){}
466
 
467
  /**
@@ -736,7 +760,31 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
736
 
737
  return($text);
738
  }
 
739
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
740
 
741
 
742
  }
462
  return($response);
463
  }
464
 
465
+
466
+ /**
467
+ * put debug of post custom fields
468
+ */
469
+ public function putPostCustomFieldsDebug($postID){
470
+
471
+ $post = get_post($postID);
472
+
473
+ if(empty($post))
474
+ return(false);
475
+
476
+ $postTitle = $post->post_title;
477
+
478
+ $arrCustomFields = UniteFunctionsWPUC::getPostMeta($postID);
479
+
480
+ $htmlFields = HelperHtmlUC::getHtmlArrayTable($arrCustomFields, "No Meta Fields Found");
481
+
482
+ echo "<br>Meta fields for post: $postTitle <br>";
483
+
484
+ dmp($htmlFields);
485
+
486
+ }
487
+
488
+
489
  private function a____________DATE____________(){}
490
 
491
  /**
760
 
761
  return($text);
762
  }
763
+
764
 
765
+ /**
766
+ * get last query data
767
+ */
768
+ public function getLastQueryData(){
769
+
770
+ $query = GlobalsProviderUC::$lastPostQuery;
771
+
772
+ if(empty($query)){
773
+
774
+ return(null);
775
+ }
776
+
777
+ $objPagination = new UniteCreatorElementorPagination();
778
+ $data = $objPagination->getPagingData();
779
+
780
+ $output = array();
781
+ $output["count_posts"] = $query->max_num_pages;
782
+ $output["total_posts"] = $query->found_posts;
783
+ $output["page"] = UniteFunctionsUC::getVal($data, "current");
784
+ $output["num_pages"] = UniteFunctionsUC::getVal($data, "total");
785
+
786
+ return($output);
787
+ }
788
 
789
 
790
  }
inc_php/unitecreator_output.class.php CHANGED
@@ -1504,15 +1504,22 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1504
  public function getHtmlItems(){
1505
 
1506
  $keyTemplate = "uc_template_items_special";
1507
-
1508
  $htmlTemplate = "{{put_items()}}";
1509
 
1510
- $html = $this->objTemplate->addTemplate($keyTemplate, $htmlTemplate, false);
 
 
 
 
1511
 
1512
  $html = $this->objTemplate->getRenderedHtml($keyTemplate);
 
1513
 
 
 
 
1514
 
1515
- return($html);
1516
  }
1517
 
1518
 
@@ -1861,6 +1868,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1861
  $this->objTemplate->addTemplate(self::TEMPLATE_HTML, $html);
1862
  $this->objTemplate->addTemplate(self::TEMPLATE_CSS, $css);
1863
  $this->objTemplate->addTemplate(self::TEMPLATE_JS, $js);
 
1864
 
1865
  $arrItemData = null;
1866
 
@@ -1917,13 +1925,31 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1917
  $arrItemData = $this->normalizeItemsData($arrItemData, $paramName);
1918
  }
1919
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1920
  break;
1921
  default:
1922
-
1923
  $arrItemData = $this->addon->getProcessedItemsData($this->processType);
1924
  break;
1925
  }
1926
-
1927
  $itemIndex = 0;
1928
  foreach($arrItemData as $key=>$item){
1929
 
@@ -1936,11 +1962,11 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1936
 
1937
  $arrItemData[$key]["item"] = $arrItem;
1938
  }
1939
-
1940
  $this->objTemplate->setParams($arrData);
1941
 
1942
  $this->objTemplate->setArrItems($arrItemData);
1943
-
1944
  $htmlItem = $this->addon->getHtmlItem();
1945
 
1946
  $this->objTemplate->addTemplate(self::TEMPLATE_HTML_ITEM, $htmlItem);
@@ -1962,7 +1988,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
1962
  //show debug data
1963
  if($this->isShowDebugData == true)
1964
  $this->putDebugDataHtml($arrData, $arrItemData);
1965
-
1966
  }
1967
 
1968
 
@@ -2002,6 +2028,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
2002
  switch($this->itemsType){
2003
  case "instagram":
2004
  case "post":
 
2005
  $this->isItemsExists = true;
2006
  break;
2007
  }
1504
  public function getHtmlItems(){
1505
 
1506
  $keyTemplate = "uc_template_items_special";
 
1507
  $htmlTemplate = "{{put_items()}}";
1508
 
1509
+ $keyTemplate2 = "uc_template_items_special2";
1510
+ $htmlTemplate2 = "{{put_items2()}}";
1511
+
1512
+ $this->objTemplate->addTemplate($keyTemplate, $htmlTemplate, false);
1513
+ $this->objTemplate->addTemplate($keyTemplate2, $htmlTemplate2, false);
1514
 
1515
  $html = $this->objTemplate->getRenderedHtml($keyTemplate);
1516
+ $html2 = $this->objTemplate->getRenderedHtml($keyTemplate2);
1517
 
1518
+ $output = array();
1519
+ $output["html_items1"] = $html;
1520
+ $output["html_items2"] = $html2;
1521
 
1522
+ return($output);
1523
  }
1524
 
1525
 
1868
  $this->objTemplate->addTemplate(self::TEMPLATE_HTML, $html);
1869
  $this->objTemplate->addTemplate(self::TEMPLATE_CSS, $css);
1870
  $this->objTemplate->addTemplate(self::TEMPLATE_JS, $js);
1871
+
1872
 
1873
  $arrItemData = null;
1874
 
1925
  $arrItemData = $this->normalizeItemsData($arrItemData, $paramName);
1926
  }
1927
 
1928
+ break;
1929
+ case "listing":
1930
+
1931
+ $paramListing = $this->addon->getParamByType(UniteCreatorDialogParam::PARAM_LISTING);
1932
+
1933
+
1934
+ if(empty($paramListing))
1935
+ UniteFunctionsUC::throwError("Some listing param should be found");
1936
+
1937
+ $paramName = UniteFunctionsUC::getVal($paramListing, "name");
1938
+
1939
+ $arrItemData = UniteFunctionsUC::getVal($arrData, $paramName."_items");
1940
+
1941
+ if(empty($arrItemData))
1942
+ $arrItemData = array();
1943
+ else
1944
+ $arrItemData = $this->normalizeItemsData($arrItemData, $paramName);
1945
+
1946
  break;
1947
  default:
1948
+
1949
  $arrItemData = $this->addon->getProcessedItemsData($this->processType);
1950
  break;
1951
  }
1952
+
1953
  $itemIndex = 0;
1954
  foreach($arrItemData as $key=>$item){
1955
 
1962
 
1963
  $arrItemData[$key]["item"] = $arrItem;
1964
  }
1965
+
1966
  $this->objTemplate->setParams($arrData);
1967
 
1968
  $this->objTemplate->setArrItems($arrItemData);
1969
+
1970
  $htmlItem = $this->addon->getHtmlItem();
1971
 
1972
  $this->objTemplate->addTemplate(self::TEMPLATE_HTML_ITEM, $htmlItem);
1988
  //show debug data
1989
  if($this->isShowDebugData == true)
1990
  $this->putDebugDataHtml($arrData, $arrItemData);
1991
+
1992
  }
1993
 
1994
 
2028
  switch($this->itemsType){
2029
  case "instagram":
2030
  case "post":
2031
+ case "listing":
2032
  $this->isItemsExists = true;
2033
  break;
2034
  }
inc_php/unitecreator_params_processor.class.php CHANGED
@@ -1524,7 +1524,7 @@ class UniteCreatorParamsProcessorWork{
1524
  /**
1525
  * get menu data
1526
  */
1527
- protected function getWPMenuData($value, $name, $param, $processType){
1528
  dmp("function for override");
1529
  exit();
1530
  }
@@ -1625,7 +1625,7 @@ class UniteCreatorParamsProcessorWork{
1625
  $data = $this->getProcessedParamsValue_icon($data, $value, $param, $processType);
1626
  break;
1627
  case UniteCreatorDialogParam::PARAM_MENU:
1628
- $data[$name] = $this->getWPMenuData($value, $name, $param, $processType);
1629
  break;
1630
  case UniteCreatorDialogParam::PARAM_SLIDER:
1631
  $data = $this->getSliderData($data, $value, $name, $param, $processType);
1524
  /**
1525
  * get menu data
1526
  */
1527
+ protected function getWPMenuData($data, $value, $name, $param, $processType){
1528
  dmp("function for override");
1529
  exit();
1530
  }
1625
  $data = $this->getProcessedParamsValue_icon($data, $value, $param, $processType);
1626
  break;
1627
  case UniteCreatorDialogParam::PARAM_MENU:
1628
+ $data = $this->getWPMenuData($data,$value, $name, $param, $processType);
1629
  break;
1630
  case UniteCreatorDialogParam::PARAM_SLIDER:
1631
  $data = $this->getSliderData($data, $value, $name, $param, $processType);
inc_php/unitecreator_settings.class.php CHANGED
@@ -536,21 +536,26 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
536
  }
537
 
538
  /**
539
- * add filters item selector
540
  */
541
- protected function addFiltersItemSelector($param){
 
 
542
 
543
- dmp("addFiltersItemSelector - function for override");
544
- exit();
 
 
 
 
 
545
  }
546
-
547
-
548
 
549
  /**
550
  * add setting by creator param
551
  */
552
  public function addByCreatorParam($param, $inputValue = null){
553
-
554
  //add ready setting if exists
555
  $arrReadySetting = UniteFunctionsUC::getVal($param, "uc_setting");
556
  if(!empty($arrReadySetting)){
@@ -561,12 +566,12 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
561
 
562
  if(!empty($inputValue))
563
  $arrReadySetting["value"] = $inputValue;
564
-
565
  $this->addSettingByArray($arrReadySetting);
566
 
567
  return(false);
568
  }
569
-
570
  $type = UniteFunctionsUC::getVal($param, "type");
571
  $title = UniteFunctionsUC::getVal($param, "title");
572
  $name = UniteFunctionsUC::getVal($param, "name");
@@ -605,9 +610,6 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
605
  }
606
 
607
  switch ($type){
608
- case "uc_filters_repeater_params":
609
- $this->addFiltersItemSelector($param);
610
- break;
611
  case "uc_editor":
612
  $this->addEditor($name, $value, $title, $extra);
613
  break;
@@ -656,14 +658,19 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
656
  $this->addCheckbox($name, $isChecked, $title, $textNear, $extra);
657
  break;
658
  case "uc_dropdown":
 
659
  $options = UniteFunctionsUC::getVal($param, "options");
660
 
 
 
661
  $this->addSelect($name, $options, $title, $value, $extra);
662
  break;
663
  case UniteCreatorDialogParam::PARAM_MULTIPLE_SELECT:
664
 
665
  $options = UniteFunctionsUC::getVal($param, "options");
666
 
 
 
667
  $this->addMultiSelect($name, $options, $title, $value, $extra);
668
 
669
  break;
536
  }
537
 
538
  /**
539
+ * run php filter if available
540
  */
541
+ private function checkModifyOptionsPHPFilter($options, $param){
542
+
543
+ $phpFilter = UniteFunctionsUC::getVal($param, "php_filter_name");
544
 
545
+ if(empty($phpFilter))
546
+ return($options);
547
+
548
+ $options = apply_filters("ue_modify_dropdown_".$phpFilter, $options);
549
+
550
+
551
+ return($options);
552
  }
 
 
553
 
554
  /**
555
  * add setting by creator param
556
  */
557
  public function addByCreatorParam($param, $inputValue = null){
558
+
559
  //add ready setting if exists
560
  $arrReadySetting = UniteFunctionsUC::getVal($param, "uc_setting");
561
  if(!empty($arrReadySetting)){
566
 
567
  if(!empty($inputValue))
568
  $arrReadySetting["value"] = $inputValue;
569
+
570
  $this->addSettingByArray($arrReadySetting);
571
 
572
  return(false);
573
  }
574
+
575
  $type = UniteFunctionsUC::getVal($param, "type");
576
  $title = UniteFunctionsUC::getVal($param, "title");
577
  $name = UniteFunctionsUC::getVal($param, "name");
610
  }
611
 
612
  switch ($type){
 
 
 
613
  case "uc_editor":
614
  $this->addEditor($name, $value, $title, $extra);
615
  break;
658
  $this->addCheckbox($name, $isChecked, $title, $textNear, $extra);
659
  break;
660
  case "uc_dropdown":
661
+
662
  $options = UniteFunctionsUC::getVal($param, "options");
663
 
664
+ $options = $this->checkModifyOptionsPHPFilter($options, $param);
665
+
666
  $this->addSelect($name, $options, $title, $value, $extra);
667
  break;
668
  case UniteCreatorDialogParam::PARAM_MULTIPLE_SELECT:
669
 
670
  $options = UniteFunctionsUC::getVal($param, "options");
671
 
672
+ $options = $this->checkModifyOptionsPHPFilter($options, $param);
673
+
674
  $this->addMultiSelect($name, $options, $title, $value, $extra);
675
 
676
  break;
inc_php/unitecreator_template_engine.class.php CHANGED
@@ -64,7 +64,7 @@ class UniteCreatorTemplateEngineWork{
64
  if($this->isTemplateExists($templateName) == false)
65
  return(false);
66
 
67
-
68
  if($numItem !== null){
69
  $itemParams = UniteFunctionsUC::getVal($this->arrItems, $numItem);
70
  if(empty($itemParams))
@@ -93,7 +93,15 @@ class UniteCreatorTemplateEngineWork{
93
  $numItem = null;
94
  $isGetFirst = false;
95
 
96
- if($input !== null){
 
 
 
 
 
 
 
 
97
  switch($input){
98
  case "shuffle": //shuffle items
99
  shuffle($this->arrItems);
@@ -106,10 +114,7 @@ class UniteCreatorTemplateEngineWork{
106
  $isGetFirst = true;
107
  break;
108
  default:
109
- if(is_numeric($input))
110
- $numItem = $input;
111
- else
112
- $sap = $input;
113
  break;
114
  }
115
 
@@ -119,9 +124,11 @@ class UniteCreatorTemplateEngineWork{
119
  if($isGetFirst == true && !empty($this->arrItems) && count($this->arrItems) > 1)
120
  $this->arrItems = array($this->arrItems[0]);
121
 
 
122
  $this->putItemsWork($templateName, $sap, $numItem);
123
  }
124
 
 
125
  /**
126
  * get the items for iteration
127
  */
@@ -639,58 +646,20 @@ class UniteCreatorTemplateEngineWork{
639
  * put dynamic loop template, similar to put listing template
640
  */
641
  public function putDynamicLoopTemplate($item, $templateID){
642
-
643
- $widgetID = UniteFunctionsUC::getVal($this->arrParams, "uc_id");
644
-
645
- HelperProviderCoreUC_EL::putListingItemTemplate($item, $templateID, $widgetID);
646
 
647
- }
648
-
649
-
650
- /**
651
- * put listing template
652
- */
653
- /*
654
- public function putListingTemplate_posts($paramName, $templateID){
655
-
656
- global $wp_query;
657
-
658
- $originalPost = $GLOBALS['post'];
659
-
660
- //backup the original querified object
661
- $originalQueriedObject = $wp_query->queried_object;
662
- $originalQueriedObjectID = $wp_query->queried_object_id;
663
 
664
- foreach($this->arrItems as $item){
 
665
 
666
- $item = UniteFunctionsUC::getVal($item, "item");
667
-
668
- $postItem = UniteFunctionsUC::getVal($item, $paramName);
669
- if(empty($postItem))
670
- UniteFunctionsUC::throwError("Posts List attribute: $paramName not found. please write the correct post list attribute name.");
671
-
672
- $postID = $postItem->ID;
673
-
674
-
675
- //set the post qieried object
676
- $wp_query->queried_object = $postItem;
677
- $wp_query->queried_object_id = $postID;
678
-
679
- $GLOBALS['post'] = $postItem;
680
-
681
- $output = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( 1753 );
682
-
683
- echo $output;
684
- }
685
-
686
- //restore the original queried object
687
- $wp_query->queried_object = $originalQueriedObject;
688
- $wp_query->queried_object_id = $originalQueriedObjectID;
689
- $GLOBALS['post'] = $originalPost;
690
 
691
  }
692
 
693
- */
694
 
695
  /**
696
  * number format for woocommerce
@@ -821,12 +790,19 @@ class UniteCreatorTemplateEngineWork{
821
  return($response);
822
  break;
823
  case "get_loadmore_data":
824
-
825
  $objPagination = new UniteCreatorElementorPagination();
826
  $strData = $objPagination->getLoadmoreData(UniteCreatorElementorIntegrate::$isEditMode);
827
 
828
  return($strData);
829
  break;
 
 
 
 
 
 
 
830
  case "get_post_term":
831
 
832
  //arg1 - postID
@@ -910,8 +886,8 @@ class UniteCreatorTemplateEngineWork{
910
  return($value);
911
  break;
912
  case "modify_text":
913
- $operations = new UCOperations();
914
- $arg1 = $operations->modifyTextFromWidget($arg1);
915
 
916
  return($arg1);
917
  break;
@@ -921,6 +897,13 @@ class UniteCreatorTemplateEngineWork{
921
 
922
  return($arrImage);
923
  break;
 
 
 
 
 
 
 
924
  default:
925
 
926
  $type = UniteFunctionsUC::sanitizeAttr($type);
64
  if($this->isTemplateExists($templateName) == false)
65
  return(false);
66
 
67
+
68
  if($numItem !== null){
69
  $itemParams = UniteFunctionsUC::getVal($this->arrItems, $numItem);
70
  if(empty($itemParams))
93
  $numItem = null;
94
  $isGetFirst = false;
95
 
96
+ if(is_numeric($input)){
97
+ $numItem = $input;
98
+ $input = null;
99
+ }
100
+
101
+ //parse the string input
102
+
103
+ if(is_string($input)){
104
+
105
  switch($input){
106
  case "shuffle": //shuffle items
107
  shuffle($this->arrItems);
114
  $isGetFirst = true;
115
  break;
116
  default:
117
+ $sap = $input;
 
 
 
118
  break;
119
  }
120
 
124
  if($isGetFirst == true && !empty($this->arrItems) && count($this->arrItems) > 1)
125
  $this->arrItems = array($this->arrItems[0]);
126
 
127
+
128
  $this->putItemsWork($templateName, $sap, $numItem);
129
  }
130
 
131
+
132
  /**
133
  * get the items for iteration
134
  */
646
  * put dynamic loop template, similar to put listing template
647
  */
648
  public function putDynamicLoopTemplate($item, $templateID){
 
 
 
 
649
 
650
+ $widgetID = UniteFunctionsUC::getVal($this->arrParams, "uc_id");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
 
652
+ $objFilters = new UniteCreatorFiltersProcess();
653
+ $isAjax = $objFilters->isFrontAjaxRequest();
654
 
655
+ if($isAjax == true)
656
+ $widgetID = "%uc_widget_id%";
657
+
658
+ HelperProviderCoreUC_EL::putListingItemTemplate($item, $templateID, $widgetID);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
 
660
  }
661
 
662
+
663
 
664
  /**
665
  * number format for woocommerce
790
  return($response);
791
  break;
792
  case "get_loadmore_data":
793
+
794
  $objPagination = new UniteCreatorElementorPagination();
795
  $strData = $objPagination->getLoadmoreData(UniteCreatorElementorIntegrate::$isEditMode);
796
 
797
  return($strData);
798
  break;
799
+ case "get_last_query_data":
800
+
801
+ $arrData = HelperUC::$operations->getLastQueryData();
802
+
803
+ return($arrData);
804
+
805
+ break;
806
  case "get_post_term":
807
 
808
  //arg1 - postID
886
  return($value);
887
  break;
888
  case "modify_text":
889
+
890
+ $arg1 = HelperUC::$operations->modifyTextFromWidget($arg1);
891
 
892
  return($arg1);
893
  break;
897
 
898
  return($arrImage);
899
  break;
900
+ case "put_post_meta_debug":
901
+
902
+ $postID = $arg1;
903
+
904
+ HelperUC::$operations->putPostCustomFieldsDebug($postID);
905
+
906
+ break;
907
  default:
908
 
909
  $type = UniteFunctionsUC::sanitizeAttr($type);
inc_php/unitecreator_unitegallery.class.php CHANGED
@@ -706,7 +706,6 @@ class UniteCreatorUniteGallery{
706
  */
707
  public static function getUniteGalleryHtmlItem($item){
708
 
709
-
710
  $type = UniteFunctionsUC::getVal($item, "type");
711
  $title = UniteFunctionsUC::getVal($item, "title");
712
  $link = UniteFunctionsUC::getVal($item, "link");
706
  */
707
  public static function getUniteGalleryHtmlItem($item){
708
 
 
709
  $type = UniteFunctionsUC::getVal($item, "type");
710
  $title = UniteFunctionsUC::getVal($item, "title");
711
  $link = UniteFunctionsUC::getVal($item, "link");
includes.php CHANGED
@@ -12,7 +12,7 @@ if(!defined('UNLIMITED_ELEMENTS_INC'))
12
  defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
13
 
14
  if(!defined("UNLIMITED_ELEMENTS_VERSION"))
15
- define("UNLIMITED_ELEMENTS_VERSION", "1.5.3");
16
 
17
  $currentFile = __FILE__;
18
  $currentFolder = dirname($currentFile);
12
  defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
13
 
14
  if(!defined("UNLIMITED_ELEMENTS_VERSION"))
15
+ define("UNLIMITED_ELEMENTS_VERSION", "1.5.10");
16
 
17
  $currentFile = __FILE__;
18
  $currentFolder = dirname($currentFile);
js/admin.js CHANGED
@@ -166,8 +166,6 @@ function UniteAdminUC(){
166
  };
167
 
168
 
169
-
170
-
171
  /**
172
  * get object property
173
  */
@@ -2306,7 +2304,7 @@ function UniteAdminUC(){
2306
  * init provider settings
2307
  */
2308
  this.initProviderSettingEvents = function(type, objInput){
2309
-
2310
  if(typeof g_providerAdmin.initSettingEvents != "function")
2311
  return(true);
2312
 
166
  };
167
 
168
 
 
 
169
  /**
170
  * get object property
171
  */
2304
  * init provider settings
2305
  */
2306
  this.initProviderSettingEvents = function(type, objInput){
2307
+
2308
  if(typeof g_providerAdmin.initSettingEvents != "function")
2309
  return(true);
2310
 
js/select2/select2.sortable.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .select2-container-multi .select2-choices .select2-search-choice {
2
+ cursor: move;
3
+ }
4
+
5
+ .select2-container {
6
+ display: block;
7
+ width: 100%;
8
+ }
9
+
10
+ .select2-choices {
11
+ border-radius: 0px;
12
+ border-color: #d0d0d0;
13
+ }
14
+
15
+ .select2-container-multi .select2-choices {
16
+ border-color: #d0d0d0;
17
+ padding: 0px;
18
+ }
19
+
20
+ .select2-drop {
21
+ border-radius: 0px;
22
+ }
23
+
24
+ .select2-container-multi.select2-container-active {
25
+ border-color: #646464;
26
+ }
27
+
28
+ .select2-container-multi.select2-container-active .select2-choices {
29
+ border-color: #646464;
30
+ }
31
+
32
+ .select2-drop-active {
33
+ border-color: #646464;
34
+ }
35
+
36
+ .select2-container-multi .select2-choices .select2-search-choice {
37
+ background: #646464;
38
+ color: #fdfdfd;
39
+ width: 100%;
40
+ margin: 0 0 2px 0;
41
+ border: 0px;
42
+ border-radius: 0px;
43
+ padding: 10px 10px 10px 30px;
44
+ box-shadow: 0 0 0px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
45
+ }
46
+
47
+ .select2-container-multi .select2-search-choice-close {
48
+ left: 10px;
49
+ top: 10px;
50
+ }
51
+
52
+ .select2-results .select2-highlighted {
53
+ background: #2f73b6;
54
+ }
js/select2/select2.sortable.js ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+
3
+ function getSortableUl($select) {
4
+
5
+ var objParent = $select.parent();
6
+ var objUl = objParent.find(".select2-container ul");
7
+
8
+ return objUl;
9
+ };
10
+
11
+ /**
12
+ * get list items
13
+ */
14
+ function getListItems(objUL){
15
+
16
+ var objItems = objUL.find("li.select2-selection__choice");
17
+
18
+ return(objItems);
19
+ }
20
+
21
+ /**
22
+ * get list items values
23
+ */
24
+ function getObjULValues(objUL){
25
+
26
+ var objItems = getListItems(objUL);
27
+
28
+ var objValues = {};
29
+
30
+ jQuery.each(objItems,function(index, li){
31
+
32
+ var objItem = jQuery(li);
33
+
34
+ var value = objItem.data("value");
35
+
36
+ objValues[value] = null;
37
+ });
38
+
39
+
40
+ return(objValues);
41
+ }
42
+
43
+ /**
44
+ * get list items values
45
+ */
46
+ function getArrULValues(objUL){
47
+
48
+ var objItems = getListItems(objUL);
49
+
50
+ var arrValues = [];
51
+
52
+ jQuery.each(objItems,function(index, li){
53
+
54
+ var objItem = jQuery(li);
55
+
56
+ var value = objItem.data("value");
57
+ var text = objItem.text();
58
+
59
+ text = text.substring(1);
60
+
61
+ value = value.toString();
62
+
63
+ arrValues.push([value,text]);
64
+ });
65
+
66
+
67
+ return(arrValues);
68
+ }
69
+
70
+
71
+ /**
72
+ * get select from ul
73
+ */
74
+ function getSelectFromUL(objUL){
75
+
76
+ var objContainer = objUL.parents(".select2-container");
77
+ var objSelectInput = objContainer.siblings("select");
78
+
79
+ return(objSelectInput);
80
+ }
81
+
82
+ /**
83
+ * update values
84
+ */
85
+ function updateLIValues(objUL, arrValues){
86
+
87
+ var objItems = getListItems(objUL);
88
+
89
+ if(objItems.length != arrValues.length){
90
+ trace("num items not match!");
91
+ return(false);
92
+ }
93
+
94
+ jQuery.each(arrValues, function(index, value){
95
+
96
+ var objItem = jQuery(objItems[index]);
97
+
98
+ objItem.attr("data-value",value);
99
+ });
100
+
101
+ }
102
+
103
+
104
+ /**
105
+ * init sortable ul
106
+ */
107
+ function initSortableUl($ul, options) {
108
+
109
+ if($ul.length == 0){
110
+ trace("no url found");
111
+ return(false);
112
+ }
113
+
114
+ $ul.sortable({
115
+ forcePlaceholderSize: true,
116
+ items: 'li.select2-selection__choice',
117
+ placeholder : '<li>&nbsp;</li>',
118
+ start:function(event){
119
+
120
+ var objUL = jQuery(event.target);
121
+ var objSelect = getSelectFromUL(objUL);
122
+ var arrValues = objSelect.val();
123
+
124
+ updateLIValues(objUL, arrValues);
125
+
126
+ },
127
+ update:function(event){
128
+
129
+ var objUL = jQuery(event.target);
130
+
131
+ var objSelectInput = getSelectFromUL(objUL);
132
+
133
+ var arrInitIDs = [];
134
+
135
+ var arrValues = getArrULValues(objUL);
136
+
137
+ if(arrValues.length == 0)
138
+ return(false);
139
+
140
+ if(!arrValues[0])
141
+ return(false);
142
+
143
+ objSelectInput.html("");
144
+
145
+ for(var index in arrValues){
146
+
147
+ var item = arrValues[index];
148
+
149
+ var value = item[0];
150
+ var text = item[1];
151
+
152
+ var option = new Option(text, value, true, true);
153
+
154
+ objSelectInput.append(option);
155
+ }
156
+
157
+ objSelectInput.trigger("change");
158
+
159
+ }
160
+
161
+ });
162
+
163
+
164
+ };
165
+
166
+
167
+ function trace(str){
168
+
169
+ console.log(str);
170
+ }
171
+
172
+ function initSelect2Sortable($select) {
173
+
174
+ var observer,
175
+ $ul;
176
+
177
+ //$select.select2();
178
+ $ul = getSortableUl($select);
179
+
180
+ if($ul.length == 0){
181
+
182
+ return(false);
183
+ }
184
+
185
+ observer = new MutationObserver(function(mutations) {
186
+ initSortableUl($ul);
187
+ observer.disconnect();
188
+ });
189
+
190
+ $select.on('select2-selecting', function() {
191
+ observer.observe($ul.get(0), { subtree: false, childList: true, attributes: false });
192
+ });
193
+
194
+ initSortableUl($ul, { bindSortEvent: true, $select: $select });
195
+
196
+ $select.data('hasSelect2Sortable', true);
197
+ };
198
+
199
+
200
+ function sortSelect2Sortable($select, val) {
201
+
202
+ var $ul = getSortableUl($select),
203
+ $lis = $ul.find('.select2-search-choice');
204
+
205
+ $.each(val, function(i, id) {
206
+ $lis.each(function() {
207
+ if (id == $(this).data('select2Data').id) {
208
+ $(this).insertBefore($ul.find('.select2-search-field'));
209
+ }
210
+ });
211
+ });
212
+
213
+ $ul.trigger('sortupdate');
214
+ }
215
+
216
+ $.fn.extend({
217
+
218
+ select2Sortable: function(val) {
219
+
220
+ var objSelect = jQuery(this);
221
+
222
+ var hasInit = objSelect.data('hasSelect2Sortable');
223
+
224
+ if(hasInit)
225
+ return(this);
226
+
227
+ initSelect2Sortable(objSelect);
228
+
229
+
230
+
231
+ return this;
232
+ }
233
+ });
234
+ }(window.jQuery));
js/unitecreator_admin.js CHANGED
@@ -227,7 +227,7 @@ function UniteCreatorAdmin(){
227
  * set the editor to the text area
228
  */
229
  function setCodeMirrorEditor(type){
230
-
231
  switch(type){
232
 
233
  case "html":
@@ -271,13 +271,13 @@ function UniteCreatorAdmin(){
271
 
272
  break;
273
  case "html_item":
274
-
275
  if(g_codemirrorHtmlItem)
276
  return(false);
277
 
278
  if(isItemsEnabled() == false)
279
  return(false);
280
-
281
  g_codemirrorHtmlItem = true;
282
 
283
  setTimeout(function(){
@@ -288,8 +288,10 @@ function UniteCreatorAdmin(){
288
  mode: mixedMode,
289
  lineNumbers: true
290
  };
291
-
292
- g_codemirrorHtmlItem = CodeMirror.fromTextArea(document.getElementById("area_addon_html_item"), optionsCM);
 
 
293
 
294
  }, 500);
295
 
@@ -517,7 +519,7 @@ function UniteCreatorAdmin(){
517
  * is items enabled
518
  */
519
  function isItemsEnabled(){
520
-
521
  if(g_temp.isItemsAsPostsMode == true)
522
  return(true);
523
 
@@ -563,7 +565,7 @@ function UniteCreatorAdmin(){
563
  * set items as posts mode
564
  */
565
  function setItemsAsPostsMode(param){
566
-
567
  //---- items tab -----
568
 
569
  //g_settingsItem.setValues({"enable_items":true});
@@ -575,7 +577,7 @@ function UniteCreatorAdmin(){
575
 
576
  g_temp.isItemsAsPostsMode = true;
577
  g_temp.itemsByPostsParam = itemsParam;
578
-
579
  g_objWrapperItems.hide();
580
  jQuery("#uc_tab_itemattr .unite_settings_wrapper").hide();
581
 
@@ -595,7 +597,7 @@ function UniteCreatorAdmin(){
595
  * remove items as posts mode
596
  */
597
  function disableItemsAsPostsMode(){
598
-
599
  g_temp.isItemsAsPostsMode = false;
600
  g_temp.itemsByPostsParam = null;
601
 
@@ -614,19 +616,18 @@ function UniteCreatorAdmin(){
614
  function checkItemsByPostsMode(arrParams){
615
 
616
  var param = getPostsListParam(arrParams);
617
-
618
  //set items by posts mode
619
  if(param){
620
 
621
  setItemsAsPostsMode(param);
622
-
623
- }else{
624
-
625
- if(g_temp.isItemsAsPostsMode == true)
626
- disableItemsAsPostsMode();
627
 
628
  }
629
 
 
 
 
630
  }
631
 
632
 
@@ -644,6 +645,18 @@ function UniteCreatorAdmin(){
644
  var param = arrParams[index];
645
 
646
  switch(param.type){
 
 
 
 
 
 
 
 
 
 
 
 
647
  case "uc_posts_list":
648
  param["items_param_type"] = "uc_post";
649
  param["items_panel_text"] = "Items as posts mode";
227
  * set the editor to the text area
228
  */
229
  function setCodeMirrorEditor(type){
230
+
231
  switch(type){
232
 
233
  case "html":
271
 
272
  break;
273
  case "html_item":
274
+
275
  if(g_codemirrorHtmlItem)
276
  return(false);
277
 
278
  if(isItemsEnabled() == false)
279
  return(false);
280
+
281
  g_codemirrorHtmlItem = true;
282
 
283
  setTimeout(function(){
288
  mode: mixedMode,
289
  lineNumbers: true
290
  };
291
+
292
+ var objAreaItem = document.getElementById("area_addon_html_item");
293
+
294
+ g_codemirrorHtmlItem = CodeMirror.fromTextArea(objAreaItem, optionsCM);
295
 
296
  }, 500);
297
 
519
  * is items enabled
520
  */
521
  function isItemsEnabled(){
522
+
523
  if(g_temp.isItemsAsPostsMode == true)
524
  return(true);
525
 
565
  * set items as posts mode
566
  */
567
  function setItemsAsPostsMode(param){
568
+
569
  //---- items tab -----
570
 
571
  //g_settingsItem.setValues({"enable_items":true});
577
 
578
  g_temp.isItemsAsPostsMode = true;
579
  g_temp.itemsByPostsParam = itemsParam;
580
+
581
  g_objWrapperItems.hide();
582
  jQuery("#uc_tab_itemattr .unite_settings_wrapper").hide();
583
 
597
  * remove items as posts mode
598
  */
599
  function disableItemsAsPostsMode(){
600
+
601
  g_temp.isItemsAsPostsMode = false;
602
  g_temp.itemsByPostsParam = null;
603
 
616
  function checkItemsByPostsMode(arrParams){
617
 
618
  var param = getPostsListParam(arrParams);
619
+
620
  //set items by posts mode
621
  if(param){
622
 
623
  setItemsAsPostsMode(param);
624
+ return(false);
 
 
 
 
625
 
626
  }
627
 
628
+ if(g_temp.isItemsAsPostsMode == true)
629
+ disableItemsAsPostsMode();
630
+
631
  }
632
 
633
 
645
  var param = arrParams[index];
646
 
647
  switch(param.type){
648
+ case "uc_listing":
649
+
650
+ var useFor = g_ucAdmin.getVal(param, "use_for");
651
+
652
+ if(useFor == "template" || useFor == "gallery"){
653
+ param["items_param_type"] = "uc_listing";
654
+ param["items_panel_text"] = "Items as dynamic loop mode";
655
+
656
+ return(param);
657
+ }
658
+
659
+ break;
660
  case "uc_posts_list":
661
  param["items_param_type"] = "uc_post";
662
  param["items_panel_text"] = "Items as posts mode";
js/unitecreator_params_dialog.js CHANGED
@@ -2012,11 +2012,28 @@ function UniteCreatorParamsDialog(){
2012
 
2013
  var objChild = jQuery(child);
2014
  var childValue = objChild.data("control");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2015
 
2016
- if(childValue == value)
2017
- objChild.show();
2018
- else
2019
- objChild.hide();
2020
  });
2021
 
2022
 
2012
 
2013
  var objChild = jQuery(child);
2014
  var childValue = objChild.data("control");
2015
+
2016
+ trace(value);
2017
+
2018
+ var arrValues = childValue.split(",");
2019
+ if(arrValues.length > 1){
2020
+
2021
+ var isInArray = jQuery.inArray(value,arrValues);
2022
+
2023
+ if(isInArray !== -1)
2024
+ objChild.show();
2025
+ else
2026
+ objChild.hide();
2027
+
2028
+ }else{
2029
+
2030
+ if(childValue == value)
2031
+ objChild.show();
2032
+ else
2033
+ objChild.hide();
2034
+
2035
+ }
2036
 
 
 
 
 
2037
  });
2038
 
2039
 
js/unitecreator_params_editor.js CHANGED
@@ -1139,7 +1139,13 @@ function UniteCreatorParamsEditor(){
1139
  var strSaveData = g_ucAdmin.encodeObjectForSave(objSaveData);
1140
 
1141
  //save the local storage data
1142
- window.localStorage.setItem(g_temp.LOCAL_STORAGE_KEY, strSaveData);
 
 
 
 
 
 
1143
 
1144
  showBottomCopySection(catTitle);
1145
 
@@ -1164,8 +1170,13 @@ function UniteCreatorParamsEditor(){
1164
  */
1165
  function copySectionGetStoredData(){
1166
 
1167
- var strData = window.localStorage.getItem(g_temp.LOCAL_STORAGE_KEY);
1168
-
 
 
 
 
 
1169
  if(!strData)
1170
  return(null);
1171
 
@@ -1182,7 +1193,11 @@ function UniteCreatorParamsEditor(){
1182
  */
1183
  function clearCopiedSection(){
1184
 
1185
- window.localStorage.removeItem(g_temp.LOCAL_STORAGE_KEY);
 
 
 
 
1186
 
1187
  g_objCopyCatSection.hide();
1188
  }
1139
  var strSaveData = g_ucAdmin.encodeObjectForSave(objSaveData);
1140
 
1141
  //save the local storage data
1142
+ try{
1143
+ window.localStorage.setItem(g_temp.LOCAL_STORAGE_KEY, strSaveData);
1144
+ }catch(e){
1145
+
1146
+ alert("local storage not available in your site");
1147
+ return(null);
1148
+ }
1149
 
1150
  showBottomCopySection(catTitle);
1151
 
1170
  */
1171
  function copySectionGetStoredData(){
1172
 
1173
+ try{
1174
+
1175
+ var strData = window.localStorage.getItem(g_temp.LOCAL_STORAGE_KEY);
1176
+
1177
+ }catch(e){
1178
+ return(null);
1179
+ }
1180
  if(!strData)
1181
  return(null);
1182
 
1193
  */
1194
  function clearCopiedSection(){
1195
 
1196
+ try{
1197
+ window.localStorage.removeItem(g_temp.LOCAL_STORAGE_KEY);
1198
+ }catch(e){
1199
+ return(null);
1200
+ }
1201
 
1202
  g_objCopyCatSection.hide();
1203
  }
provider/core/plugins/unlimited_elements/dialog_param_elementor.class.php CHANGED
@@ -126,6 +126,9 @@ class UniteCreatorDialogParamElementor extends UniteCreatorDialogParam{
126
  <?php
127
  }
128
 
 
 
 
129
  /**
130
  * put responsive controls
131
  * Enter description here ...
@@ -945,6 +948,8 @@ class UniteCreatorDialogParamElementor extends UniteCreatorDialogParam{
945
 
946
  $this->addResponsiveInputs("dropdown");
947
 
 
 
948
  }
949
 
950
 
126
  <?php
127
  }
128
 
129
+
130
+
131
+
132
  /**
133
  * put responsive controls
134
  * Enter description here ...
948
 
949
  $this->addResponsiveInputs("dropdown");
950
 
951
+ $this->addPHPFilterOptions("dropdown");
952
+
953
  }
954
 
955
 
provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js CHANGED
@@ -613,9 +613,11 @@ function UniteCreatorElementorEditorAdmin(){
613
  if(arrInitData){
614
  options["data"] = arrInitData;
615
  }
616
-
617
  objSelect.select2(options);
618
 
 
 
619
  if(!arrInitData){
620
 
621
  objSelect.on("change",function(event){
@@ -1466,9 +1468,15 @@ function UniteCreatorElementorEditorAdmin(){
1466
 
1467
  var type = objElement.data("element_type");
1468
 
1469
- if(type != "section")
1470
- return(true);
1471
-
 
 
 
 
 
 
1472
  var id = objElement.data("id");
1473
 
1474
  var objSettings = getSettingsFromElementor(id);
@@ -1512,6 +1520,7 @@ function UniteCreatorElementorEditorAdmin(){
1512
  //elementorFrontend.hooks.addAction( 'frontend/element_ready/global', onFrontElementReady);
1513
 
1514
  elementorFrontend.hooks.addAction( 'frontend/element_ready/section', onFrontElementReady);
 
1515
 
1516
  }
1517
 
613
  if(arrInitData){
614
  options["data"] = arrInitData;
615
  }
616
+
617
  objSelect.select2(options);
618
 
619
+ objSelect.select2Sortable();
620
+
621
  if(!arrInitData){
622
 
623
  objSelect.on("change",function(event){
1468
 
1469
  var type = objElement.data("element_type");
1470
 
1471
+ switch(type){
1472
+ case "section":
1473
+ case "container":
1474
+ break;
1475
+ default:
1476
+ return(true);
1477
+ break;
1478
+ }
1479
+
1480
  var id = objElement.data("id");
1481
 
1482
  var objSettings = getSettingsFromElementor(id);
1520
  //elementorFrontend.hooks.addAction( 'frontend/element_ready/global', onFrontElementReady);
1521
 
1522
  elementorFrontend.hooks.addAction( 'frontend/element_ready/section', onFrontElementReady);
1523
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/container', onFrontElementReady);
1524
 
1525
  }
1526
 
provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php CHANGED
@@ -396,24 +396,24 @@ class UniteCreatorElementorIntegrate{
396
  * register controls
397
  */
398
  public function onRegisterControls($controls_manager) {
399
-
400
  self::logMemoryUsage("before controls registered");
401
 
402
  //add hr control
403
  require $this->pathControls."control_hr.php";
404
- $controls_manager->register_control('uc_hr', new Elementor\Control_UC_HR());
405
 
406
  //add audio control
407
  require $this->pathControls."control_audio.php";
408
- $controls_manager->register_control('uc_mp3', new Elementor\Control_UC_AUDIO());
409
 
410
  //add addons selector control
411
  require $this->pathControls."control_addon_selector.php";
412
- $controls_manager->register_control('uc_addon_selector', new Elementor\Control_UC_AddonSelector());
413
 
414
  //add select post type control
415
  require $this->pathControls."control_select_posttype.php";
416
- $controls_manager->register_control('uc_select_special', new Elementor\Control_UC_SelectSpecial);
417
 
418
 
419
  self::logMemoryUsage("after controls registered");
@@ -917,10 +917,12 @@ class UniteCreatorElementorIntegrate{
917
  $this->enableBackgroundWidgets = true;
918
 
919
  add_action("elementor/element/section/section_background_overlay/after_section_end", array($this, "onSectionStyleControlsAdd"),10, 2);
 
920
 
921
  if(self::$isOutputPage == true){
922
-
923
  add_action('elementor/frontend/section/after_render', array($this, 'onFrontAfterRender'));
 
924
  add_action('wp_print_footer_scripts', array($this, 'onPrintFooterHtml'));
925
  }
926
 
@@ -1206,6 +1208,11 @@ class UniteCreatorElementorIntegrate{
1206
 
1207
  HelperUC::addScriptAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_editor_admin.js", "unlimited_elments_editor_admin");
1208
  HelperUC::addStyleAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_editor_admin.css", $adminStyleHandle);
 
 
 
 
 
1209
 
1210
  $stylesIcons = $this->getWigetIconsStyles();
1211
 
@@ -1551,7 +1558,7 @@ class UniteCreatorElementorIntegrate{
1551
  add_action('elementor/frontend/after_register_scripts', array($this, 'onRegisterFrontScripts'), 10);
1552
  add_action('elementor/editor/after_enqueue_scripts', array($this, 'onEnqueueEditorScripts'), 10);
1553
 
1554
- add_action('elementor/controls/controls_registered', array($this, 'onRegisterControls'));
1555
 
1556
  add_action('elementor/frontend/after_enqueue_scripts', array($this, 'onFrontendAfterRegisterControls'));
1557
 
396
  * register controls
397
  */
398
  public function onRegisterControls($controls_manager) {
399
+
400
  self::logMemoryUsage("before controls registered");
401
 
402
  //add hr control
403
  require $this->pathControls."control_hr.php";
404
+ $controls_manager->register(new Elementor\Control_UC_HR());
405
 
406
  //add audio control
407
  require $this->pathControls."control_audio.php";
408
+ $controls_manager->register(new Elementor\Control_UC_AUDIO());
409
 
410
  //add addons selector control
411
  require $this->pathControls."control_addon_selector.php";
412
+ $controls_manager->register(new Elementor\Control_UC_AddonSelector());
413
 
414
  //add select post type control
415
  require $this->pathControls."control_select_posttype.php";
416
+ $controls_manager->register(new Elementor\Control_UC_SelectSpecial);
417
 
418
 
419
  self::logMemoryUsage("after controls registered");
917
  $this->enableBackgroundWidgets = true;
918
 
919
  add_action("elementor/element/section/section_background_overlay/after_section_end", array($this, "onSectionStyleControlsAdd"),10, 2);
920
+ add_action("elementor/element/container/section_background_overlay/after_section_end", array($this, "onSectionStyleControlsAdd"),10, 2);
921
 
922
  if(self::$isOutputPage == true){
923
+
924
  add_action('elementor/frontend/section/after_render', array($this, 'onFrontAfterRender'));
925
+ add_action('elementor/frontend/container/after_render', array($this, 'onFrontAfterRender'));
926
  add_action('wp_print_footer_scripts', array($this, 'onPrintFooterHtml'));
927
  }
928
 
1208
 
1209
  HelperUC::addScriptAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_editor_admin.js", "unlimited_elments_editor_admin");
1210
  HelperUC::addStyleAbsoluteUrl(HelperProviderCoreUC_EL::$urlCore."elementor/assets/uc_editor_admin.css", $adminStyleHandle);
1211
+
1212
+ //select2 sortable
1213
+ HelperUC::addScriptAbsoluteUrl(GlobalsUC::$urlPlugin."js/select2/select2.sortable.js", "select2_sortable_js");
1214
+ HelperUC::addStyleAbsoluteUrl(GlobalsUC::$urlPlugin."js/select2/select2.sortable.css", "select2_sortable_css");
1215
+
1216
 
1217
  $stylesIcons = $this->getWigetIconsStyles();
1218
 
1558
  add_action('elementor/frontend/after_register_scripts', array($this, 'onRegisterFrontScripts'), 10);
1559
  add_action('elementor/editor/after_enqueue_scripts', array($this, 'onEnqueueEditorScripts'), 10);
1560
 
1561
+ add_action('elementor/controls/register', array($this, 'onRegisterControls'));
1562
 
1563
  add_action('elementor/frontend/after_enqueue_scripts', array($this, 'onFrontendAfterRegisterControls'));
1564
 
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php CHANGED
@@ -31,7 +31,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
31
  protected $isAddSapBefore = false;
32
  protected $tabsCounter = 1;
33
 
34
-
35
  const DEBUG_SETTINGS_VALUES = false;
36
 
37
 
@@ -479,6 +478,9 @@ class UniteCreatorElementorWidget extends Widget_Base {
479
  */
480
  protected function addItemsControlsUC($itemsType){
481
 
 
 
 
482
  if($itemsType == "image")
483
  return(false);
484
 
@@ -1021,6 +1023,18 @@ class UniteCreatorElementorWidget extends Widget_Base {
1021
  case UniteCreatorDialogParam::PARAM_DROPDOWN:
1022
 
1023
  $options = UniteFunctionsUC::getVal($param, "options", array());
 
 
 
 
 
 
 
 
 
 
 
 
1024
  $options = array_flip($options);
1025
  $arrControl["options"] = $options;
1026
 
@@ -1051,6 +1065,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
1051
  $arrControl["mobile_default"] = $defaultValueMobile;
1052
  }
1053
 
 
1054
  break;
1055
  case UniteCreatorDialogParam::PARAM_PADDING:
1056
  case UniteCreatorDialogParam::PARAM_MARGINS:
@@ -1545,11 +1560,18 @@ class UniteCreatorElementorWidget extends Widget_Base {
1545
 
1546
  if(!empty($placeholder))
1547
  $arrControl["placeholder"] = $placeholder;
 
1548
 
1549
  //add dynamic
1550
  $isAddDynamic = UniteFunctionsUC::getVal($param, "add_dynamic");
1551
  $isAddDynamic = UniteFunctionsUC::strToBool($isAddDynamic);
1552
 
 
 
 
 
 
 
1553
  if($isAddDynamic == true){
1554
 
1555
  $arrControl['dynamic'] = array(
@@ -2250,7 +2272,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
2250
  $activeTab = null;
2251
 
2252
  foreach($params as $index => $param){
2253
-
2254
  $type = UniteFunctionsUC::getVal($param, "type");
2255
  if($type === UniteCreatorDialogParam::PARAM_POSTS_LIST){
2256
  $hasPostsList = true;
@@ -2412,12 +2434,23 @@ class UniteCreatorElementorWidget extends Widget_Base {
2412
  //add pagination section if needed
2413
  if($hasPostsList == true){
2414
  $this->addPaginationControls($postListParam);
2415
-
2416
- }if($hasListing == true){
2417
-
2418
  $enablePagination = UniteFunctionsUC::getVal($listingParam, "enable_pagination");
2419
  $enablePagination = UniteFunctionsUC::strToBool($enablePagination);
2420
 
 
 
 
 
 
 
 
 
 
 
 
2421
  if($enablePagination == true)
2422
  $this->addPaginationControls($listingParam);
2423
  }
@@ -2467,7 +2500,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
2467
  )
2468
  );
2469
 
2470
-
2471
  $postParam = $listingParam;
2472
 
2473
  $postParam["type"] = UniteCreatorDialogParam::PARAM_POSTS_LIST;
@@ -2902,7 +2935,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
2902
  /**
2903
  * register controls
2904
  */
2905
- protected function _register_controls() {
2906
 
2907
  //$this->registerControlsTest();
2908
  //return(false);
@@ -3041,6 +3074,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
3041
  }
3042
 
3043
 
 
3044
  /**
3045
  * get settings values
3046
  */
@@ -3050,7 +3084,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
3050
 
3051
  if(self::DEBUG_SETTINGS_VALUES === true)
3052
  dmp($arrSettings);
3053
-
3054
  $arrValues = array();
3055
  foreach($arrSettings as $key=>$value){
3056
 
@@ -3069,6 +3103,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
3069
  }
3070
 
3071
  $arrValues = $this->getSettingsValues_processGlobalColors($arrValues, $arrSettings);
 
3072
 
3073
  return($arrValues);
3074
  }
@@ -3338,7 +3373,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
3338
 
3339
  $enablePagination = UniteFunctionsUC::getVal($arrListingParam, "enable_pagination");
3340
  $enablePagination = UniteFunctionsUC::strToBool($enablePagination);
3341
-
3342
  if($enablePagination == true){
3343
  $isPaginationExists = true;
3344
  $name = UniteFunctionsUC::getVal($arrListingParam, "name");
31
  protected $isAddSapBefore = false;
32
  protected $tabsCounter = 1;
33
 
 
34
  const DEBUG_SETTINGS_VALUES = false;
35
 
36
 
478
  */
479
  protected function addItemsControlsUC($itemsType){
480
 
481
+ if($itemsType == "listing")
482
+ return(false);
483
+
484
  if($itemsType == "image")
485
  return(false);
486
 
1023
  case UniteCreatorDialogParam::PARAM_DROPDOWN:
1024
 
1025
  $options = UniteFunctionsUC::getVal($param, "options", array());
1026
+
1027
+ $phpFilter = UniteFunctionsUC::getVal($param, "php_filter_name");
1028
+
1029
+ if(!empty($phpFilter)){
1030
+
1031
+ $options = apply_filters("ue_modify_dropdown_".$phpFilter, $options);
1032
+
1033
+ if(is_string($value) && in_array($value, $options) == false)
1034
+ $value = UniteFunctionsUC::getArrFirstValue($options);
1035
+
1036
+ }
1037
+
1038
  $options = array_flip($options);
1039
  $arrControl["options"] = $options;
1040
 
1065
  $arrControl["mobile_default"] = $defaultValueMobile;
1066
  }
1067
 
1068
+
1069
  break;
1070
  case UniteCreatorDialogParam::PARAM_PADDING:
1071
  case UniteCreatorDialogParam::PARAM_MARGINS:
1560
 
1561
  if(!empty($placeholder))
1562
  $arrControl["placeholder"] = $placeholder;
1563
+
1564
 
1565
  //add dynamic
1566
  $isAddDynamic = UniteFunctionsUC::getVal($param, "add_dynamic");
1567
  $isAddDynamic = UniteFunctionsUC::strToBool($isAddDynamic);
1568
 
1569
+ $disableDynamic = UniteFunctionsUC::getVal($param, "disable_dynamic");
1570
+ $disableDynamic = UniteFunctionsUC::strToBool($disableDynamic);
1571
+
1572
+ if($disableDynamic === true)
1573
+ $isAddDynamic = false;
1574
+
1575
  if($isAddDynamic == true){
1576
 
1577
  $arrControl['dynamic'] = array(
2272
  $activeTab = null;
2273
 
2274
  foreach($params as $index => $param){
2275
+
2276
  $type = UniteFunctionsUC::getVal($param, "type");
2277
  if($type === UniteCreatorDialogParam::PARAM_POSTS_LIST){
2278
  $hasPostsList = true;
2434
  //add pagination section if needed
2435
  if($hasPostsList == true){
2436
  $this->addPaginationControls($postListParam);
2437
+
2438
+ }else if($hasListing == true){
2439
+
2440
  $enablePagination = UniteFunctionsUC::getVal($listingParam, "enable_pagination");
2441
  $enablePagination = UniteFunctionsUC::strToBool($enablePagination);
2442
 
2443
+ $enableFiltering = UniteFunctionsUC::getVal($listingParam, "enable_ajax");
2444
+ $enableFiltering = UniteFunctionsUC::strToBool($enableFiltering);
2445
+
2446
+ if($enableFiltering == true)
2447
+ $listingParam["is_filterable"] = true;
2448
+
2449
+ $listingName = $listingParam["name"];
2450
+
2451
+ $listingParam["condition"] = array($listingName."_source"=>array("posts","products"));
2452
+
2453
+
2454
  if($enablePagination == true)
2455
  $this->addPaginationControls($listingParam);
2456
  }
2500
  )
2501
  );
2502
 
2503
+
2504
  $postParam = $listingParam;
2505
 
2506
  $postParam["type"] = UniteCreatorDialogParam::PARAM_POSTS_LIST;
2935
  /**
2936
  * register controls
2937
  */
2938
+ protected function register_controls() {
2939
 
2940
  //$this->registerControlsTest();
2941
  //return(false);
3074
  }
3075
 
3076
 
3077
+
3078
  /**
3079
  * get settings values
3080
  */
3084
 
3085
  if(self::DEBUG_SETTINGS_VALUES === true)
3086
  dmp($arrSettings);
3087
+
3088
  $arrValues = array();
3089
  foreach($arrSettings as $key=>$value){
3090
 
3103
  }
3104
 
3105
  $arrValues = $this->getSettingsValues_processGlobalColors($arrValues, $arrSettings);
3106
+
3107
 
3108
  return($arrValues);
3109
  }
3373
 
3374
  $enablePagination = UniteFunctionsUC::getVal($arrListingParam, "enable_pagination");
3375
  $enablePagination = UniteFunctionsUC::strToBool($enablePagination);
3376
+
3377
  if($enablePagination == true){
3378
  $isPaginationExists = true;
3379
  $name = UniteFunctionsUC::getVal($arrListingParam, "name");
provider/core/plugins/unlimited_elements/elementor/pagination.class.php CHANGED
@@ -16,8 +16,11 @@ class UniteCreatorElementorPagination{
16
  /**
17
  * add content controls
18
  */
19
- private function addElementorControls_content($widget,$postListParam){
20
-
 
 
 
21
  $isFilterable = UniteFunctionsUC::getVal($postListParam, "is_filterable");
22
  $isFilterable = UniteFunctionsUC::strToBool($isFilterable);
23
 
@@ -29,15 +32,20 @@ class UniteCreatorElementorPagination{
29
 
30
  $textSection = esc_html__("Posts Pagination", "unlimited-elements-for-elementor");
31
  if($isFilterable == true)
32
- $textSection = esc_html__("Posts Pagination and Filter", "unlimited-elements-for-elementor");
33
 
34
  if($enableAjax == true)
35
- $textSection = esc_html__("Posts Pagination and Ajax", "unlimited-elements-for-elementor");
36
 
 
 
 
 
 
 
 
37
  $widget->start_controls_section(
38
- 'section_pagination', array(
39
- 'label' => $textSection,
40
- )
41
  );
42
 
43
  $widget->add_control(
@@ -85,7 +93,7 @@ class UniteCreatorElementorPagination{
85
  $widget->add_control(
86
  $paramName.'_ajax_seturl',
87
  array(
88
- 'label' => __( 'Filters Behavoiur', "unlimited-elements-for-elementor"),
89
  'type' => \Elementor\Controls_Manager::SELECT,
90
  'default' => 'ajax',
91
  'options' => array(
@@ -343,7 +351,7 @@ class UniteCreatorElementorPagination{
343
 
344
  if(empty(GlobalsProviderUC::$lastPostQuery))
345
  return(0);
346
-
347
  $numPages = GlobalsProviderUC::$lastPostQuery->max_num_pages;
348
  if($numPages <= 1)
349
  return(0);
@@ -451,7 +459,7 @@ class UniteCreatorElementorPagination{
451
  /**
452
  * get last request paging data
453
  */
454
- private function getPagingData(){
455
 
456
  $currentPage = $this->getCurrentPage();
457
  $totalPages = $this->getTotalPages();
@@ -537,9 +545,16 @@ class UniteCreatorElementorPagination{
537
 
538
  if(!empty($nextText))
539
  $options["next_text"] = $nextText;
 
 
 
 
 
 
540
 
541
  //disable the text, leave only icon
542
  if($isShowText == false){
 
543
  $options["next_text"] = "";
544
  $options["prev_text"] = "";
545
  }
@@ -547,6 +562,7 @@ class UniteCreatorElementorPagination{
547
  //$options["total"] = 10;
548
  //$options["current"] = 3;
549
 
 
550
  //-------- put pagination html
551
 
552
  $isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
@@ -634,13 +650,7 @@ class UniteCreatorElementorPagination{
634
 
635
  return(false);
636
  }
637
-
638
- if(empty($nextText))
639
- $options["next_text"] = _x( 'Next', 'next set of posts' );
640
-
641
- if(empty($prevText))
642
- $options["prev_text"] = _x( 'Previous', 'previous set of posts' );
643
-
644
  $pagination = paginate_links($options);
645
  }
646
 
16
  /**
17
  * add content controls
18
  */
19
+ private function addElementorControls_content($widget, $postListParam){
20
+
21
+
22
+ $condition = UniteFunctionsUC::getVal($postListParam, "condition");
23
+
24
  $isFilterable = UniteFunctionsUC::getVal($postListParam, "is_filterable");
25
  $isFilterable = UniteFunctionsUC::strToBool($isFilterable);
26
 
32
 
33
  $textSection = esc_html__("Posts Pagination", "unlimited-elements-for-elementor");
34
  if($isFilterable == true)
35
+ $textSection = esc_html__("Posts Pagination and Filtering", "unlimited-elements-for-elementor");
36
 
37
  if($enableAjax == true)
38
+ $textSection = esc_html__("Posts Pagination and Filtering", "unlimited-elements-for-elementor");
39
 
40
+ $arrSectionSettings = array(
41
+ 'label' => $textSection,
42
+ );
43
+
44
+ if(!empty($condition))
45
+ $arrSectionSettings["condition"] = $condition;
46
+
47
  $widget->start_controls_section(
48
+ 'section_pagination', $arrSectionSettings
 
 
49
  );
50
 
51
  $widget->add_control(
93
  $widget->add_control(
94
  $paramName.'_ajax_seturl',
95
  array(
96
+ 'label' => __( 'Filters Behaviour', "unlimited-elements-for-elementor"),
97
  'type' => \Elementor\Controls_Manager::SELECT,
98
  'default' => 'ajax',
99
  'options' => array(
351
 
352
  if(empty(GlobalsProviderUC::$lastPostQuery))
353
  return(0);
354
+
355
  $numPages = GlobalsProviderUC::$lastPostQuery->max_num_pages;
356
  if($numPages <= 1)
357
  return(0);
459
  /**
460
  * get last request paging data
461
  */
462
+ public function getPagingData(){
463
 
464
  $currentPage = $this->getCurrentPage();
465
  $totalPages = $this->getTotalPages();
545
 
546
  if(!empty($nextText))
547
  $options["next_text"] = $nextText;
548
+
549
+ if(empty($nextText))
550
+ $options["next_text"] = _x( 'Next', 'next set of posts' );
551
+
552
+ if(empty($prevText))
553
+ $options["prev_text"] = _x( 'Previous', 'previous set of posts' );
554
 
555
  //disable the text, leave only icon
556
  if($isShowText == false){
557
+
558
  $options["next_text"] = "";
559
  $options["prev_text"] = "";
560
  }
562
  //$options["total"] = 10;
563
  //$options["current"] = 3;
564
 
565
+
566
  //-------- put pagination html
567
 
568
  $isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
650
 
651
  return(false);
652
  }
653
+
 
 
 
 
 
 
654
  $pagination = paginate_links($options);
655
  }
656
 
provider/functions_wordpress.class.php CHANGED
@@ -26,6 +26,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
26
 
27
  const SORTBY_PRICE = "price";
28
  const SORTBY_SALE_PRICE = "sale_price";
 
 
29
 
30
  const SORTBY_SLUG = "name";
31
  const SORTBY_DATE = "date";
@@ -1046,6 +1048,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1046
  if($isForWoo == true){
1047
  $arr[self::SORTBY_PRICE] = __("Price (WooCommerce)", "unlimited-elements-for-elementor");
1048
  $arr[self::SORTBY_SALE_PRICE] = __("Sale Price (WooCommerce)", "unlimited-elements-for-elementor");
 
 
1049
  }
1050
 
1051
  $arr[self::SORTBY_SLUG] = __("Slug", "unlimited-elements-for-elementor");
@@ -1085,6 +1089,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1085
  public static function getArrTermSortBy(){
1086
 
1087
  $arr = array();
 
1088
  $arr["name"] = __("Name", "unlimited-elements-for-elementor");
1089
  $arr["slug"] = __("Slug", "unlimited-elements-for-elementor");
1090
  $arr["term_group"] = __("Term Group", "unlimited-elements-for-elementor");
@@ -1160,16 +1165,19 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1160
 
1161
  if(empty($value))
1162
  $value = get_post_meta($postID, $name, true);
1163
-
 
 
1164
  return($value);
1165
  }
1166
-
1167
- if(empty($value))
1168
- $value = get_post_meta($postID, $name, true);
1169
 
1170
- if(is_array($value));
 
 
1171
  $value = json_encode($value);
1172
-
 
 
1173
  return($value);
1174
  }
1175
 
26
 
27
  const SORTBY_PRICE = "price";
28
  const SORTBY_SALE_PRICE = "sale_price";
29
+ const SORTBY_SALES = "sales";
30
+ const SORTBY_RATING = "rating";
31
 
32
  const SORTBY_SLUG = "name";
33
  const SORTBY_DATE = "date";
1048
  if($isForWoo == true){
1049
  $arr[self::SORTBY_PRICE] = __("Price (WooCommerce)", "unlimited-elements-for-elementor");
1050
  $arr[self::SORTBY_SALE_PRICE] = __("Sale Price (WooCommerce)", "unlimited-elements-for-elementor");
1051
+ $arr[self::SORTBY_SALES] = __("Number of Sales (WooCommerce)", "unlimited-elements-for-elementor");
1052
+ $arr[self::SORTBY_RATING] = __("Rating (WooCommerce)", "unlimited-elements-for-elementor");
1053
  }
1054
 
1055
  $arr[self::SORTBY_SLUG] = __("Slug", "unlimited-elements-for-elementor");
1089
  public static function getArrTermSortBy(){
1090
 
1091
  $arr = array();
1092
+ $arr["default"] = __("Default", "unlimited-elements-for-elementor");
1093
  $arr["name"] = __("Name", "unlimited-elements-for-elementor");
1094
  $arr["slug"] = __("Slug", "unlimited-elements-for-elementor");
1095
  $arr["term_group"] = __("Term Group", "unlimited-elements-for-elementor");
1165
 
1166
  if(empty($value))
1167
  $value = get_post_meta($postID, $name, true);
1168
+
1169
+ $value = trim($value);
1170
+
1171
  return($value);
1172
  }
 
 
 
1173
 
1174
+ $value = get_post_meta($postID, $name, true);
1175
+
1176
+ if(is_array($value))
1177
  $value = json_encode($value);
1178
+
1179
+ $value = trim($value);
1180
+
1181
  return($value);
1182
  }
1183
 
provider/provider_helper.class.php CHANGED
@@ -139,6 +139,25 @@ class HelperProviderUC{
139
  return($arrNames);
140
  }
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  /**
144
  * get post addditions array from options
139
  return($arrNames);
140
  }
141
 
142
+ /**
143
+ * get gallery defaults
144
+ */
145
+ public static function getArrDynamicGalleryDefaults(){
146
+
147
+ $urlImages = GlobalsUC::$urlPluginImages;
148
+
149
+ $arrItems = array();
150
+
151
+ $arrItems[] = array("id"=>0,"url"=>$urlImages."gallery1.jpg");
152
+ $arrItems[] = array("id"=>0,"url"=>$urlImages."gallery2.jpg");
153
+ $arrItems[] = array("id"=>0,"url"=>$urlImages."gallery3.jpg");
154
+ $arrItems[] = array("id"=>0,"url"=>$urlImages."gallery4.jpg");
155
+ $arrItems[] = array("id"=>0,"url"=>$urlImages."gallery5.jpg");
156
+ $arrItems[] = array("id"=>0,"url"=>$urlImages."gallery6.jpg");
157
+
158
+ return($arrItems);
159
+ }
160
+
161
 
162
  /**
163
  * get post addditions array from options
provider/provider_params_processor.class.php CHANGED
@@ -265,8 +265,113 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
265
  }
266
 
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  protected function z_______________POSTS____________(){}
269
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  /**
271
  * get post ids from post meta
272
  */
@@ -818,7 +923,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
818
  $filters["meta_key"] = UniteFunctionsUC::getVal($value, "{$name}_orderby_meta_key1");
819
  }
820
 
821
-
822
  return($filters);
823
  }
824
 
@@ -990,14 +1094,21 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
990
  $isFilterable = $isAjax && ($isAjaxSetUrl != "ajax");
991
 
992
  $isRelatedPosts = $source == "related";
 
 
993
  if(is_single() == false)
994
  $isRelatedPosts = false;
995
 
 
 
 
 
 
 
996
  $arrMetaQuery = array();
997
 
998
  $getRelatedProducts = false;
999
 
1000
-
1001
  //get post type
1002
  $postType = UniteFunctionsUC::getVal($value, "{$name}_posttype", "post");
1003
  if($isForWoo)
@@ -1008,17 +1119,21 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1008
  $post = null;
1009
 
1010
  if($isRelatedPosts == true){
1011
-
1012
  $post = get_post();
1013
  $postType = $post->post_type;
1014
 
1015
  $filters["posttype"] = $postType; //rewrite the post type argument
1016
 
1017
- if($postType == "product"){
1018
 
1019
  $getRelatedProducts = true;
1020
  $productID = $post->ID;
 
 
 
1021
 
 
1022
  }else{
1023
 
1024
  if($showDebugQuery == true){
@@ -1194,14 +1309,13 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1194
  $filters["limit"] = $limit;
1195
 
1196
  $filters = $this->getPostListData_addOrderBy($filters, $value, $name);
1197
-
1198
 
1199
  //add debug for further use
1200
  HelperUC::addDebug("Post Filters", $filters);
1201
 
1202
  //run custom query if available
1203
  $args = UniteFunctionsWPUC::getPostsArgs($filters);
1204
-
1205
  //exclude by authors
1206
 
1207
  if($excludeByAuthors == true){
@@ -1431,10 +1545,23 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1431
  $metaValue3 = UniteFunctionsUC::getVal($value, "{$name}_includeby_metavalue3");
1432
  $metaValue3 = $this->modifyMetaValueForCompare($metaValue3);
1433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1434
 
1435
  if(!empty($metaKey)){
1436
 
1437
- $arrMetaQuery[] = array(
1438
  'key' => $metaKey,
1439
  'value' => $metaValue,
1440
  'compare'=>$metaCompare
@@ -1443,28 +1570,66 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1443
 
1444
  if(!empty($metaValue2)){
1445
 
1446
- $arrMetaQuery[] = array(
1447
  'key' => $metaKey,
1448
  'value' => $metaValue2,
1449
  'compare'=>$metaCompare
1450
  );
1451
 
1452
- $arrMetaQuery["relation"] = "OR";
1453
  }
1454
 
1455
  if(!empty($metaValue3)){
1456
 
1457
- $arrMetaQuery[] = array(
1458
  'key' => $metaKey,
1459
  'value' => $metaValue3,
1460
  'compare'=>$metaCompare
1461
  );
1462
 
1463
- $arrMetaQuery["relation"] = "OR";
1464
  }
1465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1466
 
 
 
 
 
 
 
 
1467
  }
 
1468
 
1469
  break;
1470
  case "most_viewed":
@@ -1583,7 +1748,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1583
  //------ get woo related products ------
1584
 
1585
  if($getRelatedProducts == true){
1586
-
1587
  if($showDebugQuery == true){
1588
 
1589
  $debugText = "Debug: Getting up to $limit related products";
@@ -1596,9 +1761,20 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1596
  dmp($debugText);
1597
  }
1598
 
1599
- $arrRelatedProductIDs = wc_get_related_products($productID, $limit, $arrPostsNotIn);
 
 
 
 
 
 
 
 
 
1600
  if(empty($arrRelatedProductIDs))
1601
  $arrRelatedProductIDs = array("0");
 
 
1602
  $args["post__in"] = $arrRelatedProductIDs;
1603
  }
1604
 
@@ -1653,7 +1829,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1653
  $objFiltersProcess = new UniteCreatorFiltersProcess();
1654
  $args = $objFiltersProcess->processRequestFilters($args, $isFilterable);
1655
 
1656
-
1657
  HelperUC::addDebug("Posts Query", $args);
1658
 
1659
  //-------- show debug query --------------
@@ -1664,10 +1839,14 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1664
  dmp("The Query Is:");
1665
  dmp($args);
1666
  }
1667
-
1668
  //remember last args
1669
  GlobalsProviderUC::$lastQueryArgs = $args;
1670
 
 
 
 
 
1671
  //skip run
1672
  if(GlobalsProviderUC::$skipRunPostQueryOnce == true){
1673
  GlobalsProviderUC::$skipRunPostQueryOnce = false;
@@ -1675,9 +1854,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1675
  }
1676
 
1677
  $query = new WP_Query($args);
1678
-
 
1679
  if($showDebugQuery == true && $debugType == "show_query"){
1680
-
1681
  $originalQueryVars = $query->query_vars;
1682
  $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
1683
 
@@ -1691,7 +1871,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1691
 
1692
  }
1693
 
1694
-
1695
  /*
1696
  dmp($query->request);
1697
  dmp("the query");
@@ -1730,6 +1909,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1730
  echo "</div>";
1731
  }
1732
 
 
 
 
1733
 
1734
  return($arrPosts);
1735
  }
@@ -1970,14 +2152,21 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1970
  $dynamicIDs = UniteFunctionsUC::getVal($value, $name."_manual_post_ids_dynamic");
1971
 
1972
  $arrDynamicIDs = UniteFunctionsUC::getIDsArray($dynamicIDs);
1973
-
1974
  if(!empty($arrDynamicIDs))
1975
  $postIDs = array_merge($postIDs, $arrDynamicIDs);
1976
 
 
 
 
 
1977
 
1978
  $showDebugQuery = UniteFunctionsUC::getVal($value, "{$name}_show_query_debug");
1979
  $showDebugQuery = UniteFunctionsUC::strToBool($showDebugQuery);
1980
 
 
 
 
1981
  if(empty($postIDs)){
1982
 
1983
  if($showDebugQuery == true){
@@ -1992,6 +2181,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1992
  $args["post__in"] = $postIDs;
1993
  $args["ignore_sticky_posts"] = true;
1994
  $args["post_type"] = "any";
 
 
1995
  $args["post_status"] = "publish, private";
1996
 
1997
  $args = $this->getPostListData_addOrderBy($args, $value, $name, true);
@@ -2004,6 +2195,23 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2004
  GlobalsProviderUC::$lastQueryArgs = $args;
2005
 
2006
  $query = new WP_Query($args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2007
  $arrPosts = $query->posts;
2008
 
2009
  if(empty($arrPosts))
@@ -2031,7 +2239,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2031
  * get post list data
2032
  */
2033
  private function getPostListData($value, $name, $processType, $param, $data){
2034
-
2035
  if($processType != self::PROCESS_TYPE_OUTPUT && $processType != self::PROCESS_TYPE_OUTPUT_BACK)
2036
  return($data);
2037
 
@@ -2039,7 +2247,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2039
  HelperUC::addDebug("getPostList param", $param);
2040
 
2041
  $source = UniteFunctionsUC::getVal($value, "{$name}_source");
2042
-
2043
  $arrPosts = array();
2044
 
2045
  switch($source){
@@ -2091,20 +2299,29 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2091
  $imageSize = UniteFunctionsUC::getVal($value, "{$name}_imagesize","medium_large");
2092
  $arrImageSizes["desktop"] = $imageSize;
2093
  }
2094
-
2095
- $objFilters = new UniteCreatorFiltersProcess();
2096
- $data = $objFilters->addWidgetFilterableVariables($data, $this->addon);
2097
 
2098
  //prepare listing output. no items prepare for the listing
2099
 
2100
  $useForListing = UniteFunctionsUC::getVal($param, "use_for_listing");
2101
  $useForListing = UniteFunctionsUC::strToBool($useForListing);
2102
 
 
 
2103
  if($useForListing == true){
 
2104
  $nameListing = UniteFunctionsUC::getVal($param, "name_listing");
 
 
 
2105
 
2106
  $data[$nameListing."_items"] = $arrPosts;
2107
  return($data);
 
 
 
 
 
 
2108
  }
2109
 
2110
  $arrData = array();
@@ -2275,6 +2492,57 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2275
  return($item);
2276
  }
2277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2278
  /**
2279
  * get gallery item
2280
  */
@@ -2378,10 +2646,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2378
 
2379
  $title = $this->getGalleryItem_title($titleSource, $data, $name, $post, $sourceItem);
2380
  $description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post, $sourceItem);
2381
-
2382
  //demo item text
2383
  if($isByUrl == true && count($data) == 1){
2384
-
2385
  if(empty($title))
2386
  $title = "Demo Item {$index} Title";
2387
 
@@ -2400,6 +2668,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2400
 
2401
  $item["imageid"] = $id;
2402
 
 
 
2403
  return($item);
2404
  }
2405
 
@@ -2415,9 +2685,14 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2415
  $thumbSize = UniteFunctionsUC::getVal($value, $name."_thumb_size");
2416
  $imageSize = UniteFunctionsUC::getVal($value, $name."_image_size");
2417
 
 
2418
  $isEnableVideo = UniteFunctionsUC::getVal($param, "gallery_enable_video");
2419
  $isEnableVideo = UniteFunctionsUC::strToBool($isEnableVideo);
2420
 
 
 
 
 
2421
  $arrFilters = array();
2422
  if(!empty($thumbSize))
2423
  $arrFilters[] = $thumbSize;
@@ -2438,10 +2713,23 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2438
 
2439
  switch($source){
2440
  case "posts":
2441
-
2442
  $titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_post");
2443
  $descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_post");
2444
-
 
 
 
 
 
 
 
 
 
 
 
 
 
2445
  break;
2446
  case "gallery":
2447
  $titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_gallery");
@@ -2471,9 +2759,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2471
  $content = $item->post_content;
2472
 
2473
  $featuredImageID = $this->getPostFeaturedImageID($postID, $content, $item->post_type);
2474
-
2475
  $params["post"] = $item;
2476
-
2477
  $galleryItem = $this->getGalleryItem($featuredImageID,null,$params);
2478
 
2479
  $galleryItem["postid"] = $postID;
@@ -2603,22 +2891,6 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2603
  return($arrIDs);
2604
  }
2605
 
2606
- /**
2607
- * try to get gallery items from addon items
2608
- */
2609
- private function getGalleryItemsFromDefaultItems(){
2610
-
2611
- $arrItems = $this->addon->getArrItemsNonProcessed();
2612
-
2613
- if(empty($arrItems))
2614
- return(array());
2615
-
2616
- $firstItem = $arrItems[0];
2617
- if(isset($firstItem["image"]) == false)
2618
- return(array());
2619
-
2620
- return($arrItems);
2621
- }
2622
 
2623
 
2624
  /**
@@ -2645,6 +2917,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2645
 
2646
  $arrOutput["attributes"] = "";
2647
  $arrOutput["class"] = "";
 
2648
 
2649
  $data[$name] = $arrOutput;
2650
 
@@ -2814,10 +3087,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2814
  * get listing data
2815
  */
2816
  private function getListingData($value, $name, $processType, $param, $data){
2817
-
2818
  if($processType != self::PROCESS_TYPE_OUTPUT && $processType != self::PROCESS_TYPE_OUTPUT_BACK)
2819
  return($data);
2820
-
2821
  $useFor = UniteFunctionsUC::getVal($param, "use_for");
2822
 
2823
  switch($useFor){
@@ -2835,7 +3108,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2835
 
2836
  $isForGallery = ($useFor == "gallery");
2837
 
2838
- $source = UniteFunctionsUC::getVal($value, $name."_source");
2839
 
2840
  if(empty($source) && $isForGallery == true)
2841
  $source = "gallery";
@@ -2878,12 +3151,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
2878
 
2879
  break;
2880
  case "gallery":
2881
-
2882
- $arrGalleryItems = UniteFunctionsUC::getVal($value, $name."_gallery");
2883
 
2884
- //output defaults
2885
- if(empty($arrGalleryItems))
2886
- $arrGalleryItems = $this->getGalleryItemsFromDefaultItems();
2887
 
2888
  $data[$name."_items"] = $arrGalleryItems;
2889
 
@@ -3311,6 +3580,14 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3311
  if(empty($metaKey))
3312
  $orderBy = null;
3313
  }
 
 
 
 
 
 
 
 
3314
 
3315
  if(!empty($orderBy)){
3316
 
@@ -3325,6 +3602,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3325
  $args["order"] = $orderDir;
3326
  }
3327
 
 
3328
  }
3329
 
3330
  //exclude
@@ -3338,8 +3616,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3338
  }
3339
 
3340
  //include specific
3341
- if(!empty($arrIncludeTermIDs))
3342
  $args["include"] = $arrIncludeTermIDs;
 
3343
 
3344
  if(!empty($includeParentID)){
3345
 
@@ -3569,14 +3848,17 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3569
  /**
3570
  * get menu output
3571
  */
3572
- protected function getWPMenuData($value, $name, $param, $processType){
3573
-
3574
  $menuID = UniteFunctionsUC::getVal($value, $name."_id");
3575
 
3576
  //get first menu
3577
  if(empty($menuID)){
 
3578
  $htmlMenu = __("menu not selected","unlimited-elements-for-elementor");
3579
- return($htmlMenu);
 
 
3580
  }
3581
 
3582
  $depth = UniteFunctionsUC::getVal($value, $name."_depth");
@@ -3611,7 +3893,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3611
 
3612
  $htmlMenu = wp_nav_menu($args);
3613
 
3614
- return($htmlMenu);
 
 
 
3615
  }
3616
 
3617
 
265
  }
266
 
267
 
268
+ protected function z_______________POSTS_QUERY_CLAUSES____________(){}
269
+
270
+ /**
271
+ * check and if needed start the query clauses modify
272
+ */
273
+ private function checkModifyQueryClauses($args,$showDebug){
274
+
275
+ $postType = UniteFunctionsUC::getVal($args, "post_type");
276
+
277
+ if($postType != "product")
278
+ return(false);
279
+
280
+ $orderby = UniteFunctionsUC::getVal($args, "orderby");
281
+
282
+
283
+ switch($orderby){
284
+ case UniteFunctionsWPUC::SORTBY_SALES:
285
+ case UniteFunctionsWPUC::SORTBY_RATING:
286
+
287
+ if($showDebug == true)
288
+ dmp("modify post query for orderby:".$orderby);
289
+
290
+ add_filter( 'posts_clauses', array( $this, 'modifyWCQuery' ), 10, 2 );
291
+
292
+ break;
293
+ }
294
+
295
+ }
296
+
297
+
298
+ /**
299
+ * before get posts
300
+ */
301
+ public function modifyWCQuery($arrClauses){
302
+
303
+
304
+ if(empty(GlobalsProviderUC::$lastQueryArgs))
305
+ return($arrClauses);
306
+
307
+ $args = GlobalsProviderUC::$lastQueryArgs;
308
+
309
+ $postType = UniteFunctionsUC::getVal($args, "post_type");
310
+
311
+ if($postType != "product")
312
+ return($arrClauses);
313
+
314
+ $orderBY = UniteFunctionsUC::getVal($args, "orderby");
315
+ $dir = UniteFunctionsUC::getVal($args, "order", "DESC");
316
+
317
+ if(empty($orderBY))
318
+ return($arrClauses);
319
+
320
+ //add code filter by orderby
321
+
322
+ if(class_exists("WC_Query") == false)
323
+ return($arrClauses);
324
+
325
+ $objQuery = new WC_Query();
326
+
327
+ switch($orderBY){
328
+ case "price":
329
+ /*
330
+ if($dir == "DESC")
331
+ $arrClauses = $objQuery->order_by_price_desc_post_clauses($arrClauses);
332
+ else
333
+ $arrClauses = $objQuery->order_by_price_asc_post_clauses($arrClauses);
334
+ */
335
+ break;
336
+ case 'sales':
337
+ $arrClauses = $objQuery->order_by_popularity_post_clauses($arrClauses);
338
+ break;
339
+ case 'rating':
340
+ $arrClauses = $objQuery->order_by_rating_post_clauses($arrClauses);
341
+ break;
342
+ }
343
+
344
+ remove_filter( 'posts_clauses', array( $this, 'modifyWCQuery' ), 10, 2 );
345
+
346
+ return($arrClauses);
347
+ }
348
+
349
+
350
+
351
  protected function z_______________POSTS____________(){}
352
+
353
+ /**
354
+ * show meta debug if needed
355
+ */
356
+ private function showPostsDebyMeta($arrPosts, $value, $name){
357
+
358
+ if(empty($arrPosts))
359
+ return(false);
360
+
361
+ $isDebug = UniteFunctionsUC::getVal($value, $name."_includeby_meta_debug");
362
+ $isDebug = UniteFunctionsUC::strToBool($isDebug);
363
+
364
+ if($isDebug == false)
365
+ return(false);
366
+
367
+ foreach ($arrPosts as $post){
368
+ $postID = $post->ID;
369
+ HelperUC::$operations->putPostCustomFieldsDebug($postID);
370
+ }
371
+
372
+ }
373
+
374
+
375
  /**
376
  * get post ids from post meta
377
  */
923
  $filters["meta_key"] = UniteFunctionsUC::getVal($value, "{$name}_orderby_meta_key1");
924
  }
925
 
 
926
  return($filters);
927
  }
928
 
1094
  $isFilterable = $isAjax && ($isAjaxSetUrl != "ajax");
1095
 
1096
  $isRelatedPosts = $source == "related";
1097
+ $relatePostsType = "";
1098
+
1099
  if(is_single() == false)
1100
  $isRelatedPosts = false;
1101
 
1102
+ if($isForWoo == true && function_exists("is_checkout") && is_checkout() && $source == "related"){
1103
+ $isRelatedPosts = true;
1104
+ $relatePostsType = "checkout";
1105
+ }
1106
+
1107
+
1108
  $arrMetaQuery = array();
1109
 
1110
  $getRelatedProducts = false;
1111
 
 
1112
  //get post type
1113
  $postType = UniteFunctionsUC::getVal($value, "{$name}_posttype", "post");
1114
  if($isForWoo)
1119
  $post = null;
1120
 
1121
  if($isRelatedPosts == true){
1122
+
1123
  $post = get_post();
1124
  $postType = $post->post_type;
1125
 
1126
  $filters["posttype"] = $postType; //rewrite the post type argument
1127
 
1128
+ if($postType == "product" || $relatePostsType == "checkout"){
1129
 
1130
  $getRelatedProducts = true;
1131
  $productID = $post->ID;
1132
+
1133
+ if($relatePostsType == "checkout");
1134
+ $filters["posttype"] = "product"; //rewrite the post type argument
1135
 
1136
+
1137
  }else{
1138
 
1139
  if($showDebugQuery == true){
1309
  $filters["limit"] = $limit;
1310
 
1311
  $filters = $this->getPostListData_addOrderBy($filters, $value, $name);
 
1312
 
1313
  //add debug for further use
1314
  HelperUC::addDebug("Post Filters", $filters);
1315
 
1316
  //run custom query if available
1317
  $args = UniteFunctionsWPUC::getPostsArgs($filters);
1318
+
1319
  //exclude by authors
1320
 
1321
  if($excludeByAuthors == true){
1545
  $metaValue3 = UniteFunctionsUC::getVal($value, "{$name}_includeby_metavalue3");
1546
  $metaValue3 = $this->modifyMetaValueForCompare($metaValue3);
1547
 
1548
+ //second key
1549
+
1550
+ $metaKeySecond = UniteFunctionsUC::getVal($value, "{$name}_includeby_second_metakey");
1551
+ $metaCompareSecond = UniteFunctionsUC::getVal($value, "{$name}_includeby_second_metacompare");
1552
+
1553
+ $metaValueSecond = UniteFunctionsUC::getVal($value, "{$name}_includeby_second_metavalue");
1554
+ $metaValueSecond = $this->modifyMetaValueForCompare($metaValueSecond);
1555
+
1556
+ $metaRelation = UniteFunctionsUC::getVal($value, "{$name}_includeby_meta_relation");
1557
+
1558
+
1559
+ $arrMetaSubQuery = array();
1560
+ $arrMetaSubQuery2 = array();
1561
 
1562
  if(!empty($metaKey)){
1563
 
1564
+ $arrMetaSubQuery[] = array(
1565
  'key' => $metaKey,
1566
  'value' => $metaValue,
1567
  'compare'=>$metaCompare
1570
 
1571
  if(!empty($metaValue2)){
1572
 
1573
+ $arrMetaSubQuery[] = array(
1574
  'key' => $metaKey,
1575
  'value' => $metaValue2,
1576
  'compare'=>$metaCompare
1577
  );
1578
 
1579
+ $arrMetaSubQuery["relation"] = "OR";
1580
  }
1581
 
1582
  if(!empty($metaValue3)){
1583
 
1584
+ $arrMetaSubQuery[] = array(
1585
  'key' => $metaKey,
1586
  'value' => $metaValue3,
1587
  'compare'=>$metaCompare
1588
  );
1589
 
1590
+ $arrMetaSubQuery["relation"] = "OR";
1591
  }
1592
 
1593
+ }
1594
+
1595
+
1596
+ if(!empty($metaKeySecond)){
1597
+
1598
+ $arrMetaSubQuery2[] = array(
1599
+ 'key' => $metaKeySecond,
1600
+ 'value' => $metaValueSecond,
1601
+ 'compare'=>$metaCompareSecond
1602
+ );
1603
+
1604
+ }
1605
+
1606
+
1607
+ if(!empty($arrMetaSubQuery) && !empty($arrMetaSubQuery2)){
1608
+
1609
+ if(count($arrMetaSubQuery) == 1){ //both single
1610
+
1611
+ $arrMetaSubQuery[] = $arrMetaSubQuery2[0];
1612
+ $arrMetaSubQuery["relation"] = $metaRelation;
1613
+
1614
+ $arrMetaQuery[] = $arrMetaSubQuery;
1615
+
1616
+ }else{ //both - first multiple
1617
+ $arrMetaQuery[] = array(
1618
+ $arrMetaSubQuery,
1619
+ $arrMetaSubQuery2,
1620
+ "relation"=>$metaRelation);
1621
+
1622
+ }
1623
 
1624
+ }else{
1625
+
1626
+ if(!empty($arrMetaSubQuery))
1627
+ $arrMetaQuery[] = $arrMetaSubQuery;
1628
+
1629
+ if(!empty($arrMetaSubQuery2))
1630
+ $arrMetaQuery[] = $arrMetaSubQuery2;
1631
  }
1632
+
1633
 
1634
  break;
1635
  case "most_viewed":
1748
  //------ get woo related products ------
1749
 
1750
  if($getRelatedProducts == true){
1751
+
1752
  if($showDebugQuery == true){
1753
 
1754
  $debugText = "Debug: Getting up to $limit related products";
1761
  dmp($debugText);
1762
  }
1763
 
1764
+ if(is_checkout() == true){
1765
+
1766
+ $objWoo = new UniteCreatorWooIntegrate();
1767
+ $arrRelatedProductIDs = $objWoo->getRelatedProductsFromCart($limit, $arrPostsNotIn);
1768
+
1769
+
1770
+ }else{
1771
+
1772
+ $arrRelatedProductIDs = wc_get_related_products($productID, $limit, $arrPostsNotIn);
1773
+ }
1774
  if(empty($arrRelatedProductIDs))
1775
  $arrRelatedProductIDs = array("0");
1776
+
1777
+
1778
  $args["post__in"] = $arrRelatedProductIDs;
1779
  }
1780
 
1829
  $objFiltersProcess = new UniteCreatorFiltersProcess();
1830
  $args = $objFiltersProcess->processRequestFilters($args, $isFilterable);
1831
 
 
1832
  HelperUC::addDebug("Posts Query", $args);
1833
 
1834
  //-------- show debug query --------------
1839
  dmp("The Query Is:");
1840
  dmp($args);
1841
  }
1842
+
1843
  //remember last args
1844
  GlobalsProviderUC::$lastQueryArgs = $args;
1845
 
1846
+ //check for modify orderby query clauses (for woo)
1847
+ $this->checkModifyQueryClauses($args, $showDebugQuery);
1848
+
1849
+
1850
  //skip run
1851
  if(GlobalsProviderUC::$skipRunPostQueryOnce == true){
1852
  GlobalsProviderUC::$skipRunPostQueryOnce = false;
1854
  }
1855
 
1856
  $query = new WP_Query($args);
1857
+
1858
+
1859
  if($showDebugQuery == true && $debugType == "show_query"){
1860
+
1861
  $originalQueryVars = $query->query_vars;
1862
  $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
1863
 
1871
 
1872
  }
1873
 
 
1874
  /*
1875
  dmp($query->request);
1876
  dmp("the query");
1909
  echo "</div>";
1910
  }
1911
 
1912
+ //show debug meta if needed
1913
+ $this->showPostsDebyMeta($arrPosts, $value, $name);
1914
+
1915
 
1916
  return($arrPosts);
1917
  }
2152
  $dynamicIDs = UniteFunctionsUC::getVal($value, $name."_manual_post_ids_dynamic");
2153
 
2154
  $arrDynamicIDs = UniteFunctionsUC::getIDsArray($dynamicIDs);
2155
+
2156
  if(!empty($arrDynamicIDs))
2157
  $postIDs = array_merge($postIDs, $arrDynamicIDs);
2158
 
2159
+ $postsPerPage = count($postIDs);
2160
+
2161
+ if($postsPerPage < 1000)
2162
+ $postsPerPage = 1000;
2163
 
2164
  $showDebugQuery = UniteFunctionsUC::getVal($value, "{$name}_show_query_debug");
2165
  $showDebugQuery = UniteFunctionsUC::strToBool($showDebugQuery);
2166
 
2167
+ $debugType = UniteFunctionsUC::getVal($value, "{$name}_query_debug_type");
2168
+
2169
+
2170
  if(empty($postIDs)){
2171
 
2172
  if($showDebugQuery == true){
2181
  $args["post__in"] = $postIDs;
2182
  $args["ignore_sticky_posts"] = true;
2183
  $args["post_type"] = "any";
2184
+ $args["posts_per_page"] = $postsPerPage;
2185
+
2186
  $args["post_status"] = "publish, private";
2187
 
2188
  $args = $this->getPostListData_addOrderBy($args, $value, $name, true);
2195
  GlobalsProviderUC::$lastQueryArgs = $args;
2196
 
2197
  $query = new WP_Query($args);
2198
+
2199
+ if($showDebugQuery == true && $debugType == "show_query"){
2200
+
2201
+ $originalQueryVars = $query->query_vars;
2202
+ $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
2203
+
2204
+ dmp("The Query Request Is:");
2205
+ dmp($query->request);
2206
+
2207
+ dmp("The finals query vars:");
2208
+ dmp($originalQueryVars);
2209
+
2210
+ $this->showPostsDebugCallbacks(false);
2211
+
2212
+ }
2213
+
2214
+
2215
  $arrPosts = $query->posts;
2216
 
2217
  if(empty($arrPosts))
2239
  * get post list data
2240
  */
2241
  private function getPostListData($value, $name, $processType, $param, $data){
2242
+
2243
  if($processType != self::PROCESS_TYPE_OUTPUT && $processType != self::PROCESS_TYPE_OUTPUT_BACK)
2244
  return($data);
2245
 
2247
  HelperUC::addDebug("getPostList param", $param);
2248
 
2249
  $source = UniteFunctionsUC::getVal($value, "{$name}_source");
2250
+
2251
  $arrPosts = array();
2252
 
2253
  switch($source){
2299
  $imageSize = UniteFunctionsUC::getVal($value, "{$name}_imagesize","medium_large");
2300
  $arrImageSizes["desktop"] = $imageSize;
2301
  }
 
 
 
2302
 
2303
  //prepare listing output. no items prepare for the listing
2304
 
2305
  $useForListing = UniteFunctionsUC::getVal($param, "use_for_listing");
2306
  $useForListing = UniteFunctionsUC::strToBool($useForListing);
2307
 
2308
+ $objFilters = new UniteCreatorFiltersProcess();
2309
+
2310
  if($useForListing == true){
2311
+
2312
  $nameListing = UniteFunctionsUC::getVal($param, "name_listing");
2313
+
2314
+ //add filterable variables - dynamic
2315
+ $data = $objFilters->addWidgetFilterableVarsFromData($data, $value, $nameListing);
2316
 
2317
  $data[$nameListing."_items"] = $arrPosts;
2318
  return($data);
2319
+ }else{
2320
+
2321
+ //filters additions - regular
2322
+
2323
+ $data = $objFilters->addWidgetFilterableVariables($data, $this->addon);
2324
+
2325
  }
2326
 
2327
  $arrData = array();
2492
  return($item);
2493
  }
2494
 
2495
+
2496
+ /**
2497
+ * check add post gallery video
2498
+ */
2499
+ private function checkAddPostVideo($item, $arrParams, $post){
2500
+
2501
+ $enableVideo = UniteFunctionsUC::getVal($arrParams, "enable_video");
2502
+
2503
+ $enableVideo = UniteFunctionsUC::strToBool($enableVideo);
2504
+
2505
+ if($enableVideo == false)
2506
+ return($item);
2507
+
2508
+ $metaItemType = UniteFunctionsUC::getVal($arrParams, "meta_itemtype");
2509
+ $metaVideoID = UniteFunctionsUC::getVal($arrParams, "meta_videoid");
2510
+
2511
+ if(empty($metaItemType))
2512
+ return($item);
2513
+
2514
+ if(empty($metaVideoID))
2515
+ return($item);
2516
+
2517
+ $postID = $post->ID;
2518
+
2519
+ $arrMeta = UniteFunctionsWPUC::getPostMeta($postID);
2520
+
2521
+ $itemType = UniteFunctionsUC::getVal($arrMeta, $metaItemType);
2522
+ $videoID = UniteFunctionsUC::getVal($arrMeta, $metaVideoID);
2523
+
2524
+ if(empty($videoID))
2525
+ return($item);
2526
+
2527
+ if(empty($itemType))
2528
+ return($item);
2529
+
2530
+ switch($itemType){
2531
+ case "youtube":
2532
+ case "vimeo":
2533
+
2534
+ $item["type"] = $itemType;
2535
+ $item["videoid"] = $videoID;
2536
+
2537
+ break;
2538
+ default:
2539
+ return($item);
2540
+ break;
2541
+ }
2542
+
2543
+ return($item);
2544
+ }
2545
+
2546
  /**
2547
  * get gallery item
2548
  */
2646
 
2647
  $title = $this->getGalleryItem_title($titleSource, $data, $name, $post, $sourceItem);
2648
  $description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post, $sourceItem);
2649
+
2650
  //demo item text
2651
  if($isByUrl == true && count($data) == 1){
2652
+
2653
  if(empty($title))
2654
  $title = "Demo Item {$index} Title";
2655
 
2668
 
2669
  $item["imageid"] = $id;
2670
 
2671
+ $item = $this->checkAddPostVideo($item, $arrParams, $post);
2672
+
2673
  return($item);
2674
  }
2675
 
2685
  $thumbSize = UniteFunctionsUC::getVal($value, $name."_thumb_size");
2686
  $imageSize = UniteFunctionsUC::getVal($value, $name."_image_size");
2687
 
2688
+ //for instagram
2689
  $isEnableVideo = UniteFunctionsUC::getVal($param, "gallery_enable_video");
2690
  $isEnableVideo = UniteFunctionsUC::strToBool($isEnableVideo);
2691
 
2692
+ //for posts
2693
+
2694
+
2695
+
2696
  $arrFilters = array();
2697
  if(!empty($thumbSize))
2698
  $arrFilters[] = $thumbSize;
2713
 
2714
  switch($source){
2715
  case "posts":
2716
+
2717
  $titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_post");
2718
  $descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_post");
2719
+
2720
+ $enableVideos = UniteFunctionsUC::getVal($value, $name."_posts_enable_videos");
2721
+ $enableVideos = UniteFunctionsUC::strToBool($enableVideos);
2722
+
2723
+ if($enableVideos == true){
2724
+
2725
+ $metaItemType = UniteFunctionsUC::getVal($value, $name."_meta_itemtype");
2726
+ $metaVideoID = UniteFunctionsUC::getVal($value, $name."_meta_videoid");
2727
+
2728
+ $params["enable_video"] = true;
2729
+ $params["meta_itemtype"] = $metaItemType;
2730
+ $params["meta_videoid"] = $metaVideoID;
2731
+ }
2732
+
2733
  break;
2734
  case "gallery":
2735
  $titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_gallery");
2759
  $content = $item->post_content;
2760
 
2761
  $featuredImageID = $this->getPostFeaturedImageID($postID, $content, $item->post_type);
2762
+
2763
  $params["post"] = $item;
2764
+
2765
  $galleryItem = $this->getGalleryItem($featuredImageID,null,$params);
2766
 
2767
  $galleryItem["postid"] = $postID;
2891
  return($arrIDs);
2892
  }
2893
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2894
 
2895
 
2896
  /**
2917
 
2918
  $arrOutput["attributes"] = "";
2919
  $arrOutput["class"] = "";
2920
+ $arrOutput["click_event"] = "click";
2921
 
2922
  $data[$name] = $arrOutput;
2923
 
3087
  * get listing data
3088
  */
3089
  private function getListingData($value, $name, $processType, $param, $data){
3090
+
3091
  if($processType != self::PROCESS_TYPE_OUTPUT && $processType != self::PROCESS_TYPE_OUTPUT_BACK)
3092
  return($data);
3093
+
3094
  $useFor = UniteFunctionsUC::getVal($param, "use_for");
3095
 
3096
  switch($useFor){
3108
 
3109
  $isForGallery = ($useFor == "gallery");
3110
 
3111
+ $source = UniteFunctionsUC::getVal($value, $name."_source", "posts");
3112
 
3113
  if(empty($source) && $isForGallery == true)
3114
  $source = "gallery";
3151
 
3152
  break;
3153
  case "gallery":
 
 
3154
 
3155
+ $arrGalleryItems = UniteFunctionsUC::getVal($value, $name."_gallery");
 
 
3156
 
3157
  $data[$name."_items"] = $arrGalleryItems;
3158
 
3580
  if(empty($metaKey))
3581
  $orderBy = null;
3582
  }
3583
+
3584
+ //set the default
3585
+ if($orderBy == "default"){
3586
+ $orderBy = "name";
3587
+ if(!empty($arrIncludeTermIDs))
3588
+ $orderBy = "include";
3589
+ }
3590
+
3591
 
3592
  if(!empty($orderBy)){
3593
 
3602
  $args["order"] = $orderDir;
3603
  }
3604
 
3605
+
3606
  }
3607
 
3608
  //exclude
3616
  }
3617
 
3618
  //include specific
3619
+ if(!empty($arrIncludeTermIDs)){
3620
  $args["include"] = $arrIncludeTermIDs;
3621
+ }
3622
 
3623
  if(!empty($includeParentID)){
3624
 
3848
  /**
3849
  * get menu output
3850
  */
3851
+ protected function getWPMenuData($data, $value, $name, $param, $processType){
3852
+
3853
  $menuID = UniteFunctionsUC::getVal($value, $name."_id");
3854
 
3855
  //get first menu
3856
  if(empty($menuID)){
3857
+
3858
  $htmlMenu = __("menu not selected","unlimited-elements-for-elementor");
3859
+ $data[$name] = $htmlMenu;
3860
+
3861
+ return($data);
3862
  }
3863
 
3864
  $depth = UniteFunctionsUC::getVal($value, $name."_depth");
3893
 
3894
  $htmlMenu = wp_nav_menu($args);
3895
 
3896
+ $data[$name."_id"] = $menuID;
3897
+ $data[$name] = $htmlMenu;
3898
+
3899
+ return($data);
3900
  }
3901
 
3902
 
provider/provider_settings.class.php CHANGED
@@ -381,7 +381,6 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
381
  $isForWooCommerce = UniteFunctionsUC::strToBool($isForWooCommerce);
382
 
383
  $filterType = UniteFunctionsUC::getVal($extra, "filter_type");
384
-
385
 
386
  $arrPostTypesWithTax = UniteFunctionsWPUC::getPostTypesWithTaxomonies(GlobalsProviderUC::$arrFilterPostTypes, false);
387
 
@@ -432,7 +431,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
432
  $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
433
 
434
  $arrTax = UniteFunctionsUC::getVal($arrPostTypesTaxonomies, $postType, array());
435
-
436
  if(!empty($arrTax))
437
  $arrTax = array_flip($arrTax);
438
 
@@ -621,7 +620,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
621
 
622
  $arrOrderBy = array_flip($arrOrderBy);
623
 
624
- $orderBy = UniteFunctionsUC::getVal($value, $name."_orderby", "name");
625
 
626
  $params = array();
627
  $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
@@ -1154,7 +1153,14 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1154
  $params["origtype"] = UniteCreatorDialogParam::PARAM_STATIC_TEXT;
1155
  $params["elementor_condition"] = $arrRelatedOnlyCondition;
1156
 
1157
- $this->addStaticText("The related posts are being used in single post. Posts from same post type and terms", $name."_relatedtext", $params);
 
 
 
 
 
 
 
1158
  }
1159
 
1160
  //----- post type -----
@@ -1188,27 +1194,6 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1188
 
1189
  //----- hr -------
1190
 
1191
-
1192
- //------- Show Advanced Query --------
1193
- /*
1194
- $params = array();
1195
- $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1196
-
1197
- $this->addRadioBoolean($name."_show_advanced", __("Show Advanced / Dynamic Settings", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1198
-
1199
- $params = array();
1200
- $params["origtype"] = "custom_controls";
1201
- $params["function"] = array($this, "postSelection_addTaxQuery");
1202
-
1203
- $params = array();
1204
- $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
1205
-
1206
- $this->addHr("hr_after_advanced",$params);
1207
-
1208
-
1209
- */
1210
-
1211
- //----- hr -------
1212
 
1213
  $params = array();
1214
  $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
@@ -1248,7 +1233,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1248
  }
1249
 
1250
  $addPostsText = sprintf(__("Add Specific %s", "unlimited-elements-for-elementor"), $textPosts);
1251
-
1252
  $includeBy = UniteFunctionsUC::getVal($value, $name."_includeby");
1253
 
1254
  $arrIncludeBy = array_flip($arrIncludeBy);
@@ -1261,7 +1246,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1261
  $params["elementor_condition"] = $arrConditionIncludeBy;
1262
 
1263
  $this->addMultiSelect($name."_includeby", $arrIncludeBy, esc_html__("Include By", "unlimited-elements-for-elementor"), $includeBy, $params);
1264
-
1265
  //--- add hr after include by----
1266
 
1267
  $params = array();
@@ -1288,7 +1273,6 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1288
 
1289
  $arrAuthors = array_flip($arrAuthors);
1290
 
1291
-
1292
  $this->addMultiSelect($name."_includeby_authors", $arrAuthors, __("Include By Author", "unlimited-elements-for-elementor"), "", $params);
1293
 
1294
  //---- Include By Date -----
@@ -1405,6 +1389,69 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1405
 
1406
  $this->addTextBox($name."_includeby_metavalue3", "", esc_html__("Include by Meta Value 3", "unlimited-elements-for-elementor"), $params);
1407
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1408
 
1409
  // --------- include by PHP Function -------------
1410
 
@@ -1567,7 +1614,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1567
  $this->addSelect($name."_category_relation", $arrRelationItems, __("Include By Terms Relation", "unlimited-elements-for-elementor"), $relation, $params);
1568
 
1569
  //--------- show children -------------
1570
-
1571
  $params = array();
1572
  $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1573
 
@@ -1839,11 +1886,11 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1839
  if($isPro == true){
1840
 
1841
  $title = __("Query ID", "unlimited-elements-for-elementor");
1842
- $params["description"] = __("Give your Query unique ID to been able to filter it in server side using add_filter() function","unlimited-elements-for-elementor");
1843
 
1844
  }else{ //free version
1845
 
1846
- $params["description"] = __("Give your Query unique ID to been able to filter it in server side using add_filter() function. This feature exists in a PRO Version only","unlimited-elements-for-elementor");
1847
  $title = __("Query ID (pro)", "unlimited-elements-for-elementor");
1848
  $params["disabled"] = true;
1849
  }
@@ -1877,188 +1924,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1877
 
1878
  }
1879
 
1880
-
1881
- private function __________DYNAMIC_______(){}
1882
-
1883
- /**
1884
- * get gallery title title source options
1885
- */
1886
- protected function getGalleryTitleSourceOptions($isDescription = false, $hasPosts = false){
1887
-
1888
- if($isDescription == false){
1889
-
1890
- $arrTitleOptions = array();
1891
-
1892
- if($hasPosts){
1893
- $arrTitleOptions["post_title"] = __("Post Title", "unlimited-elements-for-elementor");
1894
- $arrTitleOptions["post_excerpt"]= __("Post Excerpt", "unlimited-elements-for-elementor");
1895
- }
1896
-
1897
- $arrTitleOptions["image_auto"] = __("Image Auto (title or alt or caption)", "unlimited-elements-for-elementor");
1898
- $arrTitleOptions["image_title"] = __("Image Title", "unlimited-elements-for-elementor");
1899
- $arrTitleOptions["image_alt"] = __("Image Alt", "unlimited-elements-for-elementor");
1900
- $arrTitleOptions["image_caption"] = __("Image Caption", "unlimited-elements-for-elementor");
1901
-
1902
- $arrTitleOptions = array_flip($arrTitleOptions);
1903
-
1904
- return($arrTitleOptions);
1905
- }
1906
-
1907
- //description
1908
-
1909
- $arrDescOptions = array();
1910
-
1911
- if($hasPosts == true){
1912
- $arrDescOptions["post_excerpt"]= __("Post Excerpt", "unlimited-elements-for-elementor");
1913
- $arrDescOptions["post_title"] = __("Post Title", "unlimited-elements-for-elementor");
1914
- $arrDescOptions["post_content"] = __("Post Content", "unlimited-elements-for-elementor");
1915
- }
1916
-
1917
- $arrDescOptions["image_description"] = __("Image Description", "unlimited-elements-for-elementor");
1918
- $arrDescOptions["image_title"] = __("Image Title", "unlimited-elements-for-elementor");
1919
- $arrDescOptions["image_alt"] = __("Image Alt", "unlimited-elements-for-elementor");
1920
- $arrDescOptions["image_caption"] = __("Image Caption", "unlimited-elements-for-elementor");
1921
-
1922
- $arrDescOptions = array_flip($arrDescOptions);
1923
-
1924
- return($arrDescOptions);
1925
- }
1926
-
1927
-
1928
- /**
1929
- * add gallery field
1930
- */
1931
- protected function addListingPicker_gallery($name,$value,$title,$param){
1932
-
1933
- //---- gallery option
1934
-
1935
- $conditionGallery = array($name."_source" => "gallery");
1936
-
1937
- $params = array();
1938
- $params["origtype"] = UniteCreatorDialogParam::PARAM_GALLERY;
1939
- $params["elementor_condition"] = $conditionGallery;
1940
-
1941
- $this->addTextBox($name."_gallery", "", __("Choose Images","unlimited-elements-for-elementor"), $params);
1942
-
1943
- //============
1944
-
1945
- $conditionPost = array($name."_source" => "posts");
1946
-
1947
- $params = array();
1948
- $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
1949
- $params["elementor_condition"] = $conditionPost;
1950
-
1951
- $this->addHr($name."_hr_before_title_sources_post",$params);
1952
-
1953
-
1954
- //---- posts options - title source
1955
-
1956
- $arrTitleOptions = $this->getGalleryTitleSourceOptions(false, true);
1957
-
1958
- $params = array();
1959
- $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
1960
- $params["label_block"] = true;
1961
- $params["elementor_condition"] = $conditionPost;
1962
-
1963
- $this->addSelect($name."_title_source_post", $arrTitleOptions, __("Image Title Source", "unlimited-elements-for-elementor"), "post_title", $params);
1964
-
1965
- //---- posts options - description source
1966
-
1967
- $arrDescOptions = $this->getGalleryTitleSourceOptions(true, true);
1968
-
1969
- $params = array();
1970
- $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
1971
- $params["label_block"] = true;
1972
- $params["elementor_condition"] = $conditionPost;
1973
-
1974
- $this->addSelect($name."_description_source_post", $arrDescOptions, __("Image Description Source", "unlimited-elements-for-elementor"), "post_excerpt", $params);
1975
-
1976
- //---- current post meta
1977
-
1978
- $conditionCurrentMeta = array($name."_source" => "current_post_meta");
1979
-
1980
- $params = array();
1981
- $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
1982
- $params["elementor_condition"] = $conditionCurrentMeta;
1983
-
1984
- $this->addTextBox($name."_current_metakey", "", __("Meta Key","unlimited-elements-for-elementor"), $params);
1985
-
1986
- //---- current post meta - DEBUG
1987
-
1988
- $params = array();
1989
- $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1990
- $params["description"] = __("Show the current post meta fields, turn off it after choose the right one", "unlimited-elements-for-elementor");
1991
- $params["elementor_condition"] = $conditionCurrentMeta;
1992
-
1993
- $this->addRadioBoolean($name."_show_metafields", __("Debug - Show Meta Fields", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1994
-
1995
- //=========== GALLERY TITLE AND DESCRIPTION SOURCE =================
1996
-
1997
- //---- hr before title source
1998
-
1999
- $conditionTitleSource = array($name."_source" => array("gallery", "current_post_meta"));
2000
-
2001
- $params = array();
2002
- $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
2003
- $params["elementor_condition"] = $conditionTitleSource;
2004
-
2005
- $this->addHr($name."_hr_before_title_sources",$params);
2006
-
2007
-
2008
- //---- gallery title source
2009
-
2010
- $arrTitleOptions = $this->getGalleryTitleSourceOptions(false, false);
2011
-
2012
- $params = array();
2013
- $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2014
- $params["label_block"] = true;
2015
- $params["elementor_condition"] = $conditionTitleSource;
2016
-
2017
- $this->addSelect($name."_title_source_gallery", $arrTitleOptions, __("Image Title Source", "unlimited-elements-for-elementor"), "image_auto", $params);
2018
-
2019
-
2020
- //---- gallery description source
2021
-
2022
- $arrDescOptions = $this->getGalleryTitleSourceOptions(true, false);
2023
-
2024
- $params = array();
2025
- $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2026
- $params["label_block"] = true;
2027
- $params["elementor_condition"] = $conditionTitleSource;
2028
-
2029
- $this->addSelect($name."_description_source_gallery", $arrDescOptions, __("Image Description Source", "unlimited-elements-for-elementor"), "image_description", $params);
2030
-
2031
- //----- hr before image size
2032
- $params = array();
2033
- $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
2034
-
2035
- $this->addHr($name."_hr_before_imagesize",$params);
2036
-
2037
- //----- thumb image size
2038
-
2039
- $arrSizes = UniteFunctionsWPUC::getArrThumbSizes();
2040
-
2041
- $params = array();
2042
- $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2043
- $params["label_block"] = true;
2044
-
2045
- $arrSizes = array_flip($arrSizes);
2046
- $this->addSelect($name."_thumb_size", $arrSizes, __("Thumb Image Size", "unlimited-elements-for-elementor"), "medium_large", $params);
2047
-
2048
-
2049
- //----- big image size
2050
-
2051
- $arrSizes = UniteFunctionsWPUC::getArrThumbSizes();
2052
-
2053
- $params = array();
2054
- $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2055
- $params["label_block"] = true;
2056
-
2057
- $arrSizes = array_flip($arrSizes);
2058
- $this->addSelect($name."_image_size", $arrSizes, __("Big Image Size", "unlimited-elements-for-elementor"), "large", $params);
2059
-
2060
- }
2061
-
2062
 
2063
  /**
2064
  * add remote parent settings
@@ -2264,6 +2130,244 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
2264
  }
2265
 
2266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2267
  /**
2268
  * add listing picker, function for override
2269
  */
381
  $isForWooCommerce = UniteFunctionsUC::strToBool($isForWooCommerce);
382
 
383
  $filterType = UniteFunctionsUC::getVal($extra, "filter_type");
 
384
 
385
  $arrPostTypesWithTax = UniteFunctionsWPUC::getPostTypesWithTaxomonies(GlobalsProviderUC::$arrFilterPostTypes, false);
386
 
431
  $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
432
 
433
  $arrTax = UniteFunctionsUC::getVal($arrPostTypesTaxonomies, $postType, array());
434
+
435
  if(!empty($arrTax))
436
  $arrTax = array_flip($arrTax);
437
 
620
 
621
  $arrOrderBy = array_flip($arrOrderBy);
622
 
623
+ $orderBy = UniteFunctionsUC::getVal($value, $name."_orderby", "default");
624
 
625
  $params = array();
626
  $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
1153
  $params["origtype"] = UniteCreatorDialogParam::PARAM_STATIC_TEXT;
1154
  $params["elementor_condition"] = $arrRelatedOnlyCondition;
1155
 
1156
+ $addition1 = "";
1157
+ if($isForWooProducts)
1158
+ $addition1 .= " or checkout page";
1159
+
1160
+ $staticText = "The ".strtolower("related {$textPosts} are being used in single {$textPost} $addition1. Posts from same post type and terms");
1161
+
1162
+ $this->addStaticText($staticText, $name."_relatedtext", $params);
1163
+
1164
  }
1165
 
1166
  //----- post type -----
1194
 
1195
  //----- hr -------
1196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1197
 
1198
  $params = array();
1199
  $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
1233
  }
1234
 
1235
  $addPostsText = sprintf(__("Add Specific %s", "unlimited-elements-for-elementor"), $textPosts);
1236
+
1237
  $includeBy = UniteFunctionsUC::getVal($value, $name."_includeby");
1238
 
1239
  $arrIncludeBy = array_flip($arrIncludeBy);
1246
  $params["elementor_condition"] = $arrConditionIncludeBy;
1247
 
1248
  $this->addMultiSelect($name."_includeby", $arrIncludeBy, esc_html__("Include By", "unlimited-elements-for-elementor"), $includeBy, $params);
1249
+
1250
  //--- add hr after include by----
1251
 
1252
  $params = array();
1273
 
1274
  $arrAuthors = array_flip($arrAuthors);
1275
 
 
1276
  $this->addMultiSelect($name."_includeby_authors", $arrAuthors, __("Include By Author", "unlimited-elements-for-elementor"), "", $params);
1277
 
1278
  //---- Include By Date -----
1389
 
1390
  $this->addTextBox($name."_includeby_metavalue3", "", esc_html__("Include by Meta Value 3", "unlimited-elements-for-elementor"), $params);
1391
 
1392
+ // --------- show another meta key -------------
1393
+
1394
+ $params = array();
1395
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1396
+
1397
+ $params["elementor_condition"] = $arrConditionIncludeMeta;
1398
+
1399
+ $this->addRadioBoolean($name."_includeby_meta_addsecond", __("Add Second Meta Key", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1400
+
1401
+ // --------- include by SECOND meta key -------------
1402
+
1403
+ $params = array();
1404
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
1405
+ $params["placeholder"] = __("Second Meta Key","unlimited-elements-for-elementor");
1406
+
1407
+ $arrConditionMetaSecond = $arrConditionIncludeMeta;
1408
+ $arrConditionMetaSecond[$name."_includeby_meta_addsecond"] = "true";
1409
+
1410
+ $params["elementor_condition"] = $arrConditionMetaSecond;
1411
+
1412
+ $this->addTextBox($name."_includeby_second_metakey", "", esc_html__("Include by Second Meta Key", "unlimited-elements-for-elementor"), $params);
1413
+
1414
+ // --------- include by SECOND meta compare -------------
1415
+
1416
+ $params = array();
1417
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
1418
+ $params["elementor_condition"] = $arrConditionMetaSecond;
1419
+
1420
+ $this->addSelect($name."_includeby_second_metacompare", $arrItems, esc_html__("Include by Second Meta Compare", "unlimited-elements-for-elementor"), "=", $params);
1421
+
1422
+ // --------- include by SECOND meta value -------------
1423
+
1424
+ $params = array();
1425
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
1426
+ $params["placeholder"] = __("Second Meta Value","unlimited-elements-for-elementor");
1427
+ $params["add_dynamic"] = true;
1428
+ $params["description"] = "";
1429
+
1430
+ $params["elementor_condition"] = $arrConditionMetaSecond;
1431
+
1432
+ $this->addTextBox($name."_includeby_second_metavalue", "", esc_html__("Include by Second Meta Value", "unlimited-elements-for-elementor"), $params);
1433
+
1434
+ // --------- Meta Fields Relation -------------
1435
+
1436
+ $params = array();
1437
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
1438
+ $params["elementor_condition"] = $arrConditionMetaSecond;
1439
+
1440
+ $arrRelations = array();
1441
+ $arrRelations["AND"] = "AND";
1442
+ $arrRelations["OR"] = "OR";
1443
+
1444
+ $this->addSelect($name."_includeby_meta_relation", $arrRelations, esc_html__("Meta Fields Relation", "unlimited-elements-for-elementor"), "and", $params);
1445
+
1446
+ // --------- debug post meta -------------
1447
+
1448
+ $params = array();
1449
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1450
+
1451
+ $params["elementor_condition"] = $arrConditionIncludeMeta;
1452
+
1453
+ $this->addRadioBoolean($name."_includeby_meta_debug", __("Show Post Meta Fields for Debug", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
1454
+
1455
 
1456
  // --------- include by PHP Function -------------
1457
 
1614
  $this->addSelect($name."_category_relation", $arrRelationItems, __("Include By Terms Relation", "unlimited-elements-for-elementor"), $relation, $params);
1615
 
1616
  //--------- show children -------------
1617
+
1618
  $params = array();
1619
  $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
1620
 
1886
  if($isPro == true){
1887
 
1888
  $title = __("Query ID", "unlimited-elements-for-elementor");
1889
+ $params["description"] = __("Give your Query unique ID to been able to filter it in server side using add_filter() function. <a href='https://unlimited-elements.com/docs/work-with-query-id-in-posts-selection/'><a target='blank' href='https://unlimited-elements.com/docs/work-with-query-id-in-posts-selection/'>See docs here</a></a>.","unlimited-elements-for-elementor");
1890
 
1891
  }else{ //free version
1892
 
1893
+ $params["description"] = __("Give your Query unique ID to been able to filter it in server side using add_filter() function. This feature exists in a PRO Version only. <a target='blank' href='https://unlimited-elements.com/docs/work-with-query-id-in-posts-selection/'>help</a>","unlimited-elements-for-elementor");
1894
  $title = __("Query ID (pro)", "unlimited-elements-for-elementor");
1895
  $params["disabled"] = true;
1896
  }
1924
 
1925
  }
1926
 
1927
+ private function __________REMOTE_______(){}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1928
 
1929
  /**
1930
  * add remote parent settings
2130
  }
2131
 
2132
 
2133
+ private function __________DYNAMIC_______(){}
2134
+
2135
+ /**
2136
+ * get gallery title title source options
2137
+ */
2138
+ protected function getGalleryTitleSourceOptions($isDescription = false, $hasPosts = false){
2139
+
2140
+ if($isDescription == false){
2141
+
2142
+ $arrTitleOptions = array();
2143
+
2144
+ if($hasPosts){
2145
+ $arrTitleOptions["post_title"] = __("Post Title", "unlimited-elements-for-elementor");
2146
+ $arrTitleOptions["post_excerpt"]= __("Post Excerpt", "unlimited-elements-for-elementor");
2147
+ }
2148
+
2149
+ $arrTitleOptions["image_auto"] = __("Image Auto (title or alt or caption)", "unlimited-elements-for-elementor");
2150
+ $arrTitleOptions["image_title"] = __("Image Title", "unlimited-elements-for-elementor");
2151
+ $arrTitleOptions["image_alt"] = __("Image Alt", "unlimited-elements-for-elementor");
2152
+ $arrTitleOptions["image_caption"] = __("Image Caption", "unlimited-elements-for-elementor");
2153
+
2154
+ $arrTitleOptions = array_flip($arrTitleOptions);
2155
+
2156
+ return($arrTitleOptions);
2157
+ }
2158
+
2159
+ //description
2160
+
2161
+ $arrDescOptions = array();
2162
+
2163
+ if($hasPosts == true){
2164
+ $arrDescOptions["post_excerpt"]= __("Post Excerpt", "unlimited-elements-for-elementor");
2165
+ $arrDescOptions["post_title"] = __("Post Title", "unlimited-elements-for-elementor");
2166
+ $arrDescOptions["post_content"] = __("Post Content", "unlimited-elements-for-elementor");
2167
+ }
2168
+
2169
+ $arrDescOptions["image_description"] = __("Image Description", "unlimited-elements-for-elementor");
2170
+ $arrDescOptions["image_title"] = __("Image Title", "unlimited-elements-for-elementor");
2171
+ $arrDescOptions["image_alt"] = __("Image Alt", "unlimited-elements-for-elementor");
2172
+ $arrDescOptions["image_caption"] = __("Image Caption", "unlimited-elements-for-elementor");
2173
+
2174
+ $arrDescOptions = array_flip($arrDescOptions);
2175
+
2176
+ return($arrDescOptions);
2177
+ }
2178
+
2179
+
2180
+ /**
2181
+ * add gallery field
2182
+ */
2183
+ protected function addListingPicker_gallery($name,$value,$title,$param){
2184
+
2185
+ //---- gallery option
2186
+
2187
+ $conditionGallery = array($name."_source" => "gallery");
2188
+
2189
+ $params = array();
2190
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_GALLERY;
2191
+ $params["elementor_condition"] = $conditionGallery;
2192
+
2193
+ $galleryDefaults = HelperProviderUC::getArrDynamicGalleryDefaults();
2194
+
2195
+ $this->addTextBox($name."_gallery", $galleryDefaults, __("Choose Images","unlimited-elements-for-elementor"), $params);
2196
+
2197
+ //============
2198
+
2199
+ $conditionPost = array($name."_source" => "posts");
2200
+ $conditionPostProduct = array($name."_source" => array("posts","products") );
2201
+
2202
+
2203
+ $params = array();
2204
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
2205
+ $params["elementor_condition"] = $conditionPostProduct;
2206
+
2207
+ $this->addHr($name."_hr_before_title_sources_post",$params);
2208
+
2209
+
2210
+ //---- posts options - title source
2211
+
2212
+ $arrTitleOptions = $this->getGalleryTitleSourceOptions(false, true);
2213
+
2214
+ $params = array();
2215
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2216
+ $params["label_block"] = true;
2217
+ $params["elementor_condition"] = $conditionPostProduct;
2218
+
2219
+ $this->addSelect($name."_title_source_post", $arrTitleOptions, __("Image Title Source", "unlimited-elements-for-elementor"), "post_title", $params);
2220
+
2221
+ //---- posts options - description source
2222
+
2223
+ $arrDescOptions = $this->getGalleryTitleSourceOptions(true, true);
2224
+
2225
+ $params = array();
2226
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2227
+ $params["label_block"] = true;
2228
+ $params["elementor_condition"] = $conditionPostProduct;
2229
+
2230
+ $this->addSelect($name."_description_source_post", $arrDescOptions, __("Image Description Source", "unlimited-elements-for-elementor"), "post_excerpt", $params);
2231
+
2232
+ //---- current post meta
2233
+
2234
+ $conditionCurrentMeta = array($name."_source" => "current_post_meta");
2235
+
2236
+ $params = array();
2237
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
2238
+ $params["elementor_condition"] = $conditionCurrentMeta;
2239
+
2240
+ $this->addTextBox($name."_current_metakey", "", __("Meta Key","unlimited-elements-for-elementor"), $params);
2241
+
2242
+ //---- current post meta - DEBUG
2243
+
2244
+ $params = array();
2245
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
2246
+ $params["description"] = __("Show the current post meta fields, turn off it after choose the right one", "unlimited-elements-for-elementor");
2247
+ $params["elementor_condition"] = $conditionCurrentMeta;
2248
+
2249
+ $this->addRadioBoolean($name."_show_metafields", __("Debug - Show Meta Fields", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
2250
+
2251
+ //=========== GALLERY TITLE AND DESCRIPTION SOURCE =================
2252
+
2253
+ //---- hr before title source
2254
+
2255
+ $conditionTitleSource = array($name."_source" => array("gallery", "current_post_meta"));
2256
+
2257
+ $params = array();
2258
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
2259
+ $params["elementor_condition"] = $conditionTitleSource;
2260
+
2261
+ $this->addHr($name."_hr_before_title_sources",$params);
2262
+
2263
+
2264
+ //---- gallery title source
2265
+
2266
+ $arrTitleOptions = $this->getGalleryTitleSourceOptions(false, false);
2267
+
2268
+ $params = array();
2269
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2270
+ $params["label_block"] = true;
2271
+ $params["elementor_condition"] = $conditionTitleSource;
2272
+
2273
+ $this->addSelect($name."_title_source_gallery", $arrTitleOptions, __("Image Title Source", "unlimited-elements-for-elementor"), "image_auto", $params);
2274
+
2275
+
2276
+ //---- gallery description source
2277
+
2278
+ $arrDescOptions = $this->getGalleryTitleSourceOptions(true, false);
2279
+
2280
+ $params = array();
2281
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2282
+ $params["label_block"] = true;
2283
+ $params["elementor_condition"] = $conditionTitleSource;
2284
+
2285
+ $this->addSelect($name."_description_source_gallery", $arrDescOptions, __("Image Description Source", "unlimited-elements-for-elementor"), "image_description", $params);
2286
+
2287
+ //----- hr before image size
2288
+ $params = array();
2289
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
2290
+
2291
+ $this->addHr($name."_hr_before_imagesize",$params);
2292
+
2293
+ //----- thumb image size
2294
+
2295
+ $arrSizes = UniteFunctionsWPUC::getArrThumbSizes();
2296
+
2297
+ $params = array();
2298
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2299
+ $params["label_block"] = true;
2300
+
2301
+ $arrSizes = array_flip($arrSizes);
2302
+ $this->addSelect($name."_thumb_size", $arrSizes, __("Thumb Image Size", "unlimited-elements-for-elementor"), "medium_large", $params);
2303
+
2304
+
2305
+ //----- big image size
2306
+
2307
+ $arrSizes = UniteFunctionsWPUC::getArrThumbSizes();
2308
+
2309
+ $params = array();
2310
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
2311
+ $params["label_block"] = true;
2312
+
2313
+ $arrSizes = array_flip($arrSizes);
2314
+ $this->addSelect($name."_image_size", $arrSizes, __("Big Image Size", "unlimited-elements-for-elementor"), "large", $params);
2315
+
2316
+
2317
+ //=========== GALLERY POSTS VIDEOS =================
2318
+
2319
+ //----- hr before videos
2320
+
2321
+ $params = array();
2322
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
2323
+
2324
+ $this->addHr($name."_hr_before_videos",$params);
2325
+
2326
+ //----- hr before videos
2327
+
2328
+ $params = array();
2329
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
2330
+ $params["elementor_condition"] = $conditionPost;
2331
+
2332
+ $this->addRadioBoolean($name."_posts_enable_videos", "Enable Videos Items",false,"Yes","No",$params);
2333
+
2334
+ //----- meta field for item type
2335
+
2336
+ $condionEnableVideos = $conditionPost;
2337
+ $condionEnableVideos[$name."_posts_enable_videos"] = "true";
2338
+
2339
+ $params = array();
2340
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
2341
+ $params["placeholder"] = "example: item_type";
2342
+ $params["description"] = "A custom fields that store item type text. The types are: image|youtube|vimeo";
2343
+ $params["elementor_condition"] = $condionEnableVideos;
2344
+
2345
+ $this->addTextBox($name."_meta_itemtype", "", __("Meta Field for Item Type","unlimited-elements-for-elementor"), $params);
2346
+
2347
+ //----- meta field for video id
2348
+
2349
+ $params = array();
2350
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
2351
+ $params["placeholder"] = "example: video_id";
2352
+ $params["description"] = "A custom fields that store Youtube ID / link or Vimeo ID";
2353
+ $params["elementor_condition"] = $condionEnableVideos;
2354
+
2355
+ $this->addTextBox($name."_meta_videoid", "", __("Meta Field for Video ID","unlimited-elements-for-elementor"), $params);
2356
+
2357
+ //----- debug meta fields
2358
+ /*
2359
+ $params = array();
2360
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
2361
+ $params["elementor_condition"] = $condionEnableVideos;
2362
+
2363
+ $this->addRadioBoolean($name."_debug_meta", "Debug Meta Fields",false,"Yes","No",$params);
2364
+ */
2365
+
2366
+ }
2367
+
2368
+
2369
+
2370
+
2371
  /**
2372
  * add listing picker, function for override
2373
  */
provider/woocommerce_integrate.class.php CHANGED
@@ -887,5 +887,73 @@ class UniteCreatorWooIntegrate{
887
 
888
  return($arrPostIDs);
889
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
890
 
891
  }
887
 
888
  return($arrPostIDs);
889
  }
890
+
891
+ /**
892
+ * get product id's in cart
893
+ */
894
+ public function getCartProductIDs(){
895
+
896
+ $isActive = self::isWooActive();
897
+ if($isActive == false)
898
+ return(array());
899
+
900
+ $arrCartItems = WC()->cart->get_cart();
901
+
902
+ $arrIDsAssoc = array();
903
+
904
+ foreach($arrCartItems as $item){
905
+
906
+ $productID = UniteFunctionsUC::getVal($item, "product_id");
907
+
908
+ if(empty($productID))
909
+ continue;
910
+
911
+ $arrIDsAssoc[$productID] = true;
912
+ }
913
+
914
+ $arrIDs = array_keys($arrIDsAssoc);
915
+
916
+ return($arrIDs);
917
+ }
918
+
919
+
920
+ /**
921
+ * get related product id's from selected to cart products
922
+ */
923
+ public function getRelatedProductsFromCart($limit,$arrPostsNotIn = array()){
924
+
925
+ $isActive = self::isWooActive();
926
+ if($isActive == false)
927
+ return(array());
928
+
929
+ $arrIDs = $this->getCartProductIDs();
930
+
931
+ if(empty($arrIDs))
932
+ return(array());
933
+
934
+ $arrRelatedTotal = array();
935
+
936
+ $arrPostsNotIn = array_merge($arrPostsNotIn,$arrIDs);
937
+
938
+ foreach($arrIDs as $productID){
939
+
940
+ $arrRelated = wc_get_related_products($productID, $limit, $arrPostsNotIn);
941
+
942
+ $arrRelatedTotal = array_merge($arrRelatedTotal, $arrRelated);
943
+ }
944
+
945
+ if(empty($arrRelatedTotal))
946
+ return(array());
947
+
948
+ $arrRelatedTotal = array_unique($arrRelatedTotal);
949
+
950
+ array_rand($arrRelatedTotal);
951
+
952
+ if(count($arrRelatedTotal) > $limit)
953
+ $arrRelatedTotal = array_slice($arrRelatedTotal, 0, $limit);
954
+
955
+ return($arrRelatedTotal);
956
+ }
957
+
958
 
959
  }
readme.txt CHANGED
@@ -103,20 +103,18 @@ Fully compatible and integrated with Toolset custom post types and fields.
103
  <li><a href="https://unlimited-elements.com/lordicon-animated-icons-widget-for-elementor/">Lordicon: Animated Icons Widget for Elementor (Free)</a> - The most powerful animated icon library with 1500+ free and premium animated Lottie animations.</li>
104
  <li><a href="https://unlimited-elements.com/blob-shape-widget-for-elementor/">Blob Shapes Widget for Elementor (Free)</a> - Create Blob Shapes with animated morphing effects. This free Elementor widget will help you make your images into random, unique, and organic-looking blob shapes. </li>
105
  <li><a href="https://unlimited-elements.com/image-tooltip-widget-for-elementor/">Image Tooltip Widget for Elementor (Free)</a> - The easiest way to set a tooltip to any Image on the page with a short text description or any HTML code.</li>
106
- <li><a href="https://unlimited-elements.com/icon-accordion-widget-for-elementor/">Icon Accordion Widget for Elementor (Pro)</a> - Advanced accordion addon for Elementor page builder offers multiple styles to create interactive collapsable content with multiple layouts on your page.</li>
107
  <li><a href="https://unlimited-elements.com/image-reveal-on-scroll-widget-for-elementor">Image Reveal On Scroll Widget for Elementor (Pro)</a> - The Image Reveal on Scroll widget adds an awesome reveal on scroll effect to your images to spice up your Elementor website design.</li>
108
  <li><a href="https://unlimited-elements.com/image-shapes-for-elementor-page-builder/">Image Shapes Widget for Elementor (Pro)</a> - The Image Shapes Elementor Widget allows you to make complex shape addons by clipping images using CSS to make various element layouts: circle, ellipse, polygon and more.</li>
109
  <li><a href="https://unlimited-elements.com/image-particle-widget-for-elementor/">Particle Image Widget for Elementor (Pro)</a> - Create a dispersion interactive mouse aware distortion effect for any image using the Particle Image widget for Elementor.</li>
110
  <li><a href="https://unlimited-elements.com/image-zoom-magnifier-widget-for-elementor/">Image Zoom Magnifier Widget for Elementor (Pro)</a> - Image Zoom Magnifier is a Elmentor Widget for creating a direction-aware magnifying glass effect to provide an inner zoom functionality on any given image. Enlarge images on touch, click, or mouseover.</li>
111
- <li><a href="https://unlimited-elements.com/background-switcher-widget-for-elementor/">Background Switcher Widget for Elementor (Pro)</a> - The background switcher addon lets you set up cool content boxes. When you hover over a box it will change the background for the whole section. </li>
112
  <li><a href="https://unlimited-elements.com/icon-tabs-widget-for-elementor">Icon Tabs Widget for Elementor (Pro)</a> - The Tab Widget for Elementor will help you show your text on your page divided into horizontal or vertical tabs. Customize your tabs using icons and make the content on your website interactive and fun to read.</li>
113
- <li><a href="https://unlimited-elements.com/audio-player-widget-for-elementor/">Audio Player Widget for Elementor (Pro)</a> - MP3 Music Player is a very easy to use Audio Player for Elementor. It gives you the ability to add unlimited audio tracks to any page using our Elementor addon let users listen to music on your website. </li>
114
  <li><a href="https://unlimited-elements.com/before-after-image-comparison-widget-for-elementor/">Before After Widget for Elementor (Pro)</a> - The Before After widget is an image comparison addon for Elementor. This widget allows you to create the effect for comparing two before and after images.</li>
115
  <li><a href="https://unlimited-elements.com/hotspots-for-elementor-page-builder/">Hotspots Widget for Elementor (Pro)</a> - Add hotspots to your images with a tooltip an option for opening a built in popup. Each hotspot popup can contain and image and description text.</li>
116
  <li><a href="https://unlimited-elements.com/image-accordion-widget-for-elementor/">Image Accordion Widget for Elementor (Pro)</a> - Our image accordion addon for Elementor highlights your images with amazing hover effects and interactive layouts.</li>
117
  <li><a href="https://unlimited-elements.com/shape-bullets-widget-for-elementor/">Shape Bullets Widget for Elementor (Pro)</a> - The Shape Bullets Widget for Elementor, creates an easy-to-manage bulleted list of items. Each item can be highlighted by its own icon.
118
  </li>
119
- <li><a href="https://unlimited-elements.com/audio-playlist-widget-for-elementor">Audio Playlist Widget for Elementor (Pro)</a> - Create MP3 Audio Playlists inside of Elementor. Use this widget to add the ability to create unlimited numbers of playlists, albums, and audio tracks.</li>
120
  <li><a href="https://unlimited-elements.com/interactive-circle-infographic-widget-for-elementor/">Interactive Circle Infographic Widget for Elementor (Pro)</a> - The Circle Infographic widget for Elementor is a simple and engaging way to present data, processes, concepts, structures and more. Helps your audience understand an entire cycle using a circular interactive tab layout.
121
 
122
  </li>
@@ -127,62 +125,65 @@ Fully compatible and integrated with Toolset custom post types and fields.
127
 
128
  <h3>Post Widgets for Elementor</h3>
129
  <ol>
130
- <li><a href="https://unlimited-elements.com/post-tabs-for-elementor/">Post Tabs Widget for Elementor (Free)</a></li>
131
- <li><a href="https://unlimited-elements.com/post-accordions-for-elementor/">Post Accordion Widget for Elementor (Free)</a></li>
132
- <li><a href="https://unlimited-elements.com/card-post-carousel-widget-for-elementor">Card Post Carousel Widget for Elementor (Free)</a></li>
133
- <li><a href="https://unlimited-elements.com/post-blocks-widget-for-elementor">Post Blocks Widget for Elementor (Free)</a></li>
134
- <li><a href="https://unlimited-elements.com/post-list-widget-for-elementor">Post List Widget for Elementor (Free)</a></li>
135
  <li><a href="https://unlimited-elements.com/post-news-ticker-widget-for-elementor">Post Ticker Widget for Elementor (Free)</a></li>
 
136
  <li><a href="https://unlimited-elements.com/post-pagination-widget-for-elementor/">Post Pagination Widget for Elementor (Free)</a></li>
137
- <li><a href="https://unlimited-elements.com/post-gallery-widget-for-elementor">Post Gallery Widget for Elementor (Pro)</a></li>
 
 
 
 
138
  <li><a href="https://unlimited-elements.com/elementor-author-list-widget/">Author List Widget for Elementor (Pro)</a></li>
139
  <li><a href="https://unlimited-elements.com/masonry-post-grid-widget-for-elementor">Masonry Post Grid Widget for Elementor (Pro)</a></li>
140
- <li><a href="https://unlimited-elements.com/taxonomy-terms-widget-for-elementor/">Taxonomy Terms Widget for Elementor (Pro)</a></li>
141
  <li><a href="https://unlimited-elements.com/post-tiles-widget-for-elementor">Post Tile Widget for Elementor (Pro)</a></li>
142
- <li><a href="https://unlimited-elements.com/post-grid-widget-for-elementor/">Post Grid Widget for Elementor (Pro)</a> - The Post Grid widget places multiple posts in an aesthetic post grid layout. The purpose of this widget is to let you organize and display your posts on your Elementor website.</li>
143
  <li><a href="https://unlimited-elements.com/post-sliders/">Post Slider Widget for Elementor (Pro)</a></li>
 
144
  <li><a href="https://unlimited-elements.com/blog-card-slider-widget-for-elementor">Post Card Slider Widget for Elementor (Pro)</a></li>
145
- <li><a href="https://unlimited-elements.com/post-magazine-grid-widget-for-elementor/">Post Magazine Grid Widget for Elementor (Pro)</a></li>
146
  <li><a href="https://unlimited-elements.com/load-more-infinite-scroll-widget-for-elementor/">Load More / Infinite Scroll Widget for Elementor (Pro)</a> - Add a load more button to your post or product grids. You can even make an infinite scroll effect that works with AJAX.</li>
147
- <li><a href="https://unlimited-elements.com/post-carousels-for-elementor/">Post Carousel Widget for Elementor (Pro)</a></li>
148
  <li><a href="https://unlimited-elements.com/post-timeline-widget-for-elementor/">Post Timeline Widget for Elementor (Pro)</a></li>
149
  <li><a href="https://unlimited-elements.com/post-scroll-widget-for-elementor">Post Scroll Widget for Elementor (Pro)</a></li>
 
 
 
 
 
150
  <li><a href="https://unlimited-elements.com/post-horizontal-timeline-widget-for-elementor/">Post Horizontal Timeline Widget for Elementor (Pro)</a></li>
151
  </ol>
152
 
153
  <h3>Marketing Widgets for Elementor</h3>
154
  <ol>
155
  <li><a href="https://unlimited-elements.com/price-label-product-box-widget-for-elementor/">Product Box Widget for Elementor (Free)</a></li>
 
 
 
156
  <li><a href="https://unlimited-elements.com/timer-countdowns-for-elementor-page-builder/">Timer Countdown Widget for Elementor (Free)</a> - Instantly create a beautiful, animated countdown clock addon, to share on your Elementor website. Count down to a date with your own unique timer.
157
 
158
  </li>
159
  <li><a href="https://unlimited-elements.com/call-to-action-button-widget-for-elementor/">Call To Action Button Widget for Elementor (Free)</a> - The Call to Action Button Widget is a tool for creating beautiful buttons that combine an icon, some text, and message notification.</li>
160
- <li><a href="https://unlimited-elements.com/list-widget-for-elementor/">List Widget for Elementor (Free)</a> - Create styled ordered and unordered lists easily. The ordered list will add index numbers automatically to your list items.</li>
161
- <li><a href="https://unlimited-elements.com/statistic-counters-for-elementor">Counter Widget for Elementor (Free)</a> - Showcasing your business statistics and show fun facts and figures on your Elementor website.</li>
162
  <li><a href="https://unlimited-elements.com/price-list-widget-for-elementor/">Price List Widget for Elementor (Free)</a> - A powerful addon that allows displaying a list of items, products, services or features for your business with easy styling options.</li>
163
  <li><a href="https://unlimited-elements.com/event-box-widget-for-elementor">Event Box Widget for Elementor (Free)</a> - Showcase events & special occasions on your websites using this unique Elementor addon.</li>
164
- <li><a href="https://unlimited-elements.com/notification-widget-for-elementor">Notification Widget for Elementor (Free)</a> - The Notification widget enables you to display a colored alert box and draw attention to important messages on your Elementor website.</li>
 
165
  <li><a href="https://unlimited-elements.com/pricing-table-widget-for-elementor/">Pricing Table Widget for Elementor (Free)</a> - Present the available pricing plans in an easy to read format. Use the Pricing Table widget to help your customers make purchasing decisions.</li>
166
- <li><a href="https://unlimited-elements.com/business-hours-widget-for-elementor">Business Hours Widget for Elementor (Free)</a></li>
167
- <li><a href="https://unlimited-elements.com/overlay-product-box-widget-for-elementor/">Overlay Product Box Widget for Elementor (Free)</a></li>
168
  <li><a href="http://unlimited-elements.com/food-menu-box-widget-for-elementor/">Product Card Widget for Elementor (Free)</a></li>
169
- <li><a href="https://unlimited-elements.com/review-box-widget-for-elementor">Review Box Widget for Elementor (Free)</a> - Simply create and display reviews on your Elementor website to build customers’ trust and increase SEO.</li>
 
170
  <li><a href="https://unlimited-elements.com/timer-countdown-banner-widget-for-elementor">Timer Countdown Banner Widget for Elementor (Pro)</a> - An awesome countdown banner with a a call to action button.</li>
171
  <li><a href="https://unlimited-elements.com/card-testimonial-review-carousel-widget-for-elementor">Review Carousel Widget for Elementor (Pro)</a> - The Reviews Carousel increases the visibility reviews you want to highlight to your users by letting you display them throughout your site in an interactive carousel format. </li>
172
  <li><a href="https://unlimited-elements.com/list-marquee-widget-for-elementor/">List Marquee Widget for Elementor (Pro)</a></li>
173
- <li><a href="https://unlimited-elements.com/copy-coupon-code-widget-for-elementor">Copy Coupon Code Widget for Elementor (Pro)</a> - Click to copy coupon code to the clipboard. This widgets makes it easy for users to redeem your promotions coupon codes.</li>
174
  <li><a href="https://unlimited-elements.com/pricing-flip-box-widget-for-elementor/">Pricing Table Flip Box Widget for Elementor (Pro)</a> - The Pricing Table Flip Box allows you to showcase the prices for your products, services, or packages in a beautiful flip box pricing table.</li>
175
- <li><a href="https://unlimited-elements.com/whatsapp-chat-widget-for-elementor">WhatsApp Chat Widget for Elementor (Pro)</a> - A floating WhatsApp button that allows your website visitors to start a chat conversation from your website directly to your WhatsApp phone number with just one click.</li>
176
  <li><a href="https://unlimited-elements.com/event-list-widget-for-elementor/">Event List Widget for Elementor (Pro)</a> - The event list widget is a way to easily show your recent events like concerts, conferences, parties or special occasions.
177
  </li>
178
  <li><a href="https://unlimited-elements.com/price-box-widget-for-elementor/">Price Box Widget for Elementor (Pro)</a></li>
179
  <li><a href="https://unlimited-elements.com/icon-mobile-menu-for-elementor">Icon Mobile Menu Widget for Elementor (Pro)</a> - A perfect way to add an icon menu for making your CTA buttons stand out for website visitors using mobile devices.</li>
 
 
180
  <li><a href="https://unlimited-elements.com/product-bullets-widget-for-elementor">Product Bullets Widget for Elementor (Pro)</a></li>
181
- <li><a href="https://unlimited-elements.com/food-menu-carousel-widget-for-elementor">Product Carousel Widget for Elementor (Pro)</a></li>
182
- <li><a href="https://unlimited-elements.com/two-column-product-bullets-widget-for-elementor/">Product Highlights Widget for Elementor (Pro)</a> - Design a visually attractive product feature lists that will help your potential buyers to make purchase decision and learn more about your products. </li>
183
  <li><a href="https://unlimited-elements.com/memory-game-widget-for-elementor">Memory Game Widget for Elementor (Pro)</a></li>
184
- <li><a href="https://unlimited-elements.com/google-maps-widget-for-elementor">Unlimited Google Maps Widget for Elementor (Pro)</a></li>
185
- <li><a href="https://unlimited-elements.com/mobile-conversion-menu-for-elementor">Mobile Conversion Menu Widget for Elementor (Pro)</a> - Floating action buttons that display the primary actions in your Elementor website. Provide quick access to social icons or any important or common actions to increase conversions.</li>
186
  </ol>
187
 
188
  <h3>Infographic Widgets for Elementor</h3>
@@ -250,8 +251,39 @@ https://github.com/ykob/shape-overlays</li>
250
  <li><a href="https://unlimited-elements.com/remote-control-widgets">Remote Bullets Widget for Elementor (Free)</a></li>
251
  <li><a href="https://unlimited-elements.com/remote-control-widgets">Remote Counter Widget for Elementor (Free)</a></li>
252
  <li><a href="https://unlimited-elements.com/remote-control-widgets">Remote Play Pause Widget for Elementor (Free)</a></li>
 
253
  <li><a href="https://unlimited-elements.com/remote-control-widgets">Remote Item Navigation Widget for Elementor (Pro)</a></li>
254
- <li><a href="https://unlimited-elements.com/remote-tabs-widget-for-elementor">Remote Tabs Widget for Elementor (Pro)</a></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  </ol>
256
 
257
  <h3>Testimonials for Elementor</h3>
@@ -272,13 +304,6 @@ https://github.com/ykob/shape-overlays</li>
272
  <li><a href="https://unlimited-elements.com/sliding-effect-team-member-widget-for-elementor">Team Member Sliding Effect Widget for Elementor (Pro)</a></li>
273
  </ol>
274
 
275
- <h3>Slider Widgets for Elementor</h3>
276
- <ol>
277
- <li><a href="https://unlimited-elements.com/simple-slider-widget-for-elementor/">Simple Slider Widget for Elementor (Free)</a></li>
278
- <li><a href="https://unlimited-elements.com/image-video-content-slider-widget-for-elementor">Image and Video Content Slider Widget for Elementor (Pro)</a></li>
279
- <li><a href="https://unlimited-elements.com/thumbnail-slider-widget-for-elementor/">Thumbnail Slider Widget for Elementor (Pro)</a></li>
280
- </ol>
281
-
282
  <h3>Content Boxes for Elementor</h3>
283
  <ol>
284
  <li><a href="https://unlimited-elements.com/image-zoom-content-box-widget-for-elementor/">Image Zoom Content Box Widget for Elementor (Free)</a></li>
@@ -362,19 +387,6 @@ https://github.com/ykob/shape-overlays</li>
362
  <li><a href="https://unlimited-elements.com/christmas-text-widget-for-elementor">Christmas Text Widget for Elementor (Pro)</a></li>
363
  </ol>
364
 
365
- <h3>Content Widgets for Elementor</h3>
366
- <ol>
367
- <li><a href="https://unlimited-elements.com/content-tabs-widget-for-elementor/">Content Tabs Widget for Elementor (Free)</a></li>
368
- <li><a href="https://unlimited-elements.com/content-accordion-widget-for-elementor/">Content Accordion Widget for Elementor (Free)</a></li>
369
- <li><a href="https://unlimited-elements.com/content-switcher-widget-for-elementor/">Content Switcher Widget for Elementor (Pro)</a> - Allow users to switch between two or more types of content using interactive toggle buttons. You can even load Elementor templates as content to make advanced content switcher layouts.
370
-
371
- </li>
372
- <li><a href="https://unlimited-elements.com/content-carousel-widget-for-elementor/">Content Carousel Widget for Elementor (Pro)</a></li>
373
- <li><a href="https://unlimited-elements.com/content-grid-widget-for-elementor/">Content Grid Widget for Elementor (Pro)</a></li>
374
- <li><a href="https://unlimited-elements.com/content-ticker-widget-for-elementor/">Content Ticker Widget for Elementor (Pro)</a></li>
375
- <li><a href="https://unlimited-elements.com/content-slider-widget-for-elementor">Content Slider Widget for Elementor (Pro)</a></li>
376
- </ol>
377
-
378
  <h3>Icon Boxes for Elementor</h3>
379
  <ol>
380
  <li><a href="https://unlimited-elements.com/icon-box-widget-for-elementor/">Icon Box Widget for Elementor (Free)</a></li>
@@ -389,30 +401,6 @@ https://github.com/ykob/shape-overlays</li>
389
  <li><a href="https://unlimited-elements.com/solid-color-overlay-icon-box-widget-for-elementor">Overlay Icon Box Widget for Elementor (Pro)</a></li>
390
  </ol>
391
 
392
- <h3>Image Galleries for Elementor</h3>
393
- <ol>
394
- <li><a href="https://unlimited-elements.com/tile-grid-image-gallery-for-elementor/">Tile Grid Image Gallery Widget for Elementor (Free)</a></li>
395
- <li><a href="https://unlimited-elements.com/minimalistic-image-gallery-for-elementor/">Minimalistic Image Gallery Widget for Elementor (Free)</a></li>
396
- <li><a href="https://unlimited-elements.com/slider-image-gallery-for-elementor/">Slider Image Gallery Widget for Elementor (Free)</a></li>
397
- <li><a href="https://unlimited-elements.com/justified-columns-image-gallery-for-elementor">Justified Columns Image Gallery Widget for Elementor (Pro)</a></li>
398
- <li><a href="https://unlimited-elements.com/grid-panel-image-gallery-for-elementor">Grid Panel Image Gallery Widget for Elementor (Pro)</a></li>
399
- <li><a href="https://unlimited-elements.com/video-and-image-gallery-grid-panel-widget-for-elementor/">Video and Image Gallery Grid Widget for Elementor (Pro)</a></li>
400
- <li><a href="https://unlimited-elements.com/carousel-image-gallery-for-elementor">Carousel Image Gallery Widget for Elementor (Pro)</a></li>
401
- <li><a href="https://unlimited-elements.com/basic-image-gallery-for-elementor/">Basic Image Gallery Widget for Elementor (Pro)</a></li>
402
- </ol>
403
-
404
- <h3>Video Galleries for Elementor</h3>
405
- <ol>
406
- <li><a href="https://unlimited-elements.com/slider-video-gallery-widget-for-elementor/">Slider Video Gallery Widget for Elementor (Free)</a></li>
407
- <li><a href="https://unlimited-elements.com/minimalistic-video-gallery-widget-for-elementor/">Minimalistic Video Gallery Widget for Elementor (Free)</a></li>
408
- <li><a href="https://unlimited-elements.com/thumb-list-video-gallery-widget-for-elementor/">Play List Video Gallery Widget for Elementor (Pro)</a></li>
409
- <li><a href="https://unlimited-elements.com/carousel-video-gallery-widget-for-elementor/">Carousel Video Gallery Widget for Elementor (Pro)</a></li>
410
- <li><a href="https://unlimited-elements.com/tile-columns-video-gallery-widget-for-elementor">Tile Columns Video Gallery Widget for Elementor (Pro)</a></li>
411
- <li><a href="https://unlimited-elements.com/basic-video-gallery-widget-for-elementor/">Basic Video Gallery Widget for Elementor (Pro)</a></li>
412
- <li><a href="https://unlimited-elements.com/grid-panel-video-gallery-widget-for-elementor/">Grid Panel Video Gallery Widget for Elementor (Pro)</a></li>
413
- <li><a href="https://unlimited-elements.com/tiles-grid-video-gallery-widget-for-elementor/">Tiles Grid Video Gallery Widget for Elementor (Pro)</a></li>
414
- </ol>
415
-
416
  <h3>Block Quotes for Elementor</h3>
417
  <ol>
418
  <li><a href="https://unlimited-elements.com/block-quote-box-widget-for-elementor">Block Quote Box Widget for Elementor (Free)</a></li>
@@ -467,6 +455,7 @@ https://github.com/ykob/shape-overlays</li>
467
 
468
 
469
 
 
470
  == Installation ==
471
 
472
  Note : This plugin works with Elementor. Make sure you have [Elementor](https://wordpress.org/plugins/elementor/) installed.
@@ -477,7 +466,68 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
477
 
478
  == Changelog ==
479
 
480
- version 1.5.3: 2022-02-23:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
 
482
  * Feature: added functionality to put image inside taxonomy terms widget
483
  * Fix: fixed load more on archive page with orderby=xxx filter in url
@@ -485,7 +535,7 @@ version 1.5.3: 2022-02-23:
485
  * Change: updated freemius sdk to 2.4.3 version (Security fix)
486
 
487
 
488
- version 1.5.2: 2022-02-23:
489
 
490
  * Feature: set up remote and sync functionality for the galleries
491
  * Fix: fixed load more for current query posts
@@ -494,7 +544,7 @@ version 1.5.2: 2022-02-23:
494
  * Fix: fixed replace mode in tabs filters
495
 
496
 
497
- version 1.5.1: 2022-02-21:
498
 
499
  * Feature: improved post pagination debug and added force options
500
  * Feature: added code for the button filters
@@ -511,7 +561,7 @@ version 1.5.1: 2022-02-21:
511
 
512
 
513
 
514
- version 1.5.0: 2022-02-02:
515
 
516
  * Feature: added tabs in items controls
517
  * Feature: added functionality for ajax taxonomies terms filter
103
  <li><a href="https://unlimited-elements.com/lordicon-animated-icons-widget-for-elementor/">Lordicon: Animated Icons Widget for Elementor (Free)</a> - The most powerful animated icon library with 1500+ free and premium animated Lottie animations.</li>
104
  <li><a href="https://unlimited-elements.com/blob-shape-widget-for-elementor/">Blob Shapes Widget for Elementor (Free)</a> - Create Blob Shapes with animated morphing effects. This free Elementor widget will help you make your images into random, unique, and organic-looking blob shapes. </li>
105
  <li><a href="https://unlimited-elements.com/image-tooltip-widget-for-elementor/">Image Tooltip Widget for Elementor (Free)</a> - The easiest way to set a tooltip to any Image on the page with a short text description or any HTML code.</li>
106
+ <li><a href="https://unlimited-elements.com/background-switcher-widget-for-elementor/">Background Switcher Widget for Elementor (Pro)</a> - The background switcher addon lets you set up cool content boxes. When you hover over a box it will change the background for the whole section. </li>
107
  <li><a href="https://unlimited-elements.com/image-reveal-on-scroll-widget-for-elementor">Image Reveal On Scroll Widget for Elementor (Pro)</a> - The Image Reveal on Scroll widget adds an awesome reveal on scroll effect to your images to spice up your Elementor website design.</li>
108
  <li><a href="https://unlimited-elements.com/image-shapes-for-elementor-page-builder/">Image Shapes Widget for Elementor (Pro)</a> - The Image Shapes Elementor Widget allows you to make complex shape addons by clipping images using CSS to make various element layouts: circle, ellipse, polygon and more.</li>
109
  <li><a href="https://unlimited-elements.com/image-particle-widget-for-elementor/">Particle Image Widget for Elementor (Pro)</a> - Create a dispersion interactive mouse aware distortion effect for any image using the Particle Image widget for Elementor.</li>
110
  <li><a href="https://unlimited-elements.com/image-zoom-magnifier-widget-for-elementor/">Image Zoom Magnifier Widget for Elementor (Pro)</a> - Image Zoom Magnifier is a Elmentor Widget for creating a direction-aware magnifying glass effect to provide an inner zoom functionality on any given image. Enlarge images on touch, click, or mouseover.</li>
 
111
  <li><a href="https://unlimited-elements.com/icon-tabs-widget-for-elementor">Icon Tabs Widget for Elementor (Pro)</a> - The Tab Widget for Elementor will help you show your text on your page divided into horizontal or vertical tabs. Customize your tabs using icons and make the content on your website interactive and fun to read.</li>
112
+ <li><a href="https://unlimited-elements.com/icon-accordion-widget-for-elementor/">Icon Accordion Widget for Elementor (Pro)</a> - Advanced accordion addon for Elementor page builder offers multiple styles to create interactive collapsable content with multiple layouts on your page.</li>
113
  <li><a href="https://unlimited-elements.com/before-after-image-comparison-widget-for-elementor/">Before After Widget for Elementor (Pro)</a> - The Before After widget is an image comparison addon for Elementor. This widget allows you to create the effect for comparing two before and after images.</li>
114
  <li><a href="https://unlimited-elements.com/hotspots-for-elementor-page-builder/">Hotspots Widget for Elementor (Pro)</a> - Add hotspots to your images with a tooltip an option for opening a built in popup. Each hotspot popup can contain and image and description text.</li>
115
  <li><a href="https://unlimited-elements.com/image-accordion-widget-for-elementor/">Image Accordion Widget for Elementor (Pro)</a> - Our image accordion addon for Elementor highlights your images with amazing hover effects and interactive layouts.</li>
116
  <li><a href="https://unlimited-elements.com/shape-bullets-widget-for-elementor/">Shape Bullets Widget for Elementor (Pro)</a> - The Shape Bullets Widget for Elementor, creates an easy-to-manage bulleted list of items. Each item can be highlighted by its own icon.
117
  </li>
 
118
  <li><a href="https://unlimited-elements.com/interactive-circle-infographic-widget-for-elementor/">Interactive Circle Infographic Widget for Elementor (Pro)</a> - The Circle Infographic widget for Elementor is a simple and engaging way to present data, processes, concepts, structures and more. Helps your audience understand an entire cycle using a circular interactive tab layout.
119
 
120
  </li>
125
 
126
  <h3>Post Widgets for Elementor</h3>
127
  <ol>
 
 
 
 
 
128
  <li><a href="https://unlimited-elements.com/post-news-ticker-widget-for-elementor">Post Ticker Widget for Elementor (Free)</a></li>
129
+ <li><a href="https://unlimited-elements.com/post-blocks-widget-for-elementor">Post Blocks Widget for Elementor (Free)</a></li>
130
  <li><a href="https://unlimited-elements.com/post-pagination-widget-for-elementor/">Post Pagination Widget for Elementor (Free)</a></li>
131
+ <li><a href="https://unlimited-elements.com/post-list-widget-for-elementor">Post List Widget for Elementor (Free)</a></li>
132
+ <li><a href="https://unlimited-elements.com/post-tabs-for-elementor/">Post Tabs Widget for Elementor (Free)</a></li>
133
+ <li><a href="https://unlimited-elements.com/card-post-carousel-widget-for-elementor">Card Post Carousel Widget for Elementor (Free)</a></li>
134
+ <li><a href="https://unlimited-elements.com/post-accordions-for-elementor/">Post Accordion Widget for Elementor (Free)</a></li>
135
+ <li><a href="https://unlimited-elements.com/post-grid-widget-for-elementor/">Post Grid Widget for Elementor (Pro)</a> - The Post Grid widget places multiple posts in an aesthetic post grid layout. The purpose of this widget is to let you organize and display your posts on your Elementor website.</li>
136
  <li><a href="https://unlimited-elements.com/elementor-author-list-widget/">Author List Widget for Elementor (Pro)</a></li>
137
  <li><a href="https://unlimited-elements.com/masonry-post-grid-widget-for-elementor">Masonry Post Grid Widget for Elementor (Pro)</a></li>
 
138
  <li><a href="https://unlimited-elements.com/post-tiles-widget-for-elementor">Post Tile Widget for Elementor (Pro)</a></li>
 
139
  <li><a href="https://unlimited-elements.com/post-sliders/">Post Slider Widget for Elementor (Pro)</a></li>
140
+ <li><a href="https://unlimited-elements.com/post-carousels-for-elementor/">Post Carousel Widget for Elementor (Pro)</a></li>
141
  <li><a href="https://unlimited-elements.com/blog-card-slider-widget-for-elementor">Post Card Slider Widget for Elementor (Pro)</a></li>
 
142
  <li><a href="https://unlimited-elements.com/load-more-infinite-scroll-widget-for-elementor/">Load More / Infinite Scroll Widget for Elementor (Pro)</a> - Add a load more button to your post or product grids. You can even make an infinite scroll effect that works with AJAX.</li>
 
143
  <li><a href="https://unlimited-elements.com/post-timeline-widget-for-elementor/">Post Timeline Widget for Elementor (Pro)</a></li>
144
  <li><a href="https://unlimited-elements.com/post-scroll-widget-for-elementor">Post Scroll Widget for Elementor (Pro)</a></li>
145
+ <li><a href="https://unlimited-elements.com/post-magazine-grid-widget-for-elementor/">Post Magazine Grid Widget for Elementor (Pro)</a></li>
146
+ <li><a href="https://unlimited-elements.com/tabs-filter-widget-for-elementor/">Tabs Filter Widget for Elementor (Pro)</a> - The Tabs Filter is the best post filtering widget for Elementor. You can ad post filters using category and tag taxonomies.</li>
147
+ <li><a href="https://unlimited-elements.com/taxonomy-terms-widget-for-elementor/">Taxonomy Terms Widget for Elementor (Pro)</a> - Showcase your WordPress tags and categories in different ways using the Taxonomy Widget for Elementor.
148
+
149
+ </li>
150
  <li><a href="https://unlimited-elements.com/post-horizontal-timeline-widget-for-elementor/">Post Horizontal Timeline Widget for Elementor (Pro)</a></li>
151
  </ol>
152
 
153
  <h3>Marketing Widgets for Elementor</h3>
154
  <ol>
155
  <li><a href="https://unlimited-elements.com/price-label-product-box-widget-for-elementor/">Product Box Widget for Elementor (Free)</a></li>
156
+ <li><a href="https://unlimited-elements.com/notification-widget-for-elementor">Notification Widget for Elementor (Free)</a> - The Notification widget enables you to display a colored alert box and draw attention to important messages on your Elementor website.</li>
157
+ <li><a href="https://unlimited-elements.com/overlay-product-box-widget-for-elementor/">Overlay Product Box Widget for Elementor (Free)</a></li>
158
+ <li><a href="https://unlimited-elements.com/business-hours-widget-for-elementor">Business Hours Widget for Elementor (Free)</a></li>
159
  <li><a href="https://unlimited-elements.com/timer-countdowns-for-elementor-page-builder/">Timer Countdown Widget for Elementor (Free)</a> - Instantly create a beautiful, animated countdown clock addon, to share on your Elementor website. Count down to a date with your own unique timer.
160
 
161
  </li>
162
  <li><a href="https://unlimited-elements.com/call-to-action-button-widget-for-elementor/">Call To Action Button Widget for Elementor (Free)</a> - The Call to Action Button Widget is a tool for creating beautiful buttons that combine an icon, some text, and message notification.</li>
 
 
163
  <li><a href="https://unlimited-elements.com/price-list-widget-for-elementor/">Price List Widget for Elementor (Free)</a> - A powerful addon that allows displaying a list of items, products, services or features for your business with easy styling options.</li>
164
  <li><a href="https://unlimited-elements.com/event-box-widget-for-elementor">Event Box Widget for Elementor (Free)</a> - Showcase events & special occasions on your websites using this unique Elementor addon.</li>
165
+ <li><a href="https://unlimited-elements.com/statistic-counters-for-elementor">Counter Widget for Elementor (Free)</a> - Showcasing your business statistics and show fun facts and figures on your Elementor website.</li>
166
+ <li><a href="https://unlimited-elements.com/review-box-widget-for-elementor">Review Box Widget for Elementor (Free)</a> - Simply create and display reviews on your Elementor website to build customers’ trust and increase SEO.</li>
167
  <li><a href="https://unlimited-elements.com/pricing-table-widget-for-elementor/">Pricing Table Widget for Elementor (Free)</a> - Present the available pricing plans in an easy to read format. Use the Pricing Table widget to help your customers make purchasing decisions.</li>
168
+ <li><a href="https://unlimited-elements.com/list-widget-for-elementor/">List Widget for Elementor (Free)</a> - Create styled ordered and unordered lists easily. The ordered list will add index numbers automatically to your list items.</li>
 
169
  <li><a href="http://unlimited-elements.com/food-menu-box-widget-for-elementor/">Product Card Widget for Elementor (Free)</a></li>
170
+ <li><a href="https://unlimited-elements.com/copy-coupon-code-widget-for-elementor">Copy Coupon Code Widget for Elementor (Pro)</a> - Click to copy coupon code to the clipboard. This widgets makes it easy for users to redeem your promotions coupon codes.</li>
171
+ <li><a href="https://unlimited-elements.com/google-maps-widget-for-elementor">Unlimited Google Maps Widget for Elementor (Pro)</a></li>
172
  <li><a href="https://unlimited-elements.com/timer-countdown-banner-widget-for-elementor">Timer Countdown Banner Widget for Elementor (Pro)</a> - An awesome countdown banner with a a call to action button.</li>
173
  <li><a href="https://unlimited-elements.com/card-testimonial-review-carousel-widget-for-elementor">Review Carousel Widget for Elementor (Pro)</a> - The Reviews Carousel increases the visibility reviews you want to highlight to your users by letting you display them throughout your site in an interactive carousel format. </li>
174
  <li><a href="https://unlimited-elements.com/list-marquee-widget-for-elementor/">List Marquee Widget for Elementor (Pro)</a></li>
 
175
  <li><a href="https://unlimited-elements.com/pricing-flip-box-widget-for-elementor/">Pricing Table Flip Box Widget for Elementor (Pro)</a> - The Pricing Table Flip Box allows you to showcase the prices for your products, services, or packages in a beautiful flip box pricing table.</li>
176
+ <li><a href="https://unlimited-elements.com/food-menu-carousel-widget-for-elementor">Product Carousel Widget for Elementor (Pro)</a></li>
177
  <li><a href="https://unlimited-elements.com/event-list-widget-for-elementor/">Event List Widget for Elementor (Pro)</a> - The event list widget is a way to easily show your recent events like concerts, conferences, parties or special occasions.
178
  </li>
179
  <li><a href="https://unlimited-elements.com/price-box-widget-for-elementor/">Price Box Widget for Elementor (Pro)</a></li>
180
  <li><a href="https://unlimited-elements.com/icon-mobile-menu-for-elementor">Icon Mobile Menu Widget for Elementor (Pro)</a> - A perfect way to add an icon menu for making your CTA buttons stand out for website visitors using mobile devices.</li>
181
+ <li><a href="https://unlimited-elements.com/mobile-conversion-menu-for-elementor">Mobile Conversion Menu Widget for Elementor (Pro)</a> - Floating action buttons that display the primary actions in your Elementor website. Provide quick access to social icons or any important or common actions to increase conversions.</li>
182
+ <li><a href="https://unlimited-elements.com/whatsapp-chat-widget-for-elementor">WhatsApp Chat Widget for Elementor (Pro)</a> - A floating WhatsApp button that allows your website visitors to start a chat conversation from your website directly to your WhatsApp phone number with just one click.</li>
183
  <li><a href="https://unlimited-elements.com/product-bullets-widget-for-elementor">Product Bullets Widget for Elementor (Pro)</a></li>
 
 
184
  <li><a href="https://unlimited-elements.com/memory-game-widget-for-elementor">Memory Game Widget for Elementor (Pro)</a></li>
185
+ <li><a href="https://unlimited-elements.com/two-column-product-bullets-widget-for-elementor/">Product Highlights Widget for Elementor (Pro)</a> - Design a visually attractive product feature lists that will help your potential buyers to make purchase decision and learn more about your products. </li>
186
+ <li><a href="https://unlimited-elements.com/pricing-plans-widget-for-elementor">Pricing Plans Widget for Elementor (Pro)</a> - Use the Pricing Plans widget to display all the information to your potential clients in the clearest and comparable way and help them make a choice.</li>
187
  </ol>
188
 
189
  <h3>Infographic Widgets for Elementor</h3>
251
  <li><a href="https://unlimited-elements.com/remote-control-widgets">Remote Bullets Widget for Elementor (Free)</a></li>
252
  <li><a href="https://unlimited-elements.com/remote-control-widgets">Remote Counter Widget for Elementor (Free)</a></li>
253
  <li><a href="https://unlimited-elements.com/remote-control-widgets">Remote Play Pause Widget for Elementor (Free)</a></li>
254
+ <li><a href="https://unlimited-elements.com/remote-tabs-widget-for-elementor">Remote Tabs Widget for Elementor (Pro)</a> - Control your content using remote control tabs to create advanced interactive layouts.</li>
255
  <li><a href="https://unlimited-elements.com/remote-control-widgets">Remote Item Navigation Widget for Elementor (Pro)</a></li>
256
+ </ol>
257
+
258
+ <h3>Media Widgets for Elementor</h3>
259
+ <ol>
260
+ <li><a href="https://unlimited-elements.com/simple-slider-widget-for-elementor/">Simple Slider Widget for Elementor (Free)</a></li>
261
+ <li><a href="https://unlimited-elements.com/tile-gallery-widget-for-elementor/">Tile Gallery Widget for Elementor (Free)</a> - This widget is an effective tool for adding a tile grid image gallery slider to your website. The gallery lets you navigate using bullets or arrows and opens the images or videos in a light-box.</li>
262
+ <li><a href="https://unlimited-elements.com/compact-gallery-widget-for-elementor/">Compact Gallery Widget for Elementor (Free)</a> - This widget is an effective tool for adding a Minimalistic Image and Video Gallery to your Elementor website.</li>
263
+ <li><a href="https://unlimited-elements.com/slider-gallery-widget-for-elementor/">Slider Gallery Widget for Elementor (Free)</a></li>
264
+ <li><a href="https://unlimited-elements.com/audio-playlist-widget-for-elementor">Audio Playlist Widget for Elementor (Pro)</a> - Create MP3 Audio Playlists inside of Elementor. Use this widget to add the ability to create unlimited numbers of playlists, albums, and audio tracks.</li>
265
+ <li><a href="https://unlimited-elements.com/audio-player-widget-for-elementor/">Audio Player Widget for Elementor (Pro)</a> - MP3 Music Player is a very easy to use Audio Player for Elementor. It gives you the ability to add unlimited audio tracks to any page using our Elementor addon let users listen to music on your website. </li>
266
+ <li><a href="https://unlimited-elements.com/thumbnail-slider-widget-for-elementor/">Thumbnail Slider Widget for Elementor (Pro)</a></li>
267
+ <li><a href="https://unlimited-elements.com/justified-gallery-widget-for-elementor/">Justified Gallery Widget for Elementor (Pro)</a> - Add an amazing Justified image and video grid with a pretty lightbox effect on your Elementor Pages.</li>
268
+ <li><a href="https://unlimited-elements.com/grid-gallery-widget-for-elementor/">Grid Gallery Widget for Elementor (Pro)</a> - This widget is an effective tool for adding a grid panel image and video gallery to your Elementor website.</li>
269
+ <li><a href="https://unlimited-elements.com/carousel-gallery-widget-for-elementor/">Carousel Gallery Widget for Elementor (Pro)</a> - This widget is an effective tool for adding a responsive carousel image and video media carousel to your website.</li>
270
+ <li><a href="https://unlimited-elements.com/unlimited-gallery-widget-for-elementor/">Thumbs Gallery Widget for Elementor (Pro)</a> - This widget is an effective tool for adding a simple image and video gallery to your Elementor website.</li>
271
+ <li><a href="https://unlimited-elements.com/image-video-content-slider-widget-for-elementor">Image and Video Content Slider Widget for Elementor (Pro)</a></li>
272
+ <li><a href="https://unlimited-elements.com/thumb-list-video-gallery-widget-for-elementor/">Play List Video Gallery Widget for Elementor (Pro)</a></li>
273
+ </ol>
274
+
275
+ <h3>Content Widgets for Elementor</h3>
276
+ <ol>
277
+ <li><a href="https://unlimited-elements.com/content-tabs-widget-for-elementor/">Content Tabs Widget for Elementor (Free)</a></li>
278
+ <li><a href="https://unlimited-elements.com/content-accordion-widget-for-elementor/">Content Accordion Widget for Elementor (Free)</a></li>
279
+ <li><a href="https://unlimited-elements.com/unlimited-grid-widget-for-elementor/">Unlimited Grid Widget for Elementor (Pro)</a> - Create advanced content layouts using an easy-to-use grid system with ultimate flexibility.</li>
280
+ <li><a href="https://unlimited-elements.com/content-switcher-widget-for-elementor/">Content Switcher Widget for Elementor (Pro)</a> - Allow users to switch between two or more types of content using interactive toggle buttons. You can even load Elementor templates as content to make advanced content switcher layouts.
281
+
282
+ </li>
283
+ <li><a href="https://unlimited-elements.com/content-slider-widget-for-elementor">Content Slider Widget for Elementor (Pro)</a> - Content slider is the most extensive and user-friendly Elementor widget for building amazing sliders. Create stunning animated sliders inside of your web designs in seconds.</li>
284
+ <li><a href="https://unlimited-elements.com/content-carousel-widget-for-elementor/">Content Carousel Widget for Elementor (Pro)</a> - Content carousel allows you to create an interactive carousel where the content for each slide can be anything you want: images, text, HTML, and even Elementor templates.</li>
285
+ <li><a href="https://unlimited-elements.com/content-grid-widget-for-elementor/">Content Grid Widget for Elementor (Pro)</a></li>
286
+ <li><a href="https://unlimited-elements.com/content-ticker-widget-for-elementor/">Content Ticker Widget for Elementor (Pro)</a></li>
287
  </ol>
288
 
289
  <h3>Testimonials for Elementor</h3>
304
  <li><a href="https://unlimited-elements.com/sliding-effect-team-member-widget-for-elementor">Team Member Sliding Effect Widget for Elementor (Pro)</a></li>
305
  </ol>
306
 
 
 
 
 
 
 
 
307
  <h3>Content Boxes for Elementor</h3>
308
  <ol>
309
  <li><a href="https://unlimited-elements.com/image-zoom-content-box-widget-for-elementor/">Image Zoom Content Box Widget for Elementor (Free)</a></li>
387
  <li><a href="https://unlimited-elements.com/christmas-text-widget-for-elementor">Christmas Text Widget for Elementor (Pro)</a></li>
388
  </ol>
389
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  <h3>Icon Boxes for Elementor</h3>
391
  <ol>
392
  <li><a href="https://unlimited-elements.com/icon-box-widget-for-elementor/">Icon Box Widget for Elementor (Free)</a></li>
401
  <li><a href="https://unlimited-elements.com/solid-color-overlay-icon-box-widget-for-elementor">Overlay Icon Box Widget for Elementor (Pro)</a></li>
402
  </ol>
403
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  <h3>Block Quotes for Elementor</h3>
405
  <ol>
406
  <li><a href="https://unlimited-elements.com/block-quote-box-widget-for-elementor">Block Quote Box Widget for Elementor (Free)</a></li>
455
 
456
 
457
 
458
+
459
  == Installation ==
460
 
461
  Note : This plugin works with Elementor. Make sure you have [Elementor](https://wordpress.org/plugins/elementor/) installed.
466
 
467
  == Changelog ==
468
 
469
+ version 1.5.10: 2022-04-04
470
+
471
+ * Fix: fixed title and description source in gallery source selection
472
+ * Fix: fixed the dropdown attribute php filter for elementor
473
+ * Feature: added "menu_id" for various uses as menu attribute output
474
+ * Feature: added option for side offset in owl carousel
475
+ * Feature: added option for second items html refresh in ajax filters
476
+
477
+
478
+ version 1.5.9: 2022-03-27
479
+
480
+ * Fix: fixed simple meta output for post list
481
+ * Feature: made dynamic grid work with filters
482
+ * Feature: the background widgets works for the new container objects as well
483
+ * Feature: added include by another meta field in post query
484
+
485
+
486
+ version 1.5.8: 2022-03-23
487
+
488
+ * Feature: set special behaviour for more then one filters on the page
489
+ * Feature: added option to load video item from posts in a gallery
490
+ * Change: set up galleries common default items
491
+ * Fix: fixed unclosable gallery lightbox with youtube videos
492
+ * Fix: fixed elementor 3.6.0 compatability
493
+
494
+
495
+ version 1.5.7: 2022-03-17
496
+
497
+ * Feature: added option to modify dropdown items in php
498
+ Fix: fixed gallery default items preview and init
499
+ Fix: fixed remote counter js error
500
+
501
+
502
+ version 1.5.6 = 2022-03-15:
503
+
504
+ Fix: fixed dissapearing items in remote related widgets
505
+
506
+
507
+ version 1.5.5 = 2022-03-15:
508
+
509
+ * Feature: added woocommerce sorting options in posts selection by number of sales and rating
510
+ * Feature: added option to get related products on checkout page
511
+ * Feature: done manual posts and terms selections sort by drag and drop
512
+ * Feature: done option to custom refresh filters html (for carousels, galleries etc)
513
+ * Feature: made the attributes dialog support multi controls
514
+ * Feature: prepared the galleries and dynamic loops to use filters and load more
515
+ Fix: fixed query debug in manual posts selection
516
+ Fix: fix: fixed posts_per_page in manual posts selection
517
+ Fix: fix: fixed jquery include for remote widgets
518
+
519
+
520
+ version 1.5.4 = 2022-03-06:
521
+
522
+ * Feature: added roles to post filter: single, main and child
523
+ * Feature: added option "placeholder" and "disable dynamic" for text field control
524
+ * Feature: added option for debug meta fields in post list, post grid
525
+ * Fix: fixed some pagination widget buttons related issues
526
+ * Fix: fixed non clickable items in some widgets
527
+ * Fix: fixed put_items(0) - first item output in twig
528
+
529
+
530
+ version 1.5.3 = 2022-02-23:
531
 
532
  * Feature: added functionality to put image inside taxonomy terms widget
533
  * Fix: fixed load more on archive page with orderby=xxx filter in url
535
  * Change: updated freemius sdk to 2.4.3 version (Security fix)
536
 
537
 
538
+ version 1.5.2 = 2022-02-23:
539
 
540
  * Feature: set up remote and sync functionality for the galleries
541
  * Fix: fixed load more for current query posts
544
  * Fix: fixed replace mode in tabs filters
545
 
546
 
547
+ version 1.5.1 = 2022-02-21:
548
 
549
  * Feature: improved post pagination debug and added force options
550
  * Feature: added code for the button filters
561
 
562
 
563
 
564
+ version 1.5.0 = 2022-02-02:
565
 
566
  * Feature: added tabs in items controls
567
  * Feature: added functionality for ajax taxonomies terms filter
release_log.txt CHANGED
@@ -1,4 +1,70 @@
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  version 1.5.3:
3
 
4
  -feature: added functionality to put image inside taxonomy terms widget
1
 
2
+ version 1.5.10:
3
+
4
+ -bug fix: fixed title and description source in gallery source selection
5
+ -bug fix: fixed the dropdown attribute php filter for elementor
6
+ -feature: added "menu_id" for variouse uses as menu attribute output
7
+ -feature: added option for side offset in owl carousel
8
+ -feature: added option for second items html refresh in ajax filters
9
+
10
+
11
+
12
+ version 1.5.9:
13
+
14
+ -bug fix: fixed simple meta output for post list
15
+ -feature: made dynamic grid work with filters
16
+ -feature: the background widgets works for the new container objects as well
17
+ -feature: added include by another meta field in post query
18
+
19
+
20
+
21
+ version 1.5.8:
22
+
23
+ -feature: set special behaviour for more then one filters on the page
24
+ -feature: added option to load video item from posts in a gallery
25
+ -change: set up galleries common default items
26
+ -bug fix: fixed unclosable gallery lightbox with youtube videos
27
+ -bug fix: fixed elementor 3.6.0 compatability
28
+
29
+
30
+
31
+ version 1.5.7:
32
+
33
+ -feature: added option to modify dropdown items in php
34
+ -bug fix: fixed gallery default items preview and init
35
+ -bug fix: fixed remote counter js error
36
+
37
+
38
+
39
+ version 1.5.6:
40
+
41
+ -bug fix: fixed dissapearing items in remote related widgets
42
+
43
+
44
+ version 1.5.5:
45
+
46
+ -bug fix: fixed query debug in manual posts selection
47
+ -bug fix: fixed posts_per_page in manual posts selection
48
+ -feature: added woocommerce sorting options in posts selection by number of sales and rating
49
+ -feature: added option to get related products on checkout page
50
+ -feature: done manual posts and terms selections sort by drag and drop
51
+ -bug fix: fixed jquery include for remote widgets
52
+ -feature: done option to custom refresh filters html (for carousels, galleries etc)
53
+ -feature: made the attributes dialog support multi controls
54
+ -feature: prepared the galleries and dynamic loops to use filters and load more
55
+
56
+
57
+
58
+ version 1.5.4:
59
+
60
+ -feature: added roles to post filter: single, main and child
61
+ -bug fix: fixed some pagination widget buttons related issues
62
+ -bug fix: fixed non clickable items in some widgets
63
+ -feature: added option "placeholder" and "disable dynamic" for text field control
64
+ -feature: added option for debug meta fields in post list, post grid
65
+ -bug fix: fixed put_items(0) - first item output in twig
66
+
67
+
68
  version 1.5.3:
69
 
70
  -feature: added functionality to put image inside taxonomy terms widget
unlimited_elements.php CHANGED
@@ -4,14 +4,14 @@
4
  * Plugin URI: http://unlimited-elements.com
5
  * Description: Unlimited Elements - Huge Widgets Pack for Elementor Website Builder, with html/css/js widget creator and editor
6
  * Author: Unlimited Elements
7
- * Version: 1.5.3
8
  * Author URI: http://unlimited-elements.com
9
  * Text Domain: unlimited-elements-for-elementor
10
  * Domain Path: /languages
11
  *
12
  * Tested up to: 5.9
13
- * Elementor tested up to: 3.5.3
14
- * Elementor Pro tested up to: 3.5.2
15
  */
16
 
17
  if(!defined("UNLIMITED_ELEMENTS_INC"))
4
  * Plugin URI: http://unlimited-elements.com
5
  * Description: Unlimited Elements - Huge Widgets Pack for Elementor Website Builder, with html/css/js widget creator and editor
6
  * Author: Unlimited Elements
7
+ * Version: 1.5.10
8
  * Author URI: http://unlimited-elements.com
9
  * Text Domain: unlimited-elements-for-elementor
10
  * Domain Path: /languages
11
  *
12
  * Tested up to: 5.9
13
+ * Elementor tested up to: 3.6.1
14
+ * Elementor Pro tested up to: 3.6.3
15
  */
16
 
17
  if(!defined("UNLIMITED_ELEMENTS_INC"))
views/objects/addon_view_childparams.class.php CHANGED
@@ -375,6 +375,22 @@ class UniteCreatorAddonViewChildParams{
375
 
376
  $arrParams[] = $this->createChildParam_code($key, $text);
377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
 
379
  //----- output ------
380
 
@@ -414,8 +430,8 @@ function {{uc_id}}_start(){
414
 
415
  console.log(\"This code works!\");
416
 
417
- }if(jQuery(\"#{{uc_id}}\").length) {{uc_id}}_start(); else
418
- jQuery( document ).on( 'elementor/popup/show', () => { if(jQuery(\"#{{uc_id}}\").length) {{uc_id}}_start();});
419
  });";
420
  $arrParams[] = $this->createChildParam_code($key, $text);
421
 
@@ -1415,6 +1431,7 @@ function {{uc_id}}_start(){
1415
  $arrParams = array();
1416
 
1417
  $arrParams[] = $this->createAddParam("|raw");
 
1418
 
1419
  return($arrParams);
1420
  }
375
 
376
  $arrParams[] = $this->createChildParam_code($key, $text);
377
 
378
+ //----- set and get ------
379
+
380
+ $key = "get_last_query_data()";
381
+ $text = "
382
+ {# get last post query data #}
383
+
384
+ {% set query_data = ucfunc(\"get_last_query_data\") %}
385
+
386
+ {{query_data.total_posts}}
387
+
388
+ {{printVar(query_data)}}
389
+ ";
390
+
391
+ $arrParams[] = $this->createChildParam_code($key, $text);
392
+
393
+
394
 
395
  //----- output ------
396
 
430
 
431
  console.log(\"This code works!\");
432
 
433
+ }setTimeout(function(){if(jQuery(\"#{{uc_id}}\").length) {{uc_id}}_start(); else
434
+ jQuery( document ).on( 'elementor/popup/show', () => { if(jQuery(\"#{{uc_id}}\").length) {{uc_id}}_start();});},100);
435
  });";
436
  $arrParams[] = $this->createChildParam_code($key, $text);
437
 
1431
  $arrParams = array();
1432
 
1433
  $arrParams[] = $this->createAddParam("|raw");
1434
+ $arrParams[] = $this->createAddParam("id");
1435
 
1436
  return($arrParams);
1437
  }