PageSourceSearch

https://petromag.kz/mg-cache/mg-leader/cache/pages_/affiliate/engine-script-LANG.js?rev=1789468517

js petromag.kz collected 2026-10-05 00:10:48 UTC 796,026 bytes, 7,719 lines download raw bytes

1 
2if(typeof locale == 'undefined'){locale={};}
3$.extend(locale, {
4    'cartRemove': 'Удалить',
5    'fancyNext': 'Вперед',
6    'fancyPrev': 'Назад',
7    'countMsg1': 'Здравствуйте, меня интересует товар ',
8    'countMsg2': ' с артикулом ',
9    'countMsg3': " , но его нет в наличии. Сообщите, пожалуйста, о поступлении этого товара на склад.",
10    'countInStock': 'На складе',
11    'remaining': 'Остаток',
12    'pcs': 'шт.',
13    'paymentNone': 'нет доступных способов оплаты',
14    'filterNone': 'Не нашлось подходящих товаров!',
15    'deliveryInformation': '+ доставка: ',
16    'waitCalc': 'Подождите, идет пересчет...',
17    'checkout': 'Оформить заказ',
18    'RecentlyViewed': 'Вы недавно смотрели',
19    'MAX': 'Максимум',
20    'deliveryF': 'Доставка: ',
21    'productSearch': 'Поиск товаров...',
22    'availibleVariants': 'Есть варианты',
23    'ShowInVarious': 'Показывать в нескольких категориях',
24    'share-product': 'Поделиться',
25    'emptyProduct': 'Товары не найдены',
26    'inCartText': 'В корзине',
27  	'buyBtn': 'Купить',
28    'available': 'На складе',
29    'notAvailable': 'Нет в наличии',
30    'moreButton': 'Подробнее',
31    'orderProduct': 'Товар',
32    'compareAdded': 'добавлен в',
33    'compareInformerLink': 'сравнение',
34    'compareInformerLinkRemove': 'сравнения',
35    'compareRemoved': 'удален из',
36    'favoritesRemoved': 'удален из',
37    'favoritesAdded': 'добавлен в',
38    'favoritesRemoved': 'удален из',
39    'favoritesInformerLink': 'избранное',
40    'favoritesInformerLinkRemove': 'избранного',
41    'noChangePayment': 'Нельзя изменить способ оплаты',
42}); 
43// js переменные из движка
44var mgBaseDir = '',
45    mgNoImageStub = '',
46    protocol = '',
47    phoneMask = '',
48    sessionToDB = '',
49    sessionAutoUpdate = '',
50    sessionLifeTime = 0,
51    timeWithoutUser = 0,
52    agreementClasses = '',
53    langP = '',
54    requiredFields = '',
55    varHashProduct = '';
56
57document.cookie.split(/; */).forEach(function (cookieraw) {
58    if (cookieraw.indexOf('mg_to_script') === 0) {
59        var cookie = cookieraw.split('=');
60        var name = cookie[0].substr(13);
61        var value = decodeURIComponent(cookie[1]);
62        window[name] = tryJsonParse(value.replace(/ /g, ' '));
63    }
64});
65
66// продление пхп сессии
67if (sessionLifeTime > 0 && window.sessionUpdateActive !== true) {
68    window.sessionUpdateActive = true;
69    setInterval(function () {
70        let dataObj = {
71            actionerClass: 'Ajaxuser',
72            action: 'updateSession'
73        };
74
75        let data = Object.keys(dataObj).map(function (k) {
76            return encodeURIComponent(k) + '=' + encodeURIComponent(dataObj[k])
77        }).join('&');
78
79        const request = new XMLHttpRequest();
80
81        request.open('POST', mgBaseDir + '/ajaxrequest', true);
82        request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
83
84        request.addEventListener("readystatechange", () => {
85            if (request.status < 200 && request.status >= 400) {
86                console.log('Session update error!');
87                console.log(request);
88            }
89        });
90
91        request.send(data);
92
93    }, (sessionLifeTime / 2 * 1000));
94}
95
96
97function tryJsonParse(str) {
98    try {
99        var res = JSON.parse(str);
100        return res;
101    } catch (e) {
102        return str;
103    }
104} 
105/*
106    A simple jQuery modal (http://github.com/kylefox/jquery-modal)
107    Version 0.9.1
108*/
109! function(o) { "object" == typeof module && "object" == typeof module.exports ? o(require("jquery"), window, document) : o(jQuery, window, document) }(function(o, t, i, e) { var s = [],
110        l = function() { return s.length ? s[s.length - 1] : null },
111        n = function() { var o, t = !1; for (o = s.length - 1; o >= 0; o--) s[o].$blocker && (s[o].$blocker.toggleClass("current", !t).toggleClass("behind", t), t = !0) };
112    o.modal = function(t, i) { var e, n; if (this.$body = o("body"), this.options = o.extend({}, o.modal.defaults, i), this.options.doFade = !isNaN(parseInt(this.options.fadeDuration, 10)), this.$blocker = null, this.options.closeExisting)
113            for (; o.modal.isActive();) o.modal.close(); if (s.push(this), t.is("a"))
114            if (n = t.attr("href"), this.anchor = t, /^#/.test(n)) { if (this.$elm = o(n), 1 !== this.$elm.length) return null;
115                this.$body.append(this.$elm), this.open() } else this.$elm = o("<div>"), this.$body.append(this.$elm), e = function(o, t) { t.elm.remove() }, this.showSpinner(), t.trigger(o.modal.AJAX_SEND), o.get(n).done(function(i) { if (o.modal.isActive()) { t.trigger(o.modal.AJAX_SUCCESS); var s = l();
116                    s.$elm.empty().append(i).on(o.modal.CLOSE, e), s.hideSpinner(), s.open(), t.trigger(o.modal.AJAX_COMPLETE) } }).fail(function() { t.trigger(o.modal.AJAX_FAIL); var i = l();
117                i.hideSpinner(), s.pop(), t.trigger(o.modal.AJAX_COMPLETE) });
118        else this.$elm = t, this.anchor = t, this.$body.append(this.$elm), this.open() }, o.modal.prototype = { constructor: o.modal, open: function() { var t = this;
119            this.block(), this.anchor.blur(), this.options.doFade ? setTimeout(function() { t.show() }, this.options.fadeDuration * this.options.fadeDelay) : this.show(), o(i).off("keydown.modal").on("keydown.modal", function(o) { var t = l();
120                27 === o.which && t.options.escapeClose && t.close() }), this.options.clickClose && this.$blocker.click(function(t) { t.target === this && o.modal.close() }) }, close: function() { s.pop(), this.unblock(), this.hide(), o.modal.isActive() || o(i).off("keydown.modal") }, block: function() { this.$elm.trigger(o.modal.BEFORE_BLOCK, [this._ctx()]), this.$body.css("overflow", "hidden"), this.$blocker = o('<div class="' + this.options.blockerClass + ' blocker current"></div>').appendTo(this.$body), n(), this.options.doFade && this.$blocker.css("opacity", 0).animate({ opacity: 1 }, this.options.fadeDuration), this.$elm.trigger(o.modal.BLOCK, [this._ctx()]) }, unblock: function(t) {!t && this.options.doFade ? this.$blocker.fadeOut(this.options.fadeDuration, this.unblock.bind(this, !0)) : (this.$blocker.children().appendTo(this.$body), this.$blocker.remove(), this.$blocker = null, n(), o.modal.isActive() || this.$body.css("overflow", "")) }, show: function() { this.$elm.trigger(o.modal.BEFORE_OPEN, [this._ctx()]), this.options.showClose && (this.closeButton = o('<a href="#close-modal" rel="modal:close" class="close-modal ' + this.options.closeClass + '">' + this.options.closeText + "</a>"), this.$elm.append(this.closeButton)), this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker), this.options.doFade ? this.$elm.css({ opacity: 0, display: "inline-block" }).animate({ opacity: 1 }, this.options.fadeDuration) : this.$elm.css("display", "inline-block"), this.$elm.trigger(o.modal.OPEN, [this._ctx()]) }, hide: function() { this.$elm.trigger(o.modal.BEFORE_CLOSE, [this._ctx()]), this.closeButton && this.closeButton.remove(); var t = this;
121            this.options.doFade ? this.$elm.fadeOut(this.options.fadeDuration, function() { t.$elm.trigger(o.modal.AFTER_CLOSE, [t._ctx()]) }) : this.$elm.hide(0, function() { t.$elm.trigger(o.modal.AFTER_CLOSE, [t._ctx()]) }), this.$elm.trigger(o.modal.CLOSE, [this._ctx()]) }, showSpinner: function() { this.options.showSpinner && (this.spinner = this.spinner || o('<div class="' + this.options.modalClass + '-spinner"></div>').append(this.options.spinnerHtml), this.$body.append(this.spinner), this.spinner.show()) }, hideSpinner: function() { this.spinner && this.spinner.remove() }, _ctx: function() { return { elm: this.$elm, $elm: this.$elm, $blocker: this.$blocker, options: this.options } } }, o.modal.close = function(t) { if (o.modal.isActive()) { t && t.preventDefault(); var i = l(); return i.close(), i.$elm } }, o.modal.isActive = function() { return s.length > 0 }, o.modal.getCurrent = l, o.modal.defaults = { closeExisting: !0, escapeClose: !0, clickClose: !0, closeText: "Close", closeClass: "", modalClass: "modal", blockerClass: "jquery-modal", spinnerHtml: '<div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div>', showSpinner: !0, showClose: !0, fadeDuration: null, fadeDelay: 1 }, o.modal.BEFORE_BLOCK = "modal:before-block", o.modal.BLOCK = "modal:block", o.modal.BEFORE_OPEN = "modal:before-open", o.modal.OPEN = "modal:open", o.modal.BEFORE_CLOSE = "modal:before-close", o.modal.CLOSE = "modal:close", o.modal.AFTER_CLOSE = "modal:after-close", o.modal.AJAX_SEND = "modal:ajax:send", o.modal.AJAX_SUCCESS = "modal:ajax:success", o.modal.AJAX_FAIL = "modal:ajax:fail", o.modal.AJAX_COMPLETE = "modal:ajax:complete", o.fn.modal = function(t) { return 1 === this.length && new o.modal(this, t), this }, o(i).on("click.modal", 'a[rel~="modal:close"]', o.modal.close), o(i).on("click.modal", 'a[rel~="modal:open"]', function(t) { t.preventDefault(), o(this).modal() }) }); 
122var bonusCard = (function () {
123  return {
124    /**
125     * Инициализирует обработчики для кнопок и элементов раздела.
126     */
127    init: function () {     
128      $('body').on('click', '#bonus-card  #becomeBonusKeeper', function () {
129        bonusCard.newCard();
130      });
131      $('body').on('click', '#bonus-card  #shareBonus', function(e){
132        e.preventDefault();
133        $('#bonus-card .form-for-share-bonus').show();
134        $(this).hide();
135      });
136           // закрытие формы перевода бонусов == отмена
137      $('body').on('click', '#bonus-card  .form-for-share-bonus .close-form', function(){
138        location.reload();
139      })
140            // введены получатель и количество перевода, нажатие далее - проверка существования получателя и 
141                 // возмоможности перевода данного количества
142      $('body').on('click', '#bonus-card .form-for-share-bonus .next-step', function(){
143         var button = $(this);
144          $(button).hide();
145        var recipient = $('.form-for-share-bonus input[name=number]').val();
146        var bonus = $('.form-for-share-bonus input[name=bonus]').val();
147        if (recipient && bonus) {
148        $.ajax({
149          type: "POST",
150          url: "ajaxrequest",
151          data: {
152            pluginHandler: "bonus-card",
153            actionerClass: "Cardoperations",
154            action: "shareBonus",
155            recipient:recipient,
156            bonus: bonus
157          },
158          dataType: "json",
159          cache: false,
160          success: function (response) {
161            if (response.status=='error') {
162              $(button).show();
163              $('#bonus-card .form-for-share-bonus .error-text').show();
164              $('#bonus-card .form-for-share-bonus .error-text').text(response.data.error ? response.data.error : 'Ошибка при проверке данных!');
165            } else {
166              $('#bonus-card .form-for-share-bonus .error-text').hide();
167              $('#bonus-card .form-for-share-bonus .error-text').text('');
168              var success= 'Перевод '+bonus+' бонусов пользователю '+response.data.name;
169              $('#bonus-card .form-for-share-bonus .confirm').text(success);
170              $('#bonus-card .form-for-share-bonus .confirm').show();
171              $('#bonus-card .form-for-share-bonus .step2').show();
172              $('#bonus-card .form-for-share-bonus .step1').hide();
173               $('#bonus-card .form-for-share-bonus li input').attr('disabled', true);
174            }             
175          },
176        });
177      } else {
178        $(button).show();
179        $('#bonus-card .form-for-share-bonus .error-text').show();
180        $('#bonus-card .form-for-share-bonus .error-text').text('Все поля необходимо заполнить!');
181      }
182      });
183            // первая проверка прошла, подтверждение перевода - отправка кода подтверждения
184      $('body').on('click', '#bonus-card .form-for-share-bonus .next-step2', function(){
185         var button = $(this);
186          $(button).hide();
187        var recipient = $('.form-for-share-bonus input[name=number]').val();
188        var bonus = $('.form-for-share-bonus input[name=bonus]').val();
189        if (recipient && bonus) {
190        $.ajax({
191          type: "POST",
192          url: "ajaxrequest",
193          data: {
194            pluginHandler: "bonus-card",
195            actionerClass: "Cardoperations",
196            action: "shareBonusVerify",
197            recipient:recipient,
198            bonus: bonus
199          },
200          dataType: "json",
201          cache: false,
202          success: function (response) {
203            if (response.status=='error') {
204              $(button).show();
205              $('#bonus-card .form-for-share-bonus .error-text').show();
206              $('#bonus-card .form-for-share-bonus .error-text').text(response.data.error ? response.data.error : 'Ошибка при выполнении запроса!');
207            } else {
208              $('#bonus-card .form-for-share-bonus .error-text').hide();
209              $('#bonus-card .form-for-share-bonus .error-text').text('');             
210              $('#bonus-card .form-for-share-bonus .verify').show();
211              $('#bonus-card .form-for-share-bonus .verify.message').html('<span>На почту отправлен код подтверждения, \
212                  введите его в поле и нажмите "Завершить перевод".\
213                  Если письмо не доставлено проверьте папку "Спам"</span>\
214                    <a href="javascript:void(0);" class="send-once-more" data-id="'+response.data.id+'">Отправить еще раз<a>');
215              $('#bonus-card .form-for-share-bonus li input[name="code"]').removeAttr('disabled');
216              $('#bonus-card .form-for-share-bonus .step2').hide();
217              $('#bonus-card .form-for-share-bonus .step3').show();     
218              $('#bonus-card .form-for-share-bonus .step3 .next-step3').data('id',response.data.id);    
219            }
220             
221          }
222      });
223      }
224    });
225          // ввод кода подтверждение, завершение перевода - если код отправленный совпадает с хранимым в бд
226    $('body').on('click', '#bonus-card .form-for-share-bonus .next-step3', function(){
227      var button = $(this);
228      $(button).hide();
229      var id = $(this).data('id');
230      var code = $('.form-for-share-bonus input[name=code]').val();
231      if ($.trim(code) == '') {
232        $(button).show();
233        $('.form-for-share-bonus input[name=code]').addClass('error-input');
234        $('#bonus-card .form-for-share-bonus .error-text').show();
235        $('#bonus-card .form-for-share-bonus .error-text').text('Необходимо ввести код подтверждения из письма!');
236        return false;
237      }
238      if (id&&code) {        
239        $.ajax({
240          type: "POST",
241          url: "ajaxrequest",
242          data: {
243            pluginHandler: "bonus-card",
244            actionerClass: "Cardoperations",
245            action: "shareBonusComplete",
246            id:id,
247            code: code
248          },
249          dataType: "json",
250          cache: false,
251          success: function (response) {
252            if (response.status=='error') {
253              $(button).show();
254              $('#bonus-card .form-for-share-bonus .error-text').show();
255              $('#bonus-card .form-for-share-bonus .error-text').text(response.data.error ? response.data.error : 'Ошибка при проверке данных!');
256            } else {
257              $('#bonus-card .form-for-share-bonus .success').show();
258            }             
259          },
260        });
261    }else {
262        $(button).show();
263        $('#bonus-card .form-for-share-bonus .error-text').show();
264        $('#bonus-card .form-for-share-bonus .error-text').text('Невозможно отправить запрос!');
265      }
266      });
267            // повторная отправка кода
268     $('body').on('click', '#bonus-card .form-for-share-bonus .send-once-more', function(){
269        var id = $(this).data('id');
270        $.ajax({
271          type: "POST",
272          url: "ajaxrequest",
273          data: {
274            pluginHandler: "bonus-card",
275            actionerClass: "Cardoperations",
276            action: "sendOnceMore",
277            id:id,
278          },
279          dataType: "json",
280          cache: false,
281          success: function (response) {
282            if (response.status=='error') {
283              $('#bonus-card .form-for-share-bonus .error-text').show();
284              $('#bonus-card .form-for-share-bonus .error-text').text('Ошибка при повторной отправке письма!');         
285            } else {
286              $('#bonus-card .form-for-share-bonus .error-text').hide();
287              $('#bonus-card .form-for-share-bonus .error-text').text('');             
288              $('#bonus-card .form-for-share-bonus .verify.message').text('На почту ПОВТОРНО отправлен код подтверждения, \
289                  введите его в поле и нажмите "Завершить перевод".\
290                  Если письмо не доставлено проверьте папку "Спам"');
291            }             
292          }
293      });
294       });
295           // повторная отправка кода
296     $('body').on('click', '#activateCode', function(){
297       $('.activate-gift-card .message-act').text('');
298       $('.activate-gift-card .message-act').hide();
299       var code = $('.activate-gift-card input[name=code]').val();
300       if (code =='') {
301         $('.activate-gift-card input[name=code]').addClass('error-input');
302         $('.activate-gift-card .message-act').text('Для активации необходимо ввести код!');
303         $('.activate-gift-card .message-act').show();
304         return false;
305       }
306        $.ajax({
307          type: "POST",
308          url: "ajaxrequest",
309          data: {
310            pluginHandler: "bonus-card",
311            actionerClass: "Cardoperations",
312            action: "activateCode",
313            code:code,
314          },
315          dataType: "json",
316          cache: false,
317          success: function (response) {
318            if (response.status=='error') {
319              $('.activate-gift-card .message-act').text(response.data.error);
320              $('.activate-gift-card .message-act').show();        
321            } else {
322              location.reload();
323            }             
324          }
325      });
326    });
327    },    
328    
329    newCard: function () {
330      $.ajax({
331        type: "POST",
332        url: mgBaseDir+ "/ajaxrequest",
333        data: {
334          pluginHandler: "bonus-card",
335          actionerClass: "Cardoperations",
336          action: "addNewCard"
337        },
338        dataType: "json",
339        cache: false,
340        success: function (response) {
341          location.reload();
342        }
343      });
344    }
345    
346  }
347
348})();
349$(document).ready(function () {
350// инициализация модуля при подключении
351  bonusCard.init();
352  initBonusVariants();
353});
354
355const initBonusVariants = function () {
356  function declensionNum(number, titlesAfter, titlesBefore = []) {
357    const cases = [2, 0, 1, 1, 1, 2];
358    let res = '';
359    if (titlesBefore.length === 3) {
360      res += titlesBefore[(number % 100 > 4 && number % 100 < 20)?2:cases[Math.min(number % 10, 5)]]+' ';
361    }
362    res += number+" "+titlesAfter[(number % 100 > 4 && number % 100 < 20)?2:cases[Math.min(number % 10, 5)]];
363    return res;
364  }
365  const locale = ['бонус','бонуса' ,"бонусов" ];
366  $('.bonus-card-info').each((index, elem) => {
367
368  const productWrapper = $(elem).closest('.product-wrapper');
369  const bonusContainer = productWrapper.find('.bonus-card-info');
370  const priseSelector = bonusContainer.attr('data-selector');
371  if (priseSelector) {
372    const priceElem = productWrapper.find(priseSelector);
373    if (!priceElem) return;
374    const percent = bonusContainer.attr('data-percent');
375    const bonus = bonusContainer.attr('data-bonus');
376    if ('MutationObserver' in window) {
377      //Для инициализации плагина на элементах подключаемых динамически
378      if (priceElem) {
379      
380        var target = priceElem[0];
381        // Конфигурация observer (за какими изменениями наблюдать)
382        const config = {
383            attributes: true,
384            childList: true,
385            subtree: true,
386        };
387        const callback = function (mutationsList, observer) {
388          const price = (priceElem).text().replace(/[^0-9]/g,"");
389          const isPercent = bonusContainer.attr('data-percent') == 'true' ? true : false;
390          const bonuses = bonusContainer.attr('data-bonus');
391          let bonusCount = 0;
392          if (isPercent) {
393            bonusCount = Math.round(price * bonuses / 100);
394          } else {
395            bonusCount = Math.round(price / bonuses);
396          }
397          bonusContainer.text(declensionNum(bonusCount, locale) +' при покупке');
398        }
399        const observer = new MutationObserver(callback)
400        observer.observe(target, config);
401      }
402    } else {
403      priceElem.bind("DOMSubtreeModified", function () {
404        const price = (priceElem).text().replace(/[^0-9]/g,"");
405        const isPercent = bonusContainer.attr('data-percent') == 'true' ? true : false;
406        const bonuses = bonusContainer.attr('data-bonus');
407        let bonusCount = 0;
408        if (isPercent) {
409          bonusCount = Math.round(price * bonuses / 100);
410        } else {
411          bonusCount = Math.round(price / bonuses);
412        }
413        bonusContainer.text(declensionNum(bonusCount, locale) +' при покупке');
414      })
415    }
416  }
417});
418
419}
420
421 
422$(document).ready(function () {
423  if ($((window.location.hash).length)) {
424    var id = window.location.hash.substring(1);
425    answerId = window.location.hash.substring(1);
426    if (id.length) {
427      $('[data-question-id =' + id + ']').attr('id', id); 
428      $('[data-question-id =' + id + ']').addClass("open");
429      $('[data-question-id =' + id + ']').addClass("faq-item_open");
430      $('[data-answer-id =' + id + ']').show();
431    }
432  }
433  $('body').on('click', '.question', function () {
434    var id = $(this).attr('data-question-id');
435    if (id.length) {
436      $('[data-question-id =' + id + ']').removeAttr('id');
437      $('[data-answer-id =' + id + ']').slideToggle(200);
438    }
439    
440    $(this).toggleClass("open");
441    $(this).toggleClass("faq-item_open");
442  });
443});
444 
445var iniTemporarySale = function() {
446  if ($('#tempSaleFlipclock').length) {
447    flipclockTempSale = $('#tempSaleFlipclock').FlipClock($('#tempSaleFlipclock').data('remaining'), {
448      clockFace: 'DailyCounter',
449      countdown: true,
450      language: 'Russian'
451    });
452  }
453  setTimeout(function() {
454    var key = $('.temporarySaleBanner .closeTempSale').data('saleid');
455    key = 'tempSaleClosed'+key;
456    var tmp = getSaleCookie(key);
457    if (tmp === null) {
458      $('.temporarySaleBanner').show();
459    }
460  }, 2000);
461  $('body').on('click', '.temporarySaleBanner .closeTempSale', function() {
462    var bannerID = $(this).attr('data-saleid');
463    var parentBanner = $('.closeTempSale[data-saleid=' + bannerID +']').parent();
464    parentBanner.hide();
465    var key = $('.temporarySaleBanner .closeTempSale').data('saleid');
466    key = 'tempSaleClosed'+key;
467    setSaleCookie(key, 'closed');
468  });
469}
470
471$(document).ready(function (){
472  iniTemporarySale();
473});
474
475function setSaleCookie(key, value){
476  var expires = new Date();
477  expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000));//1 день
478  document.cookie = key + '=' + value + ';expires=' + expires.toUTCString()+"; path=/";
479}
480function getSaleCookie(key) {
481  var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
482  return keyValue ? keyValue[2] : null;
483} 
484/*! flipclock 2015-08-31 */
485var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}}
485,{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a<arguments.length;a++)"function"==typeof arguments[a]?arguments[a](this.prototype):this.prototype.extend(arguments[a]);return this},toString:function(){return String(this.valueOf())}});var FlipClock;!function(a){"use strict";FlipClock=function(a,b,c){return b instanceof Object&&b instanceof Date==!1&&(c=b,b=0),new FlipClock.Factory(a,b,c)},FlipClock.Lang={},FlipClock.Base=Base.extend({buildDate:"2014-12-12",version:"0.7.7",constructor:function(b,c){"object"!=typeof b&&(b={}),"object"!=typeof c&&(c={}),this.setOptions(a.extend(!0,{},b,c))},callback:function(a){if("function"==typeof a){for(var b=[],c=1;c<=arguments.length;c++)arguments[c]&&b.push(arguments[c]);a.apply(this,b)}},log:function(a){window.console&&console.log&&console.log(a)},getOption:function(a){return this[a]?this[a]:!1},getOptions:function(){return this},setOption:function(a,b){this[a]=b},setOptions:function(a){for(var b in a)"undefined"!=typeof a[b]&&this.setOption(b,a[b])}})}(jQuery),function(a){"use strict";FlipClock.Face=FlipClock.Base.extend({autoStart:!0,dividers:[],factory:!1,lists:[],constructor:function(a,b){this.dividers=[],this.lists=[],this.base(b),this.factory=a},build:function(){this.autoStart&&this.start()},createDivider:function(b,c,d){"boolean"!=typeof c&&c||(d=c,c=b);var e=['<span class="'+this.factory.classes.dot+' top"></span>','<span class="'+this.factory.classes.dot+' bottom"></span>'].join("");d&&(e=""),b=this.factory.localize(b);var f=['<span class="'+this.factory.classes.divider+" "+(c?c:"").toLowerCase()+'">','<span class="'+this.factory.classes.label+'">'+(b?b:"")+"</span>",e,"</span>"],g=a(f.join(""));return this.dividers.push(g),g},createList:function(a,b){"object"==typeof a&&(b=a,a=0);var c=new FlipClock.List(this.factory,a,b);return this.lists.push(c),c},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(a){a.$el.append(!1)},addDigit:function(a){var b=this.createList(a,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(b)},start:function(){},stop:function(){},autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0==this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(b,c){var d=this;a.each(b,function(a,b){var e=d.lists[a];e?(c||b==e.digit||e.play(),e.select(b)):d.addDigit(b)})}})}(jQuery),function(a){"use strict";FlipClock.Factory=FlipClock.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-div
485ider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(b,c,d){d||(d={}),this.lists=[],this.running=!1,this.base(d),this.$el=a(b).addClass(this.classes.wrapper),this.$wrapper=this.$el,this.original=c instanceof Date?c:c?Math.round(c):0,this.time=new FlipClock.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new FlipClock.Timer(this,d),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,d),this.autoStart&&this.start()},loadClockFace:function(a,b){var c,d="Face",e=!1;return a=a.ucfirst()+d,this.face.stop&&(this.stop(),e=!0),this.$el.html(""),this.time.minimumDigits=this.minimumDigits,c=FlipClock[a]?new FlipClock[a](this,b):new FlipClock[this.defaultClockFace+d](this,b),c.build(),this.face=c,e&&this.start(),this.face},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a},start:function(a){var b=this;b.running||b.countdown&&!(b.countdown&&b.time.time>0)?b.log("Trying to start timer when countdown already at 0"):(b.face.start(b.time),b.timer.start(function(){b.flip(),"function"==typeof a&&a()}))},stop:function(a){this.face.stop(),this.timer.stop(a);for(var b in this.lists)this.lists.hasOwnProperty(b)&&this.lists[b].stop()},reset:function(a){this.timer.reset(a),this.face.reset()},setTime:function(a){this.time.time=a,this.flip(!0)},getTime:function(a){return this.time},setCountdown:function(a){var b=this.running;this.countdown=a?!0:!1,b&&(this.stop(),this.start())},flip:function(a){this.face.flip(!1,a)}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(a,b,c){this.factory=a,this.digit=b,this.lastDigit=b,this.$el=this.createList(
485),this.$obj=this.$el,b>0&&this.select(b),this.factory.$el.append(this.$el)},select:function(a){if("undefined"==typeof a?a=this.digit:this.digit=a,this.digit!=this.lastDigit){var b=this.$el.find("."+this.classes.before).removeClass(this.classes.before);this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.appendListItem(this.classes.active,this.digit),b.remove(),this.lastDigit=this.digit}},play:function(){this.$el.addClass(this.factory.classes.play)},stop:function(){var a=this;setTimeout(function(){a.$el.removeClass(a.factory.classes.play)},this.factory.timer.interval)},createListItem:function(a,b){return['<li class="'+(a?a:"")+'">','<a href="#">','<div class="up">','<div class="shadow"></div>','<div class="inn">'+(b?b:"")+"</div>","</div>",'<div class="down">','<div class="shadow"></div>','<div class="inn">'+(b?b:"")+"</div>","</div>","</a>","</li>"].join("")},appendListItem:function(a,b){var c=this.createListItem(a,b);this.$el.append(c)},createList:function(){var b=this.getPrevDigit()?this.getPrevDigit():this.digit,c=a(['<ul class="'+this.classes.flip+" "+(this.factory.running?this.factory.classes.play:"")+'">',this.createListItem(this.classes.before,b),this.createListItem(this.classes.active,this.digit),"</ul>"].join(""));return c},getNextDigit:function(){return 9==this.digit?0:this.digit+1},getPrevDigit:function(){return 0==this.digit?9:this.digit-1}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(a,b,c){"object"!=typeof c&&(c={}),c.minimumDigits||(c.minimumDigits=a.minimumDigits),this.base(c),this.factory=a,b&&(this.time=b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;c<a.length;c++)a[c].match(/^\d*$/g)&&b.push(a[c]);return b},digit:function(a){var b=this.toString(),c=b.length;return b[c-a]?b[c-a]:!1},digitize:function(b){var c=[];if(a.each(b,function(a,b){b=b.toString(),1==b.length&&(b="0"+b);for(var d=0;d<b.length;d++)c.push(b.charAt(d))}),c.length>this.minimumDigits&&(this.minimumDigits=c.length),this.minimumDigits>c.length)for(var d=c.length;d<this.minimumDigits;d++)c.unshift("0");return c},getDateObject:function(){return this.time instanceof Date?this.time:new Date((new Date).getTime()+1e3*this.getTimeSeconds())},getDayCounter:function(a){var b=[this.getDays(),this.getHours(!0),this.getMinutes(!0)];return a&&b.push(this.getSeconds(!0)),this.digitize(b)},getDays:function(a){var b=this.getTimeSeconds()/60/60/24;return a&&(b%=7),Math.floor(b)},getHourCounter:function(){var a=this.digitize([this.getHours(),this.getMinutes(!0),this.get
485Seconds(!0)]);return a},getHourly:function(){return this.getHourCounter()},getHours:function(a){var b=this.getTimeSeconds()/60/60;return a&&(b%=24),Math.floor(b)},getMilitaryTime:function(a,b){"undefined"==typeof b&&(b=!0),a||(a=this.getDateObject());var c=[a.getHours(),a.getMinutes()];return b===!0&&c.push(a.getSeconds()),this.digitize(c)},getMinutes:function(a){var b=this.getTimeSeconds()/60;return a&&(b%=60),Math.floor(b)},getMinuteCounter:function(){var a=this.digitize([this.getMinutes(),this.getSeconds(!0)]);return a},getTimeSeconds:function(a){return a||(a=new Date),this.time instanceof Date?this.factory.countdown?Math.max(this.time.getTime()/1e3-a.getTime()/1e3,0):a.getTime()/1e3-this.time.getTime()/1e3:this.time},getTime:function(a,b){"undefined"==typeof b&&(b=!0),a||(a=this.getDateObject()),console.log(a);var c=a.getHours(),d=[c>12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(b,c){var d=0,e=[];return a.each(c,function(a,f){b>a?d+=parseInt(c[a],10):e.push(c[a])}),0===d?e:c},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(a){"use strict";FlipClock.Timer=FlipClock.Base.extend({callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},count:0,factory:!1,interval:1e3,animationRate:1e3,constructor:function(a,b){this.base(b),this.factory=a,this.callback(this.callbacks.init),this.callback(this.callbacks.create)},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.callback(this.callbacks.reset)},start:function(a){this.factory.running=!0,this._createTimer(a),this.callback(this.callbacks.start)},stop:function(a){this.factory.running=!1,this._clearInterval(a),this.callback(this.callbacks.stop),this.callback(a)},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.timer=!1,this.callback(a),this.callback(this.callbacks.destroy)},_interval:function(a){this.callback(this.callbacks.interval),this.callback(a),this.count++},_setInterval:function(a){var b=this;b._interval(a),b.timer=setInterval(function(){b._interval(a)},this.interval)}})}(jQuery),function(a){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b)},build:function(b){var c=this,d=this.factory.$el.find("ul");this.factory.time.time||(this.factory.original=new Date,this.factory.time=new FlipClock.Time(this.factory,this.factory.original));var b=b?b:this.factory.time.getMilitaryTime(!1,this.showSeconds);b.length>d.length&&a.each(b,function(a,b){c.createList(b)}),this.createDivider(),this.createDivider(),a(this.dividers[0]).insertBefore(this.lists[this.lists.length-2].$el),a(this.dividers[1]).insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a,b){this.autoIncrement(),a=a?a:this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(a,b)}})}(jQuery),function(a){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){"object"!=typeof b&&(b={}),a.autoStart=b.autoStart?!0:!1,b.autoStart&&(this.shouldAutoIncrement=!0),a.increment=function(){a.countdown=!1,a.setTime(a.getTime().getTimeSeconds()+1)},a.decrement=function(){a.countdown=!0;var b=a.getTime().getTimeSeconds();b>0&&a.setTime(b-1)},a.setValue=function(b){a.setTime(b)},a.setCounter=function(b){a.setTime(b)},this.base(a,b)},build:function(){var b=this,c=this.factory.$el.find("ul"),d=this.factory.getTime().digitize([this.factory.getTime().time]);d.length>c.length&&a.each(d,function(a,c){var d=b.createList(c);d.select(c)}),a.each(this.lists,function(a,b){b.play()}),this.base()},flip:function(a,b){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(a,b)},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}})}(jQuery),function(a){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,constructor:function(a,b){this.base(a,b)},build:function(b){var c=this,d=this.factory.$el.find("ul"),e=0;b=b?b:this.factory.time.getDayCounter(this.showSeconds),b.length>d.length&&a.each(b,function(a,b){c.createList(b)}),this.showSeconds?a(this.createDivider("Seconds")).insertBefore(this.lists[this.lists.length-2].$el):e=2,a(this.createDivider("Minutes")).insertBefore(this.lists[this.lists.length-4+e].$el),a(this.createDivider("Hours")).insertBefore(this.lists[this.lists.length-6+e].$el),a(this.createDivider("Days",!0)).insertBefore(this.lists[0].$el),this.base()},flip:function(a,b){a||(a=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(a,b)}})}(jQuery),function(a){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b)},build:function(b,c){var d=this,e=this.factory.$el.find("ul");c=c?c:this.factory.time.getHourCounter(),c.length>e.length&&a.each(c,function(a,b){d.createList(b)}),a(this.createDivider("Seconds")).insertBefore(this.lists[this.lists.length-2].$el),a(this.createDivider("Minutes")).insertBefore(this.lists[this.lists.length-4].$el),b||a(this.createDivider("Hours",!0)).insertBefore(this.lists[0].$el),this.base()},flip:function(a,b){a||(a=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(a,b)},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}
485(jQuery),function(a){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(a,b){this.base(a,b)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(a,b){a||(a=this.factory.time.getMinuteCounter()),this.base(a,b)}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.factory.time.getTime(!1,this.showSeconds);this.base(b),this.meridiumText=this.getMeridium(),this.meridium=a(['<ul class="flip-clock-meridium">',"<li>",'<a href="#">'+this.meridiumText+"</a>","</li>","</ul>"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(a,b){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),b)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(a){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(a){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(a){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(a){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(a){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"Días",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(a){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(a){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(a){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(a){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(a){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(a){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norweg
485ian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(a){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(a){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(a){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(a){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery); 
486jQuery(document).ready(function() {
487
488   if($(".mg-scrollTop")){
489   var e = $(".mg-scrollTop");
490    var speed = 700;
491    
492    e.click(function () {
493      $("html:not(:animated), body:not(:animated)").animate({scrollTop: 0}, speed);
494      return false; //важно!
495    });
496    //появление
497    function show_scrollTop() {
498      ($(window).scrollTop() > 200) ? e.fadeIn(600) : e.hide();
499    }
500    $(window).scroll(function () {
501      show_scrollTop();
502    });
503    show_scrollTop();
504	}
505
506});
507 
508!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Swiper=t()}(this,function(){"use strict";function l(e){for(var t=0;t<e.length;t+=1)this[t]=e[t];return this.length=e.length,this}var c="undefined"==typeof document?{body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},location:{hash:""}}:document,R="undefined"==typeof window?{document:c,navigator:{userAgent:""},location:{},history:{},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){}}:window;function E(e,t){var a=[],i=0;if(e&&!t&&e instanceof l)return e;if(e)if("string"==typeof e){var s,n,r=e.trim();if(0<=r.indexOf("<")&&0<=r.indexOf(">")){var o="div";for(0===r.indexOf("<li")&&(o="ul"),0===r.indexOf("<tr")&&(o="tbody"),0!==r.indexOf("<td")&&0!==r.indexOf("<th")||(o="tr"),0===r.indexOf("<tbody")&&(o="table"),0===r.indexOf("<option")&&(o="select"),(n=c.createElement(o)).innerHTML=r,i=0;i<n.childNodes.length;i+=1)a.push(n.childNodes[i])}else for(s=t||"#"!==e[0]||e.match(/[ .<>:~]/)?(t||c).querySelectorAll(e.trim()):[c.getElementById(e.trim().split("#")[1])],i=0;i<s.length;i+=1)s[i]&&a.push(s[i])}else if(e.nodeType||e===R||e===c)a.push(e);else if(0<e.length&&e[0].nodeType)for(i=0;i<e.length;i+=1)a.push(e[i]);return new l(a)}function n(e){for(var t=[],a=0;a<e.length;a+=1)-1===t.indexOf(e[a])&&t.push(e[a]);return t}E.fn=l.prototype,E.Class=l,E.Dom7=l;var L={addClass:function(e){if(void 0!==e)for(var t=e.split(" "),a=0;a<t.length;a+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.add(t[a]);return this},removeClass:function(e){for(var t=e.split(" "),a=0;a<t.length;a+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.remove(t[a]);return this},hasClass:function(e){return!!this[0]&&this[0].classList.contains(e)},toggleClass:function(e){for(var t=e.split(" "),a=0;a<t.length;a+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.toggle(t[a]);return this},attr:function(e,t){var a=arguments;if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(var i=0;i<this.length;i+=1)if(2===a.length)this[i].setAttribute(e,t);else for(var s in e)this[i][s]=e[s],this[i].setAttribute(s,e[s]);return this},removeAttr:function(e){for(var t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this},data:function(e,t){var a;if(void 0!==t){for(var i=0;i<this.length;i+=1)(a=this[i]).dom7ElementDataStorage||(a.dom7ElementDataStorage={}),a.dom7ElementDataStorage[e]=t;return this}if(a=this[0])return a.dom7ElementDataStorage&&e in a.dom7ElementDataStorage?a.dom7ElementDataStorage[e]:a.getAttribute("data-"+e)||void 0},transform:function(e){for(var t=0;t<this.length;t+=1){var a=this[t].style;a.webkitTransform=e,a.transform=e}return this},transition:function(e){"string"!=typeof e&&(e+="ms");for(var t=0;t<this.length;t+=1){var a=this[t].style;a.webkitTransitionDuration=e,a.transitionDuration=e}return this},on:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var a=e[0],n=e[1],r=e[2],i=e[3];function s(e){var t=e.target;if(t){var a=e.target.dom7EventData||[];if(a.indexOf(e)<0&&a.unshift(e),E(t).is(n))r.apply(t,a);else for(var i=E(t).parents(),s=0;s<i.length;s+=1)E(i[s]).is(n)&&r.apply(i[s],a)}}function o(e){var t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),r.apply(this,t)}"function"==typeof e[1]&&(a=e[0],r=e[1],i=e[2],n=void 0);for(var l,i=i||!1,d=a.split(" "),p=0;p<this.length;p+=1){var c=this[p];if(n)for(l=0;l<d.length;l+=1){var u=d[l];c.dom7LiveListeners||(c.dom7LiveListeners={}),c.dom7LiveListeners[u]||(c.dom7LiveListeners[u]=[]),c.dom7LiveListeners[u].push({listener:r,proxyListener:s}),c.addEventListener(u,s,i)}else for(l=0;l<d.length;l+=1){var h=d[l];c.dom7Listeners||(c.dom7Listeners={}),c.dom7Listeners[h]||(c.dom7Listeners[h]=[]),c.dom7Listeners[h].push({listener:r,proxyListener:o}),c.addEventListener(h,o,i)}}return this},off:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var a=e[0],i=e[1],s=e[2],n=e[3];"function"==typeof e[1]&&(a=e[0],s=e[1],n=e[2],i=void 0);for(var n=n||!1,r=a.split(" "),o=0;o<r.length;o+=1)for(var l=r[o],d=0;d<this.length;d+=1){var p=this[d],c=void 0;if(!i&&p.dom7Listeners?c=p.dom7Listeners[l]:i&&p.dom7LiveListeners&&(c=p.dom7LiveListeners[l]),c&&c.length)for(var u=c.length-1;0<=u;--u){var h=c[u];(s&&h.listener===s||s&&h.listener&&h.listener.dom7proxy&&h.listener.dom7proxy===s||!s)&&(p.removeEventListener(l,h.proxyListener,n),c.splice(u,1))}}return this},trigger:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var a=e[0].split(" "),i=e[1],s=0;s<a.length;s+=1)for(var n=a[s],r=0;r<this.length;r+=1){var o=this[r],l=void 0;try{l=new R.CustomEvent(n,{detail:i,bubbles:!0,cancelable:!0})}catch(e){(l=c.createEvent("Event")).initEvent(n,!0,!0),l.detail=i}o.dom7EventData=e.filter(function(e,t){return 0<t}),o.dispatchEvent(l),o.dom7EventData=[],delete o.dom7EventData}return this},transitionEnd:function(t){var a,i=["webkitTransitionEnd","transitionend"],s=this;function n(e){if(e.target===this)for(t.call(this,e),a=0;a<i.length;a+=1)s.off(i[a],n)}if(t)for(a=0;a<i.length;a+=1)s.on(i[a],n);return this},outerWidth:function(e){return 0<this.length?e?(e=this.styles(),this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+
508parseFloat(e.getPropertyValue("margin-left"))):this[0].offsetWidth:null},outerHeight:function(e){return 0<this.length?e?(e=this.styles(),this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))):this[0].offsetHeight:null},offset:function(){var e,t,a,i,s;return 0<this.length?(e=(s=this[0]).getBoundingClientRect(),a=c.body,t=s.clientTop||a.clientTop||0,a=s.clientLeft||a.clientLeft||0,i=s===R?R.scrollY:s.scrollTop,s=s===R?R.scrollX:s.scrollLeft,{top:e.top+i-t,left:e.left+s-a}):null},css:function(e,t){var a;if(1===arguments.length){if("string"!=typeof e){for(a=0;a<this.length;a+=1)for(var i in e)this[a].style[i]=e[i];return this}if(this[0])return R.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e)for(a=0;a<this.length;a+=1)this[a].style[e]=t;return this},each:function(e){if(e)for(var t=0;t<this.length;t+=1)if(!1===e.call(this[t],t,this[t]))return this;return this},html:function(e){if(void 0===e)return this[0]?this[0].innerHTML:void 0;for(var t=0;t<this.length;t+=1)this[t].innerHTML=e;return this},text:function(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(var t=0;t<this.length;t+=1)this[t].textContent=e;return this},is:function(e){var t,a,i=this[0];if(i&&void 0!==e)if("string"==typeof e){if(i.matches)return i.matches(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);for(t=E(e),a=0;a<t.length;a+=1)if(t[a]===i)return!0}else{if(e===c)return i===c;if(e===R)return i===R;if(e.nodeType||e instanceof l)for(t=e.nodeType?[e]:e,a=0;a<t.length;a+=1)if(t[a]===i)return!0}return!1},index:function(){var e,t=this[0];if(t){for(e=0;null!==(t=t.previousSibling);)1===t.nodeType&&(e+=1);return e}},eq:function(e){var t;return void 0===e?this:(t=this.length,new l(t-1<e?[]:e<0?(t=t+e)<0?[]:[this[t]]:[this[e]]))},append:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var a=0;a<e.length;a+=1)for(var i=e[a],s=0;s<this.length;s+=1)if("string"==typeof i){var n=c.createElement("div");for(n.innerHTML=i;n.firstChild;)this[s].appendChild(n.firstChild)}else if(i instanceof l)for(var r=0;r<i.length;r+=1)this[s].appendChild(i[r]);else this[s].appendChild(i);return this},prepend:function(e){for(var t,a=0;a<this.length;a+=1)if("string"==typeof e){var i=c.createElement("div");for(i.innerHTML=e,t=i.childNodes.length-1;0<=t;--t)this[a].insertBefore(i.childNodes[t],this[a].childNodes[0])}else if(e instanceof l)for(t=0;t<e.length;t+=1)this[a].insertBefore(e[t],this[a].childNodes[0]);else this[a].insertBefore(e,this[a].childNodes[0]);return this},next:function(e){return 0<this.length?e?this[0].nextElementSibling&&E(this[0].nextElementSibling).is(e)?new l([this[0].nextElementSibling]):new l([]):this[0].nextElementSibling?new l([this[0].nextElementSibling]):new l([]):new l([])},nextAll:function(e){var t=[],a=this[0];if(!a)return new l([]);for(;a.nextElementSibling;){var i=a.nextElementSibling;e&&!E(i).is(e)||t.push(i),a=i}return new l(t)},prev:function(e){var t;return 0<this.length?(t=this[0],e?t.previousElementSibling&&E(t.previousElementSibling).is(e)?new l([t.previousElementSibling]):new l([]):t.previousElementSibling?new l([t.previousElementSibling]):new l([])):new l([])},prevAll:function(e){var t=[],a=this[0];if(!a)return new l([]);for(;a.previousElementSibling;){var i=a.previousElementSibling;e&&!E(i).is(e)||t.push(i),a=i}return new l(t)},parent:function(e){for(var t=[],a=0;a<this.length;a+=1)null===this[a].parentNode||e&&!E(this[a].parentNode).is(e)||t.push(this[a].parentNode);return E(n(t))},parents:function(e){for(var t=[],a=0;a<this.length;a+=1)for(var i=this[a].parentNode;i;)e&&!E(i).is(e)||t.push(i),i=i.parentNode;return E(n(t))},closest:function(e){var t=this;return void 0===e?new l([]):t=t.is(e)?t:t.parents(e).eq(0)},find:function(e){for(var t=[],a=0;a<this.length;a+=1)for(var i=this[a].querySelectorAll(e),s=0;s<i.length;s+=1)t.push(i[s]);return new l(t)},children:function(e){for(var t=[],a=0;a<this.length;a+=1)for(var i=this[a].childNodes,s=0;s<i.length;s+=1)e?1===i[s].nodeType&&E(i[s]).is(e)&&t.push(i[s]):1===i[s].nodeType&&t.push(i[s]);return new l(n(t))},remove:function(){for(var e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this},add:function(){for(var e,t=[],a=arguments.length;a--;
508)t[a]=arguments[a];for(e=0;e<t.length;e+=1)for(var i=E(t[e]),s=0;s<i.length;s+=1)this[this.length]=i[s],this.length+=1;return this},styles:function(){return this[0]?R.getComputedStyle(this[0],null):{}}};function e(e){var t=this;t.params=e=void 0===e?{}:e,t.eventsListeners={},t.params&&t.params.on&&Object.keys(t.params.on).forEach(function(e){t.on(e,t.params.on[e])})}Object.keys(L).forEach(function(e){E.fn[e]=E.fn[e]||L[e]});var i,q={deleteProps:function(e){var t=e;Object.keys(t).forEach(function(e){try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}})},nextTick:function(e,t){return void 0===t&&(t=0),setTimeout(e,t)},now:function(){return Date.now()},getTranslate:function(e,t){void 0===t&&(t="x");var a,i,s,e=R.getComputedStyle(e,null);return R.WebKitCSSMatrix?(6<(i=e.transform||e.webkitTransform).split(",").length&&(i=i.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),s=new R.WebKitCSSMatrix("none"===i?"":i)):a=(s=e.MozTransform||e.OTransform||e.MsTransform||e.msTransform||e.transform||e.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===t&&(i=R.WebKitCSSMatrix?s.m41:16===a.length?parseFloat(a[12]):parseFloat(a[4])),(i="y"===t?R.WebKitCSSMatrix?s.m42:16===a.length?parseFloat(a[13]):parseFloat(a[5]):i)||0},parseUrlQuery:function(e){var t,a,i,s,n={},e=e||R.location.href;if("string"==typeof e&&e.length)for(s=(a=(e=-1<e.indexOf("?")?e.replace(/\S*\?/,""):"").split("&").filter(function(e){return""!==e})).length,t=0;t<s;t+=1)i=a[t].replace(/#\S+/g,"").split("="),n[decodeURIComponent(i[0])]=void 0===i[1]?void 0:decodeURIComponent(i[1])||"";return n},isObject:function(e){return"object"==typeof e&&null!==e&&e.constructor&&e.constructor===Object},extend:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var a=Object(e[0]),i=1;i<e.length;i+=1){var s=e[i];if(null!=s)for(var n=Object.keys(Object(s)),r=0,o=n.length;r<o;r+=1){var l=n[r],d=Object.getOwnPropertyDescriptor(s,l);void 0!==d&&d.enumerable&&(q.isObject(a[l])&&q.isObject(s[l])?q.extend(a[l],s[l]):!q.isObject(a[l])&&q.isObject(s[l])?(a[l]={},q.extend(a[l],s[l])):a[l]=s[l])}}return a}},W=(i=c.createElement("div"),{touch:R.Modernizr&&!0===R.Modernizr.touch||!!(0<R.navigator.maxTouchPoints||"ontouchstart"in R||R.DocumentTouch&&c instanceof R.DocumentTouch),pointerEvents:!!(R.navigator.pointerEnabled||R.PointerEvent||"maxTouchPoints"in R.navigator&&0<R.navigator.maxTouchPoints),prefixedPointerEvents:!!R.navigator.msPointerEnabled,transition:"transition"in(t=i.style)||"webkitTransition"in t||"MozTransition"in t,transforms3d:R.Modernizr&&!0===R.Modernizr.csstransforms3d||"webkitPerspective"in(t=i.style)||"MozPerspective"in t||"OPerspective"in t||"MsPerspective"in t||"perspective"in t,flexbox:function(){for(var e=i.style,t="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),a=0;a<t.length;a+=1)if(t[a]in e)return!0;return!1}(),observer:"MutationObserver"in R||"WebkitMutationObserver"in R,passiveListener:function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});R.addEventListener("testPassiveListener",null,t)}catch(e){}return e}(),gestures:"ongesturestart"in R}),j={isIE:!!R.navigator.userAgent.match(/Trident/g)||!!R.navigator.userAgent.match(/MSIE/g),isEdge:!!R.navigator.userAgent.match(/Edge/g),isSafari:0<=(t=R.navigator.userAgent.toLowerCase()).indexOf("safari")&&t.indexOf("chrome")<0&&t.indexOf("android")<0,isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(R.navigator.userAgent)},t={components:{configurable:!0}},t=(e.prototype.on=function(e,t,a){var i,s=this;return"function"==typeof t&&(i=a?"unshift":"push",e.split(" ").forEach(function(e){s.eventsListeners[e]||(s.eventsListeners[e]=[]),s.eventsListeners[e][i](t)})),s},e.prototype.once=function(a,i,e){var s=this;return"function"!=typeof i?s:(n.f7proxy=i,s.on(a,n,e));function n(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];i.apply(s,e),s.off(a,n),n.f7proxy&&delete n.f7proxy}},e.prototype.off=function(e,i){var s=this;return s.eventsListeners&&e.split(" ").forEach(function(a){void 0===i?s.eventsListeners[a]=[]:s.eventsListeners[a]&&s.eventsListeners[a].length&&s.eventsListeners[a].forEac
508h(function(e,t){(e===i||e.f7proxy&&e.f7proxy===i)&&s.eventsListeners[a].splice(t,1)})}),s},e.prototype.emit=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var a,i,s,n=this;return n.eventsListeners&&(s="string"==typeof e[0]||Array.isArray(e[0])?(a=e[0],i=e.slice(1,e.length),n):(a=e[0].events,i=e[0].data,e[0].context||n),(Array.isArray(a)?a:a.split(" ")).forEach(function(e){var t;n.eventsListeners&&n.eventsListeners[e]&&(t=[],n.eventsListeners[e].forEach(function(e){t.push(e)}),t.forEach(function(e){e.apply(s,i)}))})),n},e.prototype.useModulesParams=function(t){var a=this;a.modules&&Object.keys(a.modules).forEach(function(e){e=a.modules[e];e.params&&q.extend(t,e.params)})},e.prototype.useModules=function(t){void 0===t&&(t={});var i=this;i.modules&&Object.keys(i.modules).forEach(function(e){var a=i.modules[e],e=t[e]||{};a.instance&&Object.keys(a.instance).forEach(function(e){var t=a.instance[e];i[e]="function"==typeof t?t.bind(i):t}),a.on&&i.on&&Object.keys(a.on).forEach(function(e){i.on(e,a.on[e])}),a.create&&a.create.bind(i)(e)})},t.components.set=function(e){this.use&&this.use(e)},e.installModule=function(t){for(var e=[],a=arguments.length-1;0<a--;)e[a]=arguments[a+1];var i=this,s=(i.prototype.modules||(i.prototype.modules={}),t.name||Object.keys(i.prototype.modules).length+"_"+q.now());return(i.prototype.modules[s]=t).proto&&Object.keys(t.proto).forEach(function(e){i.prototype[e]=t.proto[e]}),t.static&&Object.keys(t.static).forEach(function(e){i[e]=t.static[e]}),t.install&&t.install.apply(i,e),i},e.use=function(e){for(var t=[],a=arguments.length-1;0<a--;)t[a]=arguments[a+1];var i=this;return Array.isArray(e)?(e.forEach(function(e){return i.installModule(e)}),i):i.installModule.apply(i,[e].concat(t))},Object.defineProperties(e,t),{updateSize:function(){var e=this,t=e.$el,a=void 0!==e.params.width?e.params.width:t[0].clientWidth,i=void 0!==e.params.height?e.params.height:t[0].clientHeight;0===a&&e.isHorizontal()||0===i&&e.isVertical()||(a=a-parseInt(t.css("padding-left"),10)-parseInt(t.css("padding-right"),10),i=i-parseInt(t.css("padding-top"),10)-parseInt(t.css("padding-bottom"),10),q.extend(e,{width:a,height:i,size:e.isHorizontal()?a:i}))},updateSlides:function(){var e,t=this,a=t.params,i=t.$wrapperEl,s=t.size,n=t.rtlTranslate,H=t.wrongRTL,r=t.virtual&&a.virtual.enabled,G=(r?t.virtual:t).slides.length,o=i.children("."+t.params.slideClass),l=(r?t.virtual.slides:o).length,d=[],p=[],c=[],r=a.slidesOffsetBefore,u=("function"==typeof r&&(r=a.slidesOffsetBefore.call(t)),a.slidesOffsetAfter),N=("function"==typeof u&&(u=a.slidesOffsetAfter.call(t)),t.snapGrid.length),B=t.snapGrid.length,h=a.spaceBetween,m=-r,v=0,f=0;if(void 0!==s){"string"==typeof h&&0<=h.indexOf("%")&&(h=parseFloat(h.replace("%",""))/100*s),t.virtualSize=-h,n?o.css({marginLeft:"",marginTop:""}):o.css({marginRight:"",marginBottom:""}),1<a.slidesPerColumn&&(e=Math.floor(l/a.slidesPerColumn)===l/t.params.slidesPerColumn?l:Math.ceil(l/a.slidesPerColumn)*a.slidesPerColumn,"auto"!==a.slidesPerView)&&"row"===a.slidesPerColumnFill&&(e=Math.max(e,a.slidesPerView*a.slidesPerColumn));for(var g,b,w=a.slidesPerColumn,V=e/w,X=Math.floor(l/a.slidesPerColumn),y=0;y<l;y+=1){C=0;var x,T,E,S,C,M,P,k,z,$,Y,I=o.eq(y);1<a.slidesPerColumn&&(S=E=T=void 0,"column"===a.slidesPerColumnFill||"row"===a.slidesPerColumnFill&&1<a.slidesPerGroup?("column"===a.slidesPerColumnFill?(S=y-(E=Math.floor(y/w))*w,(X<E||E===X&&S===w-1)&&w<=(S+=1)&&(S=0,E+=1)):(x=Math.floor(y/a.slidesPerGroup),E=y-(S=Math.floor(y/a.slidesPerView)-x*a.slidesPerColumn)*a.slidesPerView-x*a.slidesPerView),I.css({"-webkit-box-ordinal-group":T=E+S*e/w,"-moz-box-ordinal-group":T,"-ms-flex-order":T,"-webkit-order":T,order:T})):E=y-(S=Math.floor(y/V))*V,I.css("margin-"+(t.isHorizontal()?"top":"left"),0!==S&&a.spaceBetween&&a.spaceBetween+"px").attr("data-swiper-column",E).attr("data-swiper-row",S)),"none"!==I.css("display")&&("auto"===a.slidesPerView?(x=R.getComputedStyle(I[0],null),T=I[0].style.transform,E=I[0].style.webkitTransform,T&&(I[0].style.transform="none"),E&&(I[0].style.webkitTransform="none"),C=a.roun
508dLengths?t.isHorizontal()?I.outerWidth(!0):I.outerHeight(!0):t.isHorizontal()?(S=parseFloat(x.getPropertyValue("width")),P=parseFloat(x.getPropertyValue("padding-left")),k=parseFloat(x.getPropertyValue("padding-right")),z=parseFloat(x.getPropertyValue("margin-left")),$=parseFloat(x.getPropertyValue("margin-right")),(M=x.getPropertyValue("box-sizing"))&&"border-box"===M&&!j.isIE?S+z+$:S+P+k+z+$):(M=parseFloat(x.getPropertyValue("height")),P=parseFloat(x.getPropertyValue("padding-top")),k=parseFloat(x.getPropertyValue("padding-bottom")),z=parseFloat(x.getPropertyValue("margin-top")),$=parseFloat(x.getPropertyValue("margin-bottom")),(Y=x.getPropertyValue("box-sizing"))&&"border-box"===Y&&!j.isIE?M+z+$:M+P+k+z+$),T&&(I[0].style.transform=T),E&&(I[0].style.webkitTransform=E),a.roundLengths&&(C=Math.floor(C))):(C=(s-(a.slidesPerView-1)*h)/a.slidesPerView,a.roundLengths&&(C=Math.floor(C)),o[y]&&(t.isHorizontal()?o[y].style.width=C+"px":o[y].style.height=C+"px")),o[y]&&(o[y].swiperSlideSize=C),c.push(C),a.centeredSlides?(m=m+C/2+v/2+h,0===v&&0!==y&&(m=m-s/2-h),0===y&&(m=m-s/2-h),Math.abs(m)<.001&&(m=0),a.roundLengths&&(m=Math.floor(m)),f%a.slidesPerGroup==0&&d.push(m),p.push(m)):(a.roundLengths&&(m=Math.floor(m)),f%a.slidesPerGroup==0&&d.push(m),p.push(m),m=m+C+h),t.virtualSize+=C+h,v=C,f+=1)}if(t.virtualSize=Math.max(t.virtualSize,s)+u,n&&H&&("slide"===a.effect||"coverflow"===a.effect)&&i.css({width:t.virtualSize+a.spaceBetween+"px"}),W.flexbox&&!a.setWrapperSize||(t.isHorizontal()?i.css({width:t.virtualSize+a.spaceBetween+"px"}):i.css({height:t.virtualSize+a.spaceBetween+"px"})),1<a.slidesPerColumn&&(t.virtualSize=(C+a.spaceBetween)*e,t.virtualSize=Math.ceil(t.virtualSize/a.slidesPerColumn)-a.spaceBetween,t.isHorizontal()?i.css({width:t.virtualSize+a.spaceBetween+"px"}):i.css({height:t.virtualSize+a.spaceBetween+"px"}),a.centeredSlides)){for(var L=[],D=0;D<d.length;D+=1){var O=d[D];a.roundLengths&&(O=Math.floor(O)),d[D]<t.virtualSize+d[0]&&L.push(O)}d=L}if(!a.centeredSlides){L=[];for(var A=0;A<d.length;A+=1){var F=d[A];a.roundLengths&&(F=Math.floor(F)),d[A]<=t.virtualSize-s&&L.push(F)}d=L,1<Math.floor(t.virtualSize-s)-Math.floor(d[d.length-1])&&d.push(t.virtualSize-s)}0===d.length&&(d=[0]),0!==a.spaceBetween&&(t.isHorizontal()?n?o.css({marginLeft:h+"px"}):o.css({marginRight:h+"px"}):o.css({marginBottom:h+"px"})),a.centerInsufficientSlides&&(g=0,c.forEach(function(e){g+=e+(a.spaceBetween||0)}),(g-=a.spaceBetween)<s)&&(b=(s-g)/2,d.forEach(function(e,t){d[t]=e-b}),p.forEach(function(e,t){p[t]=e+b})),q.extend(t,{slides:o,snapGrid:d,slidesGrid:p,slidesSizesGrid:c}),l!==G&&t.emit("slidesLengthChange"),d.length!==N&&(t.params.watchOverflow&&t.checkOverflow(),t.emit("snapGridLengthChange")),p.length!==B&&t.emit("slidesGridLengthChange"),(a.watchSlidesProgress||a.watchSlidesVisibility)&&t.updateSlidesOffset()}},updateAutoHeight:function(e){var t,a,i=this,s=[],n=0;if("number"==typeof e?i.setTransition(e):!0===e&&i.setTransition(i.params.speed),"auto"!==i.params.slidesPerView&&1<i.params.slidesPerView)for(t=0;t<Math.ceil(i.params.slidesPerView);t+=1){var r=i.activeIndex+t;if(r>i.slides.length)break;s.push(i.slides.eq(r)[0])}else s.push(i.slides.eq(i.activeIndex)[0]);for(t=0;t<s.length;t+=1)void 0!==s[t]&&(n=n<(a=s[t].offsetHeight)?a:n);n&&i.$wrapperEl.css("height",n+"px")},updateSlidesOffset:function(){for(var e=this.slides,t=0;t<e.length;t+=1)e[t].swiperSlideOffset=this.isHorizontal()?e[t].offsetLeft:e[t].offsetTop},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);var t=this,a=t.params,i=t.slides,s=t.rtlTranslate;if(0!==i.length){void 0===i[0].swiperSlideOffset&&t.updateSlidesOffset();var n=s?e:-e;i.removeClass(a.slideVisibleClass),t.visibleSlidesIndexes=[],t.visibleSlides=[];for(var r=0;r<i.length;r+=1){var o,l,d=i[r],p=(n+(a.centeredSlides?t.minTranslate():0)-d.swiperSlideOffset)/(d.swiperSlideSize+a.spaceBetween);a.watchSlidesVisibility&&(l=(o=-(n-d.swiperSlideOffset))+t.slidesSizesGrid[r],0<=o&&o<t.size-1||1<l&&l<=t.size||o<=0&&l>=t.size)&&(t.visibleSlides.push(d),t.visibleSlidesIndexes.push(r),i.eq(r).addClass(a.slideVisibleClass)),d.progress=s?-p:p}t.visibleSlides=E(t.visibleSlides)}},updateProgress:function(e){void 0===e&&(e=this&&this.translate||0);var t=this,a=t.params,i=t.maxTranslate()-t.minTranslate(),s=t.progress,n=t.isBeginning,r=n,o=t.isEnd,i=0==i?n=!(s=0):(n=(s=(e-t.minTranslate())/i)<=0,1<=s);q.extend(t,{progress:s,isBeginning:n,isEnd:i}),(a.watchSlidesProgress||a.watchSlidesVisibility)&&t.updateSlidesProgress(e),n&&!r&&t.emit("reachBeginning toEdge"),i&&!o&&t.emit("reachEnd toEdge"),(r&&!n||o&&!i)&&t.emit("fromEdge"),t.emit("progress",s)},updateSlidesClasses:function(){var e=this,t=e.slides,a=e.params,i=e.$wrapperEl,s=e.activeIndex,n=e.realIndex,r=e.virtual&&a.virtual.enabled,e=(t.removeClass(a.slideActiveClass+" "+a.slideNextClass+" "+a.slidePrevClass+" "+a.slideDuplicateActiveClass+" "+a.slideDuplicateNextClass+" "+a.slideDuplicatePrevClass),(r=r?e.$wrapperEl.find("."+a.slideClass+'[data-swiper-slide-index="'+s+'"]'):t.eq(s)).addClass(a.slideActiveClass),a.loop&&(r.hasClass(a.slideDuplicateClass)?i.children("."+a.slideClass+":not(."+a.slideDuplicateClass+')[data-swiper-slide-index="'+n+'"]'):i.children("."+a.slideClass+"."+a.slideDuplicateClass+'[data-swiper-slide-index="'+n+'"]')).addClass(a.slideDuplicateActiveClass),r.nextAll("."+a.slideClass).eq(0).addClass(a.slideNextClass)),s=(a.loop&&0===e.length&&(e=t.eq
508(0)).addClass(a.slideNextClass),r.prevAll("."+a.slideClass).eq(0).addClass(a.slidePrevClass));a.loop&&0===s.length&&(s=t.eq(-1)).addClass(a.slidePrevClass),a.loop&&((e.hasClass(a.slideDuplicateClass)?i.children("."+a.slideClass+":not(."+a.slideDuplicateClass+')[data-swiper-slide-index="'+e.attr("data-swiper-slide-index")+'"]'):i.children("."+a.slideClass+"."+a.slideDuplicateClass+'[data-swiper-slide-index="'+e.attr("data-swiper-slide-index")+'"]')).addClass(a.slideDuplicateNextClass),(s.hasClass(a.slideDuplicateClass)?i.children("."+a.slideClass+":not(."+a.slideDuplicateClass+')[data-swiper-slide-index="'+s.attr("data-swiper-slide-index")+'"]'):i.children("."+a.slideClass+"."+a.slideDuplicateClass+'[data-swiper-slide-index="'+s.attr("data-swiper-slide-index")+'"]')).addClass(a.slideDuplicatePrevClass))},updateActiveIndex:function(e){var t=this,a=t.rtlTranslate?t.translate:-t.translate,i=t.slidesGrid,s=t.snapGrid,n=t.params,r=t.activeIndex,o=t.realIndex,l=t.snapIndex,d=e;if(void 0===d){for(var p=0;p<i.length;p+=1)void 0!==i[p+1]?a>=i[p]&&a<i[p+1]-(i[p+1]-i[p])/2?d=p:a>=i[p]&&a<i[p+1]&&(d=p+1):a>=i[p]&&(d=p);n.normalizeSlideIndex&&(d<0||void 0===d)&&(d=0)}(e=0<=s.indexOf(a)?s.indexOf(a):Math.floor(d/n.slidesPerGroup))>=s.length&&(e=s.length-1),d!==r?(n=parseInt(t.slides.eq(d).attr("data-swiper-slide-index")||d,10),q.extend(t,{snapIndex:e,realIndex:n,previousIndex:r,activeIndex:d}),t.emit("activeIndexChange"),t.emit("snapIndexChange"),o!==n&&t.emit("realIndexChange"),(t.initialized||t.runCallbacksOnInit)&&t.emit("slideChange")):e!==l&&(t.snapIndex=e,t.emit("snapIndexChange"))},updateClickedSlide:function(e){var t=this,a=t.params,i=E(e.target).closest("."+a.slideClass)[0],s=!1;if(i)for(var n=0;n<t.slides.length;n+=1)t.slides[n]===i&&(s=!0);i&&s?(t.clickedSlide=i,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(E(i).attr("data-swiper-slide-index"),10):t.clickedIndex=E(i).index(),a.slideToClickedSlide&&void 0!==t.clickedIndex&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()):(t.clickedSlide=void 0,t.clickedIndex=void 0)}}),a={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");var t=this.params,a=this.rtlTranslate,i=this.translate,s=this.$wrapperEl;return t.virtualTranslate?a?-i:i:(t=q.getTranslate(s[0],e),(t=a?-t:t)||0)},setTranslate:function(e,t){var a=this,i=a.rtlTranslate,s=a.params,n=a.$wrapperEl,r=a.progress,o=0,l=0,i=(a.isHorizontal()?o=i?-e:e:l=e,s.roundLengths&&(o=Math.floor(o),l=Math.floor(l)),s.virtualTranslate||(W.transforms3d?n.transform("translate3d("+o+"px, "+l+"px, 0px)"):n.transform("translate("+o+"px, "+l+"px)")),a.previousTranslate=a.translate,a.translate=a.isHorizontal()?o:l,a.maxTranslate()-a.minTranslate());(0==i?0:(e-a.minTranslate())/i)!==r&&a.updateProgress(e),a.emit("setTranslate",a.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]}},s={slideTo:function(e,t,a,i){void 0===t&&(t=this.params.speed),void 0===a&&(a=!0);var s=this,n=e=void 0===e?0:e,e=(n<0&&(n=0),s.params),r=s.snapGrid,o=s.slidesGrid,l=s.previousIndex,d=s.activeIndex,p=s.rtlTranslate;if(s.animating&&e.preventInteractionOnTransition)return!1;var c=Math.floor(n/e.slidesPerGroup);c>=r.length&&(c=r.length-1),(d||e.initialSlide||0)===(l||0)&&a&&s.emit("beforeSlideChangeStart");var u,h=-r[c];if(s.updateProgress(h),e.normalizeSlideIndex)for(var m=0;m<o.length;m+=1)-Math.floor(100*h)>=Math.floor(100*o[m])&&(n=m);if(s.initialized&&n!==d){if(!s.allowSlideNext&&h<s.translate&&h<s.minTranslate())return!1;if(!s.allowSlidePrev&&h>s.translate&&h>s.maxTranslate()&&(d||0)!==n)return!1}return u=d<n?"next":n<d?"prev":"reset",p&&-h===s.translate||!p&&h===s.translate?(s.updateActiveIndex(n),e.autoHeight&&s.updateAutoHeight(),s.updateSlidesClasses(),"slide"!==e.effect&&s.setTranslate(h),"reset"!=u&&(s.transitionStart(a,u),s.transitionEnd(a,u)),!1):(0!==t&&W.transition?(s.setTransition(t),s.setTranslate(h),s.updateActiveIndex(n),s.updateSlidesClasses(),s.emit("beforeTransitionStart",t,i),s.transitionStart(a,u),s.animating||(s.animating=!0,s.onSlideToWrapperTransitionEnd||(s.onSlideToWrapperTransitionEnd=function(e){s&&!s.destroyed&&e.target===this&&(s.$wrapperEl[0].removeEventListener("transitionend",s.onSlideToWrapperTransitionEnd),s.$wrapperEl[0].removeEventListener("webkitTransitionEnd",s.onSlideToWrapperTransitionEnd),s.onSlideToWrapperTransitionEnd=null,delete s.onSlideToWrapperTransitionEnd,s.transitionEnd(a,u))}),s.$wrapperEl[0].addEventListener("transitionend",s.onSlideToWrapperTransitionEnd),s.$wrapperEl[0].addEventListener("webkitTransitionEnd",s.onSlideToWrapperTransitionEnd))):(s.setTransition(0),s.setTranslate(h),s.updateActiveIndex(n),s.updateSlidesClasses(),s.emit("beforeTransitionStart",t,i),s.transitionStart(a,u),s.transitionEnd(a,u)),!0)},slideToLoop:function(e,t,a,i){void 0===t&&(t=this.params.speed);e=void 0===e?0:e;return this.params.loop&&(e+=this.loopedSlides),this.slideTo(e,t,a=void 0===a?!0:a,i)},slideNext:function(e,t,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var i=this,s=i.params,n=i.animating;return s.loop?!n&&(i.loopFix(),i._clientLeft=i.$wrapperEl[0].clientLeft,i.slideTo(i.activeIndex+s.slidesPerGroup,e,t,a)):i.slideTo(i.activeIndex+s.slidesPerGroup,e,t,a)},slidePrev:function(e,t,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var i=this,s=i.params,n=i.animating,r=i.snapGrid,o=i.slidesGrid,l=i.rtlTranslate;if(s.loop){if(n)return!1;i.loopFix(),i._clientLeft=i.$wrapperEl[0].clientLeft}function d(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}var p,s=d(l?i.translate:-i.translate),n=r.map(d),l=(o.map(d),r[n.indexOf(s)],r[n.indexOf(s)-1]);return void 0!==l&&(p=o.indexOf(l))<0&&(p=i.activeIndex-1),i.slideTo(p,e,t,a)},slideReset:function(e,t,a){return void 0===e&&(e=this.params.speed),this.slideTo(this.activeIndex,e,t=void 0===t?!0:t,a)},slideToClosest:function(e,t,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var i,s,n=this,r=n.activeIndex,o=Math.floor(r/n.params.slidesPerGroup);return o<n.snapGrid.length-1&&(i=n.rtlTranslate?n.translate:-n.translate,s=n.snapGrid[o],(n.snapGrid[o+1]-s)/2<i-s)&&(r=n.params.slidesPerGroup),n.slideTo(r,e,t,a)},slideToClickedSlide:function(){var e,t=this,a=t.params,i=t.$wrapperEl,s="auto"===a.slidesPerView?t.slidesPerViewDynamic():a.slidesPerView,n=t.clickedIndex;a.loop?t.animating||(e=parseInt(E(t.clickedSlide).attr("data-swiper-slide-index"),10),a.centeredSlides?n<t.loopedSlides-s/2||n>
508t.slides.length-t.loopedSlides+s/2?(t.loopFix(),n=i.children("."+a.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+a.slideDuplicateClass+")").eq(0).index(),q.nextTick(function(){t.slideTo(n)})):t.slideTo(n):n>t.slides.length-s?(t.loopFix(),n=i.children("."+a.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+a.slideDuplicateClass+")").eq(0).index(),q.nextTick(function(){t.slideTo(n)})):t.slideTo(n)):t.slideTo(n)}},r={loopCreate:function(){var i=this,e=i.params,t=i.$wrapperEl,s=(t.children("."+e.slideClass+"."+e.slideDuplicateClass).remove(),t.children("."+e.slideClass));if(e.loopFillGroupWithBlank){var a=e.slidesPerGroup-s.length%e.slidesPerGroup;if(a!==e.slidesPerGroup){for(var n=0;n<a;n+=1){var r=E(c.createElement("div")).addClass(e.slideClass+" "+e.slideBlankClass);t.append(r)}s=t.children("."+e.slideClass)}}"auto"!==e.slidesPerView||e.loopedSlides||(e.loopedSlides=s.length),i.loopedSlides=parseInt(e.loopedSlides||e.slidesPerView,10),i.loopedSlides+=e.loopAdditionalSlides,i.loopedSlides>s.length&&(i.loopedSlides=s.length);var o=[],l=[];s.each(function(e,t){var a=E(t);e<i.loopedSlides&&l.push(t),e<s.length&&e>=s.length-i.loopedSlides&&o.push(t),a.attr("data-swiper-slide-index",e)});for(var d=0;d<l.length;d+=1)t.append(E(l[d].cloneNode(!0)).addClass(e.slideDuplicateClass));for(var p=o.length-1;0<=p;--p)t.prepend(E(o[p].cloneNode(!0)).addClass(e.slideDuplicateClass))},loopFix:function(){var e,t=this,a=t.params,i=t.activeIndex,s=t.slides,n=t.loopedSlides,r=t.allowSlidePrev,o=t.allowSlideNext,l=t.snapGrid,d=t.rtlTranslate,l=(t.allowSlidePrev=!0,t.allowSlideNext=!0,-l[i]-t.getTranslate());i<n?(e=s.length-3*n+i,t.slideTo(e+=n,0,!1,!0)&&0!=l&&t.setTranslate((d?-t.translate:t.translate)-l)):("auto"===a.slidesPerView&&2*n<=i||i>=s.length-n)&&(e=-s.length+i+n,t.slideTo(e+=n,0,!1,!0))&&0!=l&&t.setTranslate((d?-t.translate:t.translate)-l),t.allowSlidePrev=r,t.allowSlideNext=o},loopDestroy:function(){var e=this.$wrapperEl,t=this.params,a=this.slides;e.children("."+t.slideClass+"."+t.slideDuplicateClass+",."+t.slideClass+"."+t.slideBlankClass).remove(),a.removeAttr("data-swiper-slide-index")}},D={setGrabCursor:function(e){var t;W.touch||!this.params.simulateTouch||this.params.watchOverflow&&this.isLocked||((t=this.el).style.cursor="move",t.style.cursor=e?"-webkit-grabbing":"-webkit-grab",t.style.cursor=e?"-moz-grabbin":"-moz-grab",t.style.cursor=e?"grabbing":"grab")},unsetGrabCursor:function(){W.touch||this.params.watchOverflow&&this.isLocked||(this.el.style.cursor="")}},O={appendSlide:function(e){var t=this,a=t.$wrapperEl,i=t.params;if(i.loop&&t.loopDestroy(),"object"==typeof e&&"length"in e)for(var s=0;s<e.length;s+=1)e[s]&&a.append(e[s]);else a.append(e);i.loop&&t.loopCreate(),i.observer&&W.observer||t.update()},prependSlide:function(e){var t=this,a=t.params,i=t.$wrapperEl,s=t.activeIndex,n=(a.loop&&t.loopDestroy(),s+1);if("object"==typeof e&&"length"in e){for(var r=0;r<e.length;r+=1)e[r]&&i.prepend(e[r]);n=s+e.length}else i.prepend(e);a.loop&&t.loopCreate(),a.observer&&W.observer||t.update(),t.slideTo(n,0,!1)},addSlide:function(e,t){var a=this,i=a.$wrapperEl,s=a.params,n=a.activeIndex,r=(s.loop&&(n-=a.loopedSlides,a.loopDestroy(),a.slides=i.children("."+s.slideClass)),a.slides.length);if(e<=0)a.prependSlide(t);else if(r<=e)a.appendSlide(t);else{for(var o=e<n?n+1:n,l=[],d=r-1;e<=d;--d){var p=a.slides.eq(d);p.remove(),l.unshift(p)}if("object"==typeof t&&"length"in t){for(var c=0;c<t.length;c+=1)t[c]&&i.append(t[c]);o=e<n?n+t.length:n}else i.append(t);for(var u=0;u<l.length;u+=1)i.append(l[u]);s.loop&&a.loopCreate(),s.observer&&W.observer||a.update(),s.loop?a.slideTo(o+a.loopedSlides,0,!1):a.slideTo(o,0,!1)}},removeSlide:function(e){var t=this,a=t.params,i=t.$wrapperEl,s=t.activeIndex;a.loop&&(s-=t.loopedSlides,t.loopDestroy(),t.slides=i.children("."+a.slideClass));var n,r=s;if("object"==typeof e&&"length"in e)for(var o=0;o<e.length;o+=1)n=e[o],t.slides[n]&&t.slides.eq(n).remove(),n<r&&--r;else t.slides[n=e]&&t.slides.eq(n).remove(),n<r&&--r;r=Math.max(r,0),a.loop&&t.loopCreate(),a.observer&&W.observer||t.update(),a.loop?t.slideTo(r+t.loopedSlides,0,!1):t.slideTo(r,0,!1)},removeAllSlides:function(){for(var e=[],t=0;t<this.slides.length;t+=1)e.push(t);this.removeSlide(e)}},o=(m=R.navigator.userAgent,x={ios:!1,android:!1,androidChrome:!1,desktop:!1,windows:!1,iphone:!1,ipod:!1,ipad:!1,cordova:R.cordova||R.phonegap,phonegap:R.cordova||R.phonegap},g=m.match(/(Windows Phone);?[\s\/]+([\d.]+)?/),w=m.match(/(Android);?[\s\/]+([\d.]+)?/),p=m.match(/(iPad).*OS\s([\d_]+)/),v=m.match(/(iPod)(.*OS\s([\d_]+))?/),f=!p&&m.match(/(iPhone\sOS|iOS)\s([\d_]+)/),g&&(x.os="windows",x.osVersion=g[2],x.windows=!0),w&&!g&&(x.os="android",x.osVersion=w[2],x.android=!0,x.androidChrome=0<=m.toLowerCase().indexOf("chrome")),(p||f||v)&&(x.os="ios",x.ios=!0),f&&!v&&(x.osVersion=f[2].replace(/_/g,"."),x.iphone=!0),p&&(x.osVersion=p[2].replace(/_/g,"."),x.ipad=!0),v&&(x.osVersion=v[3]?v[3].replace(/_/g,"."):null,x.iphone=!0),x.ios&&x.osVersion&&0<=m.indexOf("Version/")&&"10"===x.osVersion.split(".")[0]&&(x.osVersion=m.toLowerCase().split("version/")[1].split(" ")[0]),x.desktop=!(x.os||x.android||x.webView),x.webView=(f||p||v)&&m.match(/.*AppleWeb
508Kit(?!.*Safari)/i),x.os&&"ios"===x.os&&(g=x.osVersion.split("."),w=c.querySelector('meta[name="viewport"]'),x.minimalUi=!x.webView&&(v||f)&&(7==+g[0]?1<=+g[1]:7<+g[0])&&w&&0<=w.getAttribute("content").indexOf("minimal-ui")),x.pixelRatio=R.devicePixelRatio||1,x);function A(){var e,t,a,i=this,s=i.params,n=i.el;n&&0===n.offsetWidth||(s.breakpoints&&i.setBreakpoint(),n=i.allowSlideNext,e=i.allowSlidePrev,t=i.snapGrid,i.allowSlideNext=!0,i.allowSlidePrev=!0,i.updateSize(),i.updateSlides(),s.freeMode?(a=Math.min(Math.max(i.translate,i.maxTranslate()),i.minTranslate()),i.setTranslate(a),i.updateActiveIndex(),i.updateSlidesClasses(),s.autoHeight&&i.updateAutoHeight()):(i.updateSlidesClasses(),("auto"===s.slidesPerView||1<s.slidesPerView)&&i.isEnd&&!i.params.centeredSlides?i.slideTo(i.slides.length-1,0,!1,!0):i.slideTo(i.activeIndex,0,!1,!0)),i.autoplay&&i.autoplay.running&&i.autoplay.paused&&i.autoplay.run(),i.allowSlidePrev=e,i.allowSlideNext=n,i.params.watchOverflow&&t!==i.snapGrid&&i.checkOverflow())}var d,p,H={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,preventInteractionOnTransition:!1,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsInverse:!1,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!0,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0},u={update:t,translate:a,transition:{setTransition:function(e,t){this.$wrapperEl.transition(e),this.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);var a=this,i=a.activeIndex,s=a.params,n=a.previousIndex,s=(s.autoHeight&&a.updateAutoHeight(),t||(n<i?"next":i<n?"prev":"reset"));a.emit("transitionStart"),e&&i!==n&&("reset"===s?a.emit("slideResetTransitionStart"):(a.emit("slideChangeTransitionStart"),"next"===s?a.emit("slideNextTransitionStart"):a.emit("slidePrevTransitionStart")))},transitionEnd:function(e,t){void 0===e&&(e=!0);var a=this,i=a.activeIndex,s=a.previousIndex,t=(a.animating=!1,a.setTransition(0),t||(s<i?"next":i<s?"prev":"reset"));a.emit("transitionEnd"),e&&i!==s&&("reset"===t?a.emit("slideResetTransitionEnd"):(a.emit("slideChangeTransitionEnd"),"next"===t?a.emit("slideNextTransitionEnd"):a.emit("slidePrevTransitionEnd")))}},slide:s,loop:r,grabCursor:D,manipulation:O,events:{attachEvents:function(){var e,t=this,a=t.params,i=t.touchEvents,s=t.el,n=t.wrapperEl,s=(t.onTouchStart=function(e){var t,a,i,s,n=this,r=n.touchEventsData,o=n.params,l=n.touches;n.animating&&o.preventInteractionOnTransition||((e=e).originalEvent&&(e=e.originalEvent),r.isTouchEvent="touchstart"===e.type,!r.isTouchEvent&&"which"in e&&3===e.which)||!r.isTouchEvent&&"button"in e&&0<e.button||r.isTouched&&r.isMoved||(o.noSwiping&&E(e.target).closest(o.noSwipingSelector||"."+o.noSwipingClass)[0]?n.allowClick=!0:o.swipeHandler&&!E(e).closest(o.swipeHandler)[0]||(l.currentX=("touchstart"===e.type?e.targetTouches[0]:e).pageX,l.currentY=("touchstart"===e.type?e.targetTouches[0]:e).pageY,t=l.currentX,a=l.currentY,i=o.edgeSwipeDetection||o.iOSEdgeSwipeDetection,s=o.edgeSwipeThreshold||o.iOSEdgeSwipeThreshold,i&&(t<=s||t>=R.screen.width-s))||(q.extend(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),l.startX=t,l.startY=a,r.touchStartTime=q.now(),n.allowClick=!0,n.updateSize(),n.swipeDirection=void 0,0<o.threshold&&(r.allowThresholdMove=!1),"touchstart"!==e.type&&(i=!0,E(e.target).is(r.formElements)&&(i=!1),c.activeElement&&E(c.activeElement).is(r.formElements)&&c.activeElement!==e.target&&c.activeElement.blur(),s=i&&n.allowTouchMove&&o.touchStartPreventDefault,o.touchStartForcePreventDefault||s)&&e.preventDefault(),n.emit("touchStart",e)))}.bind(t),t.onTouchMove=function(e){var t=this,a=t.touchEventsData,i=t.params,s=t.touches,n=t.rtlTranslate;if(e.originalEvent&&(e=e.originalEvent),a.isTouched){if(!a.isTouchEvent||"mousemove"!==e.type){var r=("touchmove"===e.type?e.targetTouches[0]:e).pageX,o=("touchmove"===e.type?e.targetTouches[0]:e).pageY;if(e.preventedByNestedSwiper)s.startX=r,s.startY=o;else if(t.allowTouchMove){if(a.isTouchEvent&&i.touchReleaseOnEdges&&!i.loop)if(t.isVertical()){if(o<s.startY&&t.translate<=t.maxTranslate()||o>s.startY&&t.translate>=t.minTranslate())return a.isTouched=!1,void(a.isMoved=!1)}else if(r<s.startX&&t.translate<=t.maxTranslate()||r>s.startX&&t.translate>=t.minTranslate())return;if(a.isTouchEvent&&c.activeElement&&e.target===c.activeElement&&E(e.target).is(a.formElements))a.isMoved=!0,t.allowClick=!1;else if(a.allowTouchCallbacks&&t.emit("touchMove",e),!(e.targetTouches&&1<e.targetTouches.length)){s.currentX=r,s.currentY=o;var l=s.currentX-s.startX,d=s.currentY-s.startY;if(!(t.params.threshold&&Math.sqrt(Math.pow(l,2)+Math.pow(d,2))<t.params.threshold))if(void 0===a.isScrolling&&(t.isHorizontal()&&s.currentY===s.startY||t.isVertical()&&s.currentX===s.startX?a.isScrolling=!1:25<=l*l+d*d&&
508(p=180*Math.atan2(Math.abs(d),Math.abs(l))/Math.PI,a.isScrolling=t.isHorizontal()?p>i.touchAngle:90-p>i.touchAngle)),a.isScrolling&&t.emit("touchMoveOpposite",e),void 0!==a.startMoving||s.currentX===s.startX&&s.currentY===s.startY||(a.startMoving=!0),a.isScrolling)a.isTouched=!1;else if(a.startMoving){t.allowClick=!1,e.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&e.stopPropagation(),a.isMoved||(i.loop&&t.loopFix(),a.startTranslate=t.getTranslate(),t.setTransition(0),t.animating&&t.$wrapperEl.trigger("webkitTransitionEnd transitionend"),a.allowMomentumBounce=!1,!i.grabCursor||!0!==t.allowSlideNext&&!0!==t.allowSlidePrev||t.setGrabCursor(!0),t.emit("sliderFirstMove",e)),t.emit("sliderMove",e),a.isMoved=!0;var p=t.isHorizontal()?l:d,l=(s.diff=p,p*=i.touchRatio,t.swipeDirection=0<(p=n?-p:p)?"prev":"next",a.currentTranslate=p+a.startTranslate,!0),d=i.resistanceRatio;if(i.touchReleaseOnEdges&&(d=0),0<p&&a.currentTranslate>t.minTranslate()?(l=!1,i.resistance&&(a.currentTranslate=t.minTranslate()-1+Math.pow(-t.minTranslate()+a.startTranslate+p,d))):p<0&&a.currentTranslate<t.maxTranslate()&&(l=!1,i.resistance)&&(a.currentTranslate=t.maxTranslate()+1-Math.pow(t.maxTranslate()-a.startTranslate-p,d)),l&&(e.preventedByNestedSwiper=!0),!t.allowSlideNext&&"next"===t.swipeDirection&&a.currentTranslate<a.startTranslate&&(a.currentTranslate=a.startTranslate),!t.allowSlidePrev&&"prev"===t.swipeDirection&&a.currentTranslate>a.startTranslate&&(a.currentTranslate=a.startTranslate),0<i.threshold){if(!(Math.abs(p)>i.threshold||a.allowThresholdMove))return void(a.currentTranslate=a.startTranslate);
508if(!a.allowThresholdMove)return a.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,a.currentTranslate=a.startTranslate,void(s.diff=t.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}i.followFinger&&((i.freeMode||i.watchSlidesProgress||i.watchSlidesVisibility)&&(t.updateActiveIndex(),t.updateSlidesClasses()),i.freeMode&&(0===a.velocities.length&&a.velocities.push({position:s[t.isHorizontal()?"startX":"startY"],time:a.touchStartTime}),a.velocities.push({position:s[t.isHorizontal()?"currentX":"currentY"],time:q.now()})),t.updateProgress(a.currentTranslate),t.setTranslate(a.currentTranslate))}}}else t.allowClick=!1,a.isTouched&&(q.extend(s,{startX:r,startY:o,currentX:r,currentY:o}),a.touchStartTime=q.now())}}else a.startMoving&&a.isScrolling&&t.emit("touchMoveOpposite",e)}.bind(t),t.onTouchEnd=function(e){var t=this,a=t.touchEventsData,i=t.params,s=t.touches,n=t.rtlTranslate,r=t.$wrapperEl,o=t.slidesGrid,l=t.snapGrid,d=e;if(d.originalEvent&&(d=d.originalEvent),a.allowTouchCallbacks&&t.emit("touchEnd",d),a.allowTouchCallbacks=!1,a.isTouched){i.grabCursor&&a.isMoved&&a.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);var p,e=q.now(),c=e-a.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(d),t.emit("tap",d),c<300&&300<e-a.lastClickTime&&(a.clickTimeout&&clearTimeout(a.clickTimeout),a.clickTimeout=q.nextTick(function(){t&&!t.destroyed&&t.emit("click",d)},300)),c<300)&&e-a.lastClickTime<300&&(a.clickTimeout&&clearTimeout(a.clickTimeout),t.emit("doubleTap",d)),a.lastClickTime=q.now(),q.nextTick(function(){t.destroyed||(t.allowClick=!0)}),a.isTouched&&a.isMoved&&t.swipeDirection&&0!==s.diff&&a.currentTranslate!==a.startTranslate)if(a.isTouched=!1,a.isMoved=!1,a.startMoving=!1,p=i.followFinger?n?t.translate:-t.translate:-a.currentTranslate,i.freeMode)if(p<-t.minTranslate())t.slideTo(t.activeIndex);else if(p>-t.maxTranslate())t.slides.length<l.length?t.slideTo(l.length-1):t.slideTo(t.slides.length-1);else{if(i.freeModeMomentum){(!(1<a.velocities.length)||(e=a.velocities.pop(),s=a.velocities.pop(),u=e.position-s.position,s=e.time-s.time,t.velocity=u/s,t.velocity/=2,Math.abs(t.velocity)<i.freeModeMinimumVelocity&&(t.velocity=0),150<s)||300<q.now()-e.time)&&(t.velocity=0),t.velocity*=i.freeModeMomentumVelocityRatio,a.velocities.length=0;var u=1e3*i.freeModeMomentumRatio,s=t.velocity*u,h=t.translate+s;n&&(h=-h);var m,v,e=!1,s=20*Math.abs(t.velocity)*i.freeModeMomentumBounceRatio;if(h<t.maxTranslate())i.freeModeMomentumBounce?(h+t.maxTranslate()<-s&&(h=t.maxTranslate()-s),m=t.maxTranslate(),a.allowMomentumBounce=e=!0):h=t.maxTranslate(),i.loop&&i.centeredSlides&&(v=!0);else if(h>t.minTranslate())i.freeModeMomentumBounce?(h-t.minTranslate()>s&&(h=t.minTranslate()+s),m=t.minTranslate(),a.allowMomentumBounce=e=!0):h=t.minTranslate(),i.loop&&i.centeredSlides&&(v=!0);else if(i.freeModeSticky){for(var f,g=0;g<l.length;g+=1)if(l[g]>-h){f=g;break}h=-(Math.abs(l[f]-h)<Math.abs(l[f-1]-h)||"next"===t.swipeDirection?l[f]:l[f-1])}if(v&&t.once("transitionEnd",function(){t.loopFix()}),0!==t.velocity)u=n?Math.abs((-h-t.translate)/t.velocity):Math.abs((h-t.translate)/t.velocity);else if(i.freeModeSticky)return void t.slideToClosest();i.freeModeMomentumBounce&&e?(t.updateProgress(m),t.setTransition(u),t.setTranslate(h),t.transitionStart(!0,t.swipeDirection),t.animating=!0,r.transitionEnd(function(){t&&!t.destroyed&&a.allowMomentumBounce&&(t.emit("momentumBounce"),t.setTransition(i.speed),t.setTranslate(m),r.transitionEnd(function(){t&&!t.destroyed&&t.transitionEnd()}))})):t.velocity?(t.updateProgress(h),t.setTransition(u),t.setTranslate(h),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,r.transitionEnd(function(){t&&!t.destroyed&&t.transitionEnd()}))):t.updateProgress(h),t.updateActiveIndex(),t.updateSlidesClasses()}else if(i.freeModeSticky)return void t.slideToClosest();(!i.freeModeMomentum||c>=i.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}else{for(var b=0,w=t.slidesSizesGrid[0],y=0;y<o.length;y+=i.slidesPerGroup)void 0!==o[y+i.slidesPerGroup]?p>=o[y]&&p<o[y+i.slidesPerGroup]&&(w=o[(b=y)+i.slidesPerGroup]-o[y]):p>=o[y]&&(b=y,w=o[o.length-1]-o[o.length-2]);s=(p-o[b])/w;c>i.longSwipesMs?i.longSwipes?("next"===t.swipeDirection&&(s>=i.longSwipesRatio?t.slideTo(b+i.slidesPerGroup):t.slideTo(b)),"prev"===t.swipeDirection&&(s>1-i.longSwipesRatio?t.slideTo(b+i.slidesPerGroup):t.slideTo(b))):t.slideTo(t.activeIndex):i.shortSwipes?("next"===t.swipeDirection&&t.slideTo(b+i.slidesPerGroup),"prev"===t.swipeDirection&&t.slideTo(b)):t.slideTo(t.activeIndex)}else a.isTouched=!1,a.isMoved=!1,a.startMoving=!1}else a.isMoved&&i.grabCursor&&t.setGrabCursor(!1),a.isMoved=!1,a.startMoving=!1}.bind(t),t.onClick=function(e){this.allowClick||(this.params.preventClicks&&e.preventDefault(),this.params.preventClicksPropagation&&this.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}.bind(t),"container"===a.touchEventsTarget?s:n),n=!!a.nested;W.touch||!W.pointerEvents&&!W.prefixedPointerEvents?(W.touch&&(e=!("touchstart"!==i.start||!W.passiveListener||!a.passiveListeners)&&{passive:!0,capture:!1},s.addEventListener(i.start,t.onTouchStart,e),s.addEventListener(i.move,t.onTouchMove,W.passiveListener?{passive:!1,capture:n}:n),s.addEventListener(i.end,t.onTouchEnd,e)),(a.simulateTouch&&!o.ios&&!o.android||a.simulateTouch&&!W.touch&&o.ios)&&(s.addEventListener("mousedown",t.onTouchStart,!1),c.addEventListener("mousemove",t.onTouchMove,n),c.addEventListener("mouseup",t.onTouchEnd,!1))):(s.addEventListener(i.start,t.onTouchStart,!1),c.addEventListener(i.move,t.onTouchMove,n),c.addEventListener(i.end,t.onTouchEnd,!1)),(a.preventClicks||a.preventClicksPropagation)&&s.addEventListener("click",t.onClick,!0),t.on(o.ios||o.android?"resize orientationchange observerUpdate":"resize observerUpdate",A,!0)},detachEvents:function(){var e,t=this,a=t.params,i=t.touchEvents,s=t.el,n=t.wrapperEl,s="container"===a.touchEventsTarget?s:n,n=!!a.nested;W.touch||!W.pointerEvents&&!W.prefixedPointerEvents?(W.touch&&(e=!("onTouchStart"!==i.start||!W.passiveListener||!a.passiveListeners)&&{passive:!0,capture:!1},s.removeEventListener(i.start,t.onTouchStart,e),s.removeEventListener(i.move,t.onTouchMove,n),s.removeEventListener(i.end,t.onTouchEnd,e)),(a.simulateTouch&&!o.ios&&!o.android||a.simulateTouch&&!W.touch&&o.ios)&&(s.removeEventListener("mousedown",t.onTouchStart,!1),c.removeEventListener("mousemove",t.onTouchMove,n),c.removeEventListener("mouseup",t.onTouchEnd,!1))):(s.removeEventListener(i.start,t.onTouchStart,!1),c.removeEventListener(i.move,t.onTouchMove,n),c.removeEventListener(i.end,t.onTouchEnd,!1)),(a.preventClicks||a.preventClicksPropagation)&&s.removeEventListener("click",t.onClick,!0),t.off(o.ios||o.android?"resize orientationchange observerUpdate":"resize observerUpdate",A)}},breakpoints:{setBreakpoint:function(){var e,a,t,i=this,s=i.activeIndex,n=i.initialized,r=i.loopedSlides,o=(void 0===r&&(r=0),i.params),l=o.breakpoints;
508l&&0!==Object.keys(l).length&&(e=i.getBreakpoint(l))&&i.currentBreakpoint!==e&&((a=e in l?l[e]:void 0)&&["slidesPerView","spaceBetween","slidesPerGroup"].forEach(function(e){var t=a[e];void 0!==t&&(a[e]="slidesPerView"!==e||"AUTO"!==t&&"auto"!==t?"slidesPerView"===e?parseFloat(t):parseInt(t,10):"auto")}),t=(l=a||i.originalParams).direction&&l.direction!==o.direction,o=o.loop&&(l.slidesPerView!==o.slidesPerView||t),t&&n&&i.changeDirection(),q.extend(i.params,l),q.extend(i,{allowTouchMove:i.params.allowTouchMove,allowSlideNext:i.params.allowSlideNext,allowSlidePrev:i.params.allowSlidePrev}),i.currentBreakpoint=e,o&&n&&(i.loopDestroy(),i.loopCreate(),i.updateSlides(),i.slideTo(s-r+i.loopedSlides,0,!1)),i.emit("breakpoint",l))},getBreakpoint:function(e){if(e){var t=!1,a=[];Object.keys(e).forEach(function(e){a.push(e)}),a.sort(function(e,t){return parseInt(e,10)-parseInt(t,10)});for(var i=0;i<a.length;i+=1){var s=a[i];this.params.breakpointsInverse?s<=R.innerWidth&&(t=s):s>=R.innerWidth&&!t&&(t=s)}return t||"max"}}},checkOverflow:{checkOverflow:function(){var e=this,t=e.isLocked;e.isLocked=1===e.snapGrid.length,e.allowSlideNext=!e.isLocked,e.allowSlidePrev=!e.isLocked,t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock"),t&&t!==e.isLocked&&(e.isEnd=!1,e.navigation.update())}},classes:{addClasses:function(){var t=this.classNames,a=this.params,e=this.rtl,i=this.$el,s=[];s.push("initialized"),s.push(a.direction),a.freeMode&&s.push("free-mode"),W.flexbox||s.push("no-flexbox"),a.autoHeight&&s.push("autoheight"),e&&s.push("rtl"),1<a.slidesPerColumn&&s.push("multirow"),o.android&&s.push("android"),o.ios&&s.push("ios"),(j.isIE||j.isEdge)&&(W.pointerEvents||W.prefixedPointerEvents)&&s.push("wp8-"+a.direction),s.forEach(function(e){t.push(a.containerModifierClass+e)}),i.addClass(t.join(" "))},removeClasses:function(){var e=this.$el,t=this.classNames;e.removeClass(t.join(" "))}},images:{loadImage:function(e,t,a,i,s,n){function r(){n&&n()}(!e.complete||!s)&&t?((e=new R.Image).onload=r,e.onerror=r,i&&(e.sizes=i),a&&(e.srcset=a),t&&(e.src=t)):r()},preloadImages:function(){var e=this;function t(){null!=e&&e&&!e.destroyed&&(void 0!==e.imagesLoaded&&(e.imagesLoaded+=1),e.imagesLoaded===e.imagesToLoad.length)&&(e.params.updateOnImagesReady&&e.update(),e.emit("imagesReady"))}e.imagesToLoad=e.$el.find("img");for(var a=0;a<e.imagesToLoad.length;a+=1){var i=e.imagesToLoad[a];e.loadImage(i,i.currentSrc||i.getAttribute("src"),i.srcset||i.getAttribute("srcset"),i.sizes||i.getAttribute("sizes"),!0,t)}}}},G={},h=((d=e)&&(T.__proto__=d),p={extendedDefaults:{configurable:!0},defaults:{configurable:!0},Class:{configurable:!0},$:{configurable:!0}},((T.prototype=Object.create(d&&d.prototype)).constructor=T).prototype.slidesPerViewDynamic=function(){var e=this,t=e.params,a=e.slides,i=e.slidesGrid,s=e.size,n=e.activeIndex,r=1;if(t.centeredSlides){for(var o,l=a[n].swiperSlideSize,d=n+1;d<a.length;d+=1)a[d]&&!o&&(r+=1,s<(l+=a[d].swiperSlideSize))&&(o=!0);for(var p=n-1;0<=p;--p)a[p]&&!o&&(r+=1,s<(l+=a[p].swiperSlideSize))&&(o=!0)}else for(var c=n+1;c<a.length;c+=1)i[c]-i[n]<s&&(r+=1);return r},T.prototype.update=function(){var e,t,a=this;function i(){var e=a.rtlTranslate?-1*a.translate:a.translate,e=Math.min(Math.max(e,a.maxTranslate()),a.minTranslate());a.setTranslate(e),a.updateActiveIndex(),a.updateSlidesClasses()}a&&!a.destroyed&&(e=a.snapGrid,(t=a.params).breakpoints&&a.setBreakpoint(),a.updateSize(),a.updateSlides(),a.updateProgress(),a.updateSlidesClasses(),a.params.freeMode?(i(),a.params.autoHeight&&a.updateAutoHeight()):(("auto"===a.params.slidesPerView||1<a.params.slidesPerView)&&a.isEnd&&!a.params.centeredSlides?a.slideTo(a.slides.length-1,0,!1,!0):a.slideTo(a.activeIndex,0,!1,!0))||i(),t.watchOverflow&&e!==a.snapGrid&&a.checkOverflow(),a.emit("update"))},T.prototype.changeDirection=function(a,e){void 0===e&&(e=!0);var t=this,i=t.params.direction;return(a=a||("horizontal"===i?"vertical":"horizontal"))===i||"horizontal"!==a&&"vertical"!==a||(t.$el.removeClass(""+t.params.containerModifierClass+i+" wp8-"+i).addClass(""+t.params.containerModifierClass+a),(j.isIE||j.isEdge)&&(W.pointerEvents||W.prefixedPointerEvents)&&t.$el.addClass(t.params.containerModifierClass+"wp8-"+a),t.params.direction=a,t.slides.each(function(e,t){"vertical"===a?t.style.width="":t.style.height=""}
508),t.emit("changeDirection"),e&&t.update()),t},T.prototype.init=function(){var e=this;e.initialized||(e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.params.loop&&e.loopCreate(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.setGrabCursor(),e.params.preloadImages&&e.preloadImages(),e.params.loop?e.slideTo(e.params.initialSlide+e.loopedSlides,0,e.params.runCallbacksOnInit):e.slideTo(e.params.initialSlide,0,e.params.runCallbacksOnInit),e.attachEvents(),e.initialized=!0,e.emit("init"))},T.prototype.destroy=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);var a=this,i=a.params,s=a.$el,n=a.$wrapperEl,r=a.slides;return void 0===a.params||a.destroyed||(a.emit("beforeDestroy"),a.initialized=!1,a.detachEvents(),i.loop&&a.loopDestroy(),t&&(a.removeClasses(),s.removeAttr("style"),n.removeAttr("style"),r)&&r.length&&r.removeClass([i.slideVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index").removeAttr("data-swiper-column").removeAttr("data-swiper-row"),a.emit("destroy"),Object.keys(a.eventsListeners).forEach(function(e){a.off(e)}),!1!==e&&(a.$el[0].swiper=null,a.$el.data("swiper",null),q.deleteProps(a)),a.destroyed=!0),null},T.extendDefaults=function(e){q.extend(G,e)},p.extendedDefaults.get=function(){return G},p.defaults.get=function(){return H},p.Class.get=function(){return d},p.$.get=function(){return E},Object.defineProperties(T,p),T),m={name:"device",proto:{device:o},static:{device:o}},v={name:"support",proto:{support:W},static:{support:W}},f={name:"browser",proto:{browser:j},static:{browser:j}},g={name:"resize",create:function(){var e=this;q.extend(e,{resize:{resizeHandler:function(){e&&!e.destroyed&&e.initialized&&(e.emit("beforeResize"),e.emit("resize"))},orientationChangeHandler:function(){e&&!e.destroyed&&e.initialized&&e.emit("orientationchange")}}})},on:{init:function(){R.addEventListener("resize",this.resize.resizeHandler),R.addEventListener("orientationchange",this.resize.orientationChangeHandler)},destroy:function(){R.removeEventListener("resize",this.resize.resizeHandler),R.removeEventListener("orientationchange",this.resize.orientationChangeHandler)}}},b={func:R.MutationObserver||R.WebkitMutationObserver,attach:function(e,t){void 0===t&&(t={});var a=this,i=new b.func(function(e){var t;1!==e.length?(t=function(){a.emit("observerUpdate",e[0])},R.requestAnimationFrame?R.requestAnimationFrame(t):R.setTimeout(t,0)):a.emit("observerUpdate",e[0])});i.observe(e,{attributes:void 0===t.attributes||t.attributes,childList:void 0===t.childList||t.childList,characterData:void 0===t.characterData||t.characterData}),a.observer.observers.push(i)},init:function(){var e=this;if(W.observer&&e.params.observer){if(e.params.observeParents)for(var t=e.$el.parents(),a=0;a<t.length;a+=1)e.observer.attach(t[a]);e.observer.attach(e.$el[0],{childList:e.params.observeSlideChildren}),e.observer.attach(e.$wrapperEl[0],{attributes:!1})}},destroy:function(){this.observer.observers.forEach(function(e){e.disconnect()}),this.observer.observers=[]}},w={name:"observer",params:{observer:!1,observeParents:!1,observeSlideChildren:!1},create:function(){q.extend(this,{observer:{init:b.init.bind(this),attach:b.attach.bind(this),destroy:b.destroy.bind(this),observers:[]}})},on:{init:function(){this.observer.init()},destroy:function(){this.observer.destroy()}}},y={update:function(e){var t=this,a=t.params,i=a.slidesPerView,s=a.slidesPerGroup,a=a.centeredSlides,n=t.params.virtual,r=n.addSlidesBefore,n=n.addSlidesAfter,o=t.virtual,l=o.from,d=o.to,p=o.slides,c=o.slidesGrid,u=o.renderSlide,o=o.offset;t.updateActiveIndex();var h,m=t.activeIndex||0,v=t.rtlTranslate?"right":t.isHorizontal()?"left":"top",a=a?(h=Math.floor(i/2)+s+r,Math.floor(i/2)+s+n):(h=i+(s-1)+r,s+n),f=Math.max((m||0)-a,0),g=Math.min((m||0)+h,p.length-1),i=(t.slidesGrid[f]||0)-(t.slidesGrid[0]||0);function b(){t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),t.lazy&&t.params.lazy.enabled&&t.lazy.load()}if(q.extend(t.virtual,{from:f,to:g,offset:i,slidesGrid:t.slidesGrid}),l!==f||d!==g||e){if(t.params.virtual.renderExternal)t.params.virtual.renderExternal.call(t,{offset:i,from:f,to:g,slides:function(){for(var e=[],t=f;t<=g;t+=1)e.push(p[t]);return e}()});else{var w=[],y=[];if(e)t.$wrapperEl.find("."+t.params.slideClass).remove();else for(var x=l;x<=d;x+=1)(x<f||g<x)&&t.$wrapperEl.find("."+t.params.slideClass+'[data-swiper-slide-index="'+x+'"]').remove();for(var T=0;T<p.length;T+=1)f<=T&&T<=g&&(void 0===d||e?y.push(T):(d<T&&y.push(T),T<l&&w.push(T)));
508y.forEach(function(e){t.$wrapperEl.append(u(p[e],e))}),w.sort(function(e,t){return t-e}).forEach(function(e){t.$wrapperEl.prepend(u(p[e],e))}),t.$wrapperEl.children(".swiper-slide").css(v,i+"px")}b()}else t.slidesGrid!==c&&i!==o&&t.slides.css(v,i+"px"),t.updateProgress()},renderSlide:function(e,t){var a=this,i=a.params.virtual;return i.cache&&a.virtual.cache[t]?a.virtual.cache[t]:((e=i.renderSlide?E(i.renderSlide.call(a,e,t)):E('<div class="'+a.params.slideClass+'" data-swiper-slide-index="'+t+'">'+e+"</div>")).attr("data-swiper-slide-index")||e.attr("data-swiper-slide-index",t),i.cache&&(a.virtual.cache[t]=e),e)},appendSlide:function(e){if("object"==typeof e&&"length"in e)for(var t=0;t<e.length;t+=1)e[t]&&this.virtual.slides.push(e[t]);else this.virtual.slides.push(e);this.virtual.update(!0)},prependSlide:function(e){var t,a,i=this,s=i.activeIndex,n=s+1,r=1;if(Array.isArray(e)){for(var o=0;o<e.length;o+=1)e[o]&&i.virtual.slides.unshift(e[o]);n=s+e.length,r=e.length}else i.virtual.slides.unshift(e);i.params.virtual.cache&&(t=i.virtual.cache,a={},Object.keys(t).forEach(function(e){a[parseInt(e,10)+r]=t[e]}),i.virtual.cache=a),i.virtual.update(!0),i.slideTo(n,0)},removeSlide:function(e){var t=this;if(null!=e){var a=t.activeIndex;if(Array.isArray(e))for(var i=e.length-1;0<=i;--i)t.virtual.slides.splice(e[i],1),t.params.virtual.cache&&delete t.virtual.cache[e[i]],e[i]<a&&--a,a=Math.max(a,0);else t.virtual.slides.splice(e,1),t.params.virtual.cache&&delete t.virtual.cache[e],e<a&&--a,a=Math.max(a,0);t.virtual.update(!0),t.slideTo(a,0)}},removeAllSlides:function(){var e=this;e.virtual.slides=[],e.params.virtual.cache&&(e.virtual.cache={}),e.virtual.update(!0),e.slideTo(0,0)}},x={name:"virtual",params:{virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,addSlidesBefore:0,addSlidesAfter:0}},create:function(){var e=this;q.extend(e,{virtual:{update:y.update.bind(e),appendSlide:y.appendSlide.bind(e),prependSlide:y.prependSlide.bind(e),removeSlide:y.removeSlide.bind(e),removeAllSlides:y.removeAllSlides.bind(e),renderSlide:y.renderSlide.bind(e),slides:e.params.virtual.slides,cache:{}}})},on:{beforeInit:function(){var e,t=this;t.params.virtual.enabled&&(t.classNames.push(t.params.containerModifierClass+"virtual"),q.extend(t.params,e={watchSlidesProgress:!0}),q.extend(t.originalParams,e),t.params.initialSlide||t.virtual.update(
508))},setTranslate:function(){this.params.virtual.enabled&&this.virtual.update()}}},N={handle:function(e){var t=this,a=t.rtlTranslate,i=(e=e.originalEvent?e.originalEvent:e).keyCode||e.charCode;if(!t.allowSlideNext&&(t.isHorizontal()&&39===i||t.isVertical()&&40===i||34===i))return!1;if(!t.allowSlidePrev&&(t.isHorizontal()&&37===i||t.isVertical()&&38===i||33===i))return!1;if(!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||c.activeElement&&c.activeElement.nodeName&&("input"===c.activeElement.nodeName.toLowerCase()||"textarea"===c.activeElement.nodeName.toLowerCase()))){if(t.params.keyboard.onlyInViewport&&(33===i||34===i||37===i||39===i||38===i||40===i)){var s=!1;if(0<t.$el.parents("."+t.params.slideClass).length&&0===t.$el.parents("."+t.params.slideActiveClass).length)return;var n=R.innerWidth,r=R.innerHeight,o=t.$el.offset();a&&(o.left-=t.$el[0].scrollLeft);for(var l=[[o.left,o.top],[o.left+t.width,o.top],[o.left,o.top+t.height],[o.left+t.width,o.top+t.height]],d=0;d<l.length;d+=1){var p=l[d];0<=p[0]&&p[0]<=n&&0<=p[1]&&p[1]<=r&&(s=!0)}if(!s)return}t.isHorizontal()?(33!==i&&34!==i&&37!==i&&39!==i||(e.preventDefault?e.preventDefault():e.returnValue=!1),(34!==i&&39!==i||a)&&(33!==i&&37!==i||!a)||t.slideNext(),(33!==i&&37!==i||a)&&(34!==i&&39!==i||!a)||t.slidePrev()):(33!==i&&34!==i&&38!==i&&40!==i||(e.preventDefault?e.preventDefault():e.returnValue=!1),34!==i&&40!==i||t.slideNext(),33!==i&&38!==i||t.slidePrev()),t.emit("keyPress",i)}},enable:function(){this.keyboard.enabled||(E(c).on("keydown",this.keyboard.handle),this.keyboard.enabled=!0)},disable:function(){this.keyboard.enabled&&(E(c).off("keydown",this.keyboard.handle),this.keyboard.enabled=!1)}},t={name:"keyboard",params:{keyboard:{enabled:!1,onlyInViewport:!0}},create:function(){q.extend(this,{keyboard:{enabled:!1,enable:N.enable.bind(this),disable:N.disable.bind(this),handle:N.handle.bind(this)}})},on:{init:function(){this.params.keyboard.enabled&&this.keyboard.enable()},destroy:function(){this.keyboard.enabled&&this.keyboard.disable()}}};function T(){for(var a,e=[],t=arguments.length;t--;)e[t]=arguments[t];a=(1===e.length&&e[0].constructor&&e[0].constructor===Object?e[0]:(r=e[0],e[1]))||{},a=q.extend({},a),r&&!a.el&&(a.el=r),d.call(this,a),Object.keys(u).forEach(function(t){Object.keys(u[t]).forEach(function(e){T.prototype[e]||(T.prototype[e]=u[t][e])})});var i,s=this,n=(void 0===s.modules&&(s.modules={}),Object.keys(s.modules).forEach(function(e){var t,e=s.modules[e];e.params&&(t=Object.keys(e.params)[0],"object"==typeof(e=e.params[t]))&&null!==e&&t in a&&"enabled"in e&&(!0===a[t]&&(a[t]={enabled:!0}),"object"!=typeof a[t]||"enabled"in a[t]||(a[t].enabled=!0),a[t]||(a[t]={enabled:!1}))}),q.extend({},H)),n=(s.useModulesParams(n),s.params=q.extend({},n,G,a),s.originalParams=q.extend({},s.params),s.passedParams=q.extend({},a),(s.$=E)(s.params.el));if(r=n[0]){if(1<n.length)return i=[],n.each(function(e,t){t=q.extend({},a,{el:t});i.push(new T(t))}),i;r.swiper=s,n.data("swiper",s);var r,o=n.children("."+s.params.wrapperClass);return q.extend(s,{$el:n,el:r,$wrapperEl:o,wrapperEl:o[0],classNames:[],slides:E(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===s.params.direction},isVertical:function(){return"vertical"===s.params.direction},rtl:"rtl"===r.dir.toLowerCase()||"rtl"===n.css("direction"),rtlTranslate:"horizontal"===s.params.direction&&("rtl"===r.dir.toLowerCase()||"rtl"===n.css("direction")),wrongRTL:"-webkit-box"===o.css("display"),activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:s.params.allowSlideNext,allowSlidePrev:s.params.allowSlidePrev,touchEvents:(r=["mousedown","mousemove","mouseup"],W.pointerEvents?r=["pointerdown","pointermove","pointerup"]:W.prefixedPointerEvents&&(r=["MSPointerDown","MSPointerMove","MSPointerUp"]),s.touchEventsTouch={start:(n=["touchstart","touchmove","touchend"])[0],move:n[1],end:n[2]},s.touchEventsDesktop={start:r[0],move:r[1],end:r[2]},W.touch||!s.params.simulateTouch?s.touchEventsTouch:s.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,formElements:"input, select, option, textarea, button, video",lastClickTime:q.now(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:s.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),s.useModules(),s.params.init&&s.init(),s}}var S={lastScrollTime:q.now(),event:-1<R.navigator.userAgent.indexOf("firefox")?"DOMMouseScroll":((s=(a="onwheel")in c)||((r=c.createElement("div")).setAttribute(a,"return;"),s="function"==typeof r[a]),(s=!s&&c.implementation&&c.implementation.hasFeature&&!0!==c.implementation.hasFeature("","")?c.implementation.hasFeature("Events.wheel","3.0"):s)?"wheel":"mousewheel"),normalize:function(e){var t=0,a=0,i=0,s=0;return"detail"in e&&(a=e.detail),"wheelDelta"in e&&(a=-e.wheelDelta/120),"wheelDeltaY"in e&&(a=-e.wheelDeltaY/120
508),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=a,a=0),i=10*t,s=10*a,"deltaY"in e&&(s=e.deltaY),((i="deltaX"in e?e.deltaX:i)||s)&&e.deltaMode&&(1===e.deltaMode?(i*=40,s*=40):(i*=800,s*=800)),{spinX:t=i&&!t?i<1?-1:1:t,spinY:a=s&&!a?s<1?-1:1:a,pixelX:i,pixelY:s}},handleMouseEnter:function(){this.mouseEntered=!0},handleMouseLeave:function(){this.mouseEntered=!1},handle:function(e){var t=this,a=t.params.mousewheel;if(!t.mouseEntered&&!a.releaseOnEdges)return!0;e.originalEvent&&(e=e.originalEvent);var i=0,s=t.rtlTranslate?-1:1,n=S.normalize(e);if(a.forceToAxis)if(t.isHorizontal()){if(!(Math.abs(n.pixelX)>Math.abs(n.pixelY)))return!0;i=n.pixelX*s}else{if(!(Math.abs(n.pixelY)>Math.abs(n.pixelX)))return!0;i=n.pixelY}else i=Math.abs(n.pixelX)>Math.abs(n.pixelY)?-n.pixelX*s:-n.pixelY;if(0===i)return!0;if(a.invert&&(i=-i),t.params.freeMode){t.params.loop&&t.loopFix();var s=t.getTranslate()+i*a.sensitivity,n=t.isBeginning,r=t.isEnd;if((s=s>=t.minTranslate()?t.minTranslate():s)<=t.maxTranslate()&&(s=t.maxTranslate()),t.setTransition(0),t.setTranslate(s),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses(),(!n&&t.isBeginning||!r&&t.isEnd)&&t.updateSlidesClasses(),t.params.freeModeSticky&&(clearTimeout(t.mousewheel.timeout),t.mousewheel.timeout=q.nextTick(function(){t.slideToClosest()},300)),t.emit("scroll",e),t.params.autoplay&&t.params.autoplayDisableOnInteraction&&t.autoplay.stop(),s===t.minTranslate()||s===t.maxTranslate())return!0}else{if(60<q.now()-t.mousewheel.lastScrollTime)if(i<0)if(t.isEnd&&!t.params.loop||t.animating){if(a.releaseOnEdges)return!0}else t.slideNext(),t.emit("scroll",e);else if(t.isBeginning&&!t.params.loop||t.animating){if(a.releaseOnEdges)return!0}else t.slidePrev(),t.emit("scroll",e);t.mousewheel.lastScrollTime=(new R.Date).getTime()}return e.preventDefault?e.preventDefault():e.returnValue=!1,!1},enable:function(){var e,t=this;return!!S.event&&!t.mousewheel.enabled&&(e=t.$el,(e="container"!==t.params.mousewheel.eventsTarged?E(t.params.mousewheel.eventsTarged):e).on("mouseenter",t.mousewheel.handleMouseEnter),e.on("mouseleave",t.mousewheel.handleMouseLeave),e.on(S.event,t.mousewheel.handle),t.mousewheel.enabled=!0)},disable:function(){var e,t=this;return!!S.event&&!(!t.mousewheel.enabled||(e=t.$el,(e="container"!==t.params.mousewheel.eventsTarged?E(t.params.mousewheel.eventsTarged):e).off(S.event,t.mousewheel.handle),t.mousewheel.enabled=!1))}},C={update:function(){var e,t,a=this,i=a.params.navigation;a.params.loop||(e=(t=a.navigation).$nextEl,(t=t.$prevEl)&&0<t.length&&(a.isBeginning?t.addClass(i.disabledClass):t.removeClass(i.disabledClass),t[a.params.watchOverflow&&a.isLocked?"addClass":"removeClass"](i.lockClass)),e&&0<e.length&&(a.isEnd?e.addClass(i.disabledClass):e.removeClass(i.disabledClass),e[a.params.watchOverflow&&a.isLocked?"addClass":"removeClass"](i.lockClass)))},onPrevClick:function(e){e.preventDefault(),this.isBeginning&&!this.params.loop||this.slidePrev()},onNextClick:function(e){e.preventDefault(),this.isEnd&&!this.params.loop||this.slideNext()},init:function(){var e,t,a=this,i=a.params.navigation;(i.nextEl||i.prevEl)&&(i.nextEl&&(e=E(i.nextEl),a.params.uniqueNavElements)&&"string"==typeof i.nextEl&&1<e.length&&1===a.$el.find(i.nextEl).length&&(e=a.$el.find(i.nextEl)),i.prevEl&&(t=E(i.prevEl),a.params.uniqueNavElements)&&"string"==typeof i.prevEl&&1<t.length&&1===a.$el.find(i.prevEl).length&&(t=a.$el.find(i.prevEl)),e&&0<e.length&&e.on("click",a.navigation.onNextClick),t&&0<t.length&&t.on("click",a.navigation.onPrevClick),q.extend(a.navigation,{$nextEl:e,nextEl:e&&e[0],$prevEl:t,prevEl:t&&t[0]}))},destroy:function(){var e=this,t=e.navigation,a=t.$nextEl,t=t.$prevEl;a&&a.length&&(a.off("click",e.navigation.onNextClick),a.removeClass(e.params.navigation.disabledClass)),t&&t.length&&(t.off("click",e.navigation.onPrevClick),t.removeClass(e.params.navigation.disabledClass))}},M={update:function(){var e=this,t=e.rtl,i=e.params.pagination;if(i.el&&e.pagination.el&&e.pagination.$el&&0!==e.pagination.$el.length){var s,a=(e.virtual&&e.params.virtual.enabled?e.virtual:e).slides.length,n=e.pagination.$el,r=e.params.loop?Math.
508ceil((a-2*e.loopedSlides)/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?((s=Math.ceil((e.activeIndex-e.loopedSlides)/e.params.slidesPerGroup))>a-1-2*e.loopedSlides&&(s-=a-2*e.loopedSlides),r-1<s&&(s-=r),s<0&&"bullets"!==e.params.paginationType&&(s=r+s)):s=void 0!==e.snapIndex?e.snapIndex:e.activeIndex||0,"bullets"===i.type&&e.pagination.bullets&&0<e.pagination.bullets.length){var o,l,d,p=e.pagination.bullets;if(i.dynamicBullets&&(e.pagination.bulletSize=p.eq(0)[e.isHorizontal()?"outerWidth":"outerHeight"](!0),n.css(e.isHorizontal()?"width":"height",e.pagination.bulletSize*(i.dynamicMainBullets+4)+"px"),1<i.dynamicMainBullets&&void 0!==e.previousIndex&&(e.pagination.dynamicBulletIndex+=s-e.previousIndex,e.pagination.dynamicBulletIndex>i.dynamicMainBullets-1?e.pagination.dynamicBulletIndex=i.dynamicMainBullets-1:e.pagination.dynamicBulletIndex<0&&(e.pagination.dynamicBulletIndex=0)),o=s-e.pagination.dynamicBulletIndex,d=((l=o+(Math.min(p.length,i.dynamicMainBullets)-1))+o)/2),p.removeClass(i.bulletActiveClass+" "+i.bulletActiveClass+"-next "+i.bulletActiveClass+"-next-next "+i.bulletActiveClass+"-prev "+i.bulletActiveClass+"-prev-prev "+i.bulletActiveClass+"-main"),1<n.length)p.each(function(e,t){var t=E(t),a=t.index();a===s&&t.addClass(i.bulletActiveClass),i.dynamicBullets&&(o<=a&&a<=l&&t.addClass(i.bulletActiveClass+"-main"),a===o&&t.prev().addClass(i.bulletActiveClass+"-prev").prev().addClass(i.bulletActiveClass+"-prev-prev"),a===l)&&t.next().addClass(i.bulletActiveClass+"-next").next().addClass(i.bulletActiveClass+"-next-next")});else if(p.eq(s).addClass(i.bulletActiveClass),i.dynamicBullets){for(var a=p.eq(o),c=p.eq(l),u=o;u<=l;u+=1)p.eq(u).addClass(i.bulletActiveClass+"-main");a.prev().addClass(i.bulletActiveClass+"-prev").prev().addClass(i.bulletActiveClass+"-prev-prev"),c.next().addClass(i.bulletActiveClass+"-next").next().addClass(i.bulletActiveClass+"-next-next")}i.dynamicBullets&&(a=Math.min(p.length,i.dynamicMainBullets+4),c=(e.pagination.bulletSize*a-e.pagination.bulletSize)/2-d*e.pagination.bulletSize,a=t?"right":"left",p.css(e.isHorizontal()?a:"top",c+"px"))}"fraction"===i.type&&(n.find("."+i.currentClass).text(i.formatFractionCurrent(s+1)),n.find("."+i.totalClass).text(i.formatFractionTotal(r))),"progressbar"===i.type&&(d=i.progressbarOpposite?e.isHorizontal()?"vertical":"horizontal":e.isHorizontal()?"horizontal":"vertical",t=(s+1)/r,c=a=1,"horizontal"==d?a=t:c=t,n.find("."+i.progressbarFillClass).transform("translate3d(0,0,0) scaleX("+a+") scaleY("+c+")").transition(e.params.speed)),"custom"===i.type&&i.renderCustom?(n.html(i.renderCustom(e,s+1,r)),e.emit("paginationRender",e,n[0])):e.emit("paginationUpdate",e,n[0]),n[e.params.watchOverflow&&e.isLocked?"addClass":"removeClass"](i.lockClass)}},render:function(){var e=this,t=e.params.pagination;if(t.el&&e.pagination.el&&e.pagination.$el&&0!==e.pagination.$el.length){var a=(e.virtual&&e.params.virtual.enabled?e.virtual:e).slides.length,i=e.pagination.$el,s="";if("bullets"===t.type){for(var n=e.params.loop?Math.ceil((a-2*e.loopedSlides)/e.params.slidesPerGroup):e.snapGrid.length,r=0;r<n;r+=1)t.renderBullet?s+=t.renderBullet.call(e,r,t.bulletClass):s+="<"+t.bulletElement+' class="'+t.bulletClass+'"></'+t.bulletElement+">";i.html(s),e.pagination.bullets=i.find("."+t.bulletClass)}"fraction"===t.type&&(s=t.renderFraction?t.renderFraction.call(e,t.currentClass,t.totalClass):'<span class="'+t.currentClass+'"></span> / <span class="'+t.totalClass+'"></span>',i.html(s)),"progressbar"===t.type&&(s=t.renderProgressbar?t.renderProgressbar.call(e,t.progressbarFillClass):'<span class="'+t.progressbarFillClass+'"></span>',i.html(s)),"custom"!==t.type&&e.emit("paginationRender",e.pagination.$el[0])}},init:function(){var e,t=this,a=t.params.pagination;a.el&&0!==(e=E(a.el)).length&&(t.params.uniqueNavElements&&"string"==typeof a.el&&1<e.length&&1===t.$el.find(a.el).length&&(e=t.$el.find(a.el)),"bullets"===a.type&&a.clickable&&e.addClass(a.clickableClass),e.addClass(a.modifierClass+a.type),"bullets"===a.type&&a.dynamicBullets&&(e.addClass(""+a.modifierClass+a.type+"-dynamic"),t.pagination.dynamicBulletIndex=0,a.dynamicMainBullets<1)&&(a.dynamicMainBullets=1),"progressbar"===a.type&&a.progressbarOpposite&&e.addClass(a.progressbarOppositeClass),a.clickable&&e.on("click","."+a.bulletClass,function(e){e.preventDefault();e=E(this).index()*t.params.slidesPerGroup;t.params.loop&&(e+=t.loopedSlides),t.slideTo(e)}),q.extend(t.pagination,{$el:e,el:e[0]}))},destroy:function(){var e,t=this,a=t.params.pagination;a.el&&t.pagination.el&&t.pagination.$el&&0!==t.pagination.$el.length&&((e=t.pagination.$el).removeClass(a.hiddenClass),e.removeClass(a.modifierClass+a.type),t.pagination.bullets&&t.pagination.bullets.removeClass(a.bulletActiveClass),a.clickable)&&e.off("click","."+a.bulletClass)}},P={setTranslate:function(){var e,t,a,i,s,n,r,o,l=this;l.params.scrollbar.el&&l.scrollbar.el&&(n=l.scrollbar,e=l.rtlTranslate,o=l.progress,t=n.dragSize,a=n.trackSize,i=n.$dragEl,s=n.$el,n=l.params.scrollbar,o=(a-(r=t))*o,e?0<(o=-o)?(r=t-o,o=0):a<-o+t&&(r=a+o):o<0?(r=t+o,o=0):a<o+t&&(r=a-o),l.isH
508orizontal()?(W.transforms3d?i.transform("translate3d("+o+"px, 0, 0)"):i.transform("translateX("+o+"px)"),i[0].style.width=r+"px"):(W.transforms3d?i.transform("translate3d(0px, "+o+"px, 0)"):i.transform("translateY("+o+"px)"),i[0].style.height=r+"px"),n.hide)&&(clearTimeout(l.scrollbar.timeout),s[0].style.opacity=1,l.scrollbar.timeout=setTimeout(function(){s[0].style.opacity=0,s.transition(400)},1e3))},setTransition:function(e){this.params.scrollbar.el&&this.scrollbar.el&&this.scrollbar.$dragEl.transition(e)},updateSize:function(){var e,t,a,i,s,n,r,o=this;o.params.scrollbar.el&&o.scrollbar.el&&(t=(e=o.scrollbar).$dragEl,a=e.$el,t[0].style.width="",t[0].style.height="",i=o.isHorizontal()?a[0].offsetWidth:a[0].offsetHeight,n=(s=o.size/o.virtualSize)*(i/o.size),r="auto"===o.params.scrollbar.dragSize?i*s:parseInt(o.params.scrollbar.dragSize,10),o.isHorizontal()?t[0].style.width=r+"px":t[0].style.height=r+"px",a[0].style.display=1<=s?"none":"",o.params.scrollbar.hide&&(a[0].style.opacity=0),q.extend(e,{trackSize:i,divider:s,moveDivider:n,dragSize:r}),e.$el[o.params.watchOverflow&&o.isLocked?"addClass":"removeClass"](o.params.scrollbar.lockClass))},getPointerPosition:function(e){return this.isHorizontal()?"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageX:e.pageX||e.clientX:"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageY:e.pageY||e.clientY},setDragPosition:function(e){var t=this,a=t.scrollbar,i=t.rtlTranslate,s=a.$el,n=a.dragSize,r=a.trackSize,o=a.dragStartPos,a=(a.getPointerPosition(e)-s.offset()[t.isHorizontal()?"left":"top"]-(null!==o?o:n/2))/(r-n),e=(a=Math.max(Math.min(a,1),0),i&&(a=1-a),t.minTranslate()+(t.maxTranslate()-t.minTranslate())*a);t.updateProgress(e),t.setTranslate(e),t.updateActiveIndex(),t.updateSlidesClasses()},onDragStart:function(e){var t=this,a=t.params.scrollbar,i=t.scrollbar,s=t.$wrapperEl,n=i.$el,r=i.$dragEl;t.scrollbar.isTouched=!0,t.scrollbar.dragStartPos=e.target===r[0]||e.target===r?i.getPointerPosition(e)-e.target.getBoundingClientRect()[t.isHorizontal()?"left":"top"]:null,e.preventDefault(),e.stopPropagation(),s.transition(100),r.transition(100),i.setDragPosition(e),clearTimeout(t.scrollbar.dragTimeout),n.transition(0),a.hide&&n.css("opacity",1),t.emit("scrollbarDragStart",e)},onDragMove:function(e){var t=this.scrollbar,a=this.$wrapperEl,i=t.$el,s=t.$dragEl;this.scrollbar.isTouched&&(e.preventDefault?e.preventDefault():e.returnValue=!1,t.setDragPosition(e),a.transition(0),i.transition(0),s.transition(0),this.emit("scrollbarDragMove",e))},onDragEnd:function(e){var t=this,a=t.params.scrollbar,i=t.scrollbar.$el;t.scrollbar.isTouched&&(t.scrollbar.isTouched=!1,a.hide&&(clearTimeout(t.scrollbar.dragTimeout),t.scrollbar.dragTimeout=q.nextTick(function(){i.css("opacity",0),i.transition(400)},1e3)),t.emit("scrollbarDragEnd",e),a.snapOnRelease)&&t.slideToClosest()},enableDraggable:function(){var e,t,a,i,s,n=this;n.params.scrollbar.el&&(a=n.scrollbar,e=n.touchEventsTouch,t=n.touchEventsDesktop,s=n.params,a=a.$el[0],i=!(!W.passiveListener||!s.passiveListeners)&&{passive:!1,capture:!1},s=!(!W.passiveListener||!s.passiveListeners)&&{passive:!0,capture:!1},W.touch?(a.addEventListener(e.start,n.scrollbar.onDragStart,i),a.addEventListener(e.move,n.scrollbar.onDragMove,i),a.addEventListener(e.end,n.scrollbar.onDragEnd,s)):(a.addEventListener(t.start,n.scrollbar.onDragStart,i),c.addEventListener(t.move,n.scrollbar.onDragMove,i),c.addEventListener(t.end,n.scrollbar.onDragEnd,s)))},disableDraggable:function(){var e,t,a,i,s,n=this;n.params.scrollbar.el&&(a=n.scrollbar,e=n.touchEventsTouch,t=n.touchEventsDesktop,s=n.params,a=a.$el[0],i=!(!W.passiveListener||!s.passiveListeners)&&{passive:!1,capture:!1},s=!(!W.passiveListener||!s.passiveListeners)&&{passive:!0,capture:!1},W.touch?(a.removeEventListener(e.start,n.scrollbar.onDragStart,i),a.removeEventListener(e.move,n.scrollbar.onDragMove,i),a.removeEventListener(e.end,n.scrollbar.onDragEnd,s)):(a.removeEventListener(t.start,n.scrollbar.onDragStart,i),c.removeEventListener(t.move,n.scrollbar.onDragMove,i),c.removeEventListener(t.end,n.scrollbar.onDragEnd,s)))},init:function(){var e,t,a,i,s=this;
508s.params.scrollbar.el&&(e=s.scrollbar,i=s.$el,a=E((t=s.params.scrollbar).el),0===(i=(a=s.params.uniqueNavElements&&"string"==typeof t.el&&1<a.length&&1===i.find(t.el).length?i.find(t.el):a).find("."+s.params.scrollbar.dragClass)).length&&(i=E('<div class="'+s.params.scrollbar.dragClass+'"></div>'),a.append(i)),q.extend(e,{$el:a,el:a[0],$dragEl:i,dragEl:i[0]}),t.draggable)&&e.enableDraggable()},destroy:function(){this.scrollbar.disableDraggable()}},B={setTransform:function(e,t){var a=this.rtl,e=E(e),a=a?-1:1,i=e.attr("data-swiper-parallax")||"0",s=e.attr("data-swiper-parallax-x"),n=e.attr("data-swiper-parallax-y"),r=e.attr("data-swiper-parallax-scale"),o=e.attr("data-swiper-parallax-opacity");s||n?(s=s||"0",n=n||"0"):this.isHorizontal()?(s=i,n="0"):(n=i,s="0"),s=0<=s.indexOf("%")?parseInt(s,10)*t*a+"%":s*t*a+"px",n=0<=n.indexOf("%")?parseInt(n,10)*t+"%":n*t+"px",null!=o&&(i=o-(o-1)*(1-Math.abs(t)),e[0].style.opacity=i),null==r?e.transform("translate3d("+s+", "+n+", 0px)"):(a=r-(r-1)*(1-Math.abs(t)),e.transform("translate3d("+s+", "+n+", 0px) scale("+a+")"))},setTranslate:function(){var i=this,e=i.$el,t=i.slides,s=i.progress,n=i.snapGrid;e.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function(e,t){i.parallax.setTransform(t,s)}),t.each(function(e,t){var a=t.progress;1<i.params.slidesPerGroup&&"auto"!==i.params.slidesPerView&&(a+=Math.ceil(e/2)-s*(n.length-1)),a=Math.min(Math.max(a,-1),1),E(t).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function(e,t){i.parallax.setTransform(t,a)})})},setTransition:function(i){void 0===i&&(i=this.params.speed),this.$el.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function(e,t){var t=E(t),a=parseInt(t.attr("data-swiper-parallax-duration"),10)||i;0===i&&(a=0),t.transition(a)})}},V={getDistanceBetweenTouches:function(e){var t,a,i;return e.targetTouches.length<2?1:(t=e.targetTouches[0].pageX,a=e.targetTouches[0].pageY,i=e.targetTouches[1].pageX,e=e.targetTouches[1].pageY,Math.sqrt(Math.pow(i-t,2)+Math.pow(e-a,2)))},onGestureStart:function(e){var t=this,a=t.params.zoom,i=t.zoom,s=i.gesture;if(i.fakeGestureTouched=!1,i.fakeGestureMoved=!1,!W.gestures){if("touchstart"!==e.type||"touchstart"===e.type&&e.targetTouches.length<2)return;i.fakeGestureTouched=!0,s.scaleStart=V.getDistanceBetweenTouches(e)}s.$slideEl&&s.$slideEl.length||(s.$slideEl=E(e.target).closest(".swiper-slide"),0===s.$slideEl.length&&(s.$slideEl=t.slides.eq(t.activeIndex)),s.$imageEl=s.$slideEl.find("img, svg, canvas"),s.$imageWrapEl=s.$imageEl.parent("."+a.containerClass),s.maxRatio=s.$imageWrapEl.attr("data-swiper-zoom")||a.maxRatio,0!==s.$imageWrapEl.length)?(s.$imageEl.transition(0),t.zoom.isScaling=!0):s.$imageEl=void 0},onGestureChange:function(e){var t=this.params.zoom,a=this.zoom,i=a.gesture;if(!W.gestures){if("touchmove"!==e.type||"touchmove"===e.type&&e.targetTouches.length<2)return;a.fakeGestureMoved=!0,i.scaleMove=V.getDistanceBetweenTouches(e)}i.$imageEl&&0!==i.$imageEl.length&&(a.scale=W.gestures?e.scale*a.currentScale:i.scaleMove/i.scaleStart*a.currentScale,a.scale>i.maxRatio&&(a.scale=i.maxRatio-1+Math.pow(a.scale-i.maxRatio+1,.5)),a.scale<t.minRatio&&(a.scale=t.minRatio+1-Math.pow(t.minRatio-a.scale+1,.5)),i.$imageEl.transform("translate3d(0,0,0) scale("+a.scale+")"))},onGestureEnd:function(e){var t=this.params.zoom,a=this.zoom,i=a.gesture;if(!W.gestures){if(!a.fakeGestureTouched||!a.fakeGestureMoved)return;if("touchend"!==e.type||"touchend"===e.type&&e.changedTouches.length<2&&!o.android)return;a.fakeGestureTouched=!1,a.fakeGestureMoved=!1}i.$imageEl&&0!==i.$imageEl.length&&(a.scale=Math.max(Math.min(a.scale,i.maxRatio),t.minRatio),i.$imageEl.transition(this.params.speed).transform("translate3d(0,0,0) scale("+a.scale+")"),a.currentScale=a.scale,a.isScaling=!1,1===a.scale)&&(i.$slideEl=void 0)},onTouchStart:function(e){var t=this.zoom,a=t.gesture,t=t.image;a.$imageEl&&0!==a.$imageEl.length&&!t.isTouched&&(o.android&&e.preventDefault(),t.isTouched=!0,t.touchesStart.x=("touchstart"===e.type?e.targetTouches[0]:e).pageX,t.touchesStart.y=("touchstart"===e.type?e.targetTouches[0]:e).pageY)},onTouchMove:function(e){var t=this,a=t.zoom,i=a.gesture,s=a.image,n=a.velocity;if(i.$imageEl&&0!==i.$imageEl.length&&(t.allowClick=!1,s.isTouched)&&i.$slideEl){s.isMoved||(s.width=i.$imageEl[0].offsetWidth,s.height=i.$imageEl[0].offsetHeight,s.startX=q.getTranslate(i.$imageWrapEl[0],"x")||0,s.startY=q.getTranslate(i.$imageWrapEl[0],"y")||0,i.slideWidth=i.$slideEl[0].offsetWidth,i.slideHeight=i.$slideEl[0].offsetHeight,i.$imageWrapEl.transition(0),t.rtl&&(s.startX=-s.startX,s.startY=-s.startY));var r=s.width*a.scale,o=s.height*a.scale;if(!(r<i.slideWidth&&o<i.slideHeight)){if(s.minX=Math.min(i.slideWidth/2-r/2,0),s.maxX=-s.minX,s.minY=Math.min(i.slideHeight/2-o/2,0),s.maxY=-s.minY,s.touchesCurrent.x=("touchmove"===e.type?e.targetTouches[0]:e).pageX,s.touchesCurrent.y=("touchmove"===e.type?e.targetTouches[0]:e).pageY,!s.isMoved&&!a.isScaling){if(t.isHorizontal()&&(Math.floor(s.minX)===Math.floor(s.startX)&&s.touchesCurrent.x<s.touchesStart.x||Math.floor(s.maxX)===Math.floor(s.startX)&&s.touchesCurrent.x>s.touchesStart.x))return void(s.isTouched=!1);if(!t.isHorizontal()&&(Math.floor(s.minY)===Math.floor(s.startY)&&s.touchesCurrent.y<s.touchesStart.y||Math.floor(s.maxY)===Math.floor(s.startY)&&s.touchesCurrent.y>s.touchesStart.y))return void(s.isTouched=!1)}e.preventDefault(),e.stopPropagation(),s.isMoved=!0,s.currentX=s.touchesCurrent.x-s.touchesStart.x+s.startX,s.currentY=s.touchesCurrent.y-s.touchesStart.y+s.startY,s.currentX<s.minX&&(s.currentX=s.minX+1-Math.pow(s.minX-s.currentX+1,.8)),s.currentX>s.maxX&&(s.currentX=s.maxX-1+Math.pow(s.currentX-s.maxX+1,.8)),s.currentY<s.minY&&(s.currentY=s.minY+1-Math.pow(s.minY-s.currentY+1,.8)),s.currentY>s.maxY&&(s.currentY=s.maxY-1+Math.pow(s.currentY-s.maxY+1,.8)),n.prevPositionX||(n.prevPositionX=s.touchesCurrent.x),n.prevPositionY||(n.prevPositionY=s.touchesCurrent.y),n.prevTime||(n.prevTime=Date.now()),n.x=(s.touchesCurrent.x-n.prevPositionX)/(Date.now()-n.prevTime)/2,n.y=(s.touchesCurrent.y-n.prevPositionY)/(Date.now()-n.prevTime)/2,Math.abs(s.touchesCurrent.x-n.prevPositionX)<2&&(n.x=0),Math.abs(s.touchesCurrent.y-n.prevPositionY)<2&&(n.y=0),n.prevPositionX=s.touchesCurrent.x,n.prevPositionY=s.touchesCurrent.y,n.prevTime=Date.now(),i.$imageWrapEl.transform("translate3d("+s.currentX+"px, "+s.currentY+"px,0)")}}},onTouchEnd:function(){var e,t,a,i,s=this.zoom,n=s.gesture,r=s.image,o=s.velocity;n.$imageEl&&0!==n.$imageEl.length&&(r.isTouched&&r.isMoved?(r.isTouched=!1,r.isMoved=!1,e=o.x*(a=300),e=r.currentX+e,t=o.y*(i=300),t=r.currentY+t,0!==o.x&&(a=Math.abs((e-r.currentX)/o.x)),0!==o.y&&(i=Math.abs((t-r.currentY)/o.y)),o=Math.max(a,i),r.currentX=e,r.currentY=t,a=r.width*s.scale,i=r.height*s.scale,r.minX=Math.min(n.slideWidth/2-a/2,0),r.maxX=-r.minX,r.minY=Math.min(n.slideHeight/2-i/2,0),r.maxY=-r.minY,r.currentX=Math.max(Math.min(r.currentX,r.maxX),r.minX),r.currentY=Math.max(Math.min(r.currentY,r.maxY),r.minY),n.$imageWrapEl.transition(o).transform("translate3d("+r.currentX+"px, "+r.currentY+"px,0)")):(r.isTouched=!1,r.isMoved=!1))},onTransitionEnd:function(){var e=this.zoom,t=e.gesture;t.$slideEl&&this.previousIndex!==this.activeIndex&&(t.$imageEl.transform("translate3d(0,
5080,0) scale(1)"),t.$imageWrapEl.transform("translate3d(0,0,0)"),e.scale=1,e.currentScale=1,t.$slideEl=void 0,t.$imageEl=void 0,t.$imageWrapEl=void 0)},toggle:function(e){var t=this.zoom;t.scale&&1!==t.scale?t.out():t.in(e)},in:function(e){var t,a,i,s,n=this,r=n.zoom,o=n.params.zoom,l=r.gesture,d=r.image;l.$slideEl||(l.$slideEl=n.clickedSlide?E(n.clickedSlide):n.slides.eq(n.activeIndex),l.$imageEl=l.$slideEl.find("img, svg, canvas"),l.$imageWrapEl=l.$imageEl.parent("."+o.containerClass)),l.$imageEl&&0!==l.$imageEl.length&&(l.$slideEl.addClass(""+o.zoomedSlideClass),n=void 0===d.touchesStart.x&&e?(t=("touchend"===e.type?e.changedTouches[0]:e).pageX,("touchend"===e.type?e.changedTouches[0]:e).pageY):(t=d.touchesStart.x,d.touchesStart.y),r.scale=l.$imageWrapEl.attr("data-swiper-zoom")||o.maxRatio,r.currentScale=l.$imageWrapEl.attr("data-swiper-zoom")||o.maxRatio,e?(d=l.$slideEl[0].offsetWidth,o=l.$slideEl[0].offsetHeight,e=l.$slideEl.offset().left+d/2-t,t=l.$slideEl.offset().top+o/2-n,n=l.$imageEl[0].offsetWidth,s=l.$imageEl[0].offsetHeight,n=n*r.scale,s=s*r.scale,n=-(d=Math.min(d/2-n/2,0)),s=-(o=Math.min(o/2-s/2,0)),n<(a=(a=e*r.scale)<d?d:a)&&(a=n),s<(i=(i=t*r.scale)<o?o:i)&&(i=s)):i=a=0,l.$imageWrapEl.transition(300).transform("translate3d("+a+"px, "+i+"px,0)"),l.$imageEl.transition(300).transform("translate3d(0,0,0) scale("+r.scale+")"))},out:function(){var e=this,t=e.zoom,a=e.params.zoom,i=t.gesture;i.$slideEl||(i.$slideEl=e.clickedSlide?E(e.clickedSlide):e.slides.eq(e.activeIndex),i.$imageEl=i.$slideEl.find("img, svg, canvas"),i.$imageWrapEl=i.$imageEl.parent("."+a.containerClass)),i.$imageEl&&0!==i.$imageEl.length&&(t.scale=1,t.currentScale=1,i.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"),i.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"),i.$slideEl.removeClass(""+a.zoomedSlideClass),i.$slideEl=void 0)},enable:function(){var e,t=this,a=t.zoom;a.enabled||(a.enabled=!0,e=!("touchstart"!==t.touchEvents.start||!W.passiveListener||!t.params.passiveListeners)&&{passive:!0,capture:!1},W.gestures?(t.$wrapperEl.on("gesturestart",".swiper-slide",a.onGestureStart,e),t.$wrapperEl.on("gesturechange",".swiper-slide",a.onGestureChange,e),t.$wrapperEl.on("gestureend",".swiper-slide",a.onGestureEnd,e)):"touchstart"===t.touchEvents.start&&(t.$wrapperEl.on(t.touchEvents.start,".swiper-slide",a.onGestureStart,e),t.$wrapperEl.on(t.touchEvents.move,".swiper-slide",a.onGestureChange,e),t.$wrapperEl.on(t.touchEvents.end,".swiper-slide",a.onGestureEnd,e)),t.$wrapperEl.on(t.touchEvents.move,"."+t.params.zoom.containerClass,a.onTouchMove))},disable:function(){var e,t=this,a=t.zoom;a.enabled&&(t.zoom.enabled=!1,e=!("touchstart"!==t.touchEvents.start||!W.passiveListener||!t.params.passiveListeners)&&{passive:!0,capture:!1},W.gestures?(t.$wrapperEl.off("gesturestart",".swiper-slide",a.onGestureStart,e),t.$wrapperEl.off("gesturechange",".swiper-slide",a.onGestureChange,e),t.$wrapperEl.off("gestureend",".swiper-slide",a.onGestureEnd,e)):"touchstart"===t.touchEvents.start&&(t.$wrapperEl.off(t.touchEvents.start,".swiper-slide",a.onGestureStart,e),t.$wrapperEl.off(t.touchEvents.move,".swiper-slide",a.onGestureChange,e),t.$wrapperEl.off(t.touchEvents.end,".swiper-slide",a.onGestureEnd,e)),t.$wrapperEl.off(t.touchEvents.move,"."+t.params.zoom.containerClass,a.onTouchMove))}},X={loadInSlide:function(e,o){void 0===o&&(o=!0);var l,d=this,p=d.params.lazy;void 0!==e&&0!==d.slides.length&&(e=(l=d.virtual&&d.params.virtual.enabled?d.$wrapperEl.children("."+d.params.slideClass+'[data-swiper-slide-index="'+e+'"]'):d.slides.eq(e)).find("."+p.elementClass+":not(."+p.loadedClass+"):not(."+p.loadingClass+")"),0!==(e=!l.hasClass(p.elementClass)||l.hasClass(p.loadedClass)||l.hasClass(p.loadingClass)?e:e.add(l[0])).length)&&e.each(function(e,t){var a=E(t),i=(a.addClass(p.loadingClass),a.attr("data-background")),s=a.attr("data-src"),n=a.attr("data-srcset"),r=a.attr("data-sizes");d.loadImage(a[0],s||i,n,r,!1,function(){var e,t;null==d||!d||d&&!d.params||d.destroyed||(i?(a.css("background-image",'url("'+i+'")'),a.removeAttr("data-background")):(n&&(a.attr("srcset",n
508),a.removeAttr("data-srcset")),r&&(a.attr("sizes",r),a.removeAttr("data-sizes")),s&&(a.attr("src",s),a.removeAttr("data-src"))),a.addClass(p.loadedClass).removeClass(p.loadingClass),l.find("."+p.preloaderClass).remove(),d.params.loop&&o&&(e=l.attr("data-swiper-slide-index"),l.hasClass(d.params.slideDuplicateClass)?(t=d.$wrapperEl.children('[data-swiper-slide-index="'+e+'"]:not(.'+d.params.slideDuplicateClass+")"),d.lazy.loadInSlide(t.index(),!1)):(t=d.$wrapperEl.children("."+d.params.slideDuplicateClass+'[data-swiper-slide-index="'+e+'"]'),d.lazy.loadInSlide(t.index(),!1))),d.emit("lazyImageReady",l[0],a[0]))}),d.emit("lazyImageLoad",l[0],a[0])})},load:function(){var a=this,t=a.$wrapperEl,i=a.params,s=a.slides,e=a.activeIndex,n=a.virtual&&i.virtual.enabled,r=i.lazy,o=i.slidesPerView;function l(e){if(n){if(t.children("."+i.slideClass+'[data-swiper-slide-index="'+e+'"]').length)return 1}else if(s[e])return 1}function d(e){return n?E(e).attr("data-swiper-slide-index"):E(e).index()}if("auto"===o&&(o=0),a.lazy.initialImageLoaded||(a.lazy.initialImageLoaded=!0),a.params.watchSlidesVisibility)t.children("."+i.slideVisibleClass).each(function(e,t){t=n?E(t).attr("data-swiper-slide-index"):E(t).index();a.lazy.loadInSlide(t)});else if(1<o)for(var p=e;p<e+o;p+=1)l(p)&&a.lazy.loadInSlide(p);else a.lazy.loadInSlide(e);if(r.loadPrevNext)if(1<o||r.loadPrevNextAmount&&1<r.loadPrevNextAmount){for(var r=r.loadPrevNextAmount,c=o,u=Math.min(e+c+Math.max(r,c),s.length),c=Math.max(e-Math.max(c,r),0),h=e+o;h<u;h+=1)l(h)&&a.lazy.loadInSlide(h);for(var m=c;m<e;m+=1)l(m)&&a.lazy.loadInSlide(m)}else{r=t.children("."+i.slideNextClass),c=(0<r.length&&a.lazy.loadInSlide(d(r)),t.children("."+i.slidePrevClass));0<c.length&&a.lazy.loadInSlide(d(c))}}},k={LinearSpline:function(e,t){var a,i,s,n,r;return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(r=function(e,t){for(i=-1,a=e.length;1<a-i;)e[s=a+i>>1]<=t?i=s:a=s;return a}(this.x,e),n=r-1,(e-this.x[n])*(this.y[r]-this.y[n])/(this.x[r]-this.x[n])+this.y[n]):0},this},getInterpolateFunction:function(e){var t=this;t.controller.spline||(t.controller.spline=t.params.loop?new k.LinearSpline(t.slidesGrid,e.slidesGrid):new k.LinearSpline(t.snapGrid,e.snapGrid))},setTranslate:function(e,t){var a,i,s=this,n=s.controller.control;function r(e){var t=s.rtlTranslate?-s.translate:s.translate;"slide"===s.params.controller.by&&(s.controller.getInterpolateFunction(e),i=-s.controller.spline.interpolate(-t)),i&&"container"!==s.params.controller.by||(a=(e.maxTranslate()-e.minTranslate())/(s.maxTranslate()-s.minTranslate()),i=(t-s.minTranslate())*a+e.minTranslate()),s.params.controller.inverse&&(i=e.maxTranslate()-i),e.updateProgress(i),e.setTranslate(i,s),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(n))for(var o=0;o<n.length;o+=1)n[o]!==t&&n[o]instanceof h&&r(n[o]);else n instanceof h&&t!==n&&r(n)},setTransition:function(t,e){var a,i=this,s=i.controller.control;function n(e){e.setTransition(t,i),0!==t&&(e.transitionStart(),e.params.autoHeight&&q.nextTick(function(){e.updateAutoHeight()}),e.$wrapperEl.transitionEnd(function(){s&&(e.params.loop&&"slide"===i.params.controller.by&&e.loopFix(),e.transitionEnd())}))}if(Array.isArray(s))for(a=0;a<s.length;a+=1)s[a]!==e&&s[a]instanceof h&&n(s[a]);else s instanceof h&&e!==s&&n(s)}},Y={makeElFocusable:function(e){return e.attr("tabIndex","0"),e},addElRole:function(e,t){return e.attr("role",t),e},addElLabel:function(e,t){return e.attr("aria-label",t),e},disableEl:function(e){return e.attr("aria-disabled",!0),e},enableEl:function(e){return e.attr("aria-disabled",!1),e},onEnterKey:function(e){var t=this,a=t.params.a11y;13===e.keyCode&&(e=E(e.target),t.navigation&&t.navigation.$nextEl&&e.is(t.navigation.$nextEl)&&(t.isEnd&&!t.params.loop||t.slideNext(),t.isEnd?t.a11y.notify(a.lastSlideMessage):t.a11y.notify(a.nextSlideMessage)),t.navigation&&t.navigation.$prevEl&&e.is(t.navigation.$prevEl)&&(t.isBeginning&&!t.params.loop||t.slidePrev(),t.isBeginning?t.a11y.notify(a.firstSlideMessage):t.a11y.notify(a.prevSlideMessage)),t.pagination)&&e.is("."+t.params.pagination.bulletClass)&&e[0].click()},notify:function(e){var t=this.a11y.liveRegion;0!==t.length&&(t.html(""),t.html(e))},updateNavigation:function(){var e,t,a=this;a.params.loop||(e=(t=a.navigation).$nextEl,(t=t.$prevEl)&&0<t.length&&(a.isBeginning?a.a11y.disableEl(t):a.a11y.enableEl(t)),e&&0<e.length&&(a.isEnd?a.a11y.disableEl(e):a.a11y.enableEl(e)))},updatePagination:function(){var a=this,i=a.params.a11y;a.pagination&&a.params.pagination.clickable&&a.pagination.bullets&&a.pagination.bullets.length&&a.pagination.bullets.each(function(e,t){t=E(t);a.a11y.makeElFocusable(t),a.a11y.addElRole(t,"button"),a.a11y.addElLabel(t,i.paginationBulletMessage.replace(/{{index}}/,t.index()+1))})},init:function(){var e=this;e.$el.append(e.a11y.liveRegion);var t,a,i=e.params.a11y;e.navigation&&e.navigation.$nextEl&&(t=e.navigation.$nextEl),e.navigation&&e.navigation.$prevEl&&(a=e.navigation.$prevEl),t&&(e.a11y.makeElFocusable(t),e.a11y.addElRole(t,"button"),e.a11y.addElLabel(t,i.nextSlideMessage),t.on("key
508down",e.a11y.onEnterKey)),a&&(e.a11y.makeElFocusable(a),e.a11y.addElRole(a,"button"),e.a11y.addElLabel(a,i.prevSlideMessage),a.on("keydown",e.a11y.onEnterKey)),e.pagination&&e.params.pagination.clickable&&e.pagination.bullets&&e.pagination.bullets.length&&e.pagination.$el.on("keydown","."+e.params.pagination.bulletClass,e.a11y.onEnterKey)},destroy:function(){var e,t,a=this;a.a11y.liveRegion&&0<a.a11y.liveRegion.length&&a.a11y.liveRegion.remove(),a.navigation&&a.navigation.$nextEl&&(e=a.navigation.$nextEl),a.navigation&&a.navigation.$prevEl&&(t=a.navigation.$prevEl),e&&e.off("keydown",a.a11y.onEnterKey),t&&t.off("keydown",a.a11y.onEnterKey),a.pagination&&a.params.pagination.clickable&&a.pagination.bullets&&a.pagination.bullets.length&&a.pagination.$el.off("keydown","."+a.params.pagination.bulletClass,a.a11y.onEnterKey)}},z={init:function(){var e,t=this;t.params.history&&(R.history&&R.history.pushState?((e=t.history).initialized=!0,e.paths=z.getPathValues(),(e.paths.key||e.paths.value)&&(e.scrollToSlide(0,e.paths.value,t.params.runCallbacksOnInit),t.params.history.replaceState||R.addEventListener("popstate",t.history.setHistoryPopState))):(t.params.history.enabled=!1,t.params.hashNavigation.enabled=!0))},destroy:function(){this.params.history.replaceState||R.removeEventListener("popstate",this.history.setHistoryPopState)},setHistoryPopState:function(){this.history.paths=z.getPathValues(),this.history.scrollToSlide(this.params.speed,this.history.paths.value,!1)},getPathValues:function(){var e=R.location.pathname.slice(1).split("/").filter(function(e){return""!==e}),t=e.length;return{key:e[t-2],value:e[t-1]}},setHistory:function(e,t){this.history.initialized&&this.params.history.enabled&&(t=this.slides.eq(t),t=z.slugify(t.attr("data-history")),R.location.pathname.includes(e)||(t=e+"/"+t),(e=R.history.state)&&e.value===t||(this.params.history.replaceState?R.history.replaceState({value:t},null,t):R.history.pushState({value:t},null,t)))},slugify:function(e){return e.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(e,t,a){var i=this;if(t)for(var s=0,n=i.slides.length;s<n;s+=1){var r=i.slides.eq(s);z.slugify(r.attr("data-history"))!==t||r.hasClass(i.params.slideDuplicateClass)||(r=r.index(),i.slideTo(r,e,a))}else i.slideTo(0,e,a)}},$={onHashCange:function(){var e=this,t=c.location.hash.replace("#","");t!==e.slides.eq(e.activeIndex).attr("data-hash")&&void 0!==(t=e.$wrapperEl.children("."+e.params.slideClass+'[data-hash="'+t+'"]').index())&&e.slideTo(t)},setHash:function(){var e=this;e.hashNavigation.initialized&&e.params.hashNavigation.enabled&&(e.params.hashNavigation.replaceState&&R.history&&R.history.replaceState?R.history.replaceState(null,null,"#"+e.slides.eq(e.activeIndex).attr("data-hash")||""):(e=(e=e.slides.eq(e.activeIndex)).attr("data-hash")||e.attr("data-history"),c.location.hash=e||""))},init:function(){var e=this;if(!(!e.params.hashNavigation.enabled||e.params.history&&e.params.history.enabled)){e.hashNavigation.initialized=!0;var t=c.location.hash.replace("#","");if(t)for(var a=0,i=e.slides.length;a<i;a+=1){var s=e.slides.eq(a);(s.attr("data-hash")||s.attr("data-history"))!==t||s.hasClass(e.params.slideDuplicateClass)||(s=s.index(),e.slideTo(s,0,e.params.runCallbacksOnInit,!0))}e.params.hashNavigation.watchState&&E(R).on("hashchange",e.hashNavigation.onHashCange)}},destroy:function(){this.params.hashNavigation.watchState&&E(R).off("hashchange",this.hashNavigation.onHashCange)}},I={run:function(){var e=this,t=e.slides.eq(e.activeIndex),a=e.params.autoplay.delay;t.attr("data-swiper-autoplay")&&(a=t.attr("data-swiper-autoplay")||e.params.autoplay.delay),clearTimeout(e.autoplay.timeout),e.autoplay.timeout=q.nextTick(function(){e.params.autoplay.reverseDirection?e.params.loop?(e.loopFix(),e.slidePrev(e.params.speed,!0,!0),e.emit("autoplay")):e.isBeginning?e.params.autoplay.stopOnLastSlide?e.autoplay.stop():(e.slideTo(e.slides.length-1,e.params.speed,!0,!0),e.emit("autoplay")):(e.slidePrev(e.params.speed,!0,!0),e.emit("autoplay")):e.params.loop?(e.loopFix(),e.slideNext(e.params.speed,!0,
508!0),e.emit("autoplay")):e.isEnd?e.params.autoplay.stopOnLastSlide?e.autoplay.stop():(e.slideTo(0,e.params.speed,!0,!0),e.emit("autoplay")):(e.slideNext(e.params.speed,!0,!0),e.emit("autoplay"))},a)},start:function(){var e=this;return void 0===e.autoplay.timeout&&!e.autoplay.running&&(e.autoplay.running=!0,e.emit("autoplayStart"),e.autoplay.run(),!0)},stop:function(){var e=this;return!!e.autoplay.running&&void 0!==e.autoplay.timeout&&(e.autoplay.timeout&&(clearTimeout(e.autoplay.timeout),e.autoplay.timeout=void 0),e.autoplay.running=!1,e.emit("autoplayStop"),!0)},pause:function(e){var t=this;t.autoplay.running&&!t.autoplay.paused&&(t.autoplay.timeout&&clearTimeout(t.autoplay.timeout),t.autoplay.paused=!0,0!==e&&t.params.autoplay.waitForTransition?(t.$wrapperEl[0].addEventListener("transitionend",t.autoplay.onTransitionEnd),t.$wrapperEl[0].addEventListener("webkitTransitionEnd",t.autoplay.onTransitionEnd)):(t.autoplay.paused=!1,t.autoplay.run()))}},F={setTranslate:function(){for(var e=this,t=e.slides,a=0;a<t.length;a+=1){var i=e.slides.eq(a),s=-i[0].swiperSlideOffset,n=(e.params.virtualTranslate||(s-=e.translate),0),r=(e.isHorizontal()||(n=s,s=0),e.params.fadeEffect.crossFade?Math.max(1-Math.abs(i[0].progress),0):1+Math.min(Math.max(i[0].progress,-1),0));i.css({opacity:r}).transform("translate3d("+s+"px, "+n+"px, 0px)")}},setTransition:function(e){var a,i=this,t=i.slides,s=i.$wrapperEl;t.transition(e),i.params.virtualTranslate&&0!==e&&(a=!1,t.transitionEnd(function(){if(!a&&i&&!i.destroyed){a=!0,i.animating=!1;for(var e=["webkitTransitionEnd","transitionend"],t=0;t<e.length;t+=1)s.trigger(e[t])}}))}},U={setTranslate:function(){var e,t=this,a=t.$el,i=t.$wrapperEl,s=t.slides,n=t.width,r=t.height,o=t.rtlTranslate,l=t.size,d=t.params.cubeEffect,p=t.isHorizontal(),c=t.virtual&&t.params.virtual.enabled,u=0;d.shadow&&(p?(0===(e=i.find(".swiper-cube-shadow")).length&&(e=E('<div class="swiper-cube-shadow"></div>'),i.append(e)),e.css({height:n+"px"})):0===(e=a.find(".swiper-cube-shadow")).length&&(e=E('<div class="swiper-cube-shadow"></div>'),a.append(e)));for(var h,m=0;m<s.length;m+=1){var v=s.eq(m),f=m,g=90*(f=c?parseInt(v.attr("data-swiper-slide-index"),10):f),b=Math.floor(g/360),w=(o&&(g=-g,b=Math.floor(-g/360)),Math.max(Math.min(v[0].progress,1),-1)),y=0,x=0,T=0,b=(f%4==0?(y=4*-b*l,T=0):(f-1)%4==0?(y=0,T=4*-b*l):(f-2)%4==0?(y=l+4*b*l,T=l):(f-3)%4==0&&(y=-l,T=3*l+4*l*b),o&&(y=-y),p||(x=y,y=0),"rotateX("+(p?0:-g)+"deg) rotateY("+(p?g:0)+"deg) translate3d("+y+"px, "+x+"px, "+T+"px)");w<=1&&-1<w&&(u=90*f+90*w,o)&&(u=90*-f-90*w),v.transform(b),d.slideShadows&&(g=p?v.find(".swiper-slide-shadow-left"):v.find(".swiper-slide-shadow-top"),y=p?v.find(".swiper-slide-shadow-right"):v.find(".swiper-slide-shadow-bottom"),0===g.length&&(g=E('<div class="swiper-slide-shadow-'+(p?"left":"top")+'"></div>'),v.append(g)),0===y.length&&(y=E('<div class="swiper-slide-shadow-'+(p?"right":"bottom")+'"></div>'),v.append(y)),g.length&&(g[0].style.opacity=Math.max(-w,0)),y.length)&&(y[0].style.opacity=Math.max(w,0))}i.css({"-webkit-transform-origin":"50% 50% -"+l/2+"px","-moz-transform-origin":"50% 50% -"+l/2+"px","-ms-transform-origin":"50% 50% -"+l/2+"px","transform-origin":"50% 50% -"+l/2+"px"}),d.shadow&&(p?e.transform("translate3d(0px, "+(n/2+d.shadowOffset)+"px, "+-n/2+"px) rotateX(90deg) rotateZ(0deg) scale("+d.shadowScale+")"):(a=Math.abs(u)-90*Math.floor(Math.abs(u)/90),n=1.5-(Math.sin(2*a*Math.PI/360)/2+Math.cos(2*a*Math.PI/360)/2),a=d.shadowScale,n=d.shadowScale/n,h=d.shadowOffset,e.transform("scale3d("+a+", 1, "+n+") translate3d(0px, "+(r/2+h)+"px, "+-r/2/n+"px) rotateX(-90deg)"))),i.transform("translate3d(0px,0,"+(j.isSafari||j.isUiWebView?-l/2:0)+"px) rotateX("+(t.isHorizontal()?0:u)+"deg) rotateY("+(t.isHorizontal()?-u:0)+"deg)")},setTransition:function(e){var t=this.$el;this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),this.params.cubeEffect.shadow&&!this.isHorizontal()&&t.find(".swiper-cube-shadow").transition(e)}},K={setTranslate:function(){for(var e=this,t=e.slides,a=e.rtlTranslate,i=0;i<t.length;i+=1){var s,n,r=t.eq(i),o=r[0].progress,l=-180*(o=e.params.flipEffect.limitRotation?Math.max(Math.min(r[0].progress,
5081),-1):o),d=0,p=-r[0].swiperSlideOffset,c=0;e.isHorizontal()?a&&(l=-l):(c=p,d=-l,l=p=0),r[0].style.zIndex=-Math.abs(Math.round(o))+t.length,e.params.flipEffect.slideShadows&&(s=e.isHorizontal()?r.find(".swiper-slide-shadow-left"):r.find(".swiper-slide-shadow-top"),n=e.isHorizontal()?r.find(".swiper-slide-shadow-right"):r.find(".swiper-slide-shadow-bottom"),0===s.length&&(s=E('<div class="swiper-slide-shadow-'+(e.isHorizontal()?"left":"top")+'"></div>'),r.append(s)),0===n.length&&(n=E('<div class="swiper-slide-shadow-'+(e.isHorizontal()?"right":"bottom")+'"></div>'),r.append(n)),s.length&&(s[0].style.opacity=Math.max(-o,0)),n.length)&&(n[0].style.opacity=Math.max(o,0)),r.transform("translate3d("+p+"px, "+c+"px, 0px) rotateX("+d+"deg) rotateY("+l+"deg)")}},setTransition:function(e){var a,i=this,t=i.slides,s=i.activeIndex,n=i.$wrapperEl;t.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),i.params.virtualTranslate&&0!==e&&(a=!1,t.eq(s).transitionEnd(function(){if(!a&&i&&!i.destroyed){a=!0,i.animating=!1;for(var e=["webkitTransitionEnd","transitionend"],t=0;t<e.length;t+=1)n.trigger(e[t])}}))}},_={setTranslate:function(){for(var e=this,t=e.width,a=e.height,i=e.slides,s=e.$wrapperEl,n=e.slidesSizesGrid,r=e.params.coverflowEffect,o=e.isHorizontal(),e=e.translate,l=o?t/2-e:a/2-e,d=o?r.rotate:-r.rotate,p=r.depth,c=0,u=i.length;c<u;c+=1){var h=i.eq(c),m=n[c],m=(l-h[0].swiperSlideOffset-m/2)/m*r.modifier,v=o?d*m:0,f=o?0:d*m,g=-p*Math.abs(m),b=o?0:r.stretch*m,w=o?r.stretch*m:0,w=(Math.abs(w)<.001&&(w=0),Math.abs(b)<.001&&(b=0),Math.abs(g)<.001&&(g=0),Math.abs(v)<.001&&(v=0),"translate3d("+w+"px,"+b+"px,"+g+"px)  rotateX("+(f=Math.abs(f)<.001?0:f)+"deg) rotateY("+v+"deg)");h.transform(w),h[0].style.zIndex=1-Math.abs(Math.round(m)),r.slideShadows&&(b=o?h.find(".swiper-slide-shadow-left"):h.find(".swiper-slide-shadow-top"),g=o?h.find(".swiper-slide-shadow-right"):h.find(".swiper-slide-shadow-bottom"),0===b.length&&(b=E('<div class="swiper-slide-shadow-'+(o?"left":"top")+'"></div>'),h.append(b)),0===g.length&&(g=E('<div class="swiper-slide-shadow-'+(o?"right":"bottom")+'"></div>'),h.append(g)),b.length&&(b[0].style.opacity=0<m?m:0),g.length)&&(g[0].style.opacity=0<-m?-m:0)}(W.pointerEvents||W.prefixedPointerEvents)&&(s[0].style.perspectiveOrigin=l+"px 50%")},setTransition:function(e){this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}},Z={init:function(){var e=this,t=e.params.thumbs,a=e.constructor;t.swiper instanceof a?(e.thumbs.swiper=t.swiper,q.extend(e.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),q.extend(e.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1})):q.isObject(t.swiper)&&(e.thumbs.swiper=new a(q.extend({},t.swiper,{watchSlidesVisibility:!0,watchSlidesProgress:!0,slideToClickedSlide:!1})),e.thumbs.swiperCreated=!0),e.thumbs.swiper.$el.addClass(e.params.thumbs.thumbsContainerClass),e.thumbs.swiper.on("tap",e.thumbs.onThumbClick)},onThumbClick:function(){var e,t,a,i=this,s=i.thumbs.swiper;s&&(e=s.clickedIndex,(a=s.clickedSlide)&&E(a).hasClass(i.params.thumbs.slideThumbActiveClass)||null==e||(a=s.params.loop?parseInt(E(s.clickedSlide).attr("data-swiper-slide-index"),10):e,i.params.loop&&(s=i.activeIndex,i.slides.eq(s).hasClass(i.params.slideDuplicateClass)&&(i.loopFix(),i._clientLeft=i.$wrapperEl[0].clientLeft,s=i.activeIndex),e=i.slides.eq(s).prevAll('[data-swiper-slide-index="'+a+'"]').eq(0).index(),t=i.slides.eq(s).nextAll('[data-swiper-slide-index="'+a+'"]').eq(0).index(),a=void 0===e||void 0!==t&&t-s<s-e?t:e),i.slideTo(a)))},update:function(e){var t=this,a=t.thumbs.swiper;if(a){var i,s,n,r="auto"===a.params.slidesPerView?a.slidesPerViewDynamic():a.params.slidesPerView,o=(t.realIndex!==a.realIndex&&(i=a.activeIndex,n=a.params.loop?(a.slides.eq(i).hasClass(a.params.slideDuplicateClass)&&(a.loopFix(),a._clientLeft=a.$wrapperEl[0].clientLeft,i=a.activeIndex),s=a.slides.eq(i).prevAll('[data-swiper-slide-index="'+t.realIndex+'"]').eq(0).index(),n=a.slides.eq(i).nextAll('[data-swiper-slide-index="'+t.realIndex+'"]').eq(0).index(),void 0===s?n:void 0===n?s:n-i==i-s?i:n-i<i-s?
vendor: 16,384 bytes, lines 508-509
508n:s):t.realIndex,a.visibleSlidesIndexes)&&a.visibleSlidesIndexes.indexOf(n)<0&&(a.params.centeredSlides?n=i<n?n-Math.floor(r/2)+1:n+Math.floor(r/2)-1:i<n&&(n=n-r+1),a.slideTo(n,e?0:void 0)),1),l=t.params.thumbs.slideThumbActiveClass;if(1<t.params.slidesPerView&&!t.params.centeredSlides&&(o=t.params.slidesPerView),a.slides.removeClass(l),a.params.loop||a.params.virtual)for(var d=0;d<o;d+=1)a.$wrapperEl.children('[data-swiper-slide-index="'+(t.realIndex+d)+'"]').addClass(l);else for(var p=0;p<o;p+=1)a.slides.eq(t.realIndex+p).addClass(l)}}},D=[m,v,f,g,w,x,t,{name:"mousewheel",params:{mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarged:"container"}},create:function(){var e=this;q.extend(e,{mousewheel:{enabled:!1,enable:S.enable.bind(e),disable:S.disable.bind(e),handle:S.handle.bind(e),handleMouseEnter:S.handleMouseEnter.bind(e),handleMouseLeave:S.handleMouseLeave.bind(e),lastScrollTime:q.now()}})},on:{init:function(){this.params.mousewheel.enabled&&this.mousewheel.enable()},destroy:function(){this.mousewheel.enabled&&this.mousewheel.disable()}}},{name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){var e=this;q.extend(e,{navigation:{init:C.init.bind(e),update:C.update.bind(e),destroy:C.destroy.bind(e),onNextClick:C.onNextClick.bind(e),onPrevClick:C.onPrevClick.bind(e)}})},on:{init:function(){this.navigation.init(),this.navigation.update()},toEdge:function(){this.navigation.update()},fromEdge:function(){this.navigation.update()},destroy:function(){this.navigation.destroy()},click:function(e){var t,a=this,i=a.navigation,s=i.$nextEl,i=i.$prevEl;!a.params.navigation.hideOnClick||E(e.target).is(i)||E(e.target).is(s)||(s?t=s.hasClass(a.params.navigation.hiddenClass):i&&(t=i.hasClass(a.params.navigation.hiddenClass)),!0===t?a.emit("navigationShow",a):a.emit("navigationHide",a),s&&s.toggleClass(a.params.navigation.hiddenClass),i&&i.toggleClass(a.params.navigation.hiddenClass))}}},{name:"pagination",params:{pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:function(e){return e},formatFractionTotal:function(e){return e},bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",modifierClass:"swiper-pagination-",currentClass:"swiper-pagination-current",totalClass:"swiper-pagination-total",hiddenClass:"swiper-pagination-hidden",progressbarFillClass:"swiper-pagination-progressbar-fill",progressbarOppositeClass:"swiper-pagination-progressbar-opposite",clickableClass:"swiper-pagination-clickable",lockClass:"swiper-pagination-lock"}},create:function(){var e=this;q.extend(e,{pagination:{init:M.init.bind(e),render:M.render.bind(e),update:M.update.bind(e),destroy:M.destroy.bind(e),dynamicBulletIndex:0}})},on:{init:function(){this.pagination.init(),this.pagination.render(),this.pagination.update()},activeIndexChange:function(){!this.params.loop&&void 0!==this.snapIndex||this.pagination.update()},snapIndexChange:function(){this.params.loop||this.pagination.update()},slidesLengthChange:function(){this.params.loop&&(this.pagination.render(),this.pagination.update())},snapGridLengthChange:function(){this.params.loop||(this.pagination.render(),this.pagination.update())},destroy:function(){this.pagination.destroy()},click:function(e){var t=this;t.params.pagination.el&&t.params.pagination.hideOnClick&&0<t.pagination.$el.length&&!E(e.target).hasClass(t.params.pagination.bulletClass)&&(!0===t.pagination.$el.hasClass(t.params.pagination.hiddenClass)?t.emit("paginationShow",t):t.emit("paginationHide",t),t.pagination.$el.toggleClass(t.params.pagination.hiddenClass))}}},{name:"scrollbar",params:{scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag"}},create:function(){var e=this;q.extend(e,{scrollbar:{init:P.init.bind(e),destroy:P.destroy.bind(e),updateSize:P.updateSize.bind(e),setTranslate:P.setTranslate.bind(e),setTransition:P.setTransition.bind(e),enableDraggable:P.enableDraggable.bind(e),disableDraggable:P.disableDraggable.bind(e),setDragPosition:P.setDragPosition.bind(e),getPointerPosition:P.getPointerPosition.bind(e),onDragStart:P.onDragStart.bind(e),onDragMove:P.onDragMove.bind(e),onDragEnd:P.onDragEnd.bind(e),isTouched:!1,timeout:null,dragTimeout:null}})},on:{init:function(){this.scrollbar.init(),this.scrollbar.updateSize(),this.scrollbar.setTranslate()},update:function(){this.scrollbar.updateSize()},resize:function(){this.scrollbar.updateSize()},observerUpdate:function(){this.scrollbar.updateSize()},setTranslate:function(){this.scrollbar.setTranslate()},setTransition:function(e){this.scrollbar.setTransition(e)},destroy:function(){this.scrollbar.destroy()}}},{name:"parallax",params:{parallax:{enabled:!1}},create:function(){q.extend(this,{parallax:{setTransform:B.setTransform.bind(this),setTranslate:B.setTranslate.bind(this),setTransition:B.setTransition.bind(this)}})},on:{beforeInit:function(){this.params.parallax.enabled&&(this.params.watchSlidesProgress=!0,this.originalParams.watchSlidesProgress=!0)},init:function(){this.params.parallax.enabled&&this.parallax.setTranslate()},setTranslate:function(){this.params.parallax.enabled&&this.parallax.setTranslate()},setTransition:function(e){this.params.parallax.enabled&&this.parallax.setTransition(e)}}},{name:"zoom",params:{zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}},create:function(){var i=this,t={enabled:!1,scale:1,currentScale:1,isScaling:!1,gesture:{$slideEl:void 0,slideWidth:void 0,slideHeight:void 0,$imageEl:void 0,$imageWrapEl:void 0,maxRatio:3},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0}},s=("onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out".split(" ").forEach(function(e){t[e]=V[e].bind(i)}),q.extend(i,{zoom:t}),1);Object.defineProperty(i.zoom,"scale",{get:function(){return s},set:function(e){var t,a;s!==e&&(t=i.zoom.gesture.$imageEl?i.zoom.gesture.$imageEl[0]:void 0,a=i.zoom.gesture.$slideEl?i.zoom.gesture.$slideEl[0]:void 0,i.emit("zoomChange",e,t,a)),s=e}})},on:{init:function(){this.params.zoom.enabled&&this.zoom.enable()},destroy:function(){this.zoom.disable()},touchStart:function(e){this.zoom.enabled&&this.zoom.onTouchStart(e)},touchEnd:function(e){this.zoom.enabled&&this.zoom.onTouchEnd(e)},doubleTap:function(e){this.params.zoom.enabled&&this.zoom.enabled&&this.params.zoom.toggle&&this.zoom.toggle(e)},transitionEnd:function(){this.zoom.enabled&&this.params.zoom.enabled&&this.zoom.onTransitionEnd()}}},{name:"lazy",params:{lazy:{enabled:!1,loadPrevNext:!1,loadPrevNextAmount:1,loadOnTransitionStart:!1,elementClass:"swiper-lazy",loadingClass:"swiper-lazy-loading",loadedClass:"swiper-lazy-loaded",preloaderClass:"swiper-lazy-preloader"}},create:function(){q.extend(this,{lazy:{initialImageLoaded:!1,load:X.load.bind(this),loadInSlide:X.loadInSlide.bind(this)}})},on:{beforeInit:function(){this.params.lazy.enabled&&this.params.preloadImages&&(this.params.preloadImages=!1)},init:function(){this.params.lazy.enabled&&!this.params.loop&&0===this.params.initialSlide&&this.lazy.load()},scroll:function(){this.params.freeMode&&!this.params.freeModeSticky&&this.lazy.load()},resize:function(){this.params.lazy.enabled&&this.lazy.load()},scrollbarDragMove:function(){this.params.lazy.enabled&&this.lazy.load()},transitionStart:function(){var e=this;e.params.lazy.enabled&&(e.params.lazy.loadOnTransitionStart||!e.params.lazy.loadOnTransitionStart&&!e.lazy.initialImageLoaded)&&e.lazy.load()},transitionEnd:function(){this.params.lazy.enabled&&!this.params.lazy.loadOnTransitionStart&&this.lazy.load()}}},{name:"controller",params:{controller:{control:void 0,inverse:!1,by:"slide"}},create:function(){var e=this;q.extend(e,{controller:{control:e.params.controller.control,getInterpolateFunction:k.getInterpolateFunction.bind(e),setTranslate:k.setTranslate.bind(e),setTransition:k.setTransition.bind(e)}})},on:{update:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},resize:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},observerUpdate:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},setTranslate:function(e,t){this.controller.control&&this.controller.setTranslate(e,t)},setTransition:function(e,t){this.controller.control&&this.controller.setTransition(e,t)}}},{name:"a11y",params:{a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}"}},create:function(){var t=this;q.extend(t,{a11y:{liveRegion:E('<span class="'+t.params.a11y.notificationClass+'" aria-live="assertive" aria-atomic="true"></span>')}}),Object.keys(Y).forEach(function(e){t.a11y[e]=Y[e].bind(t)})},on:{init:function(){this.params.a11y.enabled&&(this.a11y.init(),this.a11y.updateNavigation())},toEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},fromEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},paginationUpdate:function(){this.params.a11y.enabled&&this.a11y.updatePagination()},destroy:function(){this.params.a11y.enabled&&this.a11y.destroy()}}},{name:"history",params:{history:{enabled:!1,replaceState:!1,key:"slides"}},create:function(){var e=this;q.extend(e,{history:{init:z.init.bind(e),setHistory:z.setHistory.bind(e),setHistoryPopState:z.setHistoryPopState.bind(e),scrollToSlide:z.scrollToSlide.bind(e),destroy:z.destroy.bind(e)}})},on:{init:function(){this.params.history.enabled&&this.history.init()},destroy:function(){this.params.history.enabled&&this.history.destroy()},transitionEnd:function(){this.history.initialized&&this.history.setHistory(this.params.history.key,this.activeIndex)}}},{name:"hash-navigation",params:{hashNavigation:{enabled:!1,replaceState:!1,watchState:!1}},create:function(){var e=this;q.extend(e,{hashNavigation:{initialized:!1,init:$.init.bind(e),destroy:$.destroy.bind(e),setHash:$.setHash.bind(e),onHashCange:$.onHashCange.bind(e)}})},on:{init:function(){this.params.hashNavigation.enabled&&this.hashNavigation.init()},destroy:function(){this.params.hashNavigation.enabled&&this.hashNavigation.destroy()},transitionEnd:function(){this.hashNavigation.initialized&&this.hashNavigation.setHash()}}},{name:"autoplay",params:{autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1}},create:function(){var t=this;q.extend(t,{autoplay:{running:!1,paused:!1,run:I.run.bind(t),start:I.start.bind(t),stop:I.stop.bind(t),pause:I.pause.bind(t),onTransitionEnd:function(e){t&&!t.destroyed&&t.$wrapperEl&&e.target===this&&(t.$wrapperEl[0].removeEventListener("transitionend",t.autoplay.onTransitionEnd),t.$wrapperEl[0].removeEventListener("webkitTransitionEnd",t.autoplay.onTransitionEnd),t.autoplay.paused=!1,t.autoplay.running?t.autoplay.run():t.autoplay.stop())}}})},on:{init:function(){this.params.autoplay.enabled&&this.autoplay.start()},beforeTransitionStart:function(e,t){this.autoplay.running&&(t||!this.params.autoplay.disableOnInteraction?this.autoplay.pause(e):this.autoplay.stop())},sliderFirstMove:function(){this.autoplay.running&&(this.params.autoplay.disableOnInteraction?this.autoplay.stop():this.autoplay.pause())},destroy:function(){this.autoplay.running&&this.autoplay.stop()}}},{name:"effect-fade",params:{fadeEffect:{crossFade:!1}},create:function(){q.extend(this,{fadeEffect:{setTranslate:F.setTranslate.bind(this),setTransition:F.setTransition.bind(this)}})},on:{beforeInit:function(){var e,t=this;"fade"===t.params.effect&&(t.classNames.push(t.params.containerModifierClass+"fade"),q.extend(t.params,e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0}),q.extend(t.originalParams,e))},setTranslate:function(){"fade"===this.params.effect&&this.fadeEffect.setTranslate()},setTransition:function(e){"fade"===this.params.effect&&this.fadeEffect.setTransition(e)}}},{name:"effect-cube",params:{cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}},create:function(){q.extend(this,{cubeEffect:{setTranslate:U.setTranslate.bind(this),setTransition:U.setTransition.bind(this)}})},on:{beforeInit:function(){var e,t=this;"cube"===t.params.effect&&(t.classNames.push(t.params.containerModifierClass+"cube"),t.classNames.push(t.params.containerModifierClass+"3d"),q.extend(t.params,e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0}),q.extend(t.originalParams,e))},setTranslate:function(){"cube"===this.params.effect&&this.cubeEffect.setTranslate()},setTransition:function(e){"cube"===this.params.effect&&this.cubeEffect.setTransition(e)}}},{name:"effect-flip",params:{flipEffect:{slideShadows:!0,limitRotation:!0}},create:function(){q.extend(this,{flipEffect:{setTranslate:K.setTranslate.bind(this),setTransition:K.setTransition.bind(this)}})},on:{beforeInit:function(){var e,t=this;"flip"===t.params.effect&&(t.classNames.push(t.params.containerModifierClass+"flip"),t.classNames.push(t.params.containerModifierClass+"3d"),q.extend(t.params,e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0}),q.extend(t.originalParams,e))},setTranslate:function(){"flip"===this.params.effect&&this.flipEffect.setTranslate()},setTransition:function(e){"flip"===this.params.effect&&this.flipEffect.setTransition(e)}}},{name:"effect-coverflow",params:{coverflowEffect:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0}},create:function(){q.extend(this,{coverflowEffect:{setTranslate:_.setTranslate.bind(this),setTransition:_.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;"coverflow"===e.params.effect&&(e.classNames.push(e.params.containerModifierClass+"coverflow"),e.classNames.push(e.params.containerModifierClass+"3d"),e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)},setTranslate:function(){"coverflow"===this.params.effect&&this.coverflowEffect.setTranslate()},setTransition:function(e){"coverflow"===this.params.effect&&this.coverflowEffect.setTransition(e)}}},{name:"thumbs",params:{thumbs:{swiper:null,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-container-thumbs"}},create:function(){q.extend(this,{thumbs:{swiper:null,init:Z.init.bind(this),update:Z.update.bind(this),onThumbClick:Z.onThumbClick.bind(this)}})},on:{beforeInit:function(){var e=this.params.thumbs;e&&e.swiper&&(this.thumbs.init(),this.thumbs.update(!0))},slideChange:function(){this.thumbs.swiper&&this.thumbs.update()},update:function(){this.thumbs.swiper&&this.thumbs.update()},resize:function(){this.thumbs.swiper&&this.thumbs.update()},observerUpdate:function(){this.thumbs.swiper&&this.thumbs.update()},setTransition:function(e){var t=this.thumbs.swiper;t&&t.setTransition(e)},beforeDestroy:function(){var e=this.thumbs.swiper;e&&this.thumbs.swiperCreated&&e&&e.destroy()}}}];return void 0===h.use&&(h.use=h.Class.use,h.installModule=h.Class.installModule),h.use(D),h});
509!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).SwiperAnimation=e()}(this,function(){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.config
509urable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function t(t,e,n){e&&a(t.prototype,e),n&&a(t,n)}function i(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?o(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var r="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js",s=!1,l=function(){return!!window.Promise};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,c,f={},d={},m=d,m=(Object.defineProperty(m,"__esModule",{value:!0}),m.default=void 0,m.default=function(t){return"[object NodeList]"===Object.prototype.toString.call(t)},{}),y=m;function p(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(y,"__esModule",{value:!0}),y.default=void 0,y.default=function(t){return"Array"===Object.prototype.toString.call(t).slice(8,-1)},y=f,Object.defineProperty(y,"__esModule",{value:!0}),y.default=void 0,u=p(d),c=p(m),y.default=function(t){return(0,c.default)(t)?t:(0,u.default)(t)?Array.from?Array.from(t):Array.prototype.slice.call(t):new Array(t)};var v,h=e(f),b="visibility: hidden;",d={},m={},y=m,w=(Object.defineProperty(y,"__esModule",{value:!0}),y.default=void 0,y.default=function(t){return"Promise"===Object.prototype.toString.call(t).slice(8,-1)},f=d,Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,v=(y=m)&&y.__esModule?y:{default:y},f.default=function(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return(0,v.default)(e)?e:new Promise(function(t){e(),setTimeout(t,n)})},e(d)),D=["animated","animate__animated"],A=function(){function e(t){n(this,e),this.swiper=t,this.container=function(t){if(t.el)return t.el;if(t.container)return t.container[0];throw new Error("Illegal swiper instance")}(this.swiper),this.animationElements=[].concat(i(h(this.container.querySelectorAll("[data-swiper-animation]"))),i(h(this.container.querySelectorAll("[data-swiper-animation-once]")))),this.activeElements=[],this.animationElements.forEach(function(t){t.animationData={styleCache:t.attributes.style?b+t.style.cssText:b,effect:t.dataset.swiperAnimation||t.dataset.swiperAnimationOnce||"",duration:t.dataset.duration||".5s",delay:t.dataset.delay||".5s",outEffect:t.dataset.swiperOutAnimation||"",outDuration:t.dataset.outDuration||".5s",isRecovery:!0,runOnce:!!t.dataset.swiperAnimationOnce},t.style.cssText=t.animationData.styleCache})}return t(e,[{key:"animate",value:function(){var e=this;return Promise.resolve().then(function(){var t=e.activeElements;return t=t.map(function(t){return!t.animationData.isRecovery&&t.animationData.outEffect?w(function(){t.style.cssText=t.animationData.styleCache,t.style.visibility="visible",t.style.cssText+=" animation-duration:".concat(t.animationData.outDuration,"; -webkit-animation-duration:").concat(t.animationData.outDuration,";"),t.classList.add(t.animationData.outEffect,"animated")},500):Promise.resolve()}),Promise.all(t)}).then(function(){var t=e.activeElements;return t=t.map(function(e){return e.animationData.isRecovery||e.animationData.runOnce?Promise.resolve():w(function(){var t;e.style.cssText=e.animationData.styleCache,(t=e.classList).remove.apply(t,i([e.animationData.effect,e.animationData.outEffect].concat(i(D)).filter(function(t){return!!t}))),e.animationData.isRecovery=!0})}),Promise.all(t)}).then(function(){var t=e._updateActiveElements();return t=t.map(function(e){return e.animationData?w(function(){var t;e.style.visibility="visible",e.style.cssText+=" animation-duration:".concat(e.animationData.duration,"; -webkit-animation-duration:").concat(e.animationData.duration,"; animation-delay:").concat(e.animationData.delay,"; -webkit-animation-delay:").concat(e.animationData.delay,";"),(t=e.classList).add.apply(t,[e.animationData.effect].concat(i(D))),e.animationData.isRecovery=!1}):Promise.resolve()}),Promise.all(t)})}},{key:"_updateActiveElements",value:function(){return this.activeElements=[].concat(i(h(this.swiper.slides[this.swiper.activeIndex].querySelectorAll("[data-swiper-animation]"))),i(h(this.swiper.slides[this.swiper.activeIndex].querySelectorAll("[data-swiper-animation-once]")))),this.activeElements}}]),e}();return function(){function e(){var t;n(this,e),this.animations=null,l()||s||l()||((t=document.createElement("script")).type="text/javascript",t.src=r,document.querySelector("head").appendChild(t),s=!0)}return t(e,[{key:"init",value:function(t){return this.animations||(this.animations=new A(t)),this}},{key:"animate",value:function(){var t=this;return l()?this.animations.animate():setTimeout(function(){return t.animate()},500)}}]),e}()}); 
510function initSliderConstructor(slider) {
511    if (!slider) return;
512    const sliderId = slider.dataset.sliderConfig;
513    const sliderSelector = sliderId === 'default' 
514        ? '.swiper-container'
515        : '.swiper-container-' + sliderId;
516    const swiperAnimationSlider = new SwiperAnimation();
517    // конфиг по умолчанию, если не был получен с сервера
518    const defaultSliderConfig = {
519        direction: "horizontal",
520        speed: 500,
521        autoplay: {
522            delay: 60000,
523            disableOnInteraction: true,
524        },
525        effect: "slide",                
526        loop: false,
527        autoHeight: false,
528        pagination: {
529            el: '.swiper-pagination',
530            type: "bullets",
531            clickable: true,
532        },
533        navigation: {
534            nextEl: '.swiper-button-next',
535            prevEl: '.swiper-button-prev',
536        },     
537        on: {
538            init: function () {
539                swiperAnimationSlider.init(this).animate();
540            },
541            slideChange: function () {
542                swiperAnimationSlider.init(this).animate();
543            }
544        }
545    };
546    let sliderConfig = window[`sliderConfig_${sliderId}`];
547    let swiperSlider = null;
548
549    if (sliderConfig) {
550        // используем готовый конфиг
551        swiperSlider = new Swiper(sliderSelector, sliderConfig);
552    } else {
553        // запрашиваем опции плагина и  строим конфиг
554        admin.ajaxRequest({
555            mguniqueurl: 'action/getSlider',
556            pluginHandler: 'mg-slider',
557            id: sliderId
558        },
559        function(response) {
560            if (response.status == 'success' && response.data) {
561                const sliderOptions = response.data.options
562                sliderConfig = {
563                    direction: sliderOptions.direction,
564                    speed: sliderOptions.speed,
565                    effect: sliderOptions.effect,
566                    loop: sliderOptions.loop,
567                    on: {
568                        init: function () {
569                            swiperAnimationSlider.init(this).animate();
570                        },
571                        slideChange: function () {
572                            swiperAnimationSlider.init(this).animate();
573                        }
574                    }
575                };
576                if (sliderOptions.navigation === 'true') {
577                    sliderConfig.navigation = {
578                        nextEl: '.swiper-button-next',
579                        prevEl: '.swiper-button-prev',
580                    }
581                }
582                if (sliderOptions.pagination) {
583                    sliderConfig.pagination = {
584                        el: '.swiper-pagination',
585                        type: sliderOptions.pagination_type,
586                        clickable: true,
587                    }
588                }
589                swiperSlider = new Swiper(sliderSelector, sliderConfig);
590            } else {
591                // запускаем с дефолтным конфигом
592                swiperSlider = new Swiper(sliderSelector, defaultSliderConfig);
593            }
594        });
595    }
596};
597 
598var formDesigner = (function () {
599  return {
600    init: function () {
601      $('body').on('click', '.mg-form-designer .mg-field input[type=checkbox]', function () {
602
603        if ($(this).val() == 'true') {
604          $(this).val('false');
605          $(this).removeAttr('checked');
606        } else {
607          $(this).val('true');
608          $(this).attr('checked', 'checked');
609        }
610      })
611      
612      if ($('.mg-form-designer .agreement-data-checkbox-send-ring-button').length) {
613        var classForm = '.mg-form-designer .agreement-data-checkbox-send-ring-button';
614      } else if ( $('.mg-form-designer .js-agreement-checkbox-send-ring-button').length)  {
615        var classForm = '.mg-form-designer .js-agreement-checkbox-send-ring-button';
616      }
617      $('body').on('click', classForm, function () {
618        (this).setAttribute('name', 'agreement-form');
619        if ($(this).val() == 'true') {
620          $(this).val('false');
621          $(this).removeAttr('checked');
622        } else {
623          $(this).val('true');
624          $(this).attr('checked', 'checked');
625        }
626      })
627    }
628  }
629})();
630$(document).ready(function () {
631  formDesigner.init();
632}); 
633// ==================================================
634// fancyBox v3.5.2
635//
636// Licensed GPLv3 for open source use
637// or fancyBox Commercial License for commercial use
638//
639// http://fancyapps.com/fancybox/
640// Copyright 2018 fancyApps
641//
642// ==================================================
643!function(t,e,n,o){"use strict";function a(t,e){var o,a,i,s=[],r=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},t&&t.data&&(e=h(t.data.options,e)),o=e.$target||n(t.currentTarget).trigger("blur"),i=n.fancybox.getInstance(),i&&i.$trigger&&i.$trigger.is(o)||(e.selector?s=n(e.selector):(a=o.attr("data-fancybox")||"",a?(s=t.data?t.data.items:[],s=s.length?s.filter('[data-fancybox="'+a+'"]'):n('[data-fancybox="'+a+'"]')):s=[o]),r=n(s).index(o),r<0&&(r=0),i=n.fancybox.open(s,e,r),i.$trigger=o))}if(t.console=t.console||{info:function(t){}}
vendor: 4,684 bytes, line 643
643,n){if(n.fn.fancybox)return void console.info("fancyBox already initialized");var i={closeExisting:!1,loop:!1,gutter:50,keyboard:!0,preventCaptionOverlap:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","slideShow","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen allow="autoplay; fullscreen" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},video:{tpl:'<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}"><source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!</video>',format:"",autoStart:!0},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div></button>',smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg></button>'},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{preventCaptionOverlap:!1,idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/>
643 Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Maßstab"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),f=function(){var t,n=e.createElement("fakeelement"),a={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in a)if(n.style[t]!==o)return a[t];return"transitionend"}(),p=function(t){return t&&t.length&&t[0].offsetHeight},h=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},g=function(t){var o,a;return!(!t||t.ownerDocument!==e)&&(n(".fancybox-container").css("pointer-events","none"),o={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2},a=e.elementFromPoint(o.x,o.y)===t,n(".fancybox-container").css("pointer-events",""),a)},b=function(t,e,o){var a=this;a.opts=h({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(a.opts=h(a.opts,e)),n.fancybox.isMobile&&(a.opts=h(a.opts,a.opts.mobile)),a.id=a.opts.id||++c,a.currIndex=parseInt(a.opts.index,10)||0,a.prevIndex=null,a.prevPos=null,a.currPos=0,a.firstRun=!0,a.group=[],a.slides={},a.addContent(t),a.group.length&&a.init()};n.extend(b.prototype,{init:function(){var o,a,i=this,s=i.group[i.currIndex],r=s.opts;r.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&r.hideScrollbar!==!1&&!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:'+(t.innerWidth-e.documentElement.clientWidth)+"px;}</style>"),n("body").addClass("compensate-for-scrollbar")),a="",n.each(r.buttons,function(t,e){a+=r.btnTpl[e]||""}),o=n(i.translate(i,r.baseTpl.replace("{{buttons}}",a).replace("{{arrows}}",r.btnTpl.arrowLeft+r.btnTpl.arrowRight))).attr("id","fancybox-container-"+i.id).addClass(r.baseClass).data("FancyBox",i).appendTo(r.parentEl),i.$refs={container:o},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){i.$refs[t]=o.find(".fancybox-"+t)}),i.trigger("onInit"),i.activate(),i.jumpTo(i.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang]||t.opts.i18n.en;return e.replace(/\{\{(\w+)\}\}/g,function(t,e){var a=n[e];return a===o?t:a})},addContent:function(t){var e,a=this,i=n.makeArray(t);n.each(i,function(t,e){var i,s,r,c,l,d={},u={};n.isPlainObject(e)?(d=e,u=e.opts||e):"object"===n.type(e)&&n(e).length?(i=n(e),u=i.data()||{},u=n.extend(!0,{},u,u.options),u.$orig=i,d.src=a.opts.src||u.src||i.attr("href"),d.type||d.src||(d.type="inline",d.src=e)):d={type:"html",src:e+""},d.opts=n.extend(!0,{},a.opts,u),n.isArray(u.buttons)&&(d.opts.buttons=u.buttons),n.fancybox.isMobile&&d.opts.mobile&&(d.opts=h(d.opts,d.opts.mobile)),s=d.type||d.opts.type,c=d.src||"",!s&&c&&((r=c.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(s="video",d.opts.video.format||(d.opts.video.format="video/"+("ogv"===r[1]?"ogg":r[1]))):c.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?s="image":c.match(/\.(pdf)((\?|#).*)?$/i)?(s="iframe",d=n.extend(!0,d,{contentType:"pdf",opts:{iframe:{preload:!1}}})):"#"===c.charAt(0)&&(s="inline")),s?d.type=s:a.trigger("objectNeedsType",d),d.contentType||(d.contentType=n.inArray(d.type,["html","inline","ajax"])>-1?"html":d.type),d.index=a.group.length,"auto"==d.opts.smallBtn&&(d.opts.smallBtn=n.inArray(d.type,["html","inline","ajax"])>-1),"auto"===d.opts.toolbar&&(d.opts.toolbar=!d.opts.smallBtn),d.$thumb=d.opts.$thumb||null,d.opts.$trigger&&d.index===a.opts.index&&(d.$thumb=d.opts.$trigger.find("img:first"),d.$thumb.length&&(d.opts.$orig=d.opts.$trigger)),d.$thumb&&d.$thumb.length||!d.opts.$orig||(d.$thumb=d.opts.$orig.find("img:first")),d.$thumb&&!d.$thumb.length&&(d.$thumb=null),d.thumb=d.opts.thumb||(d.$thumb?d.$thumb[0].src:null),"function"===n.type(d.opts.caption)&&(d.opts.caption=d.opts.caption.apply(e,[a,d])),"function"===n.type(a.opts.caption)&&(d.opts.caption=a.opts.caption.apply(e,[a,d])),d.opts.caption instanceof n||(d.opts.caption=d.opts.caption===o?"":d.opts.caption+""),"ajax"===d.type&&(l=c.split(/\s+/,2),l.length>1&&(d.src=l.shift(),d.opts.filter=l.shift())),d.opts.modal&&(d.opts=n.extend(!0,d.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),a.group.push(d)}),Object.keys(a.slides).length&&(a.updateControls(),e=a.Thumbs,e&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var e=this;e.removeEvents(),e.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),e.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),e.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),e.next()}).on("click.fb","[data-fancybox-zoom]",function(t){e[e.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(e.requestId&&u(e.requestId),e.requestId=d(function(){e.update(t)})):(e.current&&"iframe"===e.current.type&&e.$refs.stage.hide(),setTimeout(function(){e.$refs.stage.show(),e.update(t)},n.fancybox.isMobile?600:250))}
vendor: 19,475 bytes, line 643
643),r.on("keydown.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null,a=o.current,i=t.keyCode||t.which;if(9==i)return void(a.opts.trapFocus&&e.focus(t));if(!(!a.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input")||n(t.target).is("textarea")))return 8===i||27===i?(t.preventDefault(),void e.close(t)):37===i||38===i?(t.preventDefault(),void e.previous()):39===i||40===i?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,i)}),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){e.idleSecondsCounter=0,e.isIdle&&e.showControls(),e.isIdle=!1}),e.idleInterval=t.setInterval(function(){e.idleSecondsCounter++,e.idleSecondsCounter>=e.group[e.currIndex].opts.idleTime&&!e.isDragging&&(e.isIdle=!0,e.idleSecondsCounter=0,e.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var a,i,s,r,c,l,d,u,f,h=this,g=h.group.length;if(!(h.isDragging||h.isClosing||h.isAnimating&&h.firstRun)){if(t=parseInt(t,10),s=h.current?h.current.opts.loop:h.opts.loop,!s&&(t<0||t>=g))return!1;if(a=h.firstRun=!Object.keys(h.slides).length,c=h.current,h.prevIndex=h.currIndex,h.prevPos=h.currPos,r=h.createSlide(t),g>1&&((s||r.index<g-1)&&h.createSlide(t+1),(s||r.index>0)&&h.createSlide(t-1)),h.current=r,h.currIndex=r.index,h.currPos=r.pos,h.trigger("beforeShow",a),h.updateControls(),r.forcedDuration=o,n.isNumeric(e)?r.forcedDuration=e:e=r.opts[a?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=h.isMoved(r),r.$slide.addClass("fancybox-slide--current"),a)return r.opts.animationEffect&&e&&h.$refs.container.css("transition-duration",e+"ms"),h.$refs.container.addClass("fancybox-is-open").trigger("focus"),h.loadSlide(r),void h.preload("image");l=n.fancybox.getTranslate(c.$slide),d=n.fancybox.getTranslate(h.$refs.stage),n.each(h.slides,function(t,e){n.fancybox.stop(e.$slide,!0)}),c.pos!==r.pos&&(c.isComplete=!1),c.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"),i?(f=l.left-(c.pos*l.width+c.pos*c.opts.gutter),n.each(h.slides,function(t,o){o.$slide.removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});var a=o.pos*l.width+o.pos*o.opts.gutter;n.fancybox.setTranslate(o.$slide,{top:0,left:a-d.left+f}),o.pos!==r.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>r.pos?"next":"previous")),p(o.$slide),n.fancybox.animate(o.$slide,{top:0,left:(o.pos-r.pos)*l.width+(o.pos-r.pos)*o.opts.gutter},e,function(){o.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===h.currPos&&h.complete()})})):e&&r.opts.transitionEffect&&(u="fancybox-animated fancybox-fx-"+r.opts.transitionEffect,c.$slide.addClass("fancybox-slide--"+(c.pos>r.pos?"next":"previous")),n.fancybox.animate(c.$slide,u,e,function(){c.$slide.removeClass(u).removeClass("fancybox-slide--next fancybox-slide--previous")},!1)),r.isLoaded?h.revealContent(r):h.loadSlide(r),h.preload("image")}},createSlide:function(t){var e,o,a=this;return o=t%a.group.length,o=o<0?a.group.length+o:o,!a.slides[t]&&a.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(a.$refs.stage),a.slides[t]=n.extend(!0,{},a.group[o],{pos:t,$slide:e,isLoaded:!1}),a.updateSlide(a.slides[t])),a.slides[t]},scaleToActual:function(t,e,a){var i,s,r,c,l,d=this,u=d.current,f=u.$content,p=n.fancybox.getTranslate(u.$slide).width,h=n.fancybox.getTranslate(u.$slide).height,g=u.width,b=u.height;d.isAnimating||d.isMoved()||!f||"image"!=u.type||!u.isLoaded||u.hasError||(d.isAnimating=!0,n.fancybox.stop(f),t=t===o?.5*p:t,e=e===o?.5*h:e,i=n.fancybox.getTranslate(f),i.top-=n.fancybox.getTranslate(u.$slide).top,i.left-=n.fancybox.getTranslate(u.$slide).left,c=g/i.width,l=b/i.height,s=.5*p-.5*g,r=.5*h-.5*b,g>p&&(s=i.left*c-(t*c-t),s>0&&(s=0),s<p-g&&(s=p-g)),b>h&&(r=i.top*l-(e*l-e),r>0&&(r=0),r<h-b&&(r=h-b)),d.updateCursor(g,b),n.fancybox.animate(f,{top:r,left:s,scaleX:c,scaleY:l},a||330,function(){d.isAnimating=!1}),d.SlideShow&&d.SlideShow.isActive&&d.SlideShow.stop())},scaleToFit:function(t){var e,o=this,a=o.current,i=a.$content;o.isAnimating||o.isMoved()||!i||"image"!=a.type||!a.isLoaded||a.hasError||(o.isAnimating=!0,n.fancybox.stop(i),e=o.getFitPos(a),o.updateCursor(e.width,e.height),n.fancybox.animate(i,{top:e.top,left:e.left,scaleX:e.width/i.width(),scaleY:e.height/i.height()},t||330,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,a,i,s=this,r=t.$content,c=t.$slide,l=t.width||t.opts.width,d=t.height||t.opts.height,u={};return!!(t.isLoaded&&r&&r.length)&&(e=n.fancybox.getTranslate(s.$refs.stage).width,o=n.fancybox.getTranslate(s.$refs.stage).height,e-=parseFloat(c.css("paddingLeft"))+parseFloat(c.css("paddingRight"))+parseFloat(r.css("marginLeft"))+parseFloat(r.css("marginRight")),o-=parseFloat(c.css("paddingTop"))+parseFloat(c.css("paddingBottom"))+parseFloat(r.css("marginTop"))+parseFloat(r.css("marginBottom")),l&&d||(l=e,d=o),a=Math.min(1,e/l,o/d),l=a*l,d=a*d,l>e-.5&&(l=e),d>o-.5&&(d=o),"image"===t.type?(u.top=Math.floor(.5*(o-d))+parseFloat(c.css("paddingTop")),u.left=Math.floor(.5*(e-l))+parseFloat(c.css("paddingLeft"))):"video"===t.contentType&&(i=t.opts.width&&t.opts.height?l/d:t.opts.ratio||16/9,d>l/i?d=l/i:l>d*i&&(l=d*i)),u.width=l,u.height=d,u)},update:function(t){var e=this;n.each(e.slides,function(n,o){e.updateSlide(o,t)})},updateSlide:function(t,e){var o=this,a=t&&t.$content,i=t.width||t.opts.width,s=t.height||t.opts.height,r=t.$slide;o.adjustCaption(t),a&&(i||s||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(a),n.fancybox.setTranslate(a,o.getFitPos(t)),t.pos===o.currPos&&(o.isAnimating=!1,o.updateCursor())),o.adjustLayout(t),r.length&&(r.trigger("refresh"),t.pos===o.currPos&&o.$refs.toolbar.add(o.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",r.get(0).scrollHeight>r.get(0).clientHeight)),o.trigger("onUpdate",t,e)},centerSlide:function(t){var e=this,a=e.current,i=a.$slide;!e.isClosing&&a&&(i.siblings().css({transform:"",opacity:""}),i.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next"),n.fancybox.animate(i,{top:0,left:0,opacity:1},t===o?0:t,function(){i.css({transform:"",opacity:""}),a.isComplete||e.complete()},!1))},isMoved:function(t){var e,o,a=t||this.current;return!!a&&(o=n.fancybox.getTranslate(this.$refs.stage),e=n.fancybox.getTranslate(a.$slide),!a.$slide.hasClass("fancybox-animated")&&(Math.abs(e.top-o.top)>.5||Math.abs(e.left-o.left)>.5))},updateCursor:function(t,e){var o,a,i=this,s=i.current,r=i.$refs.container;s&&!i.isClosing&&i.Guestures&&(r.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),o=i.canPan(t,e),a=!!o||i.isZoomable(),r.toggleClass("fancybox-is-zoomable",a),n("[data-fancybox-zoom]").prop("disabled",!a),o?r.addClass("fancybox-can-pan"):a&&("zoom"===s.opts.clickContent||n.isFunction(s.opts.clickContent)&&"zoom"==s.opts.clickContent(s))?r.addClass("fancybox-can-zoomIn"):s.opts.touch&&(s.opts.touch.vertical||i.group.length>1)&&"video"!==s.contentType&&r.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if(t=e.getFitPos(n),t&&(n.width>t.width||n.height>t.height))return!0}return!1},isScaledDown:function(t,e){var a=this,i=!1,s=a.current,r=s.$content;return t!==o&&e!==o?i=t<s.width&&e<s.height:r&&(i=n.fancybox.getTranslate(r),i=i.width<s.width&&i.height<s.height),i},canPan:function(t,e){var a=this,i=a.current,s=null,r=!1;return"image"===i.type&&(i.isComplete||t&&e)&&!i.hasError&&(r=a.getFitPos(i),t!==o&&e!==o?s={width:t,height:e}:i.isComplete&&(s=n.fancybox.getTranslate(i.$content)),s&&r&&(r=Math.abs(s.width-r.width)>1.5||Math.abs(s.height-r.height)>1.5)),r},loadSlide:function(t){var e,o,a,i=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,i.trigger("beforeLoad",t)===!1)return t.isLoading=!1,!1;switch(e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":i.setImage(t);break;case"iframe":i.setIframe(t);break;case"html":i.setContent(t,t.src||t.content);break;case"video":i.setContent(t,t.opts.video.tpl.replace(/\{\{src\}\}/gi,t.src).replace("{{format}}",t.opts.videoFormat||t.opts.video.format||"").replace("{{poster}}",t.thumb||""));break;case"inline":n(t.src).length?i.setContent(t,n(t.src)):i.setError(t);break;case"ajax":i.showLoading(t),a=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&i.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&i.setError(t)}})),o.one("onReset",function(){a.abort()});break;default:i.setError(t)}return!0}},setImage:function(t){var o,a=this;setTimeout(function(){var e=t.$image;a.isClosing||!t.isLoading||e&&e.length&&e[0].complete||t.hasError||a.showLoading(t)},50),a.checkSrcset(t),t.$content=n('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(t.$slide.addClass("fancybox-slide--image")),t.opts.preload!==!1&&t.opts.width&&t.opts.height&&t.thumb&&(t.width=t.opts.width,t.height=t.opts.height,o=e.createElement("img"),o.onerror=function(){n(this).remove(),t.$ghost=null},o.onload=function(){a.afterLoad(t)},t.$ghost=n(o).addClass("fancybox-image").appendTo(t.$content).attr("src",t.thumb)),a.setBigImage(t)},checkSrcset:function(e){var n,o,a,i,s=e.opts.srcset||e.opts.image.srcset;if(s){a=t.devicePixelRatio||1,i=t.innerWidth*a,o=s.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);return 0===n?e.url=t:void(o&&(e.value=o,e.postfix=t[t.length-1]))}),e}),o.sort(function(t,e){return t.value-e.value});for(var r=0;r<o.length;r++){var c=o[r];if("w"===c.postfix&&c.value>=i||"x"===c.postfix&&c.value>=a){n=c;break}}!n&&o.length&&(n=o[o.length-1]),n&&(e.src=n.url,e.width&&e.height&&"w"==n.postfix&&(e.height=e.width/e.height*n.value,e.width=n.value),e.opts.srcset=s)}},setBigImage:function(t){var o=this,a=e.createElement("img"),i=n(a);t.$image=i.one("error",function(){o.setError(t)}).one("load",function(){var e;t.$ghost||(o.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),o.afterLoad(t)),o.isClosing||(t.opts.srcset&&(e=t.opts.sizes,e&&"auto"!==e||(e=(t.width/t.height>1&&s.width()/s.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),i.attr("sizes",e).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout(function(){t.$ghost&&!o.isClosing&&t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))),o.hideLoading(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(a.complete||"complete"==a.readyState)&&i.naturalWidth&&i.naturalHeight?i.trigger("load"):a.error&&i.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),a=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),a>0&&(t.width=Math.floor(a*e/n),t.height=a)},setIframe:function(t){var e,a=this,i=t.opts.iframe,s=t.$slide;n.fancybox.isMobile&&(i.css.overflow="scroll"),t.$content=n('<div class="fancybox-content'+(i.preload?" fancybox-is-hidden":"")+'"></div>').css(i.css).appendTo(s),s.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(i.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(i.attr).appendTo(t.$content),i.preload?(a.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),a.afterLoad(t)}),s.on("refresh.fb",function(){var n,a,r=t.$content,c=i.css.width,l=i.css.height;if(1===e[0].isReady){try{n=e.contents(),a=n.find("body")}catch(t){}a&&a.length&&a.children().length&&(s.css("overflow","visible"),r.css({width:"100%","max-width":"100%",height:"9999px"}),c===o&&(c=Math.ceil(Math.max(a[0].clientWidth,a.outerWidth(!0)))),r.css("width",c?c:"").css("max-width",""),l===o&&(l=Math.ceil(Math.max(a[0].clientHeight,a.outerHeight(!0)))),r.css("height",l?l:""),s.css("overflow","auto")),r.removeClass("fancybox-is-hidden")}})):a.afterLoad(t),e.attr("src",t.src),s.one("onReset",function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1,t.isRevealed=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&e.parent().length?((e.hasClass("fancybox-content")||e.parent().hasClass("fancybox-content"))&&e.parents(".fancybox-slide").trigger("onReset"),t.$placeholder=n("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents()),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("<div></div>").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),o.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;t=t||e.current,t&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){var e=this;t=t||e.current,t&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e=this,n=t||e.current,o=n.opts.caption,a=e.$refs.caption,i=!1;n.opts.preventCaptionOverlap&&o&&o.length&&(n.pos!==e.currPos?(a=a.clone().empty().appendTo(a.parent()),a.html(o),i=a.outerHeight(!0),a.empty().remove()):e.$caption&&(i=e.$caption.outerHeight(!0)),n.$slide.css("padding-bottom",i||""))},adjustLayout:function(t){var e,n,o,a,i=this,s=t||i.current;s.isLoaded&&s.opts.disableLayoutFix!==!0&&(s.$content.css("margin-bottom",""),s.$content.outerHeight()>s.$slide.height()+.5&&(o=s.$slide[0].style["padding-bottom"],a=s.$slide.css("padding-bottom"),parseFloat(a)>0&&(e=s.$slide[0].scrollHeight,s.$slide.css("padding-bottom",0),Math.abs(e-s.$slide[0].scrollHeight)<1&&(n=a),s.$slide.css("padding-bottom",o))),s.$content.css("margin-bottom",n))},revealContent:function(t){var e,a,i,s,r=this,c=t.$slide,l=!1,d=!1,u=r.isMoved(t),f=t.isRevealed;return t.isRevealed=!0,e=t.opts[r.firstRun?"animationEffect":"transitionEffect"],i=t.opts[r.firstRun?"animationDuration":"transitionDuration"],i=parseInt(t.forcedDuration===o?i:t.forcedDuration,10),!u&&t.pos===r.currPos&&i||(e=!1),"zoom"===e&&(t.pos===r.currPos&&i&&"image"===t.type&&!t.hasError&&(d=r.getThumbPos(t))?l=r.getFitPos(t):e="fade"),"zoom"===e?(r.isAnimating=!0,l.scaleX=l.width/d.width,l.scaleY=l.height/d.height,s=t.opts.zoomOpacity,"auto"==s&&(s=Math.abs(t.width/t.height-d.width/d.height)>.1),s&&(d.opacity=.1,l.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),d),p(t.$content),void n.fancybox.animate(t.$content,l,i,function(){r.isAnimating=!1,r.complete()})):(r.updateSlide(t),e?(n.fancybox.stop(c),a="fancybox-slide--"+(t.pos>=r.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,c.addClass(a).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),p(c),"image"!==t.type&&t.$content.hide().show(0),void n.fancybox.animate(c,"fancybox-slide--current",i,function(){c.removeClass(a).css({transform:"",opacity:""}),t.pos===r.currPos&&r.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),f||!u||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===r.currPos&&r.complete())))},getThumbPos:function(t){var e,o,a,i,s,r=!1,c=t.$thumb;return!(!c||!g(c[0]))&&(e=n.fancybox.getTranslate(c),o=parseFloat(c.css("border-top-width")||0),a=parseFloat(c.css("border-right-width")||0),i=parseFloat(c.css("border-bottom-width")||0),s=parseFloat(c.css("border-left-width")||0),r={top:e.top+o,left:e.left+s,width:e.width-a-s,height:e.height-o-i,scaleX:1,scaleY:1},e.width>0&&e.height>0&&r)},complete:function(){var t,e=this,o=e.current,a={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),p(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?a[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),e.slides=a),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()}),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],e=o.slides[o.currPos-1],e&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,o){var a,i,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(a=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),a=a.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),a.length?(i=a.index(e.activeElement),t&&t.shiftKey?(i<0||0==i)&&(t.preventDefault(),a.eq(a.length-1).trigger("focus")):(i<0||i==a.length-1)&&(t&&t.preventDefault(),a.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");
643e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,a,i,s,r,c,l,u=this,f=u.current,h=function(){u.cleanUp(t)};return!u.isClosing&&(u.isClosing=!0,u.trigger("beforeClose",t)===!1?(u.isClosing=!1,d(function(){u.update()}),!1):(u.removeEvents(),i=f.$content,o=f.opts.animationEffect,a=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),t!==!0?n.fancybox.stop(f.$slide):o=!1,f.$slide.siblings().trigger("onReset").remove(),a&&u.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",a+"ms"),u.hideLoading(f),u.hideControls(!0),u.updateCursor(),"zoom"!==o||i&&a&&"image"===f.type&&!u.isMoved()&&!f.hasError&&(l=u.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(i),s=n.fancybox.getTranslate(i),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=f.opts.zoomOpacity,"auto"==r&&(r=Math.abs(f.width/f.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(i,c),p(i),n.fancybox.animate(i,l,a,h),!0):(o&&a?n.fancybox.animate(f.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,a,h):t===!0?setTimeout(h,a):h(),
644!0)))},cleanUp:function(e){var o,a,i,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(a=t.scrollX,i=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(i).scrollLeft(a))),s.current=null,o=n.fancybox.getInstance(),o?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,a=Array.prototype.slice.call(arguments,1),i=this,s=e&&e.opts?e:i.current;return s?a.unshift(s):s=i,a.unshift(i),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,a)),o===!1?o:void("afterClose"!==t&&i.$refs?i.$refs.container.trigger(t+".fb",a):r.trigger(t+".fb",a))},updateControls:function(){var t=this,o=t.current,a=o.index,i=t.$refs.container,s=t.$refs.caption,r=o.opts.caption;o.$slide.trigger("refresh"),t.$caption=r&&r.length?s.html(r):null,t.hasHiddenControls||t.isIdle||t.showControls(),i.find("[data-fancybox-count]").html(t.group.length),i.find("[data-fancybox-index]").html(a+1),i.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&a<=0),i.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&a>=t.group.length-1),"image"===o.type?i.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&i.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=this,n=["infobar","toolbar","nav"];!t&&e.current.opts.preventCaptionOverlap||n.push("caption"),this.$refs.container.removeClass(n.map(function(t){return"fancybox-show-"+t}).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.5.2",defaults:i,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof b&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new b(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),t===!0&&this.close(t))}
644,destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",a={};if(t&&e)return e.left===o&&e.top===o||(n=(e.left===o?t.position().left:e.left)+"px, "+(e.top===o?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),e.scaleX!==o&&e.scaleY!==o?n+=" scale("+e.scaleX+", "+e.scaleY+")":e.scaleX!==o&&(n+=" scaleX("+e.scaleX+")"),n.length&&(a.transform=n),e.opacity!==o&&(a.opacity=e.opacity),e.width!==o&&(a.width=e.width),e.height!==o&&(a.height=e.height),t.css(a)},animate:function(t,e,a,i,s){var r,c=this;n.isFunction(a)&&(i=a,a=null),c.stop(t),r=c.getTranslate(t),t.on(f,function(l){(!l||!l.originalEvent||t.is(l.originalEvent.target)&&"z-index"!=l.originalEvent.propertyName)&&(c.stop(t),n.isNumeric(a)&&t.css("transition-duration",""),n.isPlainObject(e)?e.scaleX!==o&&e.scaleY!==o&&c.setTranslate(t,{top:e.top,left:e.left,width:r.width*e.scaleX,height:r.height*e.scaleY,scaleX:1,scaleY:1}):s!==!0&&t.removeClass(e),n.isFunction(i)&&i(l))}),n.isNumeric(a)&&t.css("transition-duration",a+"ms"),n.isPlainObject(e)?(e.scaleX!==o&&e.scaleY!==o&&(delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger(f)},a+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(f),t.off(f).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},a):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},a),this},r.on("click.fb-start","[data-fancybox]",a),r.on("click.fb-start","[data-fancybox-trigger]",function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})}),function(){var t=".fancybox-button",e="fancybox-focus",o=null;r.on("mousedown mouseup focus blur",t,function(a){switch(a.type){case"mousedown":o=n(this);break;case"mouseup":o=null;break;case"focusin":n(t).removeClass(e),n(this).is(o)||n(this).is("[disabled]")||n(this).addClass(e);break;case"focusout":n(t).removeClass(e)}})}()}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"//www.youtube-nocookie.com/embed/$4",thumb:"//img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",function(o,a,i){var s,r,c,l,d,u,f,p=i.src||"",h=!1;s=t.extend(!0,{},e,i.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var a=0;a<d.length;++a){var s=d[a].split("=",2);2==s.length&&(u[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,i.opts[e],u),p="function"===t.type(o.url)?o.url.call(this,c,l,i):n(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,i):n(o.thumb,c),"youtube"===e?p=p.replace(/&t=((\d+)m)?(\d+)s/,function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))}):"vimeo"===e&&(p=p.replace("&%23","#")),!1}}),h?(i.opts.thumb||i.opts.$thumb&&i.opts.$thumb.length||(i.opts.thumb=r),"iframe"===h&&(i.opts=t.extend(!0,i.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}}
vendor: 6,830 bytes, line 644
644)),t.extend(i,{type:h,src:p,origSrc:i.src,contentSource:f,contentType:"image"===h?"image":"gmap_place"==f||"gmap_search"==f?"map":"video"})):p&&(i.type=i.opts.defaultType)});var o={youtube:{src:"https://www.youtube.com/iframe_api",class:"YT",loading:!1,loaded:!1},vimeo:{src:"https://player.vimeo.com/api/player.js",class:"Vimeo",loading:!1,loaded:!1},load:function(t){var e,n=this;return this[t].loaded?void setTimeout(function(){n.done(t)}):void(this[t].loading||(this[t].loading=!0,e=document.createElement("script"),e.type="text/javascript",e.src=this[t].src,"youtube"===t?window.onYouTubeIframeAPIReady=function(){n[t].loaded=!0,n.done(t)}:e.onload=function(){n[t].loaded=!0,n.done(t)},document.body.appendChild(e)))},done:function(e){var n,o,a;"youtube"===e&&delete window.onYouTubeIframeAPIReady,n=t.fancybox.getInstance(),n&&(o=n.current.$content.find("iframe"),"youtube"===e&&void 0!==YT&&YT?a=new YT.Player(o.attr("id"),{events:{onStateChange:function(t){0==t.data&&n.next()}}}):"vimeo"===e&&void 0!==Vimeo&&Vimeo&&(a=new Vimeo.Player(o),a.on("ended",function(){n.next()})))}};t(document).on({"afterShow.fb":function(t,e,n){e.group.length>1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),a=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),i=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,a=o.length;e<a;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],a=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,i=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return a||i},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),n(e).off(".fb.touch"),t.requestId&&(a(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},d.prototype.ontouchstart=function(o){var a=this,c=n(o.target),d=a.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&a.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||u.$slide.hasClass("fancybox-animated"))return o.stopPropagation(),void o.preventDefault();a.realPoints=a.startPoints=i(o),a.startPoints.length&&(u.touch&&o.stopPropagation(),a.startEvent=o,a.canTap=!0,a.$target=c,a.$content=p,a.opts=u.opts.touch,a.isPanning=!1,a.isSwiping=!1,a.isZooming=!1,a.isScrolling=!1,a.canPan=d.canPan(),a.startTime=(new Date).getTime(),a.distanceX=a.distanceY=a.distance=0,a.canvasWidth=Math.round(f[0].clientWidth),a.canvasHeight=Math.round(f[0].clientHeight),a.contentLastPos=null,a.contentStartPos=n.fancybox.getTranslate(a.$content)||{top:0,left:0},a.sliderStartPos=n.fancybox.getTranslate(f),a.stagePos=n.fancybox.getTranslate(d.$refs.stage),a.sliderStartPos.top-=a.stagePos.top,a.sliderStartPos.left-=a.stagePos.left,a.contentStartPos.top-=a.stagePos.top,a.contentStartPos.left-=a.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(a,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(a,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",a.onscroll,!0),((a.opts||a.canPan)&&(c.is(a.$stage)||a.$stage.find(c).length)||(c.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&c.hasClass("fancybox-caption")))&&(a.isScrollable=l(c)||l(c.parent()),n.fancybox.isMobile&&a.isScrollable||o.preventDefault(),(1===a.startPoints.length||u.hasError)&&(a.canPan?(n.fancybox.stop(a.$content),a.isPanning=!0):a.isSwiping=!0,a.$container.addClass("fancybox-is-grabbing")),2===a.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(a.canTap=!1,a.isSwiping=!1,a.isPanning=!1,a.isZooming=!0,n.fancybox.stop(a.$content),a.centerPointStartX=.5*(a.startPoints[0].x+a.startPoints[1].x)-n(t).scrollLeft(),a.centerPointStartY=.5*(a.startPoints[0].y+a.startPoints[1].y)-n(t).scrollTop(),a.percentageOfImageAtPinchPointX=(a.centerPointStartX-a.contentStartPos.left)/a.contentStartPos.width,a.percentageOfImageAtPinchPointY=(a.centerPointStartY-a.contentStartPos.top)/a.contentStartPos.height,a.startDistanceBetweenFingers=s(a.startPoints[0],a.startPoints[1]))))}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=i(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&e.isSwiping===!0||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var i,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(c!==!0)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(a(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;
644n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||s.opts.vertical===!1||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(i=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=i>45&&i<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,function(t,e){var o,a;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),a=n.fancybox.getTranslate(r.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===r.current.pos&&(s.sliderStartPos.top=o.top-a.top,s.sliderStartPos.left=o.left-a.left),n.fancybox.setTranslate(e.$slide,{top:o.top-a.top,left:o.left-a.left})}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;return s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5)?void(t.startPoints=t.newPoints):(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&a(t.requestId),void(t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})))},d.prototype.limitMovement=function(){var t,e,n,o,a,i,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return a=h>r?f+l:f,i=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&a>t&&(a=t-1+Math.pow(-t+f+l,.8)||0),l<0&&a<n&&(a=n+1-Math.pow(n-f-l,.8)||0),d>0&&i>e&&(i=e-1+Math.pow(-e+p+d,.8)||0),d<0&&i<o&&(i=o+1-Math.pow(o-p-d,.8)||0),{top:i,left:a}},d.prototype.limitPosition=function(t,e,n,o){var a=this,i=a.canvasWidth,s=a.canvasHeight;return n>i?(t=t>0?0:t,t=t<i-n?i-n:t):t=Math.max(0,i/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},d.prototype.onZoom=function(){var e=this,i=e.contentStartPos,r=i.width,c=i.height,l=i.left,d=i.top,u=s(e.newPoints[0],e.newPoints[1]),f=u/e.startDistanceBetweenFingers,p=Math.floor(r*f),h=Math.floor(c*f),g=(r-p)*e.percentageOfImageAtPinchPointX,b=(c-h)*e.percentageOfImageAtPinchPointY,m=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),v=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=m-e.centerPointStartX,x=v-e.centerPointStartY,w=l+(g+y),$=d+(b+x),S={top:$,left:w,scaleX:f,scaleY:f};e.canTap=!1,e.newWidth=p,e.newHeight=h,e.contentLastPos=S,e.requestId&&a(e.requestId),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},d.prototype.ontouchend=function(t){var o=this,s=o.isSwiping,r=o.isPanning,c=o.isZooming,l=o.isScrolling;return o.endPoints=i(t),o.dMs=Math.max((new Date).getTime()-o.startTime,1),o.$container.removeClass("fancybox-is-grabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(a(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap?o.onTap(t):(o.speed=100,o.velocityX=o.distanceX/o.dMs*.5,o.velocityY=o.distanceY/o.dMs*.5,void(r?o.endPanning():c?o.endZooming():o.endSwiping(s,l)))},d.prototype.endSwiping=function(t,e){var o=this,a=!1,i=o.instance.group.length,s=Math.abs(o.distanceX),r="x"==t&&i>1&&(o.dMs>130&&s>10||s>50),c=300;o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),a=o.instance.close(!0,250)):r&&o.distanceX>0?a=o.instance.previous(c):r&&o.distanceX<0&&(a=o.instance.next(c)),a!==!1||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,a=this;a.contentLastPos&&(a.opts.momentum===!1||a.dMs>350?(t=a.contentLastPos.left,e=a.contentLastPos.top):(t=a.contentLastPos.left+500*a.velocityX,e=a.contentLastPos.top+500*a.velocityY),o=a.limitPosition(t,e,a.contentStartPos.width,a.contentStartPos.height),o.width=a.contentStartPos.width,o.height=a.contentStartPos.height,n.fancybox.animate(a.$content,o,330))},d.prototype.endZooming=function(){var t,e,o,a,i=this,s=i.instance.current,r=i.newWidth,c=i.newHeight;i.contentLastPos&&(t=i.contentLastPos.left,e=i.contentLastPos.top,a={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(i.$content,a),r<i.canvasWidth&&c<i.canvasHeight?i.instance.scaleToFit(150):r>s.width||c>s.height?i.instance.scaleToActual(i.centerPointStartX,i.centerPointStartY,150):(o=i.limitPosition(t,e,r,c),n.fancybox.animate(i.$content,o,150)))},d.prototype.onTap=function(e){var o,a=this,s=n(e.target),r=a.instance,c=r.current,l=e&&i(e)||a.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-a.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-a.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close"
vendor: 3,682 bytes, line 644
644:r.close(a.startEvent);break;case"toggleControls":r.toggleControls();break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(a.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(a.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(a.tapped){if(clearTimeout(a.tapped),a.tapped=null,Math.abs(d-a.tapX)>50||Math.abs(u-a.tapY)>50)return this;f("dblclick"+o)}else a.tapX=d,a.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?a.tapped=setTimeout(function(){a.tapped=null,r.isAnimating||f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))}).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg></button>'},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('<div class="fancybox-progress"></div>').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,a=o.current;a&&(t===!0||a.opts.loop||o.currIndex<o.group.length-1)?n.isActive&&"video"!==a.contentType&&(n.$progress&&e.fancybox.animate(n.$progress.show(),{scaleX:1},a.opts.slideShow.speed),n.timer=setTimeout(function(){o.current.opts.loop||o.current.index!=o.group.length-1?o.next():o.jumpTo(0)},a.opts.slideShow.speed)):(n.stop(),o.idleSecondsCounter=0,o.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null,t.$progress&&t.$progress.removeAttr("style").hide()},start:function(){var t=this,e=t.instance.current;e&&(t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.isActive=!0,e.isComplete&&t.set(!0),t.instance.trigger("onSlideShowChange",!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1,t.instance.trigger("onSlideShowChange",!1),t.$progress&&t.$progress.removeAttr("style").hide()},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var a=e&&e.SlideShow;o?a&&n.opts.slideShow.autoStart&&a.start():a&&a.isActive&&a.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,a,i,s){var r=o&&o.SlideShow;!r||!a.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(i.preventDefault(),r.toggle(
644))},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,jQuery),function(t,e){"use strict";var n=function(){for(var e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n={},o=0;o<e.length;o++){var a=e[o];if(a&&a[1]in t){for(var i=0;i<a.length;i++)n[e[0][i]]=a[i];return n}}return!1}();if(n){var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.current.$content.css("transition","none"),n.isAnimating=!1,n.update(!0,!0,0)),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})}e(t).on({"onInit.fb":function(t,e){var a;return n?void(e&&e.group[e.currIndex].opts.fullScreen?(a=e.$refs.container,a.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&e.opts.fullScreen.autoStart===!0&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()):void e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove()},"afterKeydown.fb":function(t,e,n,o,a){e&&e.FullScreen&&70===a&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs",o=n+"-active";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var a=function(t){this.init(t)};e.extend(a.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,t.Thumbs=e,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var a=0,i=n.length;a<i&&(n[a].thumb&&o++,!(o>1));a++);o>1&&e.opts?(e.$button.removeAttr("style").on("click",function(){e.toggle(
vendor: 5,050 bytes, lines 644-645
644)}),e.isActive=!0):e.$button.hide()},create:function(){var t,o=this,a=o.instance,i=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('<div class="'+n+" "+n+"-"+o.opts.axis+'"></div>').appendTo(a.$refs.container.find(i).addBack().filter(i)),o.$grid.on("click","a",function(){a.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e('<div class="'+n+'__list">').appendTo(o.$grid)),e.each(a.group,function(e,n){t=n.thumb,t||"image"!==n.type||(t=n.src),s.push('<a role="button" href="javascript:;" tabindex="0" data-index="'+e+'"'+(t&&t.length?' style="background-image:url('+t+')"':'class="fancybox-thumbs-missing"')+"></a>")}),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+a.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,a=this,i=a.$list,s=a.$grid;a.instance.current&&(e=i.children().removeClass(o).filter('[data-index="'+a.instance.current.index+'"]').addClass(o),n=e.position(),"y"===a.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===a.opts.axis&&(n.left<s.scrollLeft()||n.left>s.scrollLeft()+(s.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new a(e),n.isActive&&n.opts.autoStart===!0&&n.show())},"beforeShow.fb":function(t,e,n,o){var a=e&&e.Thumbs;a&&a.isVisible&&a.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,a){var i=e&&e.Thumbs;i&&i.isActive&&71===a&&(o.preventDefault(),i.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&n.opts.hideOnClose!==!1&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p></div>'
645}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,a=e.fancybox.getInstance(),i=a.current||null;i&&("function"===e.type(i.opts.share.url)&&(t=i.opts.share.url.apply(i,[a,i])),o=i.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===i.type?encodeURIComponent(i.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,a.$caption?encodeURIComponent(a.$caption.text()):""),e.fancybox.open({src:a.translate(a,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){a.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})}
645,mobile:{autoFocus:!1}}}))})}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,a=n.join("-");return{hash:e,index:o<1?1:o,gallery:a}}function a(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function i(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""),""!==n&&n)}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)}),n(function(){n.fancybox.defaults.hash!==!1&&(n(e).on({"onInit.fb":function(t,e){var n,a;e.group[e.currIndex].opts.hash!==!1&&(n=o(),a=i(e),a&&n.gallery&&a==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,a,s){var r;a&&a.opts.hash!==!1&&(r=i(o),r&&(o.currentHash=r+(o.group.length>1?"-"+(a.index+1):""),t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null},300))))},"beforeClose.fb":function(n,o,a){a.opts.hash!==!1&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),function(t,o){var a=n(o).data("FancyBox");if(a&&a.currentHash)return e=a,!1}),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&a(t)}),setTimeout(function(){n.fancybox.getInstance()||a(o())},50))})}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,a=(new Date).getTime();e.group.length<2||o.opts.wheel===!1||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,a-n<250||(n=a,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery); 
646var buyClickFancyBoxReload = () => {
647    if ($('.chd-request-price-btn:visible').length == 0) {
648        $('.js-open-modal-bclick').show();
649    }
650    $('.js-open-modal-bclick').fancybox({
651        animationEffect: "zoom-in-out",
652        animationDuration: 366,
653        autoFocus: true,
654        touch: false,
655        backFocus: true,
656        trapFocus: true,
657        hideScrollbar: true,
658        afterShow: function () {
659            $('body').addClass('stop-scrolling');
660        },
661        afterClose: function () {
662            $('body').removeClass('stop-scrolling');
663        }
664    });
665}
666
667var initBuyClickPlugin = () => {
668    buyOneClickModule.init();
669    buyOneClickModule.targetElementsLastCount = $('.js-open-modal-bclick').length;
670    buyClickFancyBoxReload();
671
672
673    // Перезагрузка fancybox при динамическом добавлении целевого элемента
674    // Например, при добавлении товаров на страницу через плагин "Показать ещё"
675    // https://frontend-stuff.com/blog/debounce-in-javascript/
676    var debounce = function(func, wait = 300, immediate = false) {
677        var timeout;
678
679        return function executedFunction() {
680            var context = this;
681            var args = arguments;
682
683            var later = function() {
684                timeout = null;
685                if (!immediate) func.apply(context, args);
686            };
687
688            var callNow = immediate && !timeout;
689
690            clearTimeout(timeout);
691
692            timeout = setTimeout(later, wait);
693
694            if (callNow) {
695                func.apply(context, args);
696            }
697        }
698    };
699
700    var onNewTargetButtonsAction = debounce(() => {
701        buyClickFancyBoxReload();
702    });
703    if ('MutationObserver' in window) {
704    //Для инициализации плагина на элементах подключаемых динамически
705    var target = document.querySelector('body');
706
707    // Конфигурация observer (за какими изменениями наблюдать)
708    const config = {
709        attributes: true,
710        childList: true,
711        subtree: true,
712    };
713    
714    // Колбэк-функция при срабатывании мутации
715    const callback = function (mutationsList, observer) {
716        var targetElementsCurrentCount = $('.js-open-modal-bclick').length;
717        if (targetElementsCurrentCount !== buyOneClickModule.targetElementsLastCount) {
718            debounce
719            buyOneClickModule.targetElementsLastCount = targetElementsCurrentCount;
720            onNewTargetButtonsAction();
721        }
722    };
723
724    // Создаём экземпляр наблюдателя с указанной функцией колбэка
725    const observer = new MutationObserver(callback);
726    // Начинаем наблюдение за настроенными изменениями целевого элемента
727    observer.observe(target, config);
728    } else {
729    $(document.body).bind("DOMSubtreeModified", function () {
730        var targetElementsCurrentCount = $('.js-open-modal-bclick').length;
731        if (targetElementsCurrentCount !== buyOneClickModule.targetElementsLastCount) {
732            buyOneClickModule.targetElementsLastCount = targetElementsCurrentCount;
733            onNewTargetButtonsAction();
734        }
735    });
736    }
737}
738
739var buyOneClickModule = (function () {
740    return {
741        targetElementsLastCount: 0,
742        init: function () {
743            if ($('.chd-request-price-btn').length == 0) {
744                $('.js-open-modal-bclick').show();
745            }
746            var buyOneClick_recaptcha = '';
747            if ($('.wrapper-modal-mg-buy-click').length == 0) {
748
749                if (typeof agreement_buy_click == 'undefined') {
750                    agreement_buy_click = '';
751                }
752                /*
753                if ($('.agreement_buy_click_flag')) {
754                    agreement_buy_click = '' + '<label class="agreement-container">' +
755                        '<input class="agreement-data-checkbox-mg-send-order-click-button" type="checkbox"> ' +
756                        '<span class="agreement-data-denied">Я даю согласие на обработку моих <a role="button" href="javascript:void(0);" class="show-more-agreement-data">персональных данных.</a>' +
757                        '</span>' +
758                        '</label>' +
759                        '<br>';
760                }*/
761                //Постановка капчи с учтом локали
762                
763                
764                var html = '' +
765                    '<div role="document" id="modal-buy-click" class="wrapper-modal-mg-buy-click" >' +
766                        '<div class="wrapper-modal-mg-buy-click__inner">' +
767                            '<div class="header-modal-mg-buy-click">' +
768                                '<span class="title-modal-mg-buy-click">Быстрая покупка товара</span>' +
769                            '</div>' +
770                            '<div class="titles-modal-mg-buy-click">' +
771                                '<span class="title js-bg-product-title"></span>' +
772                                '<span class="variant"></span>' +
773                            '</div>' +
774                            '<div class="content-modal-mg-buy-click">' +
775                                '<div class="mg-product-info" style="display:none">
775' +
776                                    '<div class="mg-product-img">' +
777                                        '<img class="product-image" src="" >' +
778                                    '</div>' +
779                                    '<div class="mg-price-buy-click">' +
780                                        '<span class="nowrap"><span><span class="bk-label"></span><span class="bc-price"></span></span><span class="js-hide-if-single"><span class="bc-times bk-label">Количество:</span><span class="bc-count">1</span>шт.</span></span>' +
781                                    '</div>' +    
782                                '</div>' +
783                                '<div class="mg-order-buy-click">' +
784                                    '<form action="' + mgBaseDir + '/" method="post">' +
785                                        '<ul class="modal-mg-order-list">' +
786                                            '<li class="fio" style="display:none">' +
787                                                '<span>Ваше имя:</span>' +
788                                                '<input type="text" name="bc-name" placeholder="Ваше Имя" value ="">' +
789                                            '</li>' +
790                                            '<li class="phone" style="display:none">' +
791                                                '<span>Телефон:<span class="red-star">*</span></span>' +
792                                                '<input type="text" name="phone" placeholder="Телефон" value ="">' +
793                                            '</li>' +
794                                            '<li class="email" style="display:none">' +
795                                                '<span>Ваш e-mail:<span class="red-star">*</span></span>' +
796                                                '<input type="text" name="bc-email" placeholder="Ваш e-mail" value ="">' +
797                                            '</li>' +
798                                            '<li class="address" style="display:none">' +
799                                                '<span>Адрес:</span>' +
800                                                '<textarea name="bc-address" placeholder="Адрес" value =""></textarea>' +
801                                            '</li>' +
802                                            '<li class="comment" style="display:none">' +
803                                                '<span>Комментарий:</span>' +
804                                                '<textarea name="bc-comment" placeholder="Комментарий" value =  ""></textarea>' +
805                                            '</li>';
806                                            if ($('.mg-buy-click-button').data('captcha') === 'enabled') {
807                                                html += '<li class="mg-cap" style="display:none">' +
808                                                    '<div class="cap-left">' +
809                                                        '<img style="margin-top: 5px; border: 1px solid gray;" src = "' + '" width="140" height="36">' +
810                                                        '<span>Введите текст с картинки:<span class="red-star">*</span> </span>' +
811                                                        '<input type="text" name="capcha" class="captcha">' +
812                                                    '</div>' +
813                                                    '<div style="clear:both;"></div>' +
814                                                '</li>';
815                                            }
816                                        html += '</ul>' +
817                                    '</form>' +
818                                '</div>' +
819                            '</div>' +
820                            '<div class="mg-action-buttons">' +
821                                '<div class="buyClick_agreement">' + agreement_buy_click + '</div>' +
822                                '<button type="submit" class="mg-send-order-click-button mg-buy-btn"><span>Купить</span></button>' +
823                            '</div>' +
824                        '</div>' +
825                    '</div>';
826
827                $('body').append(html);
828            }
829
830            // Открытие пользовательского соглашения
831            $('body').on('click', '.agreement__btn_open', function () {$('body .agreement__modal').show(); });
832            //Закрытие пользовательского соглашения
833            $('body').on('click', '.agreement__btn_close', function () {$('body .agreement__modal').hide(); });
834
835            // если выбран вариант, которого нет на складе
836            $('.block-variants input[type=radio]:checked').each(function () {
837                if ($(this).data('count') == 0) {
838                    if ($('.wrapper-mg-buy-click').length > 1) {
839                        $(this).parents('.product-wrapper').find('.wrapper-mg-buy-click .mg-buy-click-button').hide();
840                    } else {
841                        $('.wrapper-mg-buy-click .mg-buy-click-button').hide();
842                    }
843                }
844            });
845
846            // при нажатии на кнопку купить открывается модальное окно
847            $('body').on('click', '.mg-buy-click-button', function () {
848                var id = $(this).data('product-id');
849                const captchaEnabled = $(this).data('captcha') === 'enabled';
850                $('.buyClick_agreement').show();
851                $('.wrapper-modal-mg-buy-click .mg-action-buttons .mg-send-order-click-button').prop('disabled', false);
852                if (captchaEnabled) {
853                    var capchaSrc = mgBaseDir + ((langP=='LANG')?'':('/'+langP))+"/captcha.html?t=" + Date.now();
854                    if ($('.wrapper-modal-mg-buy-click .cap-left img').attr('src') == '') {
855                        $('.wrapper-modal-mg-buy-click .cap-left img').attr('src', capchaSrc);
856                    }
857                }
858                if ($('.wrapper-modal-mg-buy-click .loading-send-order').data('buy')== id) {
859                  return true;
860                }
861                else {
862                  $('.wrapper-modal-mg-buy-click .loading-send-order').data('buy','');
863                  $('.wrapper-modal-mg-buy-click .loading-send-order').hide();
864                  $('.mg-action-buttons .mg-send-order-click-button').show();
865                  $('.mg-price-buy-click').show();
866                  $('.content-modal-mg-buy-click').show();
867                }
868
869                var var_id = '';
870                if ($(this).parents('.product-wrapper').length) {
871                    var_id = $(this).parents('.product-wrapper').find('.block-variants input[type=radio]:checked').attr('value');
872                } else {
873                    var_id = $('.block-variants input[type=radio]:checked').attr('value');
874                }
875
876                openOrderForm(id, var_id);
877                var count = 1;
878                var price = '';
879
880                // данные из мини-карточки товара (из каталога) или из полной карточки товара
881                if ($(this).parents('.product-wrapper').length) {
882                    price = $(this).parents('.product-wrapper').find(".product-price .product-default-price:first").text();
883                    count = $(this).parents('.product-wrapper').find(".property-form input[name=amount_input]").val();
884                    if (price == '') {
885                        price = $(this).parents('.product-wrapper').find(".product-price").text();
886                    }
887                } else if ($(this).parents('.js-product-page').length) {
888                    price = $(this).parents('.js-product-page').find(".product-price .product-default-price:first").text();
889                    count = $(this).parents('.js-product-page').find(".property-form input[name=amount_input]").val();
890                } else {
891                    price = $('body').find(".product-status-list li .price:first").text();
892                    count = $('body').find(".buy-block-inner .property-form .cart_form input[name=amount_input]").val();
893                }
894
895                if (!price) {
896                    price = $('[data-buy-click-price]').text();
897                }
898
899                if(!count) {
900                    count = $('[data-buy-click-count] input[name=amount_input]').val();
901                }
902
903                if (!price) {
904                    price = $('[data-buy-click-price]').text();
905                }
906
907                var countWrapper = $('body').find('.js-hide-if-single');
908                countWrapper.show()
909
910                if (price) {
911                    $('.wrapper-modal-mg-buy-click  .mg-price-buy-click .bc-price').text(price);
912                }
913                $('.wrapper-modal-mg-buy-click  .mg-price-buy-click .bc-count').text(count);
914
915                var image = $('img[data-product-id=' + id + ']').attr('src');
916                if (image) {
917                    $('.wrapper-modal-mg-buy-click  .mg-product-img img').attr('src', image);
918                }
919
920                $('.wrapper-modal-mg-buy-click .error').remove();
921
922                // $('.mg-order-buy-click input[name=bc-phone]').mask(phoneMask.replace(/#/g, '9'));
923            });
924
925            // оформление заказа по нажатию кнопки купить
926            //$('.mg-send-order-click-button').click(function () {
927                
928            $('body').on('click', '.mg-send-order-click-button', function () {
929                var checkbox = $('.js-agreement-checkbox-mg-send-order-click-button');
930                if(checkbox.length != 0){
931                    var errorClass = 'agreement__label_error';
932                    if(checkbox.is(':checked')) {
933                        checkbox.parent().removeClass(errorClass);
934                    }
935                    else{
936                        checkbox.parent().addClass(errorClass);
937                        return false;
938                    }
939                }
940                var button = $(this);
941                button.prop('disabled', true);
942                var id = $(this).attr('data-id');
943                var name = $(this).parents('.wrapper-modal-mg-buy-click').find('input[name=bc-name]');
944                var phone = $(this).parents('.wrapper-modal-mg-buy-click').find('.mg-order-buy-click input[name=phone]');
945                var email = $(this).parents('.wrapper-modal-mg-buy-click').find('input[name=bc-email]');
946                var address = $(this).parents('.wrapper-modal-mg-buy-click').find('textarea[name=bc-address]');
947                var comment = $(this).parents('.wrapper-modal-mg-buy-click').find('textarea[name=bc-comment]');
948                var capcha = $(this).parents('.wrapper-modal-mg-buy-click').find('input[name=capcha]').val();
949
950                if (!capcha) {
951                    if ($('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap .g-recaptcha-template').length) {
952                        capcha = grecaptcha.getResponse(buyOneClick_recaptcha);
953                    }
954
955                    if ($('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap .recaptcha-holder-template').length) {
956                        if (!buyOneClickModule.recaptchaToken) {
957                            grecaptcha.execute(buyOneClick_recaptcha);
958                            return false;
959                        } else {
960                            capcha = buyOneClickModule.recaptchaToken;
961                        }
962                    }
963                }
964                buyOneClickModule.recaptchaToken = null;
965
966                $.ajax({
967                    type: "POST",
968                    url: mgBaseDir + "/ajaxrequest",
969                    dataType: 'json',
970                    data: {
971                        mguniqueurl: "action/sendOrderBuyClick", // действия для выполнения на сервере
972                        pluginHandler: 'buy-click',
973                        name: name.val(),
974                        phone: phone.val(),
975                        email: email.val(),
976                        address: address.val(),
977                        comment: comment.val(),
978                        capcha: capcha,
979                    },
980                    success: function (response) {
981                        button.prop('disabled', false);
982                        if (response.status != 'error') {
983                            $('.mg-action-buttons .mg-send-order-click-button').hide();
984                            $('.agreement-container').hide();
985                            $('.buyClick_agreement').hide();
986                            $('.wrapper-modal-mg-buy-click .error').remove();
987                            $('.loading-send-order').remove();
988                            likeAddToCart(id);
989                        } else {
990                            $('.wrapper-modal-mg-buy-click .error').remove();
991                            $('.title-modal-mg-buy-click').after(response.data.msg);
992                            $('.loading-send-order').remove();
993                        }
994                    }
995                });
996            });
997            
998            /**
999             * функция добавления товара в корзину
1000             * @param {type} e
1001             * @returns {undefined}
1002             */
1003
1004            function likeAddToCart(id) {
1005                id = parseInt(id);
1006                if ($('.buy-block').find(".property-form").length) {
1007                    var request = $('.buy-block').find(".property-form").formSerialize();
1008					if (request.indexOf("inCartProductId") == -1) {
1009					  request = request +'&inCartProductId=' + id;
1010					}
1011                } else {
1012                    var inCartProd = 'inCartProductId=' + id;
1013                    var request = inCartProd + '&amount_input='+$('#modal-buy-click .mg-price-buy-click .bc-count').html();
1014                    var variant = $('.mg-buy-click-button[data-product-id=' + id + ']').parents('.product-wrapper').find('.block-variants input[type=radio]:checked').val();
1015                    if (variant) {
1016                        request = request + '&variant=' + variant;
1017                    }
1018                }
1019                $.ajax({
1020                    type: "POST",
1021                    url: mgBaseDir + "/cart?plugin=buy-click",
1022                    data: "ajax=buyclickflag&updateCart=1&" + request,
1023                    dataType: "json",
1024                    cache: false,
1025                    success: function (response) {
1026                        if ('success' == response.status) {
1027                            $('.mg-action-buttons').before("<span data-buy=" + id + " class='loading-send-order'>Спасибо за покупку! Наши менеджеры свяжутся с Вами!</span>");
1028                            $('.mg-action-buttons .mg-send-order-click-button').hide();
1029                            $('.mg-price-buy-click').hide();
1030                            $('.content-modal-mg-buy-click').hide();
1031                            $('.agreement-container').hide();
1032                            $('.titles-modal-mg-buy-click').hide();
1033                        } else {
1034                            $('.mg-action-buttons').before("<span class='loading-send-order error'>Ошибка при отправке заявки. "+response.msg+"</span>");
1035                        }
1036                    }
1037                });
1038            }
1039
1040            $('body').on('change', '.block-variants input[type=radio]', function () {
1041                if ($(this).data('count') == 0) {
1042                    if ($('.wrapper-mg-buy-click').length > 1) {
1043                        $(this).parents('.product-wrapper').find('.wrapper-mg-buy-click .mg-buy-click-button').hide();
1044                    } else {
1045                        $(this).parents('.product-wrapper').find('.wrapper-mg-buy-click .mg-buy-click-button').hide();
1046                    }
1047                } else {
1048                    if ($('.wrapper-mg-buy-click').length > 1) {
1049                        $(this).parents('.product-wrapper').find('.wrapper-mg-buy-click .mg-buy-click-button').show();
1050                    } else {
1051                        $(this).parents('.product-wrapper').find('.wrapper-mg-buy-click .mg-buy-click-button').show();
1052                    }
1053                }
1054            });
1055
1056            /**
1057             * функция загрузки формы для заказа
1058             * @param {type} e
1059             * @returns {undefined}
1060             */
1061            function openOrderForm(id, var_id) {
1062                $.ajax({
1063                    type: "POST",
1064                    url: mgBaseDir + "/ajaxrequest",
1065                    dataType: 'json',
1066                    data: {
1067                        mguniqueurl: "action/buildOrderForm", // действия для выполнения на сервере
1068                        pluginHandler: 'buy-click',
1069                        id: id,
1070                        var_id: var_id,
1071                    },
1072                    success: function (response) {
1073                        $('.wrapper-modal-mg-buy-click .mg-action-buttons .mg-send-order-click-button').attr('data-id', id);
1074                        if (response.data.options.header != '') {
1075                            $('.wrapper-modal-mg-buy-click .title-modal-mg-buy-click').html(response.data.options.header);
1076                        }
1077                        $('.js-bg-product-title').html(response.data.product_title);
1078                        $('.wrapper-modal-mg-buy-click  .variant').html(response.data.variant_title);
1079                        if (response.data.options.product == 'true') {
1080                            $('.wrapper-modal-mg-buy-click .mg-product-info').css("display", "block");
1081                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list .variant').hide();
1082                            const img = mgBaseDir + '/uploads/'  + response.data.product_image;
1083                            if (
1084                                !$('.wrapper-modal-mg-buy-click  .mg-product-img img').attr('src') ||
1085                                !$('.wrapper-modal-mg-buy-click  .mg-product-img img').attr('src') != img
1086                            ) {
1087                                $('.wrapper-modal-mg-buy-click  .mg-product-img img').attr('src', img);
1088                            }
1089                        }
1090
1091                        if (response.data.options.name == 'true') {
1092                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.fio').css("display", "block");
1093                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list input[name=bc-name]').val(response.data.user.n
1093ame);
1094                        }
1095                        if (response.data.options.phone == 'true') {
1096                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.phone').css("display", "block");
1097                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list input[name=phone]').val(response.data.user.phone);
1098                        }
1099                        if (response.data.options.email == 'true') {
1100                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.email').css("display", "block");
1101                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list input[name=bc-email]').val(response.data.user.email);
1102                        }
1103                        if (response.data.options.address == 'true') {
1104                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.address').css("display", "block");
1105                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list textarea[name=bc-address]').val(response.data.user.address);
1106                        }
1107                        if (response.data.options.comment == 'true') {
1108                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.comment').css("display", "block");
1109                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list textarea[name=bc-comment]').val('');
1110                        }
1111                        if (response.data.options.capcha == 'true') {
1112                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap').css("display", "block");
1113                            $('.wrapper-modal-mg-buy-click .modal-mg-order-list input[name=capcha]').val('');
1114                            if (response.data.options.recaptcha == 'true') {
1115                                $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap').html(response.data.recaptchahtml);
1116
1117                                if ($('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap .g-recaptcha-template').length && !$('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap .g-recaptcha-template iframe').length) {
1118                                    $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap').find('.g-recaptcha-template').attr('id', 'buyClick_recaptcha');
1119                                    var skey = $('#buyClick_recaptcha').data('sitekey');
1120                                    buyOneClick_recaptcha = grecaptcha.render('buyClick_recaptcha', {
1121                                        sitekey: skey
1122                                    });
1123                                    $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap').find('.g-recaptcha-template').removeAttr('id');
1124                                }
1125
1126                                if ($('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap .recaptcha-holder-template').length && !$('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap .recaptcha-holder-template iframe').length) {
1127                                    $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap').find('.recaptcha-holder-template').attr('id', 'buyClick_recaptcha');
1128                                    var skey = $('#buyClick_recaptcha').data('sitekey');
1129                                    buyOneClick_recaptcha = grecaptcha.render('buyClick_recaptcha', {
1130                                        sitekey: skey,
1131                                        callback: function (recaptchaToken) {
1132                                            buyOneClickModule.recaptchaToken = recaptchaToken;
1133                                            $('.mg-send-order-click-button:visible').click();
1134                                        }
1135                                    });
1136                                    $('.wrapper-modal-mg-buy-click .modal-mg-order-list li.mg-cap .recaptcha-holder-template').removeAttr('id');
1137                                }
1138
1139                            }
1140                        }
1141
1142                    }
1143                });
1144                return true;
1145
1146            }
1147
1148        }
1149    }
1150})();
1151$(document).ready(function () {
1152    initBuyClickPlugin();
1153});
1154 
1155$(document).ready(function() {
1156	if(phoneMask) {
1157		maskAll = phoneMask;//'+7 (###) ### ##-##,+380 (##) ### ##-##,+375 (##) ### ##-##';
1158		savePos = 1;
1159		tmpInputVal = '';
1160
1161		// ставим плейсхолдер
1162		tmpMask = maskAll.split(',');
1163		mask = maskAll[0].replace(/[0-9]/g, '#');
1164		$('[name=phone]').attr('placeholder', tmpMask[0].replace(/#/g, '_'));
1165		delete tmpMask
1166
1167		// устанавливаем маску при фокусе
1168		$('body').on('focus', '[name=phone]', function() {
1169			if($(this).val().indexOf('_') != -1 || $(this).val() == '') {
1170				tmpMask = maskAll.split(',');
1171				$(this).val(tmpMask[0].replace(/#/g, '_'));
1172				delete tmpMask;
1173			}
1174		});
1175
1176		// сбрасываем маску и номер, если ничего не введено или не введено до конца
1177		$('body').on('blur', '[name=phone]', function() {
1178			if($(this).val().indexOf('_') != -1) {
1179				$(this).val('');
1180			}
1181		});
1182
1183		$('body').on('input', '[name=phone]', function() {
1184			// начальное определение того, что происходит
1185			input = $(this);
1186			if(tmpInputVal.length < input.val().length) {
1187				add = true;
1188			} else {
1189				add = false;
1190			}
1191			savePos = input.get(0).selectionStart;
1192			phone = input.val().replace(/[^0-9]/g, '');
1193			newPhone = '';
1194			// определяем нужную маску
1195			masks = maskAll.split(',');
1196			for (i = 0; i < masks.length; i++) {
1197				mask = masks[0].replace(/[0-9]/g, '#');
1198				maskNumber = masks[i].replace(/[^0-9]/g, '');
1199				if(maskNumber == phone.substring(0, maskNumber.length)) {
1200					mask = masks[i].replace(/[0-9]/g, '#');
1201					i = 1000000;
1202				}
1203			}
1204			// подготовка нового телефона по шаблону
1205			setCursor = true;
1206			for(i = 0, counter = 0; i < mask.length; i++) {
1207				if(mask[i] == '#') {
1208					if(phone[counter] == undefined) {
1209						newPhone += '_';
1210						if(add && setCursor) {
1211							savePos = i;
1212							setCursor = false;
1213						}
1214					} else {
1215						newPhone += phone[counter];
1216					}
1217					counter++;
1218				} else {
1219					newPhone += mask[i];
1220				}			
1221			}
1222			// вывод телефона
1223			input.val(newPhone);
1224			// установка курсора
1225			input.get(0).setSelectionRange(savePos, savePos);
1226			tmpInputVal = newPhone;
1227		});
1228	}
1229}); 
1230var initBackRing = () => {
1231
1232  $.datepicker.regional['ru'] = {
1233    closeText: 'Закрыть',
1234    prevText: '<Пред',
1235    nextText: 'След>',
1236    currentText: 'Сегодня',
1237    monthNames: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь',
1238      'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
1239    monthNamesShort: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн',
1240      'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],
1241    dayNames: ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'],
1242    dayNamesShort: ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'сбт'],
1243    dayNamesMin: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
1244    dateFormat: 'dd.mm.yy',
1245    firstDay: 1,
1246    isRTL: false
1247  };
1248
1249  var lang = []
1250
1251
1252  if (typeof availableTags !== 'undefined' && availableTags) {
1253    $(".content-modal-back-ring input[name=city_id]").autocomplete({
1254      source: availableTags
1255    });
1256  }
1257  var backring_recaptcha = '';
1258
1259  $(".ui-autocomplete").css('z-index', '1000');
1260
1261  $('.content-modal-back-ring input[name=date_callback]').datepicker({ dateFormat: "yy-mm-dd" });
1262  let phoneInput = $(".content-modal-back-ring input[name=back-ring-phone]");
1263  if (typeof $.mask != 'undefined') {
1264    if (phoneInput.data("use-mask")) {
1265      //Получаем префикс телефона из атрибута
1266      $.mask.definitions["9"] = false;
1267      $.mask.definitions["z"] = "[0-9]";
1268      phoneInput = $(".content-modal-back-ring input[name=back-ring-phone]");
1269      phoneInput.mask(phoneInput.data("mask") + " (zzz) zzz-zz-zz");
1270    } else {
1271      $(".content-modal-back-ring input[name=back-ring-phone]").on("change", function (e) {
1272        let value = $(this).val();
1273        const pattern = /[0-9]*/gi;
1274        $(this).val("+" + value.match(pattern).join(""));
1275      });
1276      $(".content-modal-back-ring input[name=back-ring-phone]").on("keypress", function (e) {
1277        e.preventDefault();
1278        const pattern = /[0-9]*/gi;
1279        const value = $(this).val().match(pattern).join("");
1280        const key = e.originalEvent.key.match(pattern).join("");
1281        $(this).val("+" + value + key);
1282      });
1283      $(".content-modal-back-ring input[name=back-ring-phone]").on("paste", function (e) {
1284        e.preventDefault();
1285
1286        let paste = (e.originalEvent.clipboardData || window.clipboardData).getData("text");
1287        const pattern = /[0-9]*/gi;
1288        const value = $(this).val().match(pattern).join("");
1289        const num = paste.match(pattern).join("");
1290        $(this).val("+" + value + num);
1291      });
1292    }
1293  }
1294
1295  $('.back-ring-button').click(function () {
1296    if ($('.wrapper-modal-back-ring').is(':visible')) {
1297      return false;
1298    }
1299    $.ajax({
1300      type: "POST",
1301      url: mgBaseDir + "/ajaxrequest",
1302      data: {
1303        pluginHandler: "back-ring",
1304        actionerClass: "Pactioner",
1305        action: "getLang"
1306      },
1307      dataType: "json",
1308      cache: false,
1309      success: function (response) {
1310        lang = response.data.lang;
1311        $.datepicker.setDefaults($.datepicker.regional[response.data.regional]);
1312      }
1313    });
1314    window.backRingRecaptchaToken = null;
1315    //$("html, body").animate({ scrollTop: 0 }, "fast");
1316
1317    if ($('.wrapper-modal-back-ring').first().find('.g-recaptcha-template').length && !$('.wrapper-modal-back-ring').first().find('.g-recaptcha-template').find('iframe').length) {
1318      $('.wrapper-modal-back-ring').first().find('.g-recaptcha-template').attr('id', 'backring_recaptcha');
1319      var skey = $('#backring_recaptcha').data('sitekey');
1320      backring_recaptcha = grecaptcha.render('backring_recaptcha', {
1321        sitekey: skey
1322      }, true);
1323      $('.wrapper-modal-back-ring').first().find('.g-recaptcha-template').removeAttr('id');
1324    }
1325
1326    if ($('.wrapper-modal-back-ring').first().find('.recaptcha-holder-template').length && !$('.wrapper-modal-back-ring').first().find('.recaptcha-holder-template').find('iframe').length) {
1327      $('.wrapper-modal-back-ring').first().find('.recaptcha-holder-template').attr('id', 'backring_recaptcha');
1328      var skey = $('#backring_recaptcha').data('sitekey');
1329      backring_recaptcha = grecaptcha.render('backring_recaptcha', {
1330        sitekey: skey,
1331        callback: function (recaptchaToken) { window.backRingRecaptchaToken = recaptchaToken; $('.send-ring-button:visible').click(); }
1332      }, true);
1333      $('.wrapper-modal-back-ring').first().find('.recaptcha-holder-template').removeAttr('id');
1334    }
1335
1336
1337    openModal($('.wrapper-modal-back-ring').first());
1338    var off = $(document).scrollTop() + 50;
1339    $('.wrapper-modal-back-ring').first().offset({ top: off });
1340    $('.content-modal-back-ring input[name=name]').val('');
1341    $('.content-modal-back-ring textarea[name=comment]').val('');
1342    $('.content-modal-back-ring input[name=back-ring-phone]').val($('.content-modal-back-ring input[name=back-ring-phone]').attr('data-mask'));
1343    $('.content-modal-back-ring input[name=city_id]').val('');
1344    $('.content-modal-back-ring select[name=mission]').val('');
1345    $('.content-modal-back-ring input[name=date_callback]').val('');
1346
1347    $('.wrapper-modal-back-ring .error').remove();
1348  });
1349
1350  $('.close-ring-button').click(function () {
1351    $('.wrapper-modal-back-ring').hide();
1352    closeModal($('.wrapper-modal-back-ring'));
1353  });
1354
1355
1356  // Receiving and transferring user agreement on AJAX
1357  $('.enter-text').click(function () {
1358    $.ajax({
1359      type: "POST",
1360      url: mgBaseDir + "/ajaxrequest",
1361      data: {
1362        pluginHandler: "back-ring",
1363        actionerClass: "Pactioner",
1364        action: "getAgreement"
1365      },
1366      dataType: "json",
1367      cache: false,
1368      success: function (message) {
1369        $('.agr-text').html(message.data['agr']);
1370        $('.agreement__modal_ring').show();
1371      }
1372    });
1373  });
1374
1375  $('.agreement__btn_close_ring').click(function () {
1376    $('.agreement__modal_ring').hide();
1377  });
1378
1379  $('body').on('click', '.send-ring-button', function () {
1380
1381
1382    var name = $(this).parents('.content-modal-back-ring').find('input[name=name]');
1383    var comment = $(this).parents('.content-modal-back-ring').find('textarea[name=comment]');
1384    var phone = $(this).parents('.content-modal-back-ring').find('input[name=back-ring-phone]');
1385    var city_id = $(this).parents('.content-modal-back-ring').find('input[name=city_id]');
1386    var mission = $(this).parents('.content-modal-back-ring').find('select[name=mission]');
1387    var from = $(this).parents('.content-modal-back-ring').find('select[name=from]');
1388    var to = $(this).parents('.content-modal-back-ring').find('select[name=to]');
1389    var date_callback = $(this).parents('.content-modal-back-ring').find('input[name=date_callback]');
1390    var captcha = $(this).parents('.content-modal-back-ring').find('input[name=capcha]').val();
1391    var agreement = $(this).parents('.content-modal-back-ring').find('input#agreement').val();
1392
1393    if (!captcha) {
1394      if ($('.wrapper-modal-back-ring').first().find('.g-recaptcha-template').length) {
1395        captcha = grecaptcha.getResponse(backring_recaptcha);
1396      }
1397    }
1398
1399    if (!captcha) {
1400      if ($('.wrapper-modal-back-ring').first().find('.recaptcha-holder-template').length) {
1401        if (!window.backRingRecaptchaToken) {
1402          grecaptcha.execute(backring_recaptcha);
1403          return false;
1404        } else {
1405          captcha = window.backRingRecaptchaToken;
1406        }
1407      }
1408    }
1409
1410    var time_callback = 'с ' + from.val() + ' до ' + to.val();
1411    if (from.parents('li').css('display') == 'none') {
1412      time_callback = '';
1413    }
1414
1415    if ($('.js-agreement-checkbox-backRingInput').prop("checked") == false) {
1416      $('.wrapper-modal-back-ring .error').remove();
1417      $('.title-modal-back-ring').after('<div class="error">' + lang['VALID_ALL_FIELD'] + '</div>');
1418      return false;
1419    }
1420    if (phone.val() == "") {
1421      $('.wrapper-modal-back-ring .error').remove();
1422      $('.title-modal-back-ring').after('<div class="error">' + lang['VALID_ALL_FIELD'] + '</div>');
1423      return false;
1424    }
1425
1426    $('.send-ring-button').hide();
1427    $('.send-ring-button').before("<span class='loading-send-ring'>" + lang['WAIT'] + "</span>");
1428
1429    $.ajax({
1430      type: "POST",
1431      url: mgBaseDir + "/ajaxrequest",
1432      dataType: 'json',
1433      data: {
1434        mguniqueurl: "action/sendOrderRing", // действия для выполнения на сервере
1435        pluginHandler: 'back-ring',
1436        name: name.val(),
1437        comment: comment.val(),
1438        phone: phone.val(),
1439        city_id: city_id.val(),
1440        mission: mission.val(),
1441        date_callback: date_callback.val(),
1442        time_callback: time_callback,
1443        invisible: 1,
1444        status_id: 1,
1445        pub: 1,
1446        capcha: captcha,
1447      },
1448      success: function (response) {
1449        if (response.status != 'error') {
1450          $('.content-modal-back-ring').html(lang['SENDED1'] + response.data.row.id + lang['SENDED2']);
1451          $('.send-ring-button').show();
1452          $('.wrapper-modal-back-ring .error').remove();
1453          $('.loading-send-ring').remove();
1454          //closeModal($('.wrapper-modal-back-ring'));
1455        } else {
1456          $('.wrapper-modal-back-ring .error').remove();
1457          $('.title-modal-back-ring').after(response.data.msg);
1458          $('.send-ring-button').show();
1459          $('.loading-send-ring').remove();
1460        }
1461      }
1462    });
1463  });
1464
1465  /**
1466   * Открывает модальное окно
1467   */
1468  function openModal(object) {
1469    overlay();
1470    object.fadeIn(300);
1471    object.css('z-index', 1000);
1472  }
1473
1474  function captcha(object) {
1475    overlay();
1476    object.fadeIn(300);
1477    object.css('z-index', 1000);
1478  }
1479
1480  /**
1481   * Закрывает модальное окно
1482   */
1483  function closeModal(object) {
1484    object.fadeOut(300);
1485    $("#overlay").remove();
1486  }
1487
1488  /**
1489   * Фон для заднего плана при открытии всплывающего окна
1490   */
1491  function overlay() {
1492    var docHeight = $(document).height();
1493    $(".wrapper-modal-back-ring").first().before("<div id='overlay'></div>");
1494    $("#overlay").height(docHeight);
1495    $("#overlay").css("z-index", "999");
1496
1497  }
1498}
1499$(document).ready(function () {
1500  initBackRing();
1501});
1502 
1503/*
1504	Masked Input plugin for jQuery
1505	Copyright (c) 2007-2013 Josh Bush (digitalbush.com)
1506	Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
1507	Version: 1.3.1
1508*/
1509(function(e){function t(){var e=document.createElement("input"),t="onpaste";return e.setAttribute(t,""),"function"==typeof e[t]?"paste":"input"}var n,a=t()+".mask",r=navigator.userAgent,i=/iphone/i.test(r),o=/android/i.test(r);e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"},e.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof e?(t="number"==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&(n=this.createTextRange(),n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(t,r){var c,l,s,u,f,h;return!t&&this.length>0?(c=e(this[0]),c.data(e.mask.dataName)()):(r=e.extend({placeholder:e.mask.placeholder,completed:null},r),l=e.mask.definitions,s=[],u=h=t.length,f=null,e.each(t.split(""),function(e,t){"?"==t?(h--,u=e):l[t]?(s.push(RegExp(l[t])),null===f&&(f=s.length-1)):s.push(null)}),this.trigger("unmask").each(function(){function c(e){for(;h>++e&&!s[e];);return e}function d(e){for(;--e>=0&&!s[e];);return e}function m(e,t){var n,a;if(!(0>e)){for(n=e,a=c(t);h>n;n++)if(s[n]){if(!(h>a&&s[n].test(R[a])))break;R[n]=R[a],R[a]=r.placeholder,a=c(a)}b(),x.caret(Math.max(f,e))}}function p(e){var t,n,a,i;for(t=e,n=r.placeholder;h>t;t++)if(s[t]){if(a=c(t),i=R[t],R[t]=n,!(h>a&&s[a].test(i)))break;n=i}}function g(e){var t,n,a,r=e.which;8===r||46===r||i&&127===r?(t=x.caret(),n=t.begin,a=t.end,0===a-n&&(n=46!==r?d(n):a=c(n-1),a=46===r?c(a):a),k(n,a),m(n,a-1),e.preventDefault()):27==r&&(x.val(S),x.caret(0,y()),e.preventDefault())}function v(t){var n,a,i,l=t.which,u=x.caret();t.ctrlKey||t.altKey||t.metaKey||32>l||l&&(0!==u.end-u.begin&&(k(u.begin,u.end),m(u.begin,u.end-1)),n=c(u.begin-1),h>n&&(a=String.fromCharCode(l),s[n].test(a)&&(p(n),R[n]=a,b(),i=c(n),o?setTimeout(e.proxy(e.fn.caret,x,i),0):x.caret(i),r.completed&&i>=h&&r.completed.call(x))),t.preventDefault())}function k(e,t){var n;for(n=e;t>n&&h>n;n++)s[n]&&(R[n]=r.placeholder)}function b(){x.val(R.join(""))}function y(e){var t,n,a=x.val(),i=-1;for(t=0,pos=0;h>t;t++)if(s[t]){for(R[t]=r.placeholder;pos++<a.length;)if(n=a.charAt(pos-1),s[t].test(n)){R[t]=n,i=t;break}if(pos>a.length)break}else R[t]===a.charAt(pos)&&t!==u&&(pos++,i=t);return e?b():u>i+1?(x.val(""),k(0,h)):(b(),x.val(x.val().substring(0,i+1))),u?t:f}var x=e(this),R=e.map(t.split(""),function(e){return"?"!=e?l[e]?r.placeholder:e:void 0}),S=x.val();x.data(e.mask.dataName,function(){return e.map(R,function(e,t){return s[t]&&e!=r.placeholder?e:null}).join("")}),x.attr("readonly")||x.one("unmask",function(){x.unbind(".mask").removeData(e.mask.dataName)}).bind("focus.mask",function(){clearTimeout(n);var e;S=x.val(),e=y(),n=setTimeout(function(){b(),e==t.length?x.caret(0,e):x.caret(e)},10)}).bind("blur.mask",function(){y(),x.val()!=S&&x.change()}).bind("keydown.mask",g).bind("keypress.mask",v).bind(a,function(){setTimeout(function(){var e=y(!0);x.caret(e),r.completed&&e==x.val().length&&r.completed.call(x)},0)}),y()}))}})})(jQuery);
1510 
1511var partnerProgram = (function () {
1512  return {
1513     lang: [],
1514      ARROWS_ENABLED: false,
1515      SCROLL_TABLE: null,
1516      TABLE_TO_SCROLL: null,
1517    init: async function () {
1518        await $.ajax({
1519          type: "POST",
1520          url: "ajaxrequest",
1521          data: {
1522            pluginHandler: "partners-program",
1523            actionerClass: "Pactioner",
1524            action: "getLang"
1525          },
1526          dataType: "json",
1527          cache: false,
1528          success: function(response) {
1529            partnerProgram.lang = response.data.lang;
1530            $.datepicker.setDefaults($.datepicker.regional[response.data.regional]);
1531          }
1532        });
1533       $('.partner-program-pagination').on('click', ' a', 
1534       function () {
1535        let activeTableName = 'orderTable';
1536        let activePageNum = $(this).text();
1537        let pagerCountRows = $('.count-items-dropdown').attr('data-count');
1538        $(this).parent().find('a').removeClass('current');
1539        $(this).parent().find('a').removeClass('active');
1540        $(this).addClass('current');
1541        $(this).addClass('active');
1542        if($('#table2').hasClass('active_table')){
1543          activeTableName = 'requestTable';
1544        }
1545        $.ajax({
1546          type: "POST",
1547          url: "ajaxrequest",
1548          data: {
1549            pluginHandler: "partners-program",
1550            actionerClass: "Pactioner",
1551            activeTableName: activeTableName,
1552            activePageNum: activePageNum,
1553            pagerCountRows: pagerCountRows,
1554            action: "getInfoFromPagination"
1555          },
1556          dataType: "json",
1557          cache: false,
1558          success: function (response) {
1559            if(activeTableName === 'orderTable'){
1560              $('.partner-orders-tbody').html(response.data.info);
1561              partnerProgram.totalToOrder();
1562              partnerProgram.actualizeChooseAllBtn();
1563            }
1564            else{
1565              $('.request-table-accordions').html(response.data.info);
1566              $('.accordion').accordion({heightStyle: "content" ,icons: false,active: false,autoHeight:false,collapsible:true});
1567            }
1568          }
1569        });
1570       });
1571     
1572      // При клике кнопку копирования ссылки она копируется в буфер
1573      $('.partner-promocode-btn').click(function() {
1574        partnerProgram.copyToClipboard($('.partner-promocode').val().toUpperCase());
1575        $(this).find('.copy-btn-icons .copy-icon-svg').hide();
1576        $(this).find('.copy-icon-svg').css('opacity','0');
1577        $(this).find('.check-icon-svg').css('opacity','1');
1578      });
1579          // При клике кнопку копирования ссылки она копируется в буфер
1580      $('.partner-link-btn').click(function() {
1581        partnerProgram.copyToClipboard($('.partner-link-public').val());
1582        $(this).find('.copy-btn-icons .copy-icon-svg').hide();
1583        $(this).find('.copy-icon-svg').css('opacity','0');
1584        $(this).find('.check-icon-svg').css('opacity','1');
1585      });
1586      $('.partner-program-balance-table-tab').on('click',
1587      function () {
1588        let activeFirstTable = true;
1589        if($(this).hasClass('historyRequest')){
1590          activeFirstTable = false;
1591        }
1592        let tableName = 'request';
1593        if (activeFirstTable) {
1594          tableName = 'order';
1595        }
1596        $.ajax({
1597          type: "POST",
1598          url: "ajaxrequest",
1599          data: {
1600            pluginHandler: "partners-program",
1601            actionerClass: "Pactioner",
1602            action: "setTable",
1603            table: tableName,
1604          }
1605        });
1606        if(activeFirstTable){
1607          $('.historyOrder').addClass('partner-program-balance-table-tab_active');
1608          $('.historyRequest').removeClass('partner-program-balance-table-tab_active');
1609          $('#table1').addClass('active_table');
1610          $('#table2').removeClass('active_table');
1611          $('#table1').css('display','block');
1612          $('#table2').css('display','none');
1613        }
1614        else{
1615          $('.historyRequest').addClass('partner-program-balance-table-tab_active');
1616          $('.historyOrder').removeClass('partner-program-balance-table-tab_active');
1617          $('#table2').addClass('active_table');
1618          $('#table1').removeClass('active_table');
1619          $('#table1').css('display','none');
1620          $('#table2').css('display','block');
1621        }
1622      });
1623      // Вызов модального окна при нажатии на кнопку изменения.
1624      $('.partner-orders-tbody tr[data-status!=3], .partner-orders-tbody tr[data-status!=4]').find('.action input').attr('disabled', 'disabled');
1625      $('.partner-orders-tbody tr[data-status=3], .partner-orders-tbody tr[data-status=4]').find('.action input').removeAttr('disabled');
1626      $('.partner-orders-tbody tr[data-status=3]').find('.action input').attr('checked', 'checked');
1627      $('.partner-orders-tbody tr[data-status=3]').find('.action input').attr('value', 'true');
1628      $('.partner-orders-tbody tr[data-status=4]').find('.action input').attr('checked', 'checked');
1629      $('.partner-orders-tbody tr[data-status=4]').find('.action input').attr('value', 'true');
1630      partnerProgram.actualizeChooseAllBtn();
1631      $(".partnerProgram .total-request").text('');
1632      partnerProgram.totalToOrder();
1633
1634      partnerProgram.scrollInit();
1635
1636      $('.partner-link-wrapper').on('click',  function () {
1637        $('.partner-link').select();
1638      });
1639      $('#partner-promocode-edit-button').on('click',  function () {
1640        $('#partner-promocode-edit-button').hide();
1641        $('#partner-promocode-save-button').show();
1642        $('.partner-promocode').select();
1643      });
1644      $('.partner-promocode').on('input', function() {
1645        $('#partner-promocode-edit-button').hide();
1646        $('#partner-promocode-save-button').show();
1647      });
1648      $('#partner-promocode-save-button').on('click', function() {
1649        const promo = $('input.partner-promocode').val();
1650        partnerProgram.savePromo(promo);
1651      });
1652      $('.accordion').accordion({heightStyle: "content" ,icons: false,active: false,autoHeight:false,collapsible:true});
1653
1654
1655
1656      var count = $('.count-items-dropdown').data('count');
1657      $('.count-items-dropdown option[value=' + count + ']').prop('selected', true);
1658
1659      $('.partnerProgram').on('change', '.count-items-dropdown', function () {
1660        var count = $(this).val();
1661        document.cookie = "countRowsPartnersProgram=" + count + "";
1662        location.reload();
1663      });
1664
1665      $('.action').on('click', 'input', function () {
1666        if ($(this).val() == 'true') {
1667          $(this).removeAttr('checked');
1668          $(this).attr('value', 'false');
1669        }
1670        else {
1671
1672          $(this).attr('value', 'true');
1673          $(this).attr('checked', 'checked');
1674        }
1675        partnerProgram.totalToOrder();
1676      });
1677      
1678      $('.chooseAll').on('click', 'input', function () {
1679        if ($(this).prop('checked') === false) {
1680          partnerProgram.actualizeChooseAllBtn(false);
1681        } else {
1682          partnerProgram.actualizeChooseAllBtn(true);
1683        }
1684        partnerProgram.totalToOrder();
1685      });
1686
1687
1688      $('.partner-orders-tbody').not('input[disabled=disabled]').on('change', 'input', function () {
1689        partnerProgram.actualizeChooseAllBtn();
1690        });
1691   
1692
1693      $('.partnerProgram').on('click', '.showFormOrderParnet', function () {
1694        $(this).addClass('partner-btn-disable');
1695        if ($(this).data('contract') == 0) {
1696          $('.partnerProgram .totalSum .error').show();
1697          $(this).show();
1698          return false;
1699        }
1700        else {
1701          partnerProgram.orderPartner();
1702        }
1703
1704      });
1705
1706      $('.partnerProgram').on('click', '.partner-bonus-btn', function () {
1707        $(this).addClass('partner-btn-disable');
1708        partnerProgram.convertToBonusPoints();
1709      });
1710      $('#becomePartner').on('click', function () {
1711        partnerProgram.newPartner();
1712        $(this).addClass('.btn_disable');
1713      });
1714    },
1715    translate: function ( elem, x, y ) {
1716      var left = parseInt( css( elem, 'left' ), 10 ),
1717          top = parseInt( css( elem, 'top' ), 10 ),
1718          dx = left - x,
1719          dy = top - y,
1720          i = 1,
1721          count = 20,
1722          delay = 20;
1723  
1724      function loop() {
1725          if ( i >= count ) { return; }
1726          i += 1;
1727          elem.style.left = ( left - ( dx * i / count ) ).toFixed( 0 ) + 'px';
1728          elem.style.top = ( top - ( dy * i / count ) ).toFixed( 0 ) + 'px';
1729          setTimeout( loop, delay );
1730      }
1731  
1732      loop();
1733    },
1734    
1735  
1736    css: function( element, property ) {
1737        return window.getComputedStyle( element, null ).getPropertyValue( property );
1738    },
1739      /**
1740       * Копирует в буфер обмена
1741       */
1742       copyToClipboard: function(textToCopy) {
1743       textToCopy = textToCopy.trim();
1744        // navigator clipboard api needs a secure context (https)
1745        if (navigator.clipboard && window.isSecureContext) {
1746          // navigator clipboard api method'
1747          return navigator.clipboard.writeText(textToCopy);
1748        } else {
1749          // text area method
1750          let textArea = document.createElement("textarea");
1751          textArea.value = textToCopy;
1752          // make the textarea out of viewport
1753          textArea.style.position = "fixed";
1754          textArea.style.left = "-999999px";
1755          textArea.style.top = "-999999px";
1756          document.body.appendChild(textArea);
1757          textArea.focus();
1758          textArea.select();
1759          return new Promise((res, rej) => {
1760              // here the magic happens
1761              document.execCommand('copy') ? res() : rej();
1762              textArea.remove();
1763          });
1764      }
1765    },
1766    // функционал для работы боковых стрелок скролла для больших таблиц
1767    showSideArrow: function() {
1768      $('.table-wrapper').each(function() {
1769        //Если таблица шире врапера
1770        if($(this).width() <= $(this).find('.table-with-arrow:visible').width()) {
1771          if($(this).scrollLeft() === 0) {
1772            $(this).find('.table-arrow-left').hide();
1773          } else {
1774            $(this).find('.table-arrow-left').show();
1775          }
1776          if($(this).width() - $(this).find('.table-with-arrow:visible').width() + $(this).scrollLeft() >= -1) {
1777            $(this).find('.table-arrow-right').hide();
1778          } else {
1779            $(this).find('.table-arrow-right').show();
1780          }
1781          //Добавляем оверфло
1782          $(this).removeClass('table-wrapper--overflow_visible');
1783          $(this).addClass('table-wrapper--overflow_auto');
1784          //Запоминаем, что стрелки показаны
1785          partnerProgram.ARROWS_ENABLED = true;
1786        } else {
1787          $(this).find('.table-arrow-left').hide();
1788          $(this).find('.table-arrow-right').hide();
1789          //Убираем оверфло
1790          $(this).removeClass('table-wrapper--overflow_auto');
1791          $(this).addClass('table-wrapper--overflow_visible');
1792          //Запоминаем, что стрелки убраны
1793          partnerProgram.ARROWS_ENABLED = false;
1794        }
1795      });
1796    },
1797    scrollTableRight: function() {
1798      oldPos = partnerProgram.TABLE_TO_SCROLL.scrollLeft()
1799      partnerProgram.TABLE_TO_SCROLL.scrollLeft(partnerProgram.TABLE_TO_SCROLL.scrollLeft()+10);
1800      newPos = partnerProgram.TABLE_TO_SCROLL.scrollLeft()
1801      if (oldPos == newPos) {
1802        clearInterval(partnerProgram.SCROLL_TABLE);
1803      }
1804    },
1805
1806    scrollTableLeft: function() {
1807      oldPos = partnerProgram.TABLE_TO_SCROLL.scrollLeft()
1808      partnerProgram.TABLE_TO_SCROLL.scrollLeft(partnerProgram.TABLE_TO_SCROLL.scrollLeft()-10);
1809      newPos = partnerProgram.TABLE_TO_SCROLL.scrollLeft()
1810      if (oldPos == newPos) {
1811        clearInterval(partnerProgram.SCROLL_TABLE);
1812      }
1813    },
1814
1815    scrollEventInit: function() {
1816      $('.table-wrapper').scroll(function() {
1817        partnerProgram.showSideArrow();
1818      });
1819
1820      // для скролла вправо
1821      $('.table-arrow-right').hover(function() {
1822        partnerProgram.TABLE_TO_SCROLL = $(this).parents('.table-wrapper');
1823        clearInterval(partnerProgram.SCROLL_TABLE);
1824        partnerProgram.SCROLL_TABLE = setInterval(function() {
1825          partnerProgram.scrollTableRight();
1826        },20);
1827      },function() {
1828        clearInterval(partnerProgram.SCROLL_TABLE);
1829      });
1830      // для скролла влево
1831      $('.table-arrow-left').hover(function() {
1832        partnerProgram.TABLE_TO_SCROLL = $(this).parents('.table-wrapper');
1833        clearInterval(partnerProgram.SCROLL_TABLE);
1834        partnerProgram.SCROLL_TABLE = setInterval(function() {
1835          partnerProgram.scrollTableLeft();
1836        },20);
1837      },function() {
1838        clearInterval(partnerProgram.SCROLL_TABLE);
1839      });
1840    },
1841    scrollTableLeft: function() {
1842      oldPos = partnerProgram.TABLE_TO_SCROLL.scrollLeft()
1843      partnerProgram.TABLE_TO_SCROLL.scrollLeft(partnerProgram.TABLE_TO_SCROLL.scrollLeft()-10);
1844      newPos = partnerProgram.TABLE_TO_SCROLL.scrollLeft()
1845      if (oldPos == newPos) {
1846        clearInterval(partnerProgram.SCROLL_TABLE);
1847      }
1848    },
1849    scrollInit: function() {
1850      $('.table-arrow-left, .table-arrow-right').detach();
1851      partnerProgram.addScrollArrow();
1852      partnerProgram.showSideArrow();
1853      partnerProgram.scrollEventInit();
1854    },
1855    addScrollArrow: function() {
1856      $('.table-wrapper').each(function() {
1857        if($(this).parents('.reveal-overlay').html() == undefined) {
1858          // if($(this).find('.table-arrow-left').html() == undefined) {
1859          $(this).append('<div class="table-arrow-left table-arrow" style="display:none;"><i class="fa fa-chevron-left" aria-hidden="true"></i></div>\
1860                            <div class="table-arrow-right table-arrow" style="display:none;"><i class="fa fa-chevron-right" aria-hidden="true"></i></div>');
1861          // }
1862          partnerProgram.initTableArrows()
1863        }
1864      });
1865
1866      $(window).resize(function() {
1867        partnerProgram.showSideArrow();
1868      });
1869    },
1870     //Стрелки скролла таблиц
1871     initTableArrows: function() {
1872
1873      $(window).scroll(function() {
1874        if (partnerProgram.ARROWS_ENABLED) {
1875          scrolling();
1876        }
1877      });
1878
1879      $(window).resize(function() {
1880        scrolling();
1881      });
1882
1883      scrolling();
1884
1885      function scrolling() {
1886        if ($('.table-with-arrow:visible tbody tr:first-child').length > 0) {
1887          $('.table-arrow').addClass('table-arrow--fixed')
1888          var windowHeight = $(window).height();
1889          var scrollTop = $(window).scrollTop();
1890          var offsetTop = $('.table-with-arrow:visible tbody tr:first-child').offset().top;
1891          var offsetHeight = $('.table-with-arrow:visible tbody tr:first-child')[0].offsetHeight;
1892          var offsetWidth = $('.table-with-arrow:visible tbody tr:first-child')[0].offsetWidth;
1893
1894
1895          var top = offsetTop - scrollTop;
1896          top = top < offsetTop-100 ? '50%' : top;
1897
1898          var bottom = (scrollTop + windowHeight) - (offsetHeight + offsetTop);
1899          bottom = bottom < 0 ? 0 : bottom;
1900
1901          $('.table-arrow').css('top', top);
1902          $('.table-arrow').css('bottom', bottom);
1903        }
1904      }
1905    },
1906     /**
1907     * актуализирует состояние главного чекбокса
1908     */
1909    actualizeChooseAllBtn:   function (state = null) {
1910        //если передано определенное состояние то включаем или выключаем все чекбоксы
1911        if (state === false) {
1912          $('.partner-orders-tbody').find('input').not('input[disabled=disabled]').removeAttr('checked');
1913          $('.partner-orders-tbody').find('input').not('input[disabled=disabled]').prop('checked', false);
1914          $('.partner-orders-tbody').find('input').not('input[disabled=disabled]').prop('value', 'false');
1915        }
1915 if(state === true) {
1916          $('.partner-orders-tbody').find('input').not('input[disabled=disabled]').prop('value', 'true');
1917          $('.partner-orders-tbody').find('input').not('input[disabled=disabled]').prop('checked', true);
1918        }
1919           //если все чек боксы отключены то отклоючаем главный
1920          if($('.partner-orders-tbody').find('input').not('input[disabled=disabled]').length === 0){
1921            $('.chooseAll').find('input').prop('checked', false);
1922            $('.chooseAll').find('input').prop('disabled', 'disabled');
1923            $('.chooseAll').find('input').removeAttr('checked');
1924          } else {
1925            $('.chooseAll').find('input').prop('checked', true);
1926            $('.chooseAll').find('input').removeAttr('disabled');
1927          }
1928          //если все чек боксы выбраны, автоматом выбираем главный и наоборот 
1929          let checkedInputsCount = $('.partner-orders-tbody').find('input[value=true]').not('input[disabled=disabled]').length;
1930          let uncheckedInputsCount = $('.partner-orders-tbody').find('input[value=false]').not('input[disabled=disabled]').length;
1931          let inputsCount =  $('.partner-orders-tbody').find('input').not('input[disabled=disabled]').length;
1932          if(checkedInputsCount === inputsCount){
1933            $('.chooseAll').find('input').prop('checked', true);
1934            $('.chooseAll').find('input').prop('value', 'true');
1935          }
1936          else{
1937            $('.chooseAll').find('input').removeAttr('checked');
1938            $('.chooseAll').find('input').prop('checked', false);
1939            $('.chooseAll').find('input').prop('value', 'false');
1940          }
1941          
1942    },
1943    /**
1944     * Пересчитывает сумму запрошенной выплаты
1945     */
1946    totalToOrder: function () {
1947      var sum = 0;
1948      var min = $('.partnerProgram .totalSum').attr('data-min');
1949      var bonusMin = $('.partnerProgram .totalSum').attr('data-bonus-min');
1950
1951      $('.partner-orders-tbody ').find('tr[data-status=4] .action input').each(function () {
1952        $(this).prop('checked',false);
1953        $(this).prop('disabled','disabled');
1954      });
1955      $('.partner-orders-tbody').find('tr[data-status=0] .action input').each(function () {
1956        $(this).prop('checked',false);
1957        $(this).prop('disabled','disabled');
1958      });
1959      $('.partner-orders-tbody tr[data-status=3]').find('.action input:checked').each(function () {
1960        sum += parseFloat($(this).attr('data-summa'));
1961      });
1962
1963      
1964      
1965      $('.partnerProgram .total-request').text(partnerProgram.numberFormat(sum));
1966      $('.partnerProgram .total-request').attr('data-total', sum);
1967      if (sum < min) {
1968        $('.partner-program-action-btn.showFormOrderParnet').addClass('partner-btn-disable');
1969        $('.partner-program-action-btn.showFormOrderParnet').prop('disabled','true');
1970      }
1971      else {
1972        $('.partner-program-action-btn.showFormOrderParnet').removeClass('partner-btn-disable');
1973        $('.partner-program-action-btn.showFormOrderParnet').prop('disabled','false');
1974        $('.partner-program-action-btn.showFormOrderParnet').removeAttr('disabled');
1975      }
1976      if (sum < bonusMin) {
1977        $('.partner-program-action-btn.partner-bonus-btn').addClass('partner-btn-disable');
1978        $('.partner-program-action-btn.partner-bonus-btn').prop('disabled','true');
1979      }
1980      else {
1981        $('.partner-program-action-btn.partner-bonus-btn').removeClass('partner-btn-disable');
1982        $('.partner-program-action-btn.partner-bonus-btn').prop('disabled','false');
1983        $('.partner-program-action-btn.partner-bonus-btn').removeAttr('disabled');
1984      }
1985      return true;
1986    },
1987    orderPartner: function () {
1988      let arrOrdersIds = [];
1989      $('.partner-orders-tbody tr[data-status=3]').find('.action input:checked').each(function () {
1990        arrOrdersIds.push($(this).parent().parent().attr('id'));
1991      });
1992      $.ajax({
1993        type: "POST",
1994        url: "ajaxrequest",
1995        data: {
1996          pluginHandler: "partners-program",
1997          actionerClass: "Partner",
1998          action: "sendOrderToPayment",
1999          arrOrdersIds: arrOrdersIds
2000        },
2001        dataType: "json",
2002        cache: false,
2003        success: function (response) {
2004          if (!response.data.error) {
2005            let currency = $(".showFormOrderParnet").attr('data-currency');
2006            $('.totalSum').after("<div class=\"request-accept-notification\">\
2007              Заявка на выплату <b>" + partnerProgram.numberFormat(response.data.summ) + " " + currency + "</b>\
2008              принята, наши менеджеры свяжутся с Вами</div>");
2009
2010            $('.partner-orders-tbody tr').find('.action input:checked').each(function () {
2011              $(this).parent().parent().attr('data-status', 2);
2012            });
2013            $('.partner-orders-tbody tr[data-status=3]').find('.status').html(partnerProgram.lang.REQUEST_SENTED);
2014            $('.partner-orders-tbody tr[data-status=3]').find('.action input').attr('disabled', 'disabled');
2015            partnerProgram.actualizeChooseAllBtn();
2016            partnerProgram.totalToOrder();
2017            var tr = '\
2018                <tr id="' + response.data.id + '" >\
2019                <td class="dateRequest">' + response.data.date_add + '</td>\
2020                <td class="summRequest">' + summ + ' ' + currency + '</td>\
2021                <td class="statusRequest">' + partnerProgram.lang.REQUEST_SENTED + '</td>\
2022                <td class="comment"></td> \
2023                <td></td>\
2024              </tr>';
2025            if ($('.partner-request-tbody tr').length > 0) {
2026              $('.partner-request-tbody tr:first').before(tr);
2027            } else {
2028              $('.partner-request-tbody').append(tr);
2029            }
2030          }
2031          else {
2032            $('.partnerProgram .totalSum').after('<p>' + response.data.error + '</p>');
2033          }
2034        },
2035      });
2036    },
2037
2038    convertToBonusPoints: function () {
2039      let arrOrdersIds = [];
2040      $('.partner-orders-tbody tr[data-status=3]').find('.action input:checked').each(function () {
2041        arrOrdersIds.push($(this).parent().parent().attr('id'));
2042      });
2043      $.ajax({
2044        type: "POST",
2045        url: "ajaxrequest",
2046        data: {
2047          pluginHandler: "partners-program",
2048          actionerClass: "Partner",
2049          action: "convertToBonusPoints",
2050          arrOrdersIds: arrOrdersIds
2051        },
2052        dataType: "json",
2053        cache: false,
2054        success: function (response) {
2055          if (!response.data.error) {
2056            let bonusDeclinationArray = [
2057              partnerProgram.lang.BONUS_BONUS,
2058              partnerProgram.lang.BONUS_BONUSA,
2059              partnerProgram.lang.BONUS_BONUSES];
2060            let balance = partnerProgram.wordDeclination(response.data.bonus_balance,bonusDeclinationArray);
2061            let updateSum = partnerProgram.wordDeclination(response.data.summ,bonusDeclinationArray);
2062
2063            $('.partner-bonus-error').remove();
2064            $('.showFormOrderParnet').addClass('partner-btn-disable');
2065            $('.showFormOrderParnet').prop('disabled','true');
2066            $('.totalSum').after("<div class=\"request-accept-notification\">\
2067              " + updateSum + "</b>\
2068             "+ partnerProgram.lang.BONUS_ADDED + "</div>");
2069
2070            $('.partner-orders-tbody tr').find('.action input:checked').each(function () {
2071              $(this).parent().parent().attr('data-status', 5);
2072            });
2073
2074            $('.partner-program-table-order tr[data-status=5]').find('.status').html(partnerProgram.lang.ORDER_STATUS_IN_BONUS);
2075            $('.partner-program-table-order tr[data-status=5]').find('.action input').attr('disabled', 'disabled');
2076
2077            
2078            $('.bonus-into-wrapper').html(partnerProgram.lang.ON_YOUR_ACCOUNT + ' ' + balance);
2079            $('.pay-bonus').find('strong span:first-child').html(response.data.bonus_balance);
2080            partnerProgram.actualizeChooseAllBtn(); 
2081            partnerProgram.totalToOrder();
2082          }
2083          else {
2084            $('.partner-bonus-error').remove();
2085            $('.partnerProgram .totalSum').after('<div class="partner-bonus-error">' + response.data.error + '</div>');
2086          }
2087        },
2088      });
2089    },
2090
2091    newPartner: function () {
2092      $.ajax({
2093        type: "POST",
2094        url: "ajaxrequest",
2095        data: {
2096          pluginHandler: "partners-program",
2097          actionerClass: "Partner",
2098          action: "becomePartner"
2099        },
2100        dataType: "json",
2101        cache: false,
2102        success: function (response) {
2103          location.reload();
2104        }
2105      });
2106    },
2107    wordDeclination: function (declinatedValue, words) {
2108      value = Math.abs(declinatedValue) % 100; 
2109      var num = value % 10;
2110      if(value > 10 && value < 20) return declinatedValue + ' ' + words[2]; 
2111      if(num > 1 && num < 5) return declinatedValue + ' ' + words[1];
2112      if(num == 1) return declinatedValue + ' ' + words[0]; 
2113      return declinatedValue + ' ' + words[2];
2114    },
2115    numberFormat: function (str) {
2116      return partnerProgram.number_format(str, 2, ',', ' ');
2117    },
2118    // форматирует строку в соответствии с форматом
2119    number_format: function (number, decimals, dec_point, thousands_sep) {	
2120      // Format a number with grouped thousands
2121
2122      var i, j, kw, kd, km;
2123
2124      if (isNaN(decimals = Math.abs(decimals))) {
2125        decimals = 2;
2126      }
2127      if (dec_point == undefined) {
2128        dec_point = ",";
2129      }
2130      if (thousands_sep == undefined) {
2131        thousands_sep = ".";
2132      }
2133
2134      i = parseInt(number = (+number || 0).toFixed(decimals)) + "";
2135
2136      if ((j = i.length) > 3) {
2137        j = j % 3;
2138      } else {
2139        j = 0;
2140      }
2141
2142      km = (j ? i.substr(0, j) + thousands_sep : "");
2143      kw = i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands_sep);
2144
2145      kd = (decimals ? dec_point + Math.abs(number - i).toFixed(decimals).replace(/-/, 0).slice(2) : "");
2146
2147
2148      return km + kw + kd;
2149    },
2150    savePromo: function(promo) {
2151      $('.promo-message').hide();
2152      $.ajax({
2153        type: "POST",
2154        url: "ajaxrequest",
2155        data: {
2156          pluginHandler: "partners-program",
2157          actionerClass: "Pactioner",
2158          action: "savePromo",
2159          promo: promo
2160        },
2161        dataType: "json",
2162        cache: false,
2163        success: function (response) {
2164          if (response.status && response.status === 'success') {
2165            $('#partner-promocode-save-button').hide();
2166            $('#partner-promocode-edit-button').hide();
2167            $('#partner-promocode-saved').show();
2168            setTimeout(function() {
2169              $('#partner-promocode-edit-button').show();
2170              $('#partner-promocode-saved').hide();
2171            }, 2000);
2172            return;
2173          }
2174          let message = 'Неизвестная ошибка';
2175          if (response.msg) {
2176            message = response.msg;
2177          }
2178          $('.promo-message').html(message);
2179          $('.promo-message').show();
2180        },
2181        error: function() {
2182          $('.promo-message').html('Неизвестная ошибка');
2183          $('.promo-message').show();
2184        }
2185      });
2186    }
2187  }
2188
2189})();
2190$(document).ready(function () {
2191// инициализациямодуля при подключении
2192  partnerProgram.init();
2193}); 
2194$(document).ready(function() {
2195    $('.p4-subscribe [type="button"]').on('click', function() {
2196        var data = $(this).closest('form').serialize();
2197        $.ajax({
2198            url: mgBaseDir + '/ajaxrequest',
2199            method: 'POST',
2200            dataType: 'json',
2201            async: true,
2202            data: {
2203                pluginHandler: 'p4-subscribe',
2204                actionerClass: 'Pactioner',
2205                action: 'subscribe',
2206                data: data,
2207            },
2208            success: function(response) {
2209                var data = response.data;
2210
2211                if (data.error != '') {
2212                    $('.p4-subscribe .message').html(data.error).css('color', '#f00');
2213                } else {
2214                    $('.p4-subscribe .message').html(data.message).css('color', '#1E824C');
2215                    $('[name="p4-subscribe"]').get(0).reset();
2216                }
2217
2218                setTimeout(function() {
2219                    $('.p4-subscribe .message').html('').css('color', '#000');
2220                }, 5000);
2221            }
2222        });
2223    });
2224}); 
2225/*! RateIt | v1.0.22 / 05/27/2014 | https://rateit.codeplex.com/license
2226    http://rateit.codeplex.com | Twitter: @gjunge
2227*/
2228(function ($) {
2229    $.rateit = {
2230        aria: {
2231            resetLabel: 'reset rating',
2232            ratingLabel: 'rating'
2233        }
2234    };
2235
2236    $.fn.rateit = function (p1, p2) {
2237        //quick way out.
2238        var index = 1;
2239        var options = {}; var mode = 'init';
2240        var capitaliseFirstLetter = function (string) {
2241            return string.charAt(0).toUpperCase() + string.substr(1);
2242        };
2243
2244        if (this.length === 0) { return this; }
2245
2246
2247        var tp1 = $.type(p1);
2248        if (tp1 == 'object' || p1 === undefined || p1 === null) {
2249            options = $.extend({}, $.fn.rateit.defaults, p1); //wants to init new rateit plugin(s).
2250        }
2251        else if (tp1 == 'string' && p1 !== 'reset' && p2 === undefined) {
2252            return this.data('rateit' + capitaliseFirstLetter(p1)); //wants to get a value.
2253        }
2254        else if (tp1 == 'string') {
2255            mode = 'setvalue';
2256        }
2257
2258        return this.each(function () {
2259            var item = $(this);
2260
2261
2262            //shorten all the item.data('rateit-XXX'), will save space in closure compiler, will be like item.data('XXX') will become x('XXX')
2263            var itemdata = function (key, value) {
2264
2265                if (value != null) {
2266                    //update aria values
2267                    var ariakey = 'aria-value' + ((key == 'value') ? 'now' : key);
2268                    var range = item.find('.rateit-range');
2269                    if (range.attr(ariakey) != undefined) {
2270                        range.attr(ariakey, value);
2271                    }
2272
2273                }
2274
2275                arguments[0] = 'rateit' + capitaliseFirstLetter(key);
2276                return item.data.apply(item, arguments); ////Fix for WI: 523
2277            };
2278
2279            //handle programmatic reset
2280            if (p1 == 'reset') {
2281                var setup = itemdata('init'); //get initial value
2282                for (var prop in setup) {
2283                    item.data(prop, setup[prop]);
2284                }
2285
2286                if (itemdata('backingfld')) { //reset also backingfield
2287                    var fld = $(itemdata('backingfld'));
2288                    fld.val(itemdata('value'));
2289                    fld.trigger('change');
2290                    if (fld[0].min) { fld[0].min = itemdata('min'); }
2291                    if (fld[0].max) { fld[0].max = itemdata('max'); }
2292                    if (fld[0].step) { fld[0].step = itemdata('step'); }
2293                }
2294                item.trigger('reset');
2295            }
2296
2297            //add the rate it class.
2298            if (!item.hasClass('rateit')) { item.addClass('rateit'); }
2299
2300            var ltr = item.css('direction') != 'rtl';
2301
2302            // set value mode
2303            if (mode == 'setvalue') {
2304                if (!itemdata('init')) { throw 'Can\'t set value before init'; }
2305
2306
2307                //if readonly now and it wasn't readonly, remove the eventhandlers.
2308                if (p1 == 'readonly' && p2 == true && !itemdata('readonly')) {
2309                    item.find('.rateit-range').unbind();
2310                    itemdata('wired', false);
2311                }
2312                //when we receive a null value, reset the score to its min value.
2313                if (p1 == 'value') {
2314                    p2 = (p2 == null) ? itemdata('min') : Math.max(itemdata('min'), Math.min(itemdata('max'), p2));
2315                }
2316                if (itemdata('backingfld')) {
2317                    //if we have a backing field, check which fields we should update. 
2318                    //In case of input[type=range], although we did read its attributes even in browsers that don't support it (using fld.attr())
2319                    //we only update it in browser that support it (&& fld[0].min only works in supporting browsers), not only does it save us from checking if it is range input type, it also is unnecessary.
2320                    var fld = $(itemdata('backingfld'));
2321                    if (p1 == 'value') { fld.val(p2); }
2322                    if (p1 == 'min' && fld[0].min) { fld[0].min = p2; }
2323                    if (p1 == 'max' && fld[0].max) { fld[0].max = p2;}
2324                    if (p1 == 'step' && fld[0].step) { fld[0].step = p2; }
2325                }
2326
2327                itemdata(p1, p2);
2328            }
2329
2330            //init rateit plugin
2331            if (!itemdata('init')) {
2332
2333                //get our values, either from the data-* html5 attribute or from the options.
2334                itemdata('min', isNaN(itemdata('min')) ? options.min : itemdata('min'));
2335                itemdata('max', isNaN(itemdata('max')) ? options.max : itemdata('max'));
2336                itemdata('step', itemdata('step') || options.step);
2337                itemdata('readonly', itemdata('readonly') !== undefined ? itemdata('readonly') : options.readonly);
2338                itemdata('resetable', itemdata('resetable') !== undefined ? itemdata('resetable') : options.resetable);
2339                itemdata('backingfld', itemdata('backingfld') || options.backingfld);
2340                itemdata('starwidth', itemdata('starwidth') || options.starwidth);
2341                itemdata('starheight', itemdata('starheight') || options.starheight);
2342                itemdata('value', Math.max(itemdata('min'), Math.min(itemdata('max'), (!isNaN(itemdata('value')) ? itemdata('value') : (!isNaN(options.value) ? options.value : options.min)))));
2343                itemdata('ispreset', itemdata('ispreset') !== undefined ? itemdata('ispreset') : options.ispreset);
2344                //are we LTR or RTL?
2345
2346                if (itemdata('backingfld')) {
2347                    //if we have a backing field, hide it, override defaults if range or select.
2348                    var fld = $(itemdata('backingfld')).hide();
2349
2350                    if (fld.attr('disabled') || fld.attr('readonly')) {
2351                        itemdata('readonly', true); //http://rateit.codeplex.com/discussions/362055 , if a backing field is disabled or readonly at instantiation, make rateit readonly.
2352                    }
2353
2354                    if (fld[0].nodeName == 'INPUT') {
2355                        if (fld[0].type == 'range' || fld[0].type == 'text') { //in browsers not support the range type, it defaults to text
2356
2357                            itemdata('min', parseInt(fld.attr('min')) || itemdata('min')); //if we would have done fld[0].min it wouldn't have worked in browsers not supporting the range type.
2358                            itemdata('max', parseInt(fld.attr('max')) || itemdata('max'));
2359                            itemdata('step', parseInt(fld.attr('step')) || itemdata('step'));
2360                        }
2361                    }
2362                    if (fld[0].nodeName == 'SELECT' && fld[0].options.length > 1) {
2363                        itemdata('min', (!isNaN(itemdata('min')) ? itemdata('min') : Number(fld[0].options[0].value)));
2364                        itemdata('max', Number(fld[0].options[fld[0].length - 1].value));
2365                        itemdata('step', Number(fld[0].options[1].value) - Number(fld[0].options[0].value));
2366                        //see if we have a option that as explicity been selected
2367                        var selectedOption = fld.find('option[selected]');
2368                        if (selectedOption.length == 1) {
2369                            itemdata('value', selectedOption.val());
2370                        }
2371                    }
2372                    else {
2373                        //if it is not a select box, we can get's it's value using the val function. 
2374                        //If it is a selectbox, we always get a value (the first one of the list), even if it was not explicity set.
2375                        itemdata('value', fld.val());
2376                    }
2377                }
2378
2379                //Create the necessary tags. For ARIA purposes we need to give the items an ID. So we use an internal index to create unique ids
2380                var element = item[0].nodeName == 'DIV' ? 'div' : 'span';
2381                index++;
2382                var html = '<button id="rateit-reset-{{index}}" type="button" data-role="none" class="rateit-reset" aria-label="' + $.rateit.aria.resetLabel + '" aria-controls="rateit-range-{{index}}"></button><{{element}} id="rateit-range-{{index}}" class="rateit-range" tabindex="0" role="slider" aria-label="' + $.rateit.aria.ratingLabel + '" aria-owns="rateit-reset-{{index}}" aria-valuemin="' + itemdata('min') + '" aria-valuemax="' + itemdata('max') + '" aria-valuenow="' + itemdata('value') + '"><{{element}} class="rateit-selected" style="height:' + itemdata('starheight') + 'px"></{{element}}><{{element}} class="rateit-hover" style="height:' + itemdata('starheight') + 'px"></{{element}}></{{element}}>';
2383                item.append(html.replace(/{{index}}/gi, index).replace(/{{element}}/gi, element));
2384
2385                //if we are in RTL mode, we have to change the float of the "reset button"
2386                if (!ltr) {
2387                    item.find('.rateit-reset').css('float', 'right');
2388                    item.find('.rateit-selected').addClass('rateit-selected-rtl');
2389                    item.find('.rateit-hover').addClass('rateit-hover-rtl');
2390                }
2391
2392                itemdata('init', JSON.parse(JSON.stringify(item.data()))); //cheap way to create a clone
2393            }
2394            //resize the height of all elements, 
2395            item.find('.rateit-selected, .rateit-hover').height(itemdata('starheight'));
2396
2397            //set the range element to fit all the stars.
2398            var range = item.find('.rateit-range');
2399            range.width(itemdata('starwidth') * (itemdata('max') - itemdata('min'))).height(itemdata('starheight'));
2400
2401
2402            //add/remove the preset class
2403            var presetclass = 'rateit-preset' + ((ltr) ? '' : '-rtl');
2404            if (itemdata('ispreset')) {
2405                item.find('.rateit-selected').addClass(presetclass);
2406            }
2407            else {
2408                item.find('.rateit-selected').removeClass(presetclass);
2409            }
2410
2411            //set the value if we have it.
2412            if (itemdata('value') != null) {
2413                var score = (itemdata('value') - itemdata('min')) * itemdata('starwidth');
2414                item.find('.rateit-selected').width(score);
2415            }
2416
2417            //setup the reset button
2418            var resetbtn = item.find('.rateit-reset');
2419            if (resetbtn.data('wired') !== true) {
2420                resetbtn.bind('click', function (e) {
2421                    e.preventDefault();
2422
2423                    resetbtn.blur();
2424
2425                    var event = $.Event('beforereset');
2426                    item.trigger(event);
2427                    if (event.isDefaultPrevented()) {
2428                        return false;
2429                    }
2430
2431                    item.rateit('value', null);
2432                    item.trigger('reset');
2433                }).data('wired', true);
2434
2435            }
2436
2437            //this function calculates the score based on the current position of the mouse.
2438            var calcRawScore = function (element, event) {
2439                var pageX = (event.changedTouches) ? event.changedTouches[0].pageX : event.pageX;
2440
2441                var offsetx = pageX - $(element).offset().left;
2442                if (!ltr) { offsetx = range.width() - offsetx };
2443                if (offsetx > range.width()) { offsetx = range.width(); }
2444                if (offsetx < 0) { offsetx = 0; }
2445
2446                return score = Math.ceil(offsetx / itemdata('starwidth') * (1 / itemdata('step')));
2447            };
2448
2449            //sets the hover element based on the score.
2450            var setHover = function (score) {
2451                var w = score * itemdata('starwidth') * itemdata('step');
2452                var h = range.find('.rateit-hover');
2453                if (h.data('width') != w) {
2454                    range.find('.rateit-selected').hide();
2455                    h.width(w).show().data('width', w);
2456                    var data = [(score * itemdata('step')) + itemdata('min')];
2457                    item.trigger('hover', data).trigger('over', data);
2458                }
2459            };
2460
2461            var setSelection = function (value) {
2462                var event = $.Event('beforerated');
2463                item.trigger(event, [value]);
2464                if (event.isDefaultPrevented()) {
2465                    return false;
2466                }
2467
2468                itemdata('value', value);
2469                if (itemdata('backingfld')) {
2470                    $(itemdata('backingfld')).val(value).trigger('change');
2471                }
2472                if (itemdata('ispreset')) { //if it was a preset value, unset that.
2473                    range.find('.rateit-selected').removeClass(presetclass);
2474                    itemdata('ispreset', false);
2475                }
2476                range.find('.rateit-hover').hide();
2477                range.find('.rateit-selected').width(value * itemdata('starwidth') - (itemdata('min') * itemdata('starwidth'))).show();
2478                item.trigger('hover', [null]).trigger('over', [null]).trigger('rated', [value]);
2479                return true;
2480            };
2481
2482            if (!itemdata('readonly')) {
2483                //if we are not read only, add all the events
2484
2485                //if we have a reset button, set the event handler.
2486                if (!itemdata('resetable')) {
2487                    resetbtn.hide();
2488                }
2489
2490                //when the mouse goes over the range element, we set the "hover" stars.
2491                if (!itemdata('wired')) {
2492                    range.bind('touchmove touchend', touchHandler); //bind touch events
2493                    range.mousemove(function (e) {
2494                        var score = calcRawScore(this, e);
2495                        setHover(score);
2496                    });
2497                    //when the mouse leaves the range, we have to hide the hover stars, and show the current value.
2498                    range.mouseleave(function (e) {
2499                        range.find('.rateit-hover').hide().width(0).data('width', '');
2500                        item.trigger('hover', [null]).trigger('over', [null]);
2501                        range.find('.rateit-selected').show();
2502                    });
2503                    //when we click on the range, we have to set the value, hide the hover.
2504                    range.mouseup(function (e) {
2505                        var score = calcRawScore(this, e);
2506                        var value = (score * itemdata('step')) + itemdata('min');
2507                        setSelection(value);
2508                        range.blur();
2509                    });
2510
2511                    //support key nav
2512                    range.keyup(function (e) {
2513                        if (e.which == 38 || e.which == (ltr ? 39 : 37)) {
2514                            setSelection(Math.min(itemdata('value') + itemdata('step'), itemdata('max')));
2515                        }
2516                        if (e.which == 40 || e.which == (ltr ? 37 : 39)) {
2517                            setSelection(Math.max(itemdata('value') - itemdata('step'), itemdata('min')));
2518                        }
2519                    });
2520
2521                    itemdata('wired', true);
2522                }
2523                if (itemdata('resetable')) {
2524                    resetbtn.show();
2525                }
2526            }
2527            else {
2528                resetbtn.hide();
2529            }
2530
2531            range.attr('aria-readonly', itemdata('readonly'));
2532        });
2533    };
2534
2535    //touch converter http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/
2536    function touchHandler(event) {
2537
2538        var touches = event.originalEvent.changedTouches,
2539                first = touches[0],
2540                type = "";
2541        switch (event.type) {
2542            case "touchmove": type = "mousemove"; break;
2543            case "touchend": type = "mouseup"; break;
2544            default: return;
2545        }
2546
2547        var simulatedEvent = document.createEvent("MouseEvent");
2548        simulatedEvent.initMouseEvent(type, true, true, window, 1,
2549                              first.screenX, first.screenY,
2550                              first.clientX, first.clientY, false,
2551                              false, false, false, 0/*left*/, null);
2552
2553        first.target.dispatchEvent(simulatedEvent);
2554        event.preventDefault();
2555    };
2556
2557    //some default values.
2558    $.fn.rateit.defaults = { min: 0, max: 5, step: 0.5, starwidth: 16, starheight: 16, readonly: false, resetable: false, ispreset: false };
2559
2560    
2561
2562})(jQuery); 
2563(function($) {
2564  window.initProductCommentRating = function() {
2565    $(".rateit").rateit();
2566  }
2567  $(document).ready(function() {
2568    initProductCommentRating();
2569  })
2570})(jQuery);  
2571var mgTimerSale = (function() {
2572  return {
2573    init: function() {
2574      $('.mg-timer-sale').each(function(){
2575      if ($(this).data('time-finish')) {
2576        mgTimerSale.timer(this,$(this).data('time-finish'));
2577      }
2578    })
2579  },
2580  timer: function(item, times) {
2581    var clock = times.trim();
2582    var time = clock, hours;    
2583    var hour = 0;
2584    var min = 0;
2585    var sec = 0;
2586    if (clock.indexOf(' ') > 0) {
2587      time = clock.split(' ');
2588      hours = time[1].split(':');
2589      hour = hours[0] ? hours[0] : 0;
2590      min = hours[1] ? hours[1] : 0;
2591      sec = hours[2] ? hours[2] : 0;
2592      time = time[0];
2593    }
2594    var until = time.split('.');
2595    var date = new Date(until[2], (parseInt(until[1], 10)-1), until[0], hour, min, sec);
2596    $(item).countdown({until: date,
2597    layout: '<div class="number-wrap"><span>{dl}</span><div class="number">{d10}{d1}</div></div>' +
2598        ' <div class="number-wrap"><span>Час</span><div class="number">{h10}{h1}</div></div> ' +
2599        '<div class="number-wrap"><span>Мин</span><div class="number">{m10}{m1}</div></div> ' +
2600        '<div class="number-wrap"><span>Сек</span><div class="number last">{s10}
2600{s1}</div></div> '});
2601  }
2602}
2603})();
2604
2605var initMgTimerSale = function() {
2606  mgTimerSale.init();
2607};
2608
2609var countDiscont = function() {
2610  const productWrappers = $('.timer-sale-block').closest('.product-wrapper')
2611
2612  if (productWrappers.length == 0) return;
2613  productWrappers.each((index, productWrapper) => {
2614
2615    const priceBox = $(productWrapper).find('.price-box');
2616    if (priceBox.length == 0) return;
2617    let saleBlock = $(productWrapper).find('.timer-sale-block .percent');
2618    let currentPrice = parseFloat(priceBox.find('.price').text().trim().replace(' ', ''));
2619    let oldPriceElem = priceBox.find('.old');
2620    let oldPrice = parseFloat(oldPriceElem.text().trim().replace(' ', ''));
2621    if (currentPrice != 0 && oldPrice > currentPrice) {
2622      let sale = (oldPrice - currentPrice) / oldPrice * 100;
2623      saleBlock.text(Math.round(sale) + '%');
2624    }
2625    if ('MutationObserver' in window) {
2626    
2627
2628      //Для инициализации плагина на элементах подключаемых динамически
2629      if ($(priceBox).length > 0) {
2630        
2631        var target = priceBox[0];
2632    
2633        // Конфигурация observer (за какими изменениями наблюдать)
2634        const config = {
2635            attributes: true,
2636            childList: true,
2637            subtree: true,
2638        };
2639      
2640        // Колбэк-функция при срабатывании мутации
2641        const callback = function (mutationsList, observer) {
2642          saleBlock = $(productWrapper).find('.timer-sale-block .percent');
2643          currentPrice = parseFloat(priceBox.find('.price').text().trim().replace(' ', ''));
2644          oldPriceElem = priceBox.find('.old');
2645          oldPrice = parseFloat(oldPriceElem.text().trim().replace(' ', ''));
2646          if (currentPrice != 0 && oldPrice > currentPrice) {
2647            sale = (oldPrice - currentPrice) / oldPrice * 100;
2648            saleBlock.text(Math.round(sale) + '%');
2649          }
2650        };
2651      
2652        // Создаём экземпляр наблюдателя с указанной функцией колбэка
2653        const observer = new MutationObserver(callback);
2654        // Начинаем наблюдение за настроенными изменениями целевого элемента
2655        observer.observe(target, config);
2656      }
2657    }
2658  });
2659}
2660
2661$(document).ready(function() {
2662  initMgTimerSale();
2663  countDiscont()
2664}); 
2665/** Abstract base class for collection plugins v1.0.1.
2666	Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
2667	Licensed under the MIT (http://keith-wood.name/licence.html) license. */
2668(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery); 
2669/*! http://keith-wood.name/countdown.html
2670	Countdown for jQuery v2.1.0.
2671	Written by Keith Wood (wood.keith{at}optusnet.com.au) January 2008.
2672	Available under the MIT (http://keith-wood.name/licence.html) license. 
2673	Please attribute the author if you use it. */
2674function initTimerSale() {
2675
2676	(function($) { // Hide scope, no $ conflict
2677		'use strict';
2678	
2679		var pluginName = 'countdown';
2680	
2681		var Y = 0; // Years
2682		var O = 1; // Months
2683		var W = 2; // Weeks
2684		var D = 3; // Days
2685		var H = 4; // Hours
2686		var M = 5; // Minutes
2687		var S = 6; // Seconds
2688	
2689		/** Create the countdown plugin.
2690			<p>Sets an element to show the time remaining until a given instant.</p>
2691			<p>Expects HTML like:</p>
2692			<pre>&lt;div>&lt;/div></pre>
2693			<p>
2693Provide inline configuration like:</p>
2694			<pre>&lt;div data-countdown="name: 'value', ...">&lt;/div></pre>
2695			@module Countdown
2696			@augments JQPlugin
2697			@example $(selector).countdown({until: +300}) */
2698		$.JQPlugin.createPlugin({
2699		
2700			/** The name of the plugin.
2701				@default 'countdown' */
2702			name: pluginName,
2703	
2704			/** Countdown expiry callback.
2705				Used with the {@linkcode module:Countdown~defaultOptions|onExpiry} option and
2706				triggered when the countdown expires.
2707				@global
2708				@callback CountdownExpiryCallback
2709				@this <code>Element</code>
2710				@example onExpiry: function() {
2711	  alert('Done');
2712	} */
2713	
2714			/** Countdown server synchronisation callback.
2715				Used with the {@linkcode module:Countdown~defaultOptions|serverSync} option and
2716				triggered when the countdown is initialised.
2717				@global
2718				@callback CountdownServerSyncCallback
2719				@return {Date} The current date/time on the server as expressed in the local timezone.
2720				@this <code>$.countdown</code>
2721				@example serverSync: function() {
2722	  var time = null;
2723	  $.ajax({url: 'http://myserver.com/serverTime.php',
2724		async: false, dataType: 'text',
2725		success: function(text) {
2726		  time = new Date(text);
2727		}, error: function(http, message, exc) {
2728		  time = new Date();
2729	  });
2730	  return time;
2731	} */
2732				
2733			/** Countdown tick callback.
2734				Used with the {@linkcode module:Countdown~defaultOptions|onTick} option and
2735				triggered on every {@linkcode module:Countdown~defaultOptions|tickInterval} ticks of the countdown.
2736				@global
2737				@callback CountdownTickCallback
2738				@this <code>Element</code>
2739				@param {number[]} periods The breakdown by period (years, months, weeks, days,
2740						hours, minutes, seconds) of the time remaining/passed.
2741				@example onTick: function(periods) {
2742	  $('#altTime').text(periods[4] + ':' + twoDigits(periods[5]) +
2743		':' + twoDigits(periods[6]));
2744	} */
2745	
2746			/** Countdown which labels callback.
2747				Used with the {@linkcode module:Countdown~regionalOptions|whichLabels} option and
2748				triggered when the countdown is being display to determine which set of labels
2749				(<code>labels</code>, <code>labels1</code>, ...) are to be used for the current period value.
2750				@global
2751				@callback CountdownWhichLabelsCallback
2752				@param {number} num The current period value.
2753				@return {number} The suffix for the label set to use, or zero for the default labels.
2754				@example whichLabels: function(num) {
2755	  return (num === 1 ? 1 : (num >= 2 && num <= 4 ? 2 : 0));
2756	} */
2757				
2758			/** Default settings for the plugin.
2759				@property {Date|number|string} [until] The date/time to count down to, or number of seconds
2760							offset from now, or string of amounts and units for offset(s) from now:
2761							'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
2762							One of <code>until</code> or <code>since</code> must be specified.
2763							If both are given <code>since</code> takes precedence.
2764				@example until: new Date(2013, 12-1, 25, 13, 30)
2765	until: +300
2766	until: '+1O -2D'
2767				@property {Date|number|string} [since] The date/time to count up from, or number of seconds
2768							offset from now, or string of amounts and units for offset(s) from now:
2769							'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
2770							One of <code>until</code> or <code>since</code> must be specified.
2771							If both are given <code>since</code> takes precedence.
2772				@example since: new Date(2013, 1-1, 1)
2773	since: -300
2774	since: '-1O +2D'
2775				@property {number} [timezone=null] The timezone (hours or minutes from GMT) for the target times,
2776							or <code>null</code> for client local timezone.
2777				@example timezone: +10
2778	timezone: -60
2779				@property {CountdownServerSyncCallback} [serverSync=null] A function to retrieve the current server time
2780							for synchronisation.
2781				@property {string} [format='dHMS'] The format for display - upper case to always show,
2782							lower case to show only if non-zero,
2783							'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
2784				@property {string} [layout=''] <p>Build your own layout for the countdown.</p>
2785							<p>
2785Indicate substitution points with '{desc}' for the description, '{sep}' for the time separator,
2786							'{pv}' where p is 'y' for years, 'o' for months, 'w' for weeks, 'd' for days,
2787							'h' for hours, 'm' for minutes, or 's' for seconds and v is 'n' for the period value,
2788							'nn' for the period value with a minimum of two digits,
2789							'nnn' for the period value with a minimum of three digits, or
2790							'l' for the period label (long or short form depending on the compact setting), or
2791							'{pd}' where p is as above and d is '1' for the units digit, '10' for the tens digit,
2792							'100' for the hundreds digit, or '1000' for the thousands digit.</p>
2793							<p>If you need to exclude entire sections when the period value is zero and
2794							you have specified the period as optional, surround these sections with
2795							'{p<}' and '{p>}', where p is the same as above.</p>
2796							<p>Your layout can just be simple text, or can contain HTML markup as well.</p>
2797				@example layout: '{d<}{dn} {dl}{d>} {hnn}:{mnn}:{snn}'
2798				@property {boolean} [compact=false] <code>true</code> to display in a compact format,
2799							<code>false</code> for an expanded one.
2800				@property {boolean} [padZeroes=false] <code>true</code> to add leading zeroes.
2801				@property {number} [significant=0] The maximum number of periods with non-zero values to show, zero for all.
2802				@property {string} [description=''] The description displayed for the countdown.
2803				@property {string} [expiryUrl=''] A URL to load upon expiry, replacing the current page.
2804				@property {string} [expiryText=''] Text to display upon expiry, replacing the countdown. This may be HTML.
2805				@property {boolean} [alwaysExpire=false] <code>true</code> to trigger <code>onExpiry</code>
2806							even if the target time has passed.
2807				@property {CountdownExpiryCallback} [onExpiry=null] Callback when the countdown expires -
2808							receives no parameters and <code>this</code> is the containing element.
2809				@example onExpiry: function() {
2810	  ...
2811	}
2812				@property {CountdownTickCallback} [onTick=null] Callback when the countdown is updated -
2813							receives <code>number[7]</code> being the breakdown by period
2814							(years, months, weeks, days, hours, minutes, seconds - based on
2815							<code>format</code>) and <code>this</code> is the containing element.
2816				@example onTick: function(periods) {
2817	  var secs = $.countdown.periodsToSeconds(periods);
2818	  if (secs < 300) { // Last five minutes
2819		...
2820	  }
2821	}
2822				@property {number} [tickInterval=1] The interval (seconds) between <code>onTick</code> callbacks. */
2823			defaultOptions: {
2824				until: null,
2825				since: null,
2826				timezone: null,
2827				serverSync: null,
2828				format: 'dHMS',
2829				layout: '',
2830				compact: false,
2831				padZeroes: false,
2832				significant: 0,
2833				description: '',
2834				expiryUrl: '',
2835				expiryText: '',
2836				alwaysExpire: false,
2837				onExpiry: null,
2838				onTick: null,
2839				tickInterval: 1
2840			},
2841	
2842			/** Localisations for the plugin.
2843				Entries are objects indexed by the language code ('' being the default US/English).
2844				Each object has the following attributes.
2845				@property {string[]} [labels=['Years','Months','Weeks','Days','Hours','Minutes','Seconds']]
2846							The display texts for the counter periods.
2847				@property {string[]} [labels1=['Year','Month','Week','Day','Hour','Minute','Second']]
2848							The display texts for the counter periods if they have a value of 1.
2849							Add other <code>labels<em>n</em></code> attributes as necessary to
2850							cater for other numeric idiosyncrasies of the localisation.
2851				@property {string[]}[compactLabels=['y','m','w','d']] The compact texts for the counter periods.
2852				@property {CountdownWhichLabelsCallback} [whichLabels=null] A function to determine which
2853							<code>labels<em>n</em></code> to use.
2854				@example whichLabels: function(num) {
2855	  return (num > 1 ? 0 : 1);
2856	}
2857				@property {string[]} [digits=['0','1',...,'9']] The digits to display (0-9).
2858				@property {string} [timeSeparator=':'] Separator for time periods in the compact layout.
2859				@property {boolean} [isRTL=false] <code>true</code> for right-to-left languages,
2860							<code>false</code> for left-to-right. */
2861			regionalOptions: { // Available regional settings, indexed by language/country code
2862				'': { // Default regional settings - English/US
2863					labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
2864					labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
2865					compactLabels: ['y', 'm', 'w', 'd'],
2866					whichLabels: null,
2867					digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
2868					timeSeparator: ':',
2869					isRTL: false
2870				}
2871			},
2872	
2873			/* Class name for the right-to-left marker. */
2874			_rtlClass: pluginName + '-rtl',
2875			/* Class name for the countdown section marker. */
2876			_sectionClass: pluginName + '-section',
2877			/* Class name for the period amount marker. */
2878			_amountClass: pluginName + '-amount',
2879			/* Class name for the period name marker. */
2880			_periodClass: pluginName + '-period',
2881			/* Class name for the countdown row marker. */
2882			_rowClass: pluginName + '-row',
2883			/* Class name for the holding countdown marker. */
2884			_holdingClass: pluginName + '-holding',
2885			/* Class name for the showing countdown marker. */
2886			_showClass: pluginName + '-show',
2887			/* Class name for the description marker. */
2888			_descrClass: pluginName + '-descr',
2889	
2890			/* List of currently active countdown elements. */
2891			_timerElems: [],
2892	
2893			/** Additional setup for the countdown.
2894				Apply default localisations.
2895				Create the timer.
2896				@private */
2897			_init: function() {
2898				var self = this;
2899				this._super();
2900				this._serverSyncs = [];
2901				var now = (typeof Date.now === 'function' ? Date.now : function() { return new Date().getTime(); });
2902				var perfAvail = (window.performance && typeof window.performance.now === 'function');
2903				// Shared timer for all countdowns
2904				function timerCallBack(timestamp) {
2905					var drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer
2906						(perfAvail ? (window.performance.now() + window.performance.timing.navigationStart) : now()) :
2907						// Integer milliseconds since unix epoch
2908						timestamp || now());
2909					if (drawStart - animationStartTime >= 1000) {
2910						self._updateElems();
2911						animationStartTime = drawStart;
2912					}
2913					requestAnimationFrame(timerCallBack);
2914				}
2915				var requestAnimationFrame = window.requestAnimationFrame ||
2916					window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
2917					window.oRequestAnimationFrame || window.msRequestAnimationFrame || null;
2918					// This is when we expect a fall-back to setInterval as it's much more fluid
2919				var animationStartTime = 0;
2920				if (!requestAnimationFrame || $.noRequestAnimationFrame) {
2921					$.noRequestAnimationFrame = null;
2922					// Fall back to good old setInterval
2923					$.countdown._timer = setInterval(function() { self._updateElems(); }, 1000);
2924				}
2925				else {
2926					animationStartTime = window.animationStartTime ||
2927						window.webkitAnimationStartTime || window.mozAnimationStartTime ||
2928						window.oAnimationStartTime || window.msAnimationStartTime || now();
2929					requestAnimationFrame(timerCallBack);
2930				}
2931			},
2932	
2933			/** Convert a date/time to UTC.
2934				@param {number} tz The hour or minute offset from GMT, e.g. +9, -360.
2935				@param {Date|number} year the date/time in that timezone or the year in that timezone.
2936				@param {number} [month] The month (0 - 11) (omit if <code>year</code> is a <code>Date</code>).
2937				@param {number} [day] The day (omit if <code>year</code> is a <code>Date</code>).
2938				@param {number} [hours] The hour (omit if <code>year</code> is a <code>Date</code>).
2939				@param {number} [mins] The minute (omit if <code>year</code> is a <code>Date</code>).
2940				@param {number} [secs] The second (omit if <code>year</code> is a <code>Date</code>).
2941				@param {number} [ms] The millisecond (omit if <code>year</code> is a <code>Date</code>).
2942				@return {Date} The equivalent UTC date/time.
2943				@example $.countdown.UTCDate(+10, 2013, 12-1, 25, 12, 0)
2944	$.countdown.UTCDate(-7, new Date(2013, 12-1, 25, 12, 0)) */
2945			UTCDate: function(tz, year, month, day, hours, mins, secs, ms) {
2946				if (typeof year === 'object' && year instanceof Date) {
2947					ms = year.getMilliseconds();
2948					secs = year.getSeconds();
2949					mins = year.getMinutes();
2950					hours = year.getHours();
2951					day = year.getDate();
2952					month = year.getMonth();
2953					year = year.getFullYear();
2954				}
2955				var d = new Date();
2956				d.setUTCFullYear(year);
2957				d.setUTCDate(1);
2958				d.setUTCMonth(month || 0);
2959				d.setUTCDate(day || 1);
2960				d.setUTCHours(hours || 0);
2961				d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz));
2962				d.setUTCSeconds(secs || 0);
2963				d.setUTCMilliseconds(ms || 0);
2964				return d;
2965			},
2966	
2967			/** Convert a set of periods into seconds.
2968				Averaged for months and years.
2969				@param {number[]} periods The periods per year/month/week/day/hour/minute/second.
2970				@return {number} The corresponding number of seconds.
2971				@example var secs = $.countdown.periodsToSeconds(periods) */
2972			periodsToSeconds: function(periods) {
2973				return periods[0] * 31557600 + periods[1] * 2629800 + periods[2] * 604800 +
2974					periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
2975			},
2976	
2977			/** Resynchronise the countdowns with the server.
2978				@example $.countdown.resync() */
2979			resync: function() {
2980				var self = this;
2981				$('.' + this._getMarker()).each(function() { // Each countdown
2982					var inst = $.data(this, self.name);
2983					if (inst.options.serverSync) { // If synced
2984						var serverSync = null;
2985						for (var i = 0; i < self._serverSyncs.length; i++) {
2986							if (self._serverSyncs[i][0] === inst.options.serverSync) { // Find sync details
2987								serverSync = self._serverSyncs[i];
2988								break;
2989							}
2990						}
2991						if (self._eqNull(serverSync[2])) { // Recalculate if missing
2992							var serverResult = ($.isFunction(inst.options.serverSync) ?
2993								inst.options.serverSync.apply(this, []) : null);
2994							serverSync[2] =
2995								(serverResult ? new Date().getTime() - serverResult.getTime() : 0) - serverSync[1];
2996						}
2997						if (inst._since) { // Apply difference
2998							inst._since.setMilliseconds(inst._since.getMilliseconds() + serverSync[2]);
2999						}
3000						inst._until.setMilliseconds(inst._until.getMilliseconds() + serverSync[2]);
3001					}
3002				});
3003				for (var i = 0; i < self._serverSyncs.length; i++) { // Update sync details
3004					if (!self._eqNull(self._serverSyncs[i][2])) {
3005						self._serverSyncs[i][1] += self._serverSyncs[i][2];
3006						delete self._serverSyncs[i][2];
3007					}
3008				}
3009			},
3010	
3011			_instSettings: function(elem, options) { // jshint unused:false
3012				return {_periods: [0, 0, 0, 0, 0, 0, 0]};
3013			},
3014	
3015			/** Add an element to the list of active ones.
3016				@private
3017				@param {Element} elem The countdown element. */
3018			_addElem: function(elem) {
3019				if (!this._hasElem(elem)) {
3020					this._timerElems.push(elem);
3021				}
3022			},
3023	
3024			/** See if an element is in the list of active ones.
3025				@private
3026				@param {Element} elem The countdown element.
3027				@return {boolean} <code>true</code> if present, <code>false</code> if not. */
3028			_hasElem: function(elem) {
3029				return ($.inArray(elem, this._timerElems) > -1);
3030			},
3031	
3032			/** Remove an element from the list of active ones.
3033				@private
3034				@param {Element} elem The countdown element. */
3035			_removeElem: function(elem) {
3036				this._timerElems = $.map(this._timerElems,
3037					function(value) { return (value === elem ? null : value); }); // delete entry
3038			},
3039	
3040			/** Update each active timer element.
3041				@private */
3042			_updateElems: function() {
3043				for (var i = this._timerElems.length - 1; i >= 0; i--) {
3044					this._updateCountdown(this._timerElems[i]);
3045				}
3046			},
3047	
3048			_optionsChanged: function(elem, inst, options) {
3049				if (options.layout) {
3050					options.layout = options.layout.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
3051				}
3052				this._resetExtraLabels(inst.options, options);
3053				var timezoneChanged = (inst.options.timezone !== options.timezone);
3054				$.extend(inst.options, options);
3055				this._adjustSettings(elem, inst,
3056					!this._eqNull(options.until) || !this._eqNull(options.since) || timezoneChanged);
3057				var now = new Date();
3058				if ((inst._since && inst._since < now) || (inst._until && inst._until > now)) {
3059					this._addElem(elem[0]);
3060				}
3061				this._updateCountdown(elem, inst);
3062			},
3063	
3064			/** Redisplay the countdown with an updated display.
3065				@private
3066				@param {Element|jQuery} elem The containing element.
3067				@param {object} inst The current settings for this instance. */
3068			_updateCountdown: function(elem, inst) {
3069				elem = elem.jquery ? elem : $(elem);
3070				inst = inst || this._getInst(elem);
3071				if (!inst.options) {
3072					clearInterval($.countdown._timer);
3073					return;
3074				}
3075				if (!inst) {
3076					return;
3077				}
3078				elem.html(this._generateHTML(inst)).toggleClass(this._rtlClass, inst.options.isRTL);
3079				if (inst._hold !== 'pause' && $.isFunction(inst.options.onTick)) {
3080					var periods = inst._hold !== 'lap' ? inst._periods :
3081						this._calculatePeriods(inst, inst._show, inst.options.significant, new Date());
3082					if (inst.options.tickInterval === 1 ||
3083							this.periodsToSeconds(periods) % inst.options.tickInterval === 0) {
3084						inst.options.onTick.apply(elem[0], [periods]);
3085					}
3086				}
3087				var expired = inst._hold !== 'pause' &&
3088					(inst._since ? inst._now.getTime() < inst._since.getTime() :
3089					inst._now.getTime() >= inst._until.getTime());
3090				if (expired && !inst._expiring) {
3091					inst._expiring = true;
3092					if (this._hasElem(elem[0]) || inst.options.alwaysExpire) {
3093						this._removeElem(elem[0]);
3094						if ($.isFunction(inst.options.onExpiry)) {
3095							inst.options.onExpiry.apply(elem[0], []);
3096						}
3097						if (inst.options.expiryText) {
3098							var layout = inst.options.layout;
3099							inst.options.layout = inst.options.expiryText;
3100							this._updateCountdown(elem[0], inst);
3101							inst.options.layout = layout;
3102						}
3103						if (inst.options.expiryUrl) {
3104							window.location = inst.options.expiryUrl;
3105						}
3106					}
3107					inst._expiring = false;
3108				}
3109				else if (inst._hold === 'pause') {
3110					this._removeElem(elem[0]);
3111				}
3112			},
3113	
3114			/** Reset any extra labelsn and compactLabelsn entries if changing labels.
3115				@private
3116				@param {object} base The options to be updated.
3117				@param {object} options The new option values. */
3118			_resetExtraLabels: function(base, options) {
3119				var n = null;
3120				for (n in options) {
3121					if (n.match(/[Ll]abels[02-9]|compactLabels1/)) {
3122						base[n] = options[n];
3123					}
3124				}
3125				for (n in base) { // Remove custom numbered labels
3126					if (n.match(/[Ll]abels[02-9]|compactLabels1/) && typeof options[n] === 'undefined') {
3127						base[n] = null;
3128					}
3129				}
3130			},
3131			
3132			/** Determine whether or not a value is equivalent to <code>null</code>.
3133				@private
3134				@param {object} value The value to test.
3135				@return {boolean} <code>true</code> if equivalent to <code>null</code>, <code>false</code> if not. */
3136			_eqNull: function(value) {
3137				return typeof value === 'undefined' || value === null;
3138			},
3139	
3140	
3141			/** Calculate internal settings for an instance.
3142				@private
3143				@param {jQuery} elem The containing element.
3144				@param {object} inst The current settings for this instance.
3145				@param {boolean} recalc <code>true</code> if until or since are set. */
3146			_adjustSettings: function(elem, inst, recalc) {
3147				var serverEntry = null;
3148				for (var i = 0; i < this._serverSyncs.length; i++) {
3149					if (this._serverSyncs[i][0] === inst.options.serverSync) {
3150						serverEntry = this._serverSyncs[i][1];
3151						break;
3152					}
3153				}
3154				var now = null;
3155				var serverOffset = null;
3156				if (!this._eqNull(serverEntry)) {
3157					now = new Date();
3158					serverOffset = (inst.options.serverSync ? serverEntry : 0);
3159				}
3160				else {
3161					var serverResult = ($.isFunction(inst.options.serverSync) ?
3162						inst.options.serverSync.apply(elem[0], []) : null);
3163					now = new Date();
3164					serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0);
3165					this._serverSyncs.push([inst.options.serverSync, serverOffset]);
3166				}
3167				var timezone = inst.options.timezone;
3168				timezone = (this._eqNull(timezone) ? -now.getTimezoneOffset() : timezone);
3169				if (recalc || (!recalc && this._eqNull(inst._until) && this._eqNull(inst._since))) {
3170					inst._since = inst.options.since;
3171					if (!this._eqNull(inst._since)) {
3172						inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
3173						if (inst._since && serverOffset) {
3174							inst._since.setMilliseconds(inst._since.getMilliseconds() + serverOffset);
3175						}
3176					}
3177					inst._until = this.UTCDate(timezone, this._determineTime(inst.options.until, now));
3178					if (serverOffset) {
3179						inst._until.setMilliseconds(inst._until.getMilliseconds() + serverOffset);
3180					}
3181				}
3182				inst._show = this._determineShow(inst);
3183			},
3184	
3185			/** Remove the countdown widget from an element.
3186				@private
3187				@param {jQuery} elem The containing element.
3188				@param {object} inst The current instance object. */
3189			_preDestroy: function(elem, inst) { // jshint unused:false
3190				this._removeElem(elem[0]);
3191				elem.empty();
3192			},
3193	
3194			/** Pause a countdown widget at the current time.
3195				Stop it running but remember and display the current time.
3196				@param {Element} elem The containing element.
3197				@example $(selector).countdown('pause') */
3198			pause: function(elem) {
3199				this._hold(elem, 'pause');
3200			},
3201	
3202			/** Pause a countdown widget at the current time.
3203				Stop the display but keep the countdown running.
3204				@param {Element} elem The containing element.
3205				@example $(selector).countdown('lap') */
3206			lap: function(elem) {
3207				this._hold(elem, 'lap');
3208			},
3209	
3210			/** Resume a paused countdown widget.
3211				@param {Element} elem The containing element.
3212				@example $(selector).countdown('resume') */
3213			resume: function(elem) {
3214				this._hold(elem, null);
3215			},
3216	
3217			/** Toggle a paused countdown widget.
3218				@param {Element} elem The containing element.
3219				@example $(selector).countdown('toggle') */
3220			toggle: function(elem) {
3221				var inst = $.data(elem, this.name) || {};
3222				this[!inst._hold ? 'pause' : 'resume'](elem);
3223			},
3224	
3225			/** Toggle a lapped countdown widget.
3226				@param {Element} elem The containing element.
3227				@example $(selector).countdown('toggleLap') */
3228			toggleLap: function(elem) {
3229				var inst = $.data(elem, this.name) || {};
3230				this[!inst._hold ? 'lap' : 'resume'](elem);
3231			},
3232	
3233			/** Pause or resume a countdown widget.
3234				@private
3235				@param {Element} elem The containing element.
3236				@param {string} hold The new hold setting. */
3237			_hold: function(elem, hold) {
3238				var inst = $.data(elem, this.name);
3239				if (inst) {
3240					if (inst._hold === 'pause' && !hold) {
3241						inst._periods = inst._savePeriods;
3242						var sign = (inst._since ? '-' : '+');
3243						inst[inst._since ? '_since' : '_until'] =
3244							this._determineTime(sign + inst._periods[0] + 'y' +
3245								sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' +
3246								sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' + 
3247								sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's');
3248						this._addElem(elem);
3249					}
3250					inst._hold = hold;
3251					inst._savePeriods = (hold === 'pause' ? inst._periods : null);
3252					$.data(elem, this.name, inst);
3253					this._updateCountdown(elem, inst);
3254				}
3255			},
3256	
3257			/** Return the current time periods, broken down by years, months, weeks, days, hours, minutes, and seconds.
3258				@param {Element} elem The containing element.
3259				@return {number[]} The current periods for the countdown.
3260				@example var periods = $(selector).countdown('getTimes') */
3261			getTimes: function(elem) {
3262				var inst = $.data(elem, this.name);
3263				return (!inst ? null : (inst._hold === 'pause' ? inst._savePeriods : (!inst._hold ? inst._periods :
3264					this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()))));
3265			},
3266	
3267			/** A time may be specified as an exact value or a relative one.
3268				@private
3269				@param {string|number|Date} setting The date/time value as a relative or absolute value.
3270				@param {Date} defaultTime The date/time to use if no other is supplied.
3271				@return {Date} The corresponding date/time. */
3272			_determineTime: function(setting, defaultTime) {
3273				var self = this;
3274				var offsetNumeric = function(offset) { // e.g. +300, -2
3275					var time = new Date();
3276					time.setTime(time.getTime() + offset * 1000);
3277					return time;
3278				};
3279				var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m'
3280					offset = offset.toLowerCase();
3281					var time = new Date();
3282					var year = time.getFullYear();
3283					var month = time.getMonth();
3284					var day = time.getDate();
3285					var hour = time.getHours();
3286					var minute = time.getMinutes();
3287					var second = time.getSeconds();
3288					var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
3289					var matches = pattern.exec(offset);
3290					while (matches) {
3291						switch (matches[2] || 's') {
3292							case 's':
3293								second += parseInt(matches[1], 10);
3294								break;
3295							case 'm':
3296								minute += parseInt(matches[1], 10);
3297								break;
3298							case 'h':
3299								hour += parseInt(matches[1], 10);
3300								break;
3301							case 'd':
3302								day += parseInt(matches[1], 10);
3303								break;
3304							case 'w':
3305								day += parseInt(matches[1], 10) * 7;
3306								break;
3307							case 'o':
3308								month += parseInt(matches[1], 10); 
3309								day = Math.min(day, self._getDaysInMonth(year, month));
3310								break;
3311							case 'y':
3312								year += parseInt(matches[1], 10);
3313								day = Math.min(day, self._getDaysInMonth(year, month));
3314								break;
3315						}
3316						matches = pattern.exec(offset);
3317					}
3318					return new Date(year, month, day, hour, minute, second, 0);
3319				};
3320				var time = (this._eqNull(setting) ? defaultTime :
3321					(typeof setting === 'string' ? offsetString(setting) :
3322					(typeof setting === 'number' ? offsetNumeric(setting) : setting)));
3323				if (time) {
3324					time.setMilliseconds(0);
3325				}
3326				return time;
3327			},
3328	
3329			/** Determine the number of days in a month.
3330				@private
3331				@param {number} year The year.
3332				@param {number} month The month.
3333				@return {number} The days in that month. */
3334			_getDaysInMonth: function(year, month) {
3335				return 32 - new Date(year, month, 32).getDate();
3336			},
3337	
3338			/** Default implementation to determine which set of labels should be used for an amount.
3339				Use the <code>labels</code> attribute with the same numeric suffix (if it exists).
3340				@private
3341				@param {number} num The amount to be displayed.
3342				@return {number} The set of labels to be used for this amount. */
3343			_normalLabels: function(num) {
3344				return num;
3345			},
3346	
3347			/** Generate the HTML to display the countdown widget.
3348				@private
3349				@param {object} inst The current settings for this instance.
3350				@return {string} The new HTML for the countdown display. */
3351			_generateHTML: function(inst) {
3352				var self = this;
3353				// Determine what to show
3354				if (!inst.options) return;
3355				inst._periods = (inst._hold ? inst._periods :
3356					this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()));
3357				// Show all 'asNeeded' after first non-zero value
3358				var shownNonZero = false;
3359				var showCount = 0;
3360				var sigCount = inst.options.significant;
3361				var show = $.extend({}, inst._show);
3362				var period = null;
3363				for (period = Y; period <= S; period++) {
3364					shownNonZero = shownNonZero || (inst._show[period] === '?' && inst._periods[period] > 0);
3365					show[period] = (inst._show[period] === '?' && !shownNonZero ? null : inst._show[period]);
3366					showCount += (show[period] ? 1 : 0);
3367					sigCount -= (inst._periods[period] > 0 ? 1 : 0);
3368				}
3369				var showSignificant = [false, false, false, false, false, false, false];
3370				for (period = S; period >= Y; period--) { // Determine significant periods
3371					if (inst._show[period]) {
3372						if (inst._periods[period]) {
3373							showSignificant[period] = true;
3374						}
3375						else {
3376							showSignificant[period] = sigCount > 0;
3377							sigCount--;
3378						}
3379					}
3380				}
3381				var labels = (inst.options.compact ? inst.options.compactLabels : inst.options.labels);
3382				var whichLabels = inst.options.whichLabels || this._normalLabels;
3383				var showCompact = function(period) {
3384					var labelsNum = inst.options['compactLabels' + whichLabels(inst._periods[period])];
3385					return (show[period] ? self._translateDigits(inst, inst._periods[period]) +
3386						(labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
3387				};
3388				var minDigits = (inst.options.padZeroes ? 2 : 1);
3389				var showFull = function(period) {
3390					var labelsNum = inst.options['labels' + whichLabels(inst._periods[period])];
3391					return ((!inst.options.significant && show[period]) ||
3392						(inst.options.significant && showSignificant[period]) ?
3393							'<span class="' + self._sectionClass + '">' +
3394							'<span class="' + self._amountClass + '">' +
3395						self._minDigits(inst, inst._periods[period], minDigits) + '</span>' +
3396						'<span class="' + self._periodClass + '">' +
3397						(labelsNum ? labelsNum[period] : labels[period]) + '</span></span>' : '');
3398				};
3399				return (inst.options.layout ? this._buildLayout(inst, show, inst.options.layout,
3400					inst.options.compact, inst.options.significant, showSignificant) :
3401					((inst.options.compact ? // Compact version
3402					'<span class="' + this._rowClass + ' ' + this._amountClass +
3403					(inst._hold ? ' ' + this._holdingClass : '') + '">' + 
3404					showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) + 
3405					(show[H] ? this._minDigits(inst, inst._periods[H], 2) : '') +
3406					(show[M] ? (show[H] ? inst.options.timeSeparator : '') +
3407					this._minDigits(inst, inst._periods[M], 2) : '') +
3408					(show[S] ? (show[H] || show[M] ? inst.options.timeSeparator : '') +
3409					this._minDigits(inst, inst._periods[S], 2) : '') :
3410					// Full version
3411					'<span class="' + this._rowClass + ' ' + this._showClass + (inst.options.significant || showCount) +
3412					(inst._hold ? ' ' + this._holdingClass : '') + '">' +
3413					showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
3414					showFull(H) + showFull(M) + showFull(S)) + '</span>' +
3415					(inst.options.description ? '<span class="' + this._rowClass + ' ' + this._descrClass + '">' +
3416					inst.options.description + '</span>' : '')));
3417			},
3418	
3419			/** Construct a custom layout.
3420				@private
3421				@param {object} inst The current settings for this instance.
3422				@param {boolean[]} show Flags indicating which periods are requested.
3423				@param {string} layout The customised layout.
3424				@param {boolean} compact <code>true</code> if using compact labels.
3425				@param {number} significant The number of periods with values to show, zero for all.
3426				@param {boolean[]} showSignificant Other periods to show for significance.
3427				@return {string} The custom HTML. */
3428			_buildLayout: function(inst, show, layout, compact, significant, showSignificant) {
3429				var labels = inst.options[compact ? 'compactLabels' : 'labels'];
3430				var whichLabels = inst.options.whichLabels || this._normalLabels;
3431				var labelFor = function(index) {
3432					return (inst.options[(compact ? 'compactLabels' : 'labels') +
3433						whichLabels(inst._periods[index])] || labels)[index];
3434				};
3435				var digit = function(value, position) {
3436					return inst.options.digits[Math.floor(value / position) % 10];
3437				};
3438				var subs = {desc: inst.options.description, sep: inst.options.timeSeparator,
3439					yl: labelFor(Y), yn: this._minDigits(inst, inst._periods[Y], 1),
3440					ynn: this._minDigits(inst, inst._periods[Y], 2),
3441					ynnn: this._minDigits(inst, inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
3442					y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
3443					y1000: digit(inst._periods[Y], 1000),
3444					ol: labelFor(O), on: this._minDigits(inst, inst._periods[O], 1),
3445					onn: this._minDigits(inst, inst._periods[O], 2),
3446					onnn: this._minDigits(inst, inst._periods[O], 3), o1: digit(inst._periods[O], 1),
3447					o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
3448					o1000: digit(inst._periods[O], 1000),
3449					wl: labelFor(W), wn: this._minDigits(inst, inst._periods[W], 1),
3450					wnn: this._minDigits(inst, inst._periods[W], 2),
3451					wnnn: this._minDigits(inst, inst._periods[W], 3), w1: digit(inst._periods[W], 1),
3452					w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
3453					w1000: digit(inst._periods[W], 1000),
3454					dl: labelFor(D), dn: this._minDigits(inst, inst._periods[D], 1),
3455					dnn: this._minDigits(inst, inst._periods[D], 2),
3456					dnnn: this._minDigits(inst, inst._periods[D], 3), d1: digit(inst._periods[D], 1),
3457					d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
3458					d1000: digit(inst._periods[D], 1000),
3459					hl: labelFor(H), hn: this._minDigits(inst, inst._periods[H], 1),
3460					hnn: this._minDigits(inst, inst._periods[H], 2),
3461					hnnn: this._minDigits(inst, inst._periods[H], 3), h1: digit(inst._periods[H], 1),
3462					h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
3463					h1000: digit(inst._periods[H], 1000),
3464					ml: labelFor(M), mn: this._minDigits(inst, inst._periods[M], 1),
3465					mnn: this._minDigits(inst, inst._periods[M], 2),
3466					mnnn: this._minDigits(inst, inst._periods[M], 3), m1: digit(inst._periods[M], 1),
3467					m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
3468					m1000: digit(inst._periods[M], 1000),
3469					sl: labelFor(S), sn: this._minDigits(inst, inst._periods[S], 1),
3470					snn: this._minDigits(inst, inst._periods[S], 2),
3471					snnn: this._minDigits(inst, inst._periods[S], 3), s1: digit(inst._periods[S], 1),
3472					s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100),
3473					s1000: digit(inst._periods[S], 1000)};
3474				var html = layout;
3475				// Replace period containers: {p<}...{p>}
3476				for (var i = Y; i <= S; i++) {
3477					var period = 'yowdhms'.charAt(i);
3478					var re = new RegExp('\\{' + period + '<\\}([\\s\\S]*)\\{' + period + '>\\}', 'g');
3479					html = html.replace(re, ((!significant && show[i]) ||
3480						(significant && showSignificant[i]) ? '$1' : ''));
3481				}
3482				// Replace period values: {pn}
3483				$.each(subs, function(n, v) {
3484					var re = new RegExp('\\{' + n + '\\}', 'g');
3485					html = html.replace(re, v);
3486				});
3487				return html;
3488			},
3489	
3490			/** Ensure a numeric value has at least n digits for display.
3491				@private
3492				@param {object} inst The current settings for this instance.
3493				@param {number} value The value to display.
3494				@param {number} len The minimum length.
3495				@return {string} The display text. */
3496			_minDigits: function(inst, value, len) {
3497				value = '' + value;
3498				if (value.length >= len) {
3499					return this._translateDigits(inst, value);
3500				}
3501				value = '0000000000' + value;
3502				return this._translateDigits(inst, value.substr(value.length - len));
3503			},
3504	
3505			/** Translate digits into other representations.
3506				@private
3507				@param {object} inst The current settings for this instance.
3508				@param {string} value The text to translate.
3509				@return {string} The translated text. */
3510			_translateDigits: function(inst, value) {
3511				return ('' + value).replace(/[0-9]/g, function(digit) {
3512						return inst.options.digits[digit];
3513					});
3514			},
3515	
3516			/** Translate the format into flags for each period.
3517				@private
3518				@param {object} inst The current settings for this instance.
3519				@return {string[]} Flags indicating which periods are requested (?) or
3520						required (!) by year, month, week, day, hour, minute, second. */
3521			_determineShow: function(inst) {
3522				var format = inst.options.format;
3523				var show = [];
3524				show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
3525				show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
3526				show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null));
3527				show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null));
3528				show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null));
3529				show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null));
3530				show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null));
3531				return show;
3532			},
3533	
3534			/** Calculate the requested periods between now and the target time.
3535				@private
3536				@param {object} inst The current settings for this instance.
3537				@param {string[]} show Flags indicating which periods are requested/required.
3538				@param {number} significant The number of periods with values to show, zero for all.
3539				@param {Date} now The current date and time.
3540				@return {number[]} The current time periods (always positive)
3541						by year, month, week, day, hour, minute, second. */
3542			_calculatePeriods: function(inst, show, significant, now) {
3543				// Find endpoints
3544				inst._now = now;
3545				inst._now.setMilliseconds(0);
3546				var until = new Date(inst._now.getTime());
3547				if (inst._since) {
3548					if (now.getTime() < inst._since.getTime()) {
3549						inst._now = now = until;
3550					}
3551					else {
3552						now = inst._since;
3553					}
3554				}
3555				else {
3556					until.setTime(inst._until.getTime());
3557					if (now.getTime() > inst._until.getTime()) {
3558						inst._now = now = until;
3559					}
3560				}
3561				// Calculate differences by period
3562				var periods = [0, 0, 0, 0, 0, 0, 0];
3563				if (show[Y] || show[O]) {
3564					// Treat end of months as the same
3565					var lastNow = this._getDaysInMonth(now.getFullYear(), now.getMonth());
3566					var lastUntil = this._getDaysInMonth(until.getFullYear(), until.getMonth());
3567					var sameDay = (until.getDate() === now.getDate() ||
3568						(until.getDate() >= Math.min(lastNow, lastUntil) &&
3569						now.getDate() >= Math.min(lastNow, lastUntil)));
3570					var getSecs = function(date) {
3571						return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds();
3572					};
3573					var months = Math.max(0,
3574						(until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() +
3575						((until.getDate() < now.getDate() && !sameDay) ||
3576						(sameDay && getSecs(until) < getSecs(now)) ? -1 : 0));
3577					periods[Y] = (show[Y] ? Math.floor(months / 12) : 0);
3578					periods[O] = (show[O] ? months - periods[Y] * 12 : 0);
3579					// Adjust for months difference and end of month if necessary
3580					now = new Date(now.getTime());
3581					var wasLastDay = (now.getDate() === lastNow);
3582					var lastDay = this._getDaysInMonth(now.getFullYear() + periods[Y],
3583						now.getMonth() + periods[O]);
3584					if (now.getDate() > lastDay) {
3585						now.setDate(lastDay);
3586					}
3587					now.setFullYear(now.getFullYear() + periods[Y]);
3588					now.setMonth(now.getMonth() + periods[O]);
3589					if (wasLastDay) {
3590						now.setDate(lastDay);
3591					}
3592				}
3593				var diff = Math.floor((until.getTime() - now.getTime()) / 1000);
3594				var period = null;
3595				var extractPeriod = function(period, numSecs) {
3596					periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0);
3597					diff -= periods[period] * numSecs;
3598				};
3599				extractPeriod(W, 604800);
3600				extractPeriod(D, 86400);
3601				extractPeriod(H, 3600);
3602				extractPeriod(M, 60);
3603				extractPeriod(S, 1);
3604				if (diff > 0 && !inst._since) { // Round up if left overs
3605					var multiplier = [1, 12, 4.3482, 7, 24, 60, 60];
3606					var lastShown = S;
3607					var max = 1;
3608					for (period = S; period >= Y; period--) {
3609						if (show[period]) {
3610							if (periods[lastShown] >= max) {
3611								periods[lastShown] = 0;
3612								diff = 1;
3613							}
3614							if (diff > 0) {
3615								periods[period]++;
3616								diff = 0;
3617								lastShown = period;
3618								max = 1;
3619							}
3620						}
3621						max *= multiplier[period];
3622					}
3623				}
3624				if (significant) { // Zero out insignificant periods
3625					for (period = Y; period <= S; period++) {
3626						if (significant && periods[period]) {
3627							significant--;
3628						}
3629						else if (!significant) {
3630							periods[period] = 0;
3631						}
3632					}
3633				}
3634				return periods;
3635			}
3636		});
3637	
3638	})(jQuery);
3639	
3640}
3641
3642initTimerSale();
3643 
3644/* http://keith-wood.name/countdown.html
3645 * Russian initialisation for the jQuery countdown extension
3646 * Written by Sergey K. (xslade{at}gmail.com) June 2010. */
3647(function($) {
3648        $.countdown.regionalOptions['ru'] = {
3649		labels: ['Лет', 'Месяцев', 'Недель', 'Дней', 'Час', 'Мин', 'Сек'],
3650		labels1: ['Год', 'Месяц', 'Неделя', 'День', 'Час', 'Мин', 'Сек'],
3651		labels2: ['Года', 'Месяца', 'Недели', 'Дня', 'Час', 'Мин', 'Сек'],
3652		compactLabels: ['л', 'м', 'н', 'д'], compactLabels1: ['г', 'м', 'н', 'д'],
3653		whichLabels: function(amount) {
3654			var units = amount % 10;
3655			var tens = Math.floor((amount % 100) / 10);
3656			return (amount == 1 ? 1 : (units >= 2 && units <= 4 && tens != 1 ? 2 :
3657				(units == 1 && tens != 1 ? 1 : 0)));
3658		},
3659		digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
3660		timeSeparator: ':', isRTL: false};
3661	$.countdown.setDefaults($.countdown.regionalOptions['ru']);
3662})(jQuery); 
3663/**
3664 * Basic structure: TC_Class is the public class that is returned upon being called
3665 * 
3666 * So, if you do
3667 *      var tc = $(".timer").TimeCircles();
3668 *      
3669 * tc will contain an instance of the public TimeCircles class. It is important to
3670 * note that TimeCircles is not chained in the conventional way, check the
3671 * documentation for more info on how TimeCircles can be chained.
3672 * 
3673 * After being called/created, the public TimerCircles class will then- for each element
3674 * within it's collection, either fetch or create an instance of the private class.
3675 * Each function called upon the public class will be forwarded to each instance
3676 * of the private classes within the relevant element collection
3677 **/
3678(function($) {
3679
3680    var useWindow = window;
3681    
3682    // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
3683    if (!Object.keys) {
3684        Object.keys = (function() {
3685            'use strict';
3686            var hasOwnProperty = Object.prototype.hasOwnProperty,
3687                    hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
3688                    dontEnums = [
3689                        'toString',
3690                        'toLocaleString',
3691                        'valueOf',
3692                        'hasOwnProperty',
3693                        'isPrototypeOf',
3694                        'propertyIsEnumerable',
3695                        'constructor'
3696                    ],
3697                    dontEnumsLength = dontEnums.length;
3698
3699            return function(obj) {
3700                if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
3701                    throw new TypeError('Object.keys called on non-object');
3702                }
3703
3704                var result = [], prop, i;
3705
3706                for (prop in obj) {
3707                    if (hasOwnProperty.call(obj, prop)) {
3708                        result.push(prop);
3709                    }
3710                }
3711
3712                if (hasDontEnumBug) {
3713                    for (i = 0; i < dontEnumsLength; i++) {
3714                        if (hasOwnProperty.call(obj, dontEnums[i])) {
3715                            result.push(dontEnums[i]);
3716                        }
3717                    }
3718                }
3719                return result;
3720            };
3721        }());
3722    }
3723    
3724    // Used to disable some features on IE8
3725    var limited_mode = false;
3726    var tick_duration = 200; // in ms
3727    
3728    var debug = (location.hash === "#debug");
3729    function debug_log(msg) {
3730        if (debug) {
3731            console.log(msg);
3732        }
3733    }
3734
3735    var allUnits = ["Days", "Hours", "Minutes", "Seconds"];
3736    var nextUnits = {
3737        Seconds: "Minutes",
3738        Minutes: "Hours",
3739        Hours: "Days",
3740        Days: "Years"
3741    };
3742    var secondsIn = {
3743        Seconds: 1,
3744        Minutes: 60,
3745        Hours: 3600,
3746        Days: 86400,
3747        Months: 2678400,
3748        Years: 31536000
3749    };
3750
3751    /**
3752     * Converts hex color code into object containing integer values for the r,g,b use
3753     * This function (hexToRgb) originates from:
3754     * http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
3755     * @param {string} hex color code
3756     */
3757    function hexToRgb(hex) {
3758        // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
3759        var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
3760        hex = hex.replace(shorthandRegex, function(m, r, g, b) {
3761            return r + r + g + g + b + b;
3762        });
3763
3764        var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
3765        return result ? {
3766            r: parseInt(result[1], 16),
3767            g: parseInt(result[2], 16),
3768            b: parseInt(result[3], 16)
3769        } : null;
3770    }
3771    
3772    function isCanvasSupported() {
3773        var elem = document.createElement('canvas');
3774        return !!(elem.getContext && elem.getContext('2d'));
3775    }
3776
3777    /**
3778     * Function s4() and guid() originate from:
3779     * http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
3780     */
3781    function s4() {
3782        return Math.floor((1 + Math.random()) * 0x10000)
3783                .toString(16)
3784                .substring(1);
3785    }
3786
3787    /**
3788     * Creates a unique id
3789     * @returns {String}
3790     */
3791    function guid() {
3792        return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
3793                s4() + '-' + s4() + s4() + s4();
3794    }
3795
3796    /**
3797     * Array.prototype.indexOf fallback for IE8
3798     * @param {Mixed} mixed
3799     * @returns {Number}
3800     */
3801    if (!Array.prototype.indexOf) {
3802        Array.prototype.indexOf = function(elt /*, from*/)
3803        {
3804            var len = this.length >>> 0;
3805
3806            var from = Number(arguments[1]) || 0;
3807            from = (from < 0)
3808                    ? Math.ceil(from)
3809                    : Math.floor(from);
3810            if (from < 0)
3811                from += len;
3812
3813            for (; from < len; from++)
3814            {
3815                if (from in this &&
3816                        this[from] === elt)
3817                    return from;
3818            }
3819            return -1;
3820        };
3821    }
3822
3823    function parse_date(str) {
3824        var match = str.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s[0-9]{1,2}:[0-9]{2}:[0-9]{2}$/);
3825        if (match !== null && match.length > 0) {
3826            var parts = str.split(" ");
3827            var date = parts[0].split("-");
3828            var time = parts[1].split(":");
3829            return new Date(date[0], date[1] - 1, date[2], time[0], time[1], time[2]);
3830        }
3831        // Fallback for different date formats
3832        var d = Date.parse(str);
3833        if (!isNaN(d))
3834            return d;
3835        d = Date.parse(str.replace(/-/g, '/').replace('T', ' '));
3836        if (!isNaN(d))
3837            return d;
3838        // Cant find anything
3839        return new Date();
3840    }
3841
3842    function parse_times(diff, old_diff, total_duration, units, floor) {
3843        var raw_time = {};
3844        var raw_old_time = {};
3845        var time = {};
3846        var pct = {};
3847        var old_pct = {};
3848        var old_time = {};
3849
3850        var greater_unit = null;
3851        for(var i = 0; i < units.length; i++) {
3852            var unit = units[i];
3853            var maxUnits;
3854
3855            if (greater_unit === null) {
3856                maxUnits = total_duration / secondsIn[unit];
3857            }
3858            else {
3859                maxUnits = secondsIn[greater_unit] / secondsIn[unit];
3860            }
3861
3862            var curUnits = (diff / secondsIn[unit]);
3863            var oldUnits = (old_diff / secondsIn[unit]);
3864            
3865            if(floor) {
3866                if(curUnits > 0) curUnits = Math.floor(curUnits);
3867                else curUnits = Math.ceil(curUnits);
3868                if(oldUnits > 0) oldUnits = Math.floor(oldUnits);
3869                else oldUnits = Math.ceil(oldUnits);
3870            }
3871            
3872            if (unit !== "Days") {
3873                curUnits = curUnits % maxUnits;
3874                oldUnits = oldUnits % maxUnits;
3875            }
3876
3877            raw_time[unit] = curUnits;
3878            time[unit] = Math.abs(curUnits);
3879            raw_old_time[unit] = oldUnits;
3880            old_time[unit] = Math.abs(oldUnits);
3881            pct[unit] = Math.abs(curUnits) / maxUnits;
3882            old_pct[unit] = Math.abs(oldUnits) / maxUnits;
3883
3884            greater_unit = unit;
3885        }
3886
3887        return {
3888            raw_time: raw_time,
3889            raw_old_time: raw_old_time,
3890            time: time,
3891            old_time: old_time,
3892            pct: pct,
3893            old_pct: old_pct
3894        };
3895    }
3896
3897    var TC_Instance_List = {};
3898    function updateUsedWindow() {
3899        if(typeof useWindow.TC_Instance_List !== "undefined") {
3900            TC_Instance_List = useWindow.TC_Instance_List;
3901        }
3902        else {
3903            useWindow.TC_Instance_List = TC_Instance_List;
3904        }
3905        initializeAnimationFrameHandler(useWindow);
3906    };
3907    
3908    function initializeAnimationFrameHandler(w) {
3909        var vendors = ['webkit', 'moz'];
3910        for (var x = 0; x < vendors.length && !w.requestAnimationFrame; ++x) {
3911            w.requestAnimationFrame = w[vendors[x] + 'RequestAnimationFrame'];
3912            w.cancelAnimationFrame = w[vendors[x] + 'CancelAnimationFrame'];
3913        }
3914
3915        if (!w.requestAnimationFrame || !w.cancelAnimationFrame) {
3916            w.requestAnimationFrame = function(callback, element, instance) {
3917                if (typeof instance === "undefined")
3918                    instance = {data: {last_frame: 0}};
3919                var currTime = new Date().getTime();
3920                var timeToCall = Math.max(0, 16 - (currTime - instance.data.last_frame));
3921                var id = w.setTimeout(function() {
3922                    callback(currTime + timeToCall);
3923                }, timeToCall);
3924                instance.data.last_frame = currTime + timeToCall;
3925                return id;
3926            };
3927            w.cancelAnimationFrame = function(id) {
3928                clearTimeout(id);
3929            };
3930        }
3931    };
3932    
3933
3934    var TC_Instance = function(element, options) {
3935        this.element = element;
3936        this.container;
3937        this.listeners = null;
3938        this.data = {
3939            paused: false,
3940            last_frame: 0,
3941            animation_frame: null,
3942            interval_fallback: null,
3943            timer: false,
3944            total_duration: null,
3945            prev_time: null,
3946            drawn_units: [],
3947            text_elements: {
3948                Days: null,
3949                Hours: null,
3950                Minutes: null,
3951                Seconds: null
3952            },
3953            attributes: {
3954                canvas: null,
3955                context: null,
3956                item_size: null,
3957                line_width: null,
3958                radius: null,
3959                outer_radius: null
3960            },
3961            state: {
3962                fading: {
3963                    Days: false,
3964                    Hours: false,
3965                    Minutes: false,
3966                    Seconds: false
3967                }
3968            }
3969        };
3970
3971        this.config = null;
3972        this.setOptions(options);
3973        this.initialize();
3974    };
3975
3976    TC_Instance.prototype.clearListeners = function() {
3977        this.listeners = { all: [], visible: [] };
3978    };
3979    
3980    TC_Instance.prototype.addTime = function(seconds_to_add) {
3981        if(this.data.attributes.ref_date instanceof Date) {
3982            var d = this.data.attributes.ref_date;
3983            d.setSeconds(d.getSeconds() + seconds_to_add);
3984        }
3985        else if(!isNaN(this.data.attributes.ref_date)) {
3986            this.data.attributes.ref_date += (seconds_to_add * 1000);
3987        }
3988    };
3989    
3990    TC_Instance.prototype.initialize = function(clear_listeners) {
3991        // Initialize drawn units
3992        this.data.drawn_units = [];
3993        for(var i = 0; i < Object.keys(this.config.time).length; i++) {
3994            var unit = Object.keys(this.config.time)[i];
3995            if (this.config.time[unit].show) {
3996                this.data.drawn_units.push(unit);
3997            }
3998        }
3999
4000        // Avoid stacking
4001        $(this.element).children('div.time_circles').remove();
4002
4003        if (typeof clear_listeners === "undefined")
4004            clear_listeners = true;
4005        if (clear_listeners || this.listeners === null) {
4006            this.clearListeners();
4007        }
4008        this.container = $("<div>");
4009        this.container.addClass('time_circles');
4010        this.container.appendTo(this.element);
4011        
4012        // Determine the needed width and height of TimeCircles
4013        var height = this.element.offsetHeight;
4014        var width = this.element.offsetWidth;
4015        if (height === 0)
4016            height = $(this.element).height();
4017        if (width === 0)
4018            width = $(this.element).width();
4019
4020        if (height === 0 && width > 0)
4021            height = width / this.data.drawn_units.length;
4022        else if (width === 0 && height > 0)
4023            width = height * this.data.drawn_units.length;
4024        
4025        // Create our canvas and set it to the appropriate size
4026        var canvasElement = document.createElement('canvas');
4027        canvasElement.width = width;
4028        canvasElement.height = height;
4029        
4030        // Add canvas elements
4031        this.data.attributes.canvas = $(canvasElement);
4032        this.data.attributes.canvas.appendTo(this.container);
4033        
4034        // Check if the browser has browser support
4035        var canvasSupported = isCanvasSupported();
4036        // If the browser doesn't have browser support, check if explorer canvas is loaded
4037        // (A javascript library that adds canvas support to browsers that don't have it)
4038        if(!canvasSupported && typeof G_vmlCanvasManager !== "undefined") {
4039            G_vmlCanvasManager.initElement(canvasElement);
4040            limited_mode = true;
4041            canvasSupported = true;
4042        }
4043        if(canvasSupported) {
4044            this.data.attributes.context = canvasElement.getContext('2d');
4045        }
4046
4047        this.data.attributes.item_size = Math.min(width / this.data.drawn_units.length, height);
4048        this.data.attributes.line_width = this.data.attributes.item_size * this.config.fg_width;
4049        this.data.attributes.radius = ((this.data.attributes.item_size * 0.8) - this.data.attributes.line_width) / 2;
4050        this.data.attributes.outer_radius = this.data.attributes.radius + 0.5 * Math.max(this.data.attributes.line_width, this.data.attributes.line_width * this.config.bg_width);
4051
4052        // Prepare Time Elements
4053        var i = 0;
4054        for (var key in this.data.text_elements) {
4055            if (!this.config.time[key].show)
4056                continue;
4057
4058            var textElement = $("<div>");
4059            textElement.addClass('textDiv_' + key);
4060            textElement.css("top", Math.round(0.35 * this.data.attributes.item_size));
4061            textElement.css("left", Math.round(i++ * this.data.attributes.item_size));
4062            textElement.css("width", this.data.attributes.item_size);
4063            textElement.appendTo(this.container);
4064
4065            var headerElement = $("<h4>");
4066            headerElement.text(this.config.time[key].text); // Options
4067            headerElement.css("font-size", Math.round(this.config.text_size * this.data.attributes.item_size));
4068            headerElement.css("line-height", Math.round(this.config.text_size * this.data.attributes.item_size) + "px");
4069            headerElement.appendTo(textElement);
4070
4071            var numberElement = $("<span>");
4072            numberElement.css("font-size", Math.round(3 * this.config.text_size * this.data.attributes.item_size));
4073            numberElement.css("line-height", Math.round(this.config.text_size * this.data.attributes.item_size) + "px");
4074            numberElement.appendTo(textElement);
4075
4076            this.data.text_elements[key] = numberElement;
4077        }
4078
4079        this.start();
4080        if (!this.config.start) {
4081            this.data.paused = true;
4082        }
4083        
4084        // Set up interval fallback
4085        var _this = this;
4086        this.data.interval_fallback = useWindow.setInterval(function(){
4087            _this.update.call(_this, true);
4088        }, 100);
4089    };
4090
4091    TC_Instance.prototype.update = function(nodraw) {
4092        if(typeof nodraw === "undefined") {
4093            nodraw = false;
4094        }
4095        else if(nodraw && this.data.paused) {
4096            return;
4097        }
4098        
4099        if(limited_mode) {
4100            //Per unit clearing doesn't work in IE8 using explorer canvas, so do it in one time. The downside is that radial fade cant be used
4101            this.data.attributes.context.clearRect(0, 0, this.data.attributes.canvas[0].width, this.data.attributes.canvas[0].hright);
4102        }
4103        var diff, old_diff;
4104
4105        var prevDate = this.data.prev_time;
4106        var curDate = new Date();
4107        this.data.prev_time = curDate;
4108
4109        if (prevDate === null)
4110            prevDate = curDate;
4111
4112        // If not counting past zero, and time < 0, then simply draw the zero point once, and call stop
4113        if (!this.config.count_past_zero) {
4114            if (curDate > this.data.attributes.ref_date) {
4115                for(var i = 0; i < this.data.drawn_units.length; i++) {
4116                    var key = this.data.drawn_units[i];
4117
4118                    // Set the text value
4119                    this.data.text_elements[key].text("0");
4120                    var x = (i * this.data.attributes.item_size) + (this.data.attributes.item_size / 2);
4121                    var y = this.data.attributes.item_size / 2;
4122                    var color = this.config.time[key].color;
4123                    this.drawArc(x, y, color, 0);
4124                }
4125                this.stop();
4126                return;
4127            }
4128        }
4129
4130        // Compare current time with reference
4131        diff = (this.data.attributes.ref_date - curDate) / 1000;
4132        old_diff = (this.data.attributes.ref_date - prevDate) / 1000;
4133
4134        var floor = this.config.animation !== "smooth";
4135
4136        var visible_times = parse_times(diff, old_diff, this.data.total_duration, this.data.drawn_units, floor);
4137        var all_times = parse_times(diff, old_diff, secondsIn["Years"], allUnits, floor);
4138
4139        var i = 0;
4140        var j = 0;
4141        var lastKey = null;
4142
4143        var cur_shown = this.data.drawn_units.slice();
4144        for (var i in allUnits) {
4145            var key = allUnits[i];
4146
4147            // Notify (all) listeners
4148            if (Math.floor(all_times.raw_time[key]) !== Math.floor(all_times.raw_old_time[key])) {
4149                this.notifyListeners(key, Math.floor(all_times.time[key]), Math.floor(diff), "all");
4150            }
4151
4152            if (cur_shown.indexOf(key) < 0)
4153                continue;
4154
4155            // Notify (visible) listeners
4156            if (Math.floor(visible_times.raw_time[key]) !== Math.floor(visible_times.raw_old_time[key])) {
4157                this.notifyListeners(key, Math.floor(visible_times.time[key]), Math.floor(diff), "visible");
4158            }
4159            
4160            if(!nodraw) {
4161                // Set the text value
4162                this.data.text_elements[key].text(Math.floor(Math.abs(visible_times.time[key])));
4163
4164                var x = (j * this.data.attributes.item_size) + (this.data.attributes.item_size / 2);
4165                var y = this.data.attributes.item_size / 2;
4166                var color = this.config.time[key].color;
4167
4168                if (this.config.animation === "smooth") {
4169                    if (lastKey !== null && !limited_mode) {
4170                        if (Math.floor(visible_times.time[lastKey]) > Math.floor(visible_times.old_time[lastKey])) {
4171                            this.radialFade(x, y, color, 1, key);
4172                            this.data.state.fading[key] = true;
4173                        }
4174                        else if (Math.floor(visible_times.time[lastKey]) < Math.floor(visible_times.old_time[lastKey])) {
4175                            this.radialFade(x, y, color, 0, key);
4176                            this.data.state.fading[key] = true;
4177                        }
4178                    }
4179                    if (!this.data.state.fading[key]) {
4180                        this.drawArc(x, y, color, visible_times.pct[key]);
4181                    }
4182                }
4183                else {
4184                    this.animateArc(x, y, color, visible_times.pct[key], visible_times.old_pct[key], (new Date()).getTime() + tick_duration);
4185                }
4186            }
4187            lastKey = key;
4188            j++;
4189        }
4190
4191        // Dont request another update if we should be paused
4192        if(this.data.paused || nodraw) {
4193            return;
4194        }
4195        
4196        // We need this for our next frame either way
4197        var _this = this;
4198        var update = function() {
4199            _this.update.call(_this);
4200        };
4201
4202        // Either call next update immediately, or in a second
4203        if (this.config.animation === "smooth") {
4204            // Smooth animation, Queue up the next frame
4205            this.data.animation_frame = useWindow.requestAnimationFrame(update, _this.element, _this);
4206        }
4207        else {
4208            // Tick animation, Don't queue until very slightly after the next second happens
4209            var delay = (diff % 1) * 1000;
4210            if (delay < 0)
4211                delay = 1000 + delay;
4212            delay += 50;
4213
4214            _this.data.animation_frame = useWindow.setTimeout(function() {
4215                _this.data.animation_frame = useWindow.requestAnimationFrame(update, _this.element, _this);
4216            }, delay);
4217        }
4218    };
4219
4220    TC_Instance.prototype.animateArc = function(x, y, color, target_pct, cur_pct, animation_end) {
4221        if (this.data.attributes.context === null)
4222            return;
4223
4224        var diff = cur_pct - target_pct;
4225        if (Math.abs(diff) > 0.5) {
4226            if (target_pct === 0) {
4227                this.radialFade(x, y, color, 1);
4228            }
4229            else {
4230                this.radialFade(x, y, color, 0);
4231            }
4232        }
4233        else {
4234            var progress = (tick_duration - (animation_end - (new Date()).getTime())) / tick_duration;
4235            if (progress > 1)
4236                progress = 1;
4237
4238            var pct = (cur_pct * (1 - progress)) + (target_pct * progress);
4239            this.drawArc(x, y, color, pct);
4240
4241            //var show_pct =
4242            if (progress >= 1)
4243                return;
4244            var _this = this;
4245            useWindow.requestAnimationFrame(function() {
4246                _this.animateArc(x, y, color, target_pct, cur_pct, animation_end);
4247            }, this.element);
4248        }
4249    };
4250
4251    TC_Instance.prototype.drawArc = function(x, y, color, pct) {
4252        if (this.data.attributes.context === null)
4253            return;
4254
4255        var clear_radius = Math.max(this.data.attributes.outer_radius, this.data.attributes.item_size / 2);
4256        if(!limited_mode) {
4257            this.data.attributes.context.clearRect(
4258                    x - clear_radius,
4259                    y - clear_radius,
4260                    clear_radius * 2,
4261                    clear_radius * 2
4262                    );
4263        }
4264        
4265        if (this.config.use_background) {
4266            this.data.attributes.context.beginPath();
4267            this.data.attributes.context.arc(x, y, this.data.attributes.radius, 0, 2 * Math.PI, false);
4268            this.data.attributes.context.lineWidth = this.data.attributes.line_width * this.config.bg_width;
4269
4270            // line color
4271            this.data.attributes.context.strokeStyle = this.config.circle_bg_color;
4272            this.data.attributes.context.stroke();
4273        }
4274
4275        // Direction
4276        var startAngle, endAngle, counterClockwise;
4277        var defaultOffset = (-0.5 * Math.PI);
4278        var fullCircle = 2 * Math.PI;
4279        startAngle = defaultOffset + (this.config.start_angle / 360 * fullCircle);
4280        var offset = (2 * pct * Math.PI);
4281
4282        if (this.config.direction === "Both") {
4283            counterClockwise = false;
4284            startAngle -= (offset / 2);
4285            endAngle = startAngle + offset;
4286        }
4287        else {
4288            if (this.config.direction === "Clockwise") {
4289                counterClockwise = false;
4290                endAngle = startAngle + offset;
4291            }
4292            else {
4293                counterClockwise = true;
4294                endAngle = startAngle - offset;
4295            }
4296        }
4297
4298        this.data.attributes.context.beginPath();
4299        this.data.attributes.context.arc(x, y, this.data.attributes.radius, startAngle, endAngle, counterClockwise);
4300        this.data.attributes.context.lineWidth = this.data.attributes.line_width;
4301
4302        // line color
4303        this.data.attributes.context.strokeStyle = color;
4304        this.data.attributes.context.stroke();
4305    };
4306
4307    TC_Instance.prototype.radialFade = function(x, y, color, from, key) {
4308        // TODO: Make fade_time option
4309        var rgb = hexToRgb(color);
4310        var _this = this; // We have a few inner scopes here that will need access to our instance
4311
4312        var step = 0.2 * ((from === 1) ? -1 : 1);
4313        var i;
4314        for (i = 0; from <= 1 && from >= 0; i++) {
4315            // Create inner scope so our variables are not changed by the time the Timeout triggers
4316            (function() {
4317                var delay = 50 * i;
4318                var rgba = "rgba(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ", " + (Math.round(from * 10) / 10) + ")";
4319                useWindow.setTimeout(function() {
4320                    _this.drawArc(x, y, rgba, 1);
4321                }, delay);
4322            }());
4323            from += step;
4324        }
4325        if (typeof key !== undefined) {
4326            useWindow.setTimeout(function() {
4327                _this.data.state.fading[key] = false;
4328            }, 50 * i);
4329        }
4330    };
4331
4332    TC_Instance.prototype.timeLeft = function() {
4333        if (this.data.paused && typeof this.data.timer === "number") {
4334            return this.data.timer;
4335        }
4336        var now = new Date();
4337        return ((this.data.attributes.ref_date - now) / 1000);
4338    };
4339
4340    TC_Instance.prototype.start = function() {
4341        useWindow.cancelAnimationFrame(this.data.animation_frame);
4342        useWindow.clearTimeout(this.data.animation_frame)
4343
4344        // Check if a date was passed in html attribute or jquery data
4345        var attr_data_date = $(this.element).data('date');
4346        if (typeof attr_data_date === "undefined") {
4347            attr_data_date = $(this.element).attr('data-date');
4348        }
4349        if (typeof attr_data_date === "string") {
4350            this.data.attributes.ref_date = parse_date(attr_data_date);
4351        }
4352        // Check if this is an unpause of a timer
4353        else if (typeof this.data.timer === "number") {
4354            if (this.data.paused) {
4355                this.data.attributes.ref_date = (new Date()).getTime() + (this.data.timer * 1000);
4356            }
4357        }
4358        else {
4359            // Try to get data-timer
4360            var attr_data_timer = $(this.element).data('timer');
4361            if (typeof attr_data_timer === "undefined") {
4362                attr_data_timer = $(this.element).attr('data-timer');
4363            }
4364            if (typeof attr_data_timer === "string") {
4365                attr_data_timer = parseFloat(attr_data_timer);
4366            }
4367            if (typeof attr_data_timer === "number") {
4368                this.data.timer = attr_data_timer;
4369                this.data.attributes.ref_date = (new Date()).getTime() + (attr_data_timer * 1000);
4370            }
4371            else {
4372                // data-timer and data-date were both not set
4373                // use config date
4374                this.data.attributes.ref_date = this.config.ref_date;
4375            }
4376        }
4377
4378        // Start running
4379        this.data.paused = false;
4380        this.update.call(this);
4381    };
4382
4383    TC_Instance.prototype.restart = function() {
4384        this.data.timer = false;
4385        this.start();
4386    };
4387
4388    TC_Instance.prototype.stop = function() {
4389        if (typeof this.data.timer === "number") {
4390            this.data.timer = this.timeLeft(this);
4391        }
4392        // Stop running
4393        this.data.paused = true;
4394        useWindow.cancelAnimationFrame(this.data.animation_frame);
4395    };
4396
4397    TC_Instance.prototype.destroy = function() {
4398        this.clearListeners();
4399        this.stop();
4400        useWindow.clearInterval(this.data.interval_fallback);
4401        this.data.interval_fallback = null;
4402        
4403        this.container.remove();
4404        $(this.element).removeAttr('data-tc-id');
4405        $(this.element).removeData('tc-id');
4406    };
4407
4408    TC_Instance.prototype.setOptions = function(options) {
4409        if (this.config === null) {
4410            this.default_options.ref_date = new Date();
4411            this.config = $.extend(true, {}, this.default_options);
4412        }
4413        $.extend(true, this.config, options);
4414
4415        // Use window.top if use_top_frame is true
4416        if(this.config.use_top_frame) {
4417            useWindow = window.top;
4418        }
4419        else {
4420            useWindow = window;
4421        }
4422        updateUsedWindow();
4423        
4424        this.data.total_duration = this.config.total_duration;
4425        if (typeof this.data.total_duration === "string") {
4426            if (typeof secondsIn[this.data.total_duration] !== "undefined") {
4427                // If set to Years, Months, Days, Hours or Minutes, fetch the secondsIn value for that
4428                this.data.total_duration = secondsIn[this.data.total_duration];
4429            }
4430            else if (this.data.total_duration === "Auto") {
4431                // If set to auto, total_duration is the size of 1 unit, of the unit type bigger than the largest shown
4432                for(var i = 0; i < Object.keys(this.config.time).length; i++) {
4433                    var unit = Object.keys(this.config.time)[i];
4434                    if (this.config.time[unit].show) {
4435                        this.data.total_duration = secondsIn[nextUnits[unit]];
4436                        break;
4437                    }
4438                }
4439            }
4440            else {
4441                // If it's a string, but neither of the above, user screwed up.
4442                this.data.total_duration = secondsIn["Years"];
4443                console.error("Valid values for TimeCircles config.total_duration are either numeric, or (string) Years, Months, Days, Hours, Minutes, Auto");
4444            }
4445        }
4446    };
4447
4448    TC_Instance.prototype.addListener = function(f, context, type) {
4449        if (typeof f !== "function")
4450            return;
4451        if (typeof type === "undefined")
4452            type = "visible";
4453        this.listeners[type].push({func: f, scope: context});
4454    };
4455
4456    TC_Instance.prototype.notifyListeners = function(unit, value, total, type) {
4457        for (var i = 0; i < this.listeners[type].length; i++) {
4458            var listener = this.listeners[type][i];
4459            listener.func.apply(listener.scope, [unit, value, total]);
4460        }
4461    };
4462
4463    TC_Instance.prototype.default_options = {
4464        ref_date: new Date(),
4465        start: true,
4466        animation: "smooth",
4467        count_past_zero: true,
4468        circle_bg_color: "#60686F",
4469        use_background: true,
4470        fg_width: 0.1,
4471        bg_width: 1.2,
4472        text_size: 0.07,
4473        total_duration: "Auto",
4474        direction: "Clockwise",
4475        use_top_frame: false,
4476        start_angle: 0,
4477        time: {
4478            Days: {
4479                show: true,
4480                text: "Days",
4481                color: "#FC6"
4482            },
4483            Hours: {
4484                show: true,
4485                text: "Hours",
4486                color: "#9CF"
4487            },
4488            Minutes: {
4489                show: true,
4490                text: "Minutes",
4491                color: "#BFB"
4492            },
4493            Seconds: {
4494                show: true,
4495                text: "Seconds",
4496                color: "#F99"
4497            }
4498        }
4499    };
4500
4501    // Time circle class
4502    var TC_Class = function(elements, options) {
4503        this.elements = elements;
4504        this.options = options;
4505        this.foreach();
4506    };
4507
4508    TC_Class.prototype.getInstance = function(element) {
4509        var instance;
4510
4511        var cur_id = $(element).data("tc-id");
4512        if (typeof cur_id === "undefined") {
4513            cur_id = guid();
4514            $(element).attr("data-tc-id", cur_id);
4515        }
4516        if (typeof TC_Instance_List[cur_id] === "undefined") {
4517            var options = this.options;
4518            var element_options = $(element).data('options');
4519            if (typeof element_options === "string") {
4520                element_options = JSON.parse(element_options);
4521            }
4522            if (typeof element_options === "object") {
4523                options = $.extend(true, {}, this.options, element_options);
4524            }
4525            instance = new TC_Instance(element, options);
4526            TC_Instance_List[cur_id] = instance;
4527        }
4528        else {
4529            instance = TC_Instance_List[cur_id];
4530            if (typeof this.options !== "undefined") {
4531                instance.setOptions(this.options);
4532            }
4533        }
4534        return instance;
4535    };
4536
4537    TC_Class.prototype.addTime = function(seconds_to_add) {
4538        this.foreach(function(instance) {
4539            instance.addTime(seconds_to_add);
4540        });
4541    };
4542    
4543    TC_Class.prototype.foreach = function(callback) {
4544        var _this = this;
4545        this.elements.each(function() {
4546            var instance = _this.getInstance(this);
4547            if (typeof callback === "function") {
4548                callback(instance);
4549            }
4550        });
4551        return this;
4552    };
4553
4554    TC_Class.prototype.start = function() {
4555        this.foreach(function(instance) {
4556            instance.start();
4557        });
4558        return this;
4559    };
4560
4561    TC_Class.prototype.stop = function() {
4562        this.foreach(function(instance) {
4563            instance.stop();
4564        });
4565        return this;
4566    };
4567
4568    TC_Class.prototype.restart = function() {
4569        this.foreach(function(instance) {
4570            instance.restart();
4571        });
4572        return this;
4573    };
4574
4575    TC_Class.prototype.rebuild = function() {
4576        this.foreach(function(instance) {
4577            instance.initialize(false);
4578        });
4579        return this;
4580    };
4581
4582    TC_Class.prototype.getTime = function() {
4583        return this.getInstance(this.elements[0]).timeLeft();
4584    };
4585
4586    TC_Class.prototype.addListener = function(f, type) {
4587        if (typeof type === "undefined")
4588            type = "visible";
4589        var _this = this;
4590        this.foreach(function(instance) {
4591            instance.addListener(f, _this.elements, type);
4592        });
4593        return this;
4594    };
4595
4596    TC_Class.prototype.destroy = function() {
4597        this.foreach(function(instance) {
4598            instance.destroy();
4599        });
4600        return this;
4601    };
4602
4603    TC_Class.prototype.end = function() {
4604        return this.elements;
4605    };
4606
4607    $.fn.TimeCircles = function(options) {
4608        return new TC_Class(this, options);
4609    };
4610}(jQuery));
4611 
4612function initDailyProduct() {
4613	setTimeout(() => {
4614		if ($('.dailyProduct .dailyTimer').length) {
4615			if ($('.dailyProduct .dailyTimer .textDiv_Minutes').length) {return false;}
4616			$(".dailyProduct .dailyTimer").TimeCircles({
4617				"animation": $('.dailyProduct .dailyTimer').data('animation'),
4618				"bg_width": $('.dailyProduct .dailyTimer').data('bgwidth'),
4619				"fg_width": $('.dailyProduct .dailyTimer').data('circlewidth'),
4620				"circle_bg_color": "#"+$('.dailyProduct .dailyTimer').data('bgcolor'),
4621				"direction": $('.dailyProduct .dailyTimer').data('direction'),
4622					"start_angle": $('.dailyProduct .dailyTimer').data('angle'),
4623					"count_past_zero": false,
4624				"time": {
4625					"Days": {
4626						"text": "Days",
4627						"color": "#FFCC66",
4628						"show": false
4629					},
4630					"Hours": {
4631						"text": $('.dailyProduct .dailyTimer').data('hourtext'),
4632						"color": "#"+$('.dailyProduct .dailyTimer').data('hourcolor'),
4633						"show": true
4634					},
4635					"Minutes": {
4636						"text": $('.dailyProduct .dailyTimer').data('minutetext'),
4637						"color": "#"+$('.dailyProduct .dailyTimer').data('minutecolor'),
4638						"show": true
4639					},
4640					"Seconds": {
4641						"text": $('.dailyProduct .dailyTimer').data('secondtext'),
4642						"color": "#"+$('.dailyProduct .dailyTimer').data('secondcolor'),
4643						"show": true
4644					}
4645				}
4646			});
4647			if ($('.dailyProduct .dailyTimer').data('labelsize') < 1) {$(".dailyProduct .dailyTimer h4").hide();}
4648				else{$(".dailyProduct .dailyTimer h4").css("fontSize", $('.dailyProduct .dailyTimer').data('labelsize')+"px").show();}
4649			if ($('.dailyProduct .dailyTimer').data('numbersize') < 1) {$(".dailyProduct .dailyTimer span").hide();}
4650				else{$(".dailyProduct .dailyTimer span").css("fontSize", $('.dailyProduct .dailyTimer').data('numbersize')+"px").show();}
4651			$(".dailyProduct .dailyTimer h4").css("lineHeight", $('.dailyProduct .dailyTimer').data('labellinesize')+"px");
4652			$(".dailyProduct .dailyTimer span").css("lineHeight", $('.dailyProduct .dailyTimer').data('numberlinesize')+"px");
4653	
4654			$(".dailyProduct .dailyTimer .textDiv_Hours h4").css("color", '#'+$('.dailyProduct .dailyTimer').data('hourcolorlabel'));
4655			$(".dailyProduct .dailyTimer .textDiv_Hours span").css("color", '#'+$('.dailyProduct .dailyTimer').data('hourcolornumber'));
4656			$(".dailyProduct .dailyTimer .textDiv_Minutes h4").css("color", '#'+$('.dailyProduct .dailyTimer').data('minutecolorlabel'));
4657			$(".dailyProduct .dailyTimer .textDiv_Minutes span").css("color", '#'+$('.dailyProduct .dailyTimer').data('minutecolornumber'));
4658			$(".dailyProduct .dailyTimer .textDiv_Seconds h4").css("color", '#'+$('.dailyProduct .dailyTimer').data('secondcolorlabel'));
4659			$(".dailyProduct .dailyTimer .textDiv_Seconds span").css("color", '#'+$('.dailyProduct .dailyTimer').data('secondcolornumber'));				
4660		}
4661	}, 10)
4662}
4663
4664$(document).ready(function() {
4665	initDailyProduct();
4666}); 
4667$(document).ready(function() {
4668    nonAvailableModule.init();
4669});
4670
4671var nonAvailableModule = (function() {
4672    return {
4673        init: function() {
4674            var nonAvailable_recaptcha = '';
4675            // появляется окно оформления заявки
4676            if ($('.wrapper-modal-mg-non-available').length == 0) {
4677
4678                if (typeof agreement_non_avaiailable == 'undefined') {
4679                    agreement_non_avaiailable = '';
4680                }
4681                var html = '\
4682              <span class="mg-non-available-overlay"></span>\
4683    <div class="wrapper-modal-mg-non-available">\
4684      <div class="header-modal-mg-non-available">\
4685        <h2 class="title-modal-mg-non-available">\
4686        </h2>\
4687          <span class="close-mg-booking-button"><a role="button" href="javascript:void(0);"></a></span>\
4688      </div>\
4689      <div class="modal-mg-non-available-title"><div class="link"><h3 data-link ></h3></div></div>\
4690      <div class="content-modal-mg-non-available">\
4691        <div class="mg-product-info">\
4692          <div class="mg-product-img">\
4693      <img class="product-image" src="" >\
4694      </div>\
4695      <div class="mg-price-non-available"></div>\
4696      <div id="na-variant"> </div>\
4697        </div> \
4698        <div class="mg-booking-non-available">\
4699    <form action="' + mgBaseDir + '/" method="post">\
4700          <ul class="modal-mg-booking-list">\
4701            <li style="display:none" class="fio">\
4702                <span>Ваше имя:</span>\
4703                <input type="text" name="na-name" value ="">\
4704            </li>\
4705            <li style="display:none" class="phone">\
4706                <span>Телефон:<span class="red-star">*</span></span>\
4707                <input type="tel" name="phone" value ="">\
4708            </li>\
4709            <li style="display:none" class="email">\
4710                <span>Ваш e-mail:<span class="red-star">*</span></span>\
4711                <input type="text" name="na-email" value ="">\
4712            </li>\
4713            <li style="display:none" class="address">\
4714                <span>Адрес:</span>\
4715                <textarea name="na-address"  value =""></textarea>\
4716            </li>\
4717            <li style="display:none" class="count">\
4718                <span>Количество:</span>\
4719                <input type="number" name="na-count"  value ="1">\
4720            </li>\
4721            <li style="display:none" class="comment">\
4722                <span>Комментарий:</span>\
4723                <textarea name="na-comment"  value =""></textarea>\
4724            </li>\
4725            <li class="mg-cap" style="display:none">\
4726                <div class="cap-left">\
4727                    <img style="margin-top: 5px; border: 1px solid gray;" src = "'+ '' +'" width="140" height="36">\
4728                    <span>Введите текст с картинки:<span class="red-star">*</span> </span>\
4729                    <input type="text" name="capcha" class="captcha">\
4730                </div>\
4731                <div style="clear:both;">\
4732                </div>\
4733            </li>\
4734          </ul>\
4735          </form>\
4736        </div>\
4737      </div>\
4738  <div class="mg-action-buttons">\
4739  <div class="noneAvaileble_agreement">' + agreement_non_avaiailable + '</div> \
4740    <button class="close-mg-booking-button mg-plugin-btn">Отмена</button>\
4741      <button type = "" class="mg-send-booking-click-button mg-booking-btn" data-code="">Заказать</button>\
4742      </div>\
4743    </div>';
4744                $('body').append(html);
4745            }
4746
4747            // Открытие пользовательского соглашения
4748            $('body').on('click', '.agreement__btn_open', function () {$('body .agreement__modal').show(); });
4749            //Закрытие пользовательского соглашения
4750            $('body').on('click', '.agreement__btn_close', function () {$('body .agreement__modal').hide(); });
4751
4752            $('.mg-non-available-button').on('click', function() {
4753                var capchaSrc = mgBaseDir + ((langP=='LANG')?'':('/'+langP))+"/captcha.html?t=" + Date.now();
4754                
4755                var id = $(this).data('product_id');
4756                var id_var = $(this).data('var_id');
4757                var type = $(this).attr('data-type');
4758                $('.mg-price-non-available').html('');
4759                if (type == 'product') {
4760                    var price = $('.product-status-list li .price:first').text();
4761                    if (price.length < 1) {
4762                       price = $(this).closest('.product-wrapper').find('.price:first').text();
4763                    }
4764                    if (price.length > 1) {
4765                        $('.mg-price-non-available').html('<span>' + price + '</span>');
4766                        $('.wrapper-modal-mg-non-available .mg-send-booking-click-button').attr('data-price', price);
4767                    }
4768                }
4769                
4770                if ($('.wrapper-modal-mg-non-available .cap-left img').attr('src') == '') {
4771                    $('.wrapper-modal-mg-non-available .mg-cap img').attr('src', capchaSrc);
4772                }
4773                
4774                // if($('.buy-block').is('.product-code span')){
4775                //   code = $('.buy-block .product-code span').text();
4776                // }
4777                openOrderForm(id, id_var, type);
4778                $('.wrapper-modal-mg-non-available .error').remove();
4779                // var title_var = '';
4780                // if ($('.block-variants input[type=radio]:checked').val()) {
4781                //   title_var = $('.block-variants input[type=radio]:checked').parents("tr").find('label').text();
4782                //   $('#na-variant').html("" + title_var + "");
4783                // }
4784                // var title = $('.product-details-block .product-title').text();
4785                // $('.wrapper-modal-mg-non-available .modal-mg-booking-list .link h3').html(title+ ' ' + title_var);
4786                // var src = $('.product-details-block img[data-product-id='+id+']').attr('src');
4787                // $('.wrapper-modal-mg-non-available .mg-product-img img').attr('src', src);
4788                $('.wrapper-modal-mg-non-available').show();
4789                $('.mg-non-available-overlay').show();
4790                
4791                openModal($('.wrapper-modal-mg-non-available'));
4792                
4793            });
4794
4795
4796            // закрытие окна заявка
4797            $('.close-mg-booking-button').click(function() {
4798                $('.wrapper-modal-mg-non-available').hide();
4799                $('.mg-non-available-overlay').hide();
4800                closeModal($('.wrapper-modal-mg-non-available'));
4801            });
4802
4803
4804            // проверка введенных данных и отправка заявки
4805            $('body').on('click', '.mg-send-booking-click-button', function() {
4806                var checkbox = $('.noneAvaileble_agreement .js-agreement-checkbox-mg-send-order-click-button');
4807                if(checkbox.length != 0){
4808                    var errorClass = 'agreement__label_error';
4809                    if(checkbox.is(':checked')) {
4810                        checkbox.parent().removeClass(errorClass);
4811                    }
4812                    else{
4813                        checkbox.parent().addClass(errorClass);
4814                        return false;
4815                    }
4816                }
4817                var name = $(this).parents('.wrapper-modal-mg-non-available').find('input[name=na-name]');
4818                var phone = $(this).parents('.wrapper-modal-mg-non-available').find('input[name=phone]');
4819                var email = $(this).parents('.wrapper-modal-mg-non-available').find('input[name=na-email]');
4820                var address = $(this).parents('.wrapper-modal-mg-non-available').find('textarea[name=na-address]');
4821                var comment = $(this).parents('.wrapper-modal-mg-non-available').find('textarea[name=na-comment]');
4822                var count = $(this).parents('.wrapper-modal-mg-non-available').find('input[name=na-count]');
4823                var capcha = $(this).parents('.wrapper-modal-mg-non-available').find('input[name=capcha]').val();
4824                // var code = $(".mg-non-available-button").data('product_code');
4825                var code = $('.wrapper-modal-mg-non-available .mg-send-booking-click-button').attr('data-code');
4826                var product_id = $('.mg-non-available-button').data('product_id');
4827                // var title_var = '';
4828                // if ($('.block-variants input[type=radio]:checked').val()) {
4829                //   title_var = $('.block-variants input[type=radio]:checked').parents("tr").find('label').text();
4830                // }
4831                // var title = $(".mg-non-available-button").data('product_title');
4832                var title = $('.wrapper-modal-mg-non-available .mg-send-booking-click-button').attr('data-title');
4833                var price = $('.wrapper-modal-mg-non-available .mg-send-booking-click-button').attr('data-price');
4834                // var price = $(".product-status-list li .price:first").text();
4835
4836                if (!capcha) {
4837                    if ($('.wrapper-modal-mg-non-available li.mg-cap .g-recaptcha-template').length) {
4838                        capcha = grecaptcha.getResponse(nonAvailable_recaptcha);
4839                    }
4840                }
4841
4842                if (!capcha) {
4843                    if ($('.wrapper-modal-mg-non-available li.mg-cap .recaptcha-holder-template').length) {
4844                        if (!nonAvailableModule.recaptchaToken) {
4845                            grecaptcha.execute(nonAvailable_recaptcha);
4846                            return false;
4847                        } else {
4848                            capcha = nonAvailableModule.recaptchaToken;
4849                        }
4850                    }
4851                }
4852                nonAvailableModule.recaptchaToken = null;
4853
4854                if ($('.buy-block').find('.property-form').length) {
4855                    var request = $('.buy-block').find('.property-form').formSeri
4855alize();
4856                } else {
4857                    var inCartProd = 'inCartProductId=' + $('.mg-non-available-button').data('product_id');
4858                    var request = inCartProd + '&amount_input=1';
4859                }
4860
4861                var link = $('.modal-mg-non-available-title h3').data('link');
4862                $.ajax({
4863                    type: 'POST',
4864                    url: mgBaseDir + '/ajaxrequest?' + request,
4865                    dataType: 'json',
4866                    data: {
4867                        mguniqueurl: 'action/orderNonAvailable', // действия для выполнения на сервере
4868                        pluginHandler: 'non-available',
4869                        name: name.val(),
4870                        phone: phone.val(),
4871                        email: email.val(),
4872                        address: address.val(),
4873                        comment: comment.val(),
4874                        count: count.val(),
4875                        capcha: capcha,
4876                        invisible: 1,
4877                        status_id: 1,
4878                        code: code,
4879                        product_id: product_id,
4880                        title: title,
4881                        price: price,
4882                        url: link,
4883                    },
4884                    success: function(response) {
4885                        if (response.status != 'error') {
4886                            $('.wrapper-modal-mg-non-available .error').remove();
4887                            $('.loading-send-booking').remove();
4888                            $('.mg-action-buttons').before('<span class="loading-send-booking">' + response.data.msg + '</span>');
4889                            $('.content-modal-mg-non-available').hide();
4890                            $('.mg-action-buttons').hide();
4891                            $('.mg-price-non-available').hide();
4892                            $('.agreement-container').hide();
4893
4894                            $('body').animate({ scrollTop: $('body').scrollTop() - 700, scrollLeft: 0 }, 350);
4895
4896                        } else {
4897                            $('.wrapper-modal-mg-non-available .error').remove();
4898                            $('.content-modal-mg-non-available').prepend(response.data.msg);
4899                            $('.mg-action-buttons').show();
4900                            $('.loading-send-booking').remove();
4901                        }
4902                    },
4903                });
4904            });
4905
4906
4907            $('body').on('click', '.variants-table input[type=radio]', function() {
4908                if ($(this).data('count') != 0) {
4909                    $(this).parents('.product-wrapper').find('.wrapper-mg-non-available .mg-non-available-button').hide().data('var_id', '').data('type', 'catalog');
4910                    $(this).parents('.product-details-block').find('.wrapper-mg-non-available .mg-non-available-button').hide().data('var_id', '').data('type', 'product');
4911                } else {
4912                    $(this).parents('.product-wrapper').find('.wrapper-mg-non-available .mg-non-available-button').show().data('var_id', $(this).val()).data('type', 'catalog');
4913                    $(this).parents('.product-details-block').find('.wrapper-mg-non-available .mg-non-available-button').show().data('var_id', $(this).val()).data('type', 'product');
4914                }
4915            });
4916
4917            $('body').on('change', '.variants-table input[type=radio]', function() {
4918                if ($(this).data('count') != 0) {
4919                    $(this).parents('.product-wrapper').find('.wrapper-mg-non-available .mg-non-available-button').hide().data('var_id', '').data('type', 'catalog');
4920                    $(this).parents('.product-details-block').find('.wrapper-mg-non-available .mg-non-available-button').hide().data('var_id', '').data('type', 'product');
4921                } else {
4922                    $(this).parents('.product-wrapper').find('.wrapper-mg-non-available .mg-non-available-button').show().data('var_id', $(this).val()).data('type', 'catalog');
4923                    $(this).parents('.product-details-block').find('.wrapper-mg-non-available .mg-non-available-button').show().data('var_id', $(this).val()).data('type', 'product');
4924                }
4925            });
4926
4927            $('.buy-block .variants-table input[type=radio]:checked').each(function(index, element) {
4928                if ($(this).data('count') != 0) {
4929                    $(this).parents('.product-wrapper').find('.wrapper-mg-non-available .mg-non-available-button').hide().data('type', 'catalog');
4930                    $(this).parents('.product-details-block').find('.wrapper-mg-non-available .mg-non-available-button').hide().data('type', 'product');
4931                } else {
4932                    $(this).parents('.product-wrapper').find('.wrapper-mg-non-available .mg-non-available-button').data('var_id', $(this).val()).data('type', 'catalog');
4933                    $(this).parents('.product-details-block').find('.wrapper-mg-non-available .mg-non-available-button').data('var_id', $(this).val()).data('type', 'product');
4934                }
4935            });
4936            $('.mg-non-available-button').each(function(index, item) {
4937                const currentVariantCount = $(item).closest('.product-wrapper').find('.block-variants input[type=radio]:checked').attr('data-count');
4938                if (currentVariantCount && currentVariantCount != '0') {
4939                    $(item).hide();
4940                } else {
4941                    $(item).show();
4942                }
4943            });
4944            if ($('.block-variants input[type=radio]:checked').length) {
4945              if ($(this).data('count') != 0 ) {
4946                $(this).parents('.product-wrapper').find('.wrapper-mg-non-available .mg-non-available-button').hide();
4947                $(this).parents('.product-details-block').find('.wrapper-mg-non-available .mg-non-available-button').hide();
4948              }
4949            };
4950
4951
4952            /**
4953             * Открывает модальное окно
4954             */
4955            function openModal(object) {
4956                overlay();
4957                object.fadeIn(300);
4958                object.css('z-index', 200);
4959                var offset = (window.pageYOffset);
4960                object.css('margin-top', offset);
4961            }
4962
4963            /**
4964             * Закрывает модальное окно
4965             */
4966            function closeModal(object) {
4967                object.fadeOut(300);
4968                $('#overlay-non-av').remove();
4969            }
4970
4971            /**
4972             * Фон для заднего плана при открытии всплывающего окна
4973             */
4974            function overlay() {
4975                var docHeight = $(document).height();
4976                $('body').append('<div id=\'overlay-non-av\'></div>');
4977                $('#overlay-non-av').height(docHeight);
4978            }
4979
4980            /**
4981             * функция загрузки формы для заказа
4982             * @param {type} e
4983             * @returns {undefined}
4984             */
4985            function openOrderForm(id, id_var, type) {
4986                $.ajax({
4987                    type: 'POST',
4988                    url: mgBaseDir + '/ajaxrequest',
4989                    dataType: 'json',
4990                    data: {
4991                        mguniqueurl: 'action/buildOrderForm', // действия для выполнения на сервере
4992                        pluginHandler: 'non-available',
4993                        id: id,
4994                        id_var: id_var,
4995                    },
4996                    success: function(response) {
4997                        if (type == 'catalog' || $('.mg-price-non-available').text().length < 3) {
4998                            $('.mg-price-non-available').html('Стоимость товара: <span>' + response.data.product.price + '</span>');
4999                            console.log(response.data.product.price);
5000                            $('.wrapper-modal-mg-non-available .mg-send-booking-click-button').attr('data-price', response.data.product.price.trim());
5001                        }
5002                        $('.wrapper-modal-mg-non-available .mg-send-booking-click-button').attr('data-title', response.data.product.name);
5003                        $('.wrapper-modal-mg-non-available .modal
5003-mg-non-available-title .link h3').html(response.data.product.name);
5004                        $('.wrapper-modal-mg-non-available .mg-product-img img').attr('src', response.data.product.img);
5005                        $('.wrapper-modal-mg-non-available .mg-send-booking-click-button').attr('data-code', response.data.product.code);
5006                        $('.wrapper-modal-mg-non-available .modal-mg-non-available-title li.link h3').attr('data-link', response.data.link);
5007                        if (response.data.options.header != '') {
5008                            $('.wrapper-modal-mg-non-available .title-modal-mg-non-available').html(response.data.options.header);
5009                        }
5010                        if (response.data.options.button != '') {
5011                            $('.wrapper-modal-mg-non-available .mg-send-booking-click-button').text(response.data.options.button);
5012                        }
5013                        if (response.data.options.name == 'true') {
5014                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.fio').css('display', 'block');
5015                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list input[name=na-name]').val(response.data.user.name ? response.data.user.name : '');
5016                        }
5017                        if (response.data.options.phone == 'true') {
5018                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.phone').css('display', 'block');
5019                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list input[name=phone]').val(response.data.user.phone ? response.data.user.phone : '');
5020                        }
5021                        if (response.data.options.email == 'true') {
5022                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.email').css('display', 'block');
5023                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list input[name=na-email]').val(response.data.user.email ? response.data.user.email : '');
5024                        }
5025                        if (response.data.options.address == 'true') {
5026                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.address').css('display', 'block');
5027                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list textarea[name=na-address]').val(response.data.user.address ? response.data.user.address : '');
5028                        }
5029                        if (response.data.options.comment == 'true') {
5030                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.comment').css('display', 'block');
5031                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list textarea[name=na-comment]').val('');
5032                        }
5033                        if (response.data.options.count == 'true') {
5034                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.count').css('display', 'block');
5035                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list textarea[name=na-count]').val(1);
5036                        }
5037                        if (response.data.options.capcha == 'true') {
5038                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap').css('display', 'block');
5039                            $('.wrapper-modal-mg-non-available .modal-mg-booking-list input[name=capcha]').val('');
5040                            if (response.data.options.recaptcha == 'true') {
5041                                $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap').html(response.data.recaptchahtml);
5042
5043                                if ($('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap .g-recaptcha-template').length && !$('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap .g-recaptcha-template iframe').length) {
5044                                    $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap .g-recaptcha-template').attr('id', 'nonAvailable_recaptcha');
5045                                    var skey = $('#nonAvailable_recaptcha').data('sitekey');
5046                                    nonAvailable_recaptcha = grecaptcha.render('nonAvailable_recaptcha', {
5047                                        sitekey: skey,
5048                                    });
5049                                    $('.wrapper-modal-mg-non-available .modal
5049-mg-booking-list li.mg-cap .g-recaptcha-template').removeAttr('id');
5050                                }
5051
5052                                if ($('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap .recaptcha-holder-template').length && !$('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap .recaptcha-holder-template iframe').length) {
5053                                    $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap .recaptcha-holder-template').attr('id', 'nonAvailable_recaptcha');
5054                                    var skey = $('#nonAvailable_recaptcha').data('sitekey');
5055                                    nonAvailable_recaptcha = grecaptcha.render('nonAvailable_recaptcha', {
5056                                        sitekey: skey,
5057                                        callback: function(recaptchaToken) {
5058                                            nonAvailableModule.recaptchaToken = recaptchaToken;
5059                                            $('.mg-send-booking-click-button:visible').click();
5060                                        },
5061                                    });
5062                                    $('.wrapper-modal-mg-non-available .modal-mg-booking-list li.mg-cap .recaptcha-holder-template').removeAttr('id');
5063                                }
5064
5065                            }
5066                        }
5067
5068                    },
5069                });
5070                return true;
5071
5072            }
5073        },
5074    };
5075})();
5076 
5077$(document).ready(function() {
5078
5079    $('body').on('click', '.addToWishList', function(e) {
5080        e.preventDefault();
5081
5082        product_id = $(this).attr('data-item-id');
5083
5084        $.ajax({
5085            type: "POST",
5086            url: mgBaseDir + "/ajaxrequest",
5087            data: {
5088                pluginHandler: 'mg-want-discount',
5089                actionerClass: 'Desires',
5090                action: "addProduct",
5091                product_id: product_id,
5092            },
5093            dataType: "json",
5094            cache: false,
5095            success: function(response) {
5096                popupAlert(response.msg);
5097                $.ajax({
5098                    type: 'POST',
5099                    url: mgBaseDir + '/ajaxrequest',
5100                    data: {
5101                        pluginHandler: 'mg-want-discount',
5102                        actionerClass: 'Desires',
5103                        action: 'getCount',
5104                        product_id: product_id
5105                    },
5106                    dataType: 'json',
5107                    cache: false,
5108                    success: function(response) {
5109                        if (response.data.count == -1) $('.wishlist .count').remove();
5110
5111                        $('.wishlist_'+product_id+' .count').html(response.data.count);
5112                    }
5113                });
5114            }
5115        });
5116    });
5117
5118    $('body').on('click', '.desire-delete', function(e) {
5119        e.preventDefault();
5120
5121        id = $(this).attr('data-id');
5122
5123        $.ajax({
5124            type: "POST",
5125            url: mgBaseDir + "/ajaxrequest",
5126            data: {
5127                pluginHandler: 'mg-want-discount',
5128                actionerClass: 'Desires',
5129                action: "delete",
5130                desire_id: id,
5131            },
5132            dataType: "json",
5133            cache: false,
5134            success: function(response) {
5135                popupAlert(response.msg);
5136                $('.desires-container tr[data-id=' + id + ']').fadeOut(300, function() {
5137                    $(this).remove();
5138                });
5139            }
5140        });
5141    });
5142
5143    $('.desiresEnableTimer').each(function() {
5144        desiresEnableTimer($(this), $(this).data('time'));
5145    });
5146
5147    function getCookie(name) {
5148        const value = `; ${document.cookie}`;
5149        const parts = value.split(`; ${name}=`);
5150        if (parts.length === 2) return parts.pop().split(';').shift();
5151    }
5152
5153    $('body').one('click', '#c-tab-btn-desires', function() {
5154        $.ajax({
5155            type: "POST",
5156            url: mgBaseDir + "/ajaxrequest",
5157            data: {
5158                pluginHandler: 'mg-want-discount', // имя папки в которой лежит данный плагин
5159                actionerClass: 'desires', // класс Pactioner в Pactioner.php - в папке плагина
5160                action: 'changePage',
5161                page: 1,
5162            },
5163            cache: false,
5164            dataType: 'json',
5165            success: function(response) {
5166                $('#c-tab__desires').html(response.data);
5167                $('.desiresEnableTimer').each(function() {
5168                    desiresEnableTimer($(this), $(this).data('time'));
5169                });
5170            }
5171        });
5172    });
5173
5174    $('body').on('click', '#c-tab__desires .mg-pager .linkPage', function() {
5175        var page = $(this).text();
5176        switch (page) {
5177            case '«':
5178                page = parseInt($(this).parent().parent().find('.current a').text()) - 1;
5179                break;
5180            case '»':
5181                page = parseInt($(this).parent().parent().find('.current a').text()) + 1;
5182                break;
5183            case '»»':
5184                page = parseInt($(this).parent().parent().parent().find('.allPages span').text());
5185                break;
5186        }
5187
5188        $.ajax({
5189            type: "POST",
5190            url: mgBaseDir + "/ajaxrequest",
5191            data: {
5192                pluginHandler: 'mg-want-discount', // имя папки в которой лежит данный плагин
5193                actionerClass: 'desires', // класс Pactioner в Pactioner.php - в папке плагина
5194                action: 'changePage',
5195                page: page,
5196            },
5197            cache: false,
5198            dataType: 'json',
5199            success: function(response) {
5200                $('#c-tab__desires').html(response.data);
5201                $('.desiresEnableTimer').each(function() {
5202                    desiresEnableTimer($(this), $(this).data('time'));
5203                });
5204            }
5205        });
5206    });
5207
5208});
5209
5210function popupAlert(message) {
5211    $(".desire-popup-alert").remove();
5212    $('body').append(
5213        `<div class="desire-popup-alert">
5214            <button class="close desire-popup-alert__close" aria-label="Закрыть всплывающее окно">
5215                    <svg enable-background="new 0 0 47.971 47.971" viewB
5215ox="0 0 47.971 47.971" xmlns="http://www.w3.org/2000/svg">
5216                        <path d="m28.228 23.986 18.864-18.864c1.172-1.171 1.172-3.071 0-4.242-1.172-1.172-3.07-1.172-4.242 0l-18.864 18.864-18.865-18.864c-1.172-1.172-3.07-1.172-4.242 0-1.172 1.171-1.172 3.071 0 4.242l18.865 18.864-18.865 18.864c-1.172 1.171-1.172 3.071 0 4.242.586.585 1.354.878 2.121.878s1.535-.293 2.121-.879l18.865-18.864 18.864 18.864c.586.586 1.354.879 2.121.879s1.535-.293 2.121-.879c1.172-1.171 1.172-3.071 0-4.242z"/>
5217                    </svg>
5218            </button>
5219            <div class="desire-popup-alert__icon"><img loading="lazy" src="${mgBaseDir}/mg-plugins/mg-want-discount/images/discount.svg"></div>
5220            <div class="message">` + message + `</div>
5221        </div>`);
5222    $('.desire-popup-alert .close').click(function() {
5223        $(this).parent().remove();
5224    });
5225}
5226
5227function desiresEnableTimer(timer, time) {
5228    // Узнаём текущее время
5229    var timeOnStart = new Date().getTime();
5230
5231    var timeLeft = time;
5232
5233    var clockDigits = new Array(
5234        timer.find('.clockDays'),
5235        timer.find('.clockHours'),
5236        timer.find('.clockMinutes'),
5237        timer.find('.clockSeconds')
5238    );
5239    setInterval(function() {
5240        // Текущее время
5241        var timeCurrent = new Date().getTime();
5242        // Сколько вемени прошло с момента открытия страницы, сразу переводим из миллисекунд в секунды
5243        var timePassed = Math.floor((timeCurrent - timeOnStart) * 0.001);
5244        // Текущее количество секунд до конца отсчёта
5245        var timeCurrentLeft = timeLeft - timePassed;
5246
5247        if (timeCurrentLeft > 0) {
5248            // Переменная, в которой будут храниться остатки, нужна для выmg-want-discount из оставшихся секунд минут, часов и дней
5249            var rest = new Array();
5250
5251            // Действие % — остаток от mg-want-discount
5252            rest[0] = timeCurrentLeft % 60;
5253            rest[1] = (timeCurrentLeft - rest[0]) % 3600;
5254            rest[2] = (timeCurrentLeft - rest[1] - rest[0]) % 86400;
5255            rest[3] = (timeCurrentLeft - rest[2] - rest[1] - rest[0]);
5256
5257            clockDigits[0].html(rest[3] / 86400);
5258            clockDigits[1].html((rest[2] < 36000 ? '0' : '') + rest[2] / 3600);
5259            clockDigits[2].html((rest[1] < 600 ? '0' : '') + rest[1] / 60);
5260            clockDigits[3].html((rest[0] < 10 ? '0' : '') + rest[0]);
5261        } else {
5262            // Действие, которое выполняется, когда отсчёт окончен
5263            //clockDigits[0].innerHTML = '0';
5264            //clockDigits[1].innerHTML  = clockDigits[2].innerHTML  = clockDigits[3].innerHTML = '00';
5265            timer.find('span').html('00');
5266            clockDigits[0].html('0');
5267        }
5268    }, 1000);
5269} 
5270/*!
5271 * css-vars-ponyfill
5272 * v2.1.2
5273 * https://jhildenbiddle.github.io/css-vars-ponyfill/
5274 * (c) 2018-2019 John Hildenbiddle <http://hildenbiddle.com>
5275 * MIT license
5276 */
5277!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).cssVars=t()}(this,function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function t(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},n=Array.isArray(e)?e:[e],o=Array.apply(null,Array(n.length)).map(function(e){return null});function s(){return!("<"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().charAt(0))}function a(e,t){r.onError(e,n[t],t)}function c(e,t){var s=r.onSuccess(e,n[t],t);e=!1===s?"":s||e,o[t]=e,-1===o.indexOf(null)&&r.onComplete(o)}var i=document.createElement("a");
5277n.forEach(function(e,t){if(i.setAttribute("href",e),i.href=String(i.href),Boolean(document.all&&!window.atob)&&i.host.split(":")[0]!==location.host.split(":")[0]){if(i.protocol===location.protocol){var n=new XDomainRequest;n.open("GET",e),n.timeout=0,n.onprogress=Function.prototype,n.ontimeout=Function.prototype,n.onload=function(){s(n.responseText)?c(n.responseText,t):a(n,t)},n.onerror=function(e){a(n,t)},setTimeout(function(){n.send()},0)}else console.warn("Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (".concat(e,")")),a(null,t)}else{var o=new XMLHttpRequest;o.open("GET",e),r.mimeType&&o.overrideMimeType&&o.overrideMimeType(r.mimeType),r.onBeforeSend(o,e,t),o.onreadystatechange=function(){4===o.readyState&&(200===o.status&&s(o.responseText)?c(o.responseText,t):a(o,t))},o.send()}})}function n(e){var t={cssComments:/\/\*[\s\S]+?\*\//g,cssImports:/(?:@import\s*)(?:url\(\s*)?(?:['"])([^'"]*)(?:['"])(?:\s*\))?(?:[^;]*;)/g},n={rootElement:e.rootElement||document,include:e.include||'style,link[rel="stylesheet"]',exclude:e.exclude||null,filter:e.filter||null,useCSSOM:e.useCSSOM||!1,onBeforeSend:e.onBeforeSend||Function.prototype,onSuccess:e.onSuccess||Function.prototype,onError:e.onError||Function.prototype,onComplete:e.onComplete||Function.prototype},s=Array.apply(null,n.rootElement.querySelectorAll(n.include)).filter(function(e){return t=e,r=n.exclude,!(t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector).call(t,r);var t,r}),a=Array.apply(null,Array(s.length)).map(function(e){return null});function c(){if(-1===a.indexOf(null)){var e=a.join("");n.onComplete(e,a,s)}}function i(e,t,o,s){var i=n.onSuccess(e,o,s);(function e(t,o,s,a){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];var l=u(t,s,i);l.rules.length?r(l.absoluteUrls,{onBeforeSend:function(e,t,r){n.onBeforeSend(e,o,t)},onSuccess:function(e,t,r){var s=n.onSuccess(e,o,t),a=u(e=!1===s?"":s||e,t,i);
vendor: 3,964 bytes, line 5277
5277return a.rules.forEach(function(t,r){e=e.replace(t,a.absoluteRules[r])}),e},onError:function(r,n,u){c.push({xhr:r,url:n}),i.push(l.rules[u]),e(t,o,s,a,c,i)},onComplete:function(r){r.forEach(function(e,r){t=t.replace(l.rules[r],e)}),e(t,o,s,a,c,i)}}):a(t,c)})(e=void 0!==i&&!1===Boolean(i)?"":i||e,o,s,function(e,r){null===a[t]&&(r.forEach(function(e){return n.onError(e.xhr,o,e.url)}),!n.filter||n.filter.test(e)?a[t]=e:a[t]="",c())})}function u(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s={};return s.rules=(e.replace(t.cssComments,"").match(t.cssImports)||[]).filter(function(e){return-1===n.indexOf(e)}),s.urls=s.rules.map(function(e){return e.replace(t.cssImports,"$1")}),s.absoluteUrls=s.urls.map(function(e){return o(e,r)}),s.absoluteRules=s.rules.map(function(e,t){var n=s.urls[t],a=o(s.absoluteUrls[t],r);return e.replace(n,a)}),s}s.length?s.forEach(function(e,t){var s=e.getAttribute("href"),u=e.getAttribute("rel"),l="LINK"===e.nodeName&&s&&u&&"stylesheet"===u.toLowerCase(),f="STYLE"===e.nodeName;if(l)r(s,{mimeType:"text/css",onBeforeSend:function(t,r,o){n.onBeforeSend(t,e,r)},onSuccess:function(r,n,a){var c=o(s,location.href);i(r,t,e,c)},onError:function(r,o,s){a[t]="",n.onError(r,e,o),c()}});else if(f){var d=e.textContent;n.useCSSOM&&(d=Array.apply(null,e.sheet.cssRules).map(function(e){return e.cssText}).join("")),i(d,t,e,location.href)}else a[t]="",c()}):n.onComplete("",[])}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,r=document.implementation.createHTMLDocument(""),n=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(o),n.href=t,o.href=e,o.href}var s=a;function a(e,t,r){e instanceof RegExp&&(e=c(e,r)),t instanceof RegExp&&(t=c(t,r));var n=i(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function c(e,t){var r=t.match(e);return r?r[0]:null}function i(e,t,r){var n,o,s,a,c,i=r.indexOf(e),u=r.indexOf(t,i+1),l=i;if(i>=0&&u>0){for(n=[],s=r.length;l>=0&&!c;)l==i?(n.push(l),i=r.indexOf(e,l+1)):1==n.length?c=[n.pop(),u]:((o=n.pop())<s&&(s=o,a=u),u=r.indexOf(t,l+1)),l=i<u&&i>=0?i:u;n.length&&(c=[s,a])}return c}function u(t){var r=e({},{preserveStatic:!0,removeComments:!1},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});function n(e){throw new Error("CSS parse error: ".concat(e))}function o(e){var r=e.exec(t);if(r)return t=t.slice(r[0].length),r}function a(){return o(/^{\s*/)}function c(){return o(/^}/)}function i(){o(/^\s*/)}function u(){if(i(),"/"===t[0]&&"*"===t[1]){for(var e=2;t[e]&&("*"!==t[e]||"/"!==t[e+1]);)e++;if(!t[e])return n("end of comment is missing");var r=t.slice(2,e);return t=t.slice(e+2),{type:"comment",comment:r}}}function l(){for(var e,t=[];e=u();)t.push(e);return r.removeComments?[]:t}function f(){for(i();"}"===t[0];)n("extra closing bracket");var e=o(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(e)return e[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function d(){o(/^([;\s]*)+/);var e=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g,t=o(/^(\*?[-#\/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){if(t=t[0].trim(),!o(/^:\s*/))return n("property missing ':'");var r=o(/^((?:\/\*.*?\*\/|'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((\s*'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)]*?)\s*\)|[^};])+)/),s={type:"declaration",property:t.replace(e,""),value:r?r[0].replace(e,"").trim():""};return o(/^[;\s]*/),s}}function p(){if(!a())return n("missing '{'");for(var e,t=l();e=d();)t.push(e),t=t.concat(l());return c()?t:n("missing '}'")}function m(){i();for(var e,t=[];e=o(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),o(/^,\s*/);if(t.length)return{type:"keyframe",values:t,declarations:p()}}function v(){if(i(),"@"===t[0]){var e=function(){var e=o(/^@([-\w]+)?ke
5277yframes\s*/);if(e){var t=e[1];if(!(e=o(/^([-\w]+)\s*/)))return n("@keyframes missing name");var r,s=e[1];if(!a())return n("@keyframes missing '{'");for(var i=l();r=m();)i.push(r),i=i.concat(l());return c()?{type:"keyframes",name:s,vendor:t,keyframes:i}:n("@keyframes missing '}'")}}()||function(){var e=o(/^@supports *([^{]+)/);if(e)return{type:"supports",supports:e[1].trim(),rules:y()}}()||function(){if(o(/^@host\s*/))return{type:"host",rules:y()}}()||function(){var e=o(/^@media([^{]+)*/);if(e)return{type:"media",media:(e[1]||"").trim(),rules:y()}}()||function(){var e=o(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(e)return{type:"custom-media",name:e[1].trim(),media:e[2].trim()}}()||function(){if(o(/^@page */))return{type:"page",selectors:f()||[],declarations:p()}}()||function(){var e=o(/^@([-\w]+)?document *([^{]+)/);if(e)return{type:"document",document:e[2].trim(),vendor:e[1]?e[1].trim():null,rules:y()}}()||function(){if(o(/^@font-face\s*/))return{type:"font-face",declarations:p()}}()||function(){var e=o(/^@(import|charset|namespace)\s*([^;]+);/);if(e)return{type:e[1],name:e[2].trim()}}();if(e&&!r.preserveStatic){var s=!1;if(e.declarations)s=e.declarations.some(function(e){return/var\(/.test(e.value)});else s=(e.keyframes||e.rules||[]).some(function(e){return(e.declarations||[]).some(function(e){return/var\(/.test(e.value)})});return s?e:{}}return e}}function h(){if(!r.preserveStatic){var e=s("{","}",t);if(e){var o=/:(?:root|host)(?![.:#(])/.test(e.pre)&&/--\S*\s*:/.test(e.body),a=/var\(/.test(e.body);if(!o&&!a)return t=t.slice(e.end+1),{}}}var c=f()||[],i=r.preserveStatic?p():p().filter(function(e){var t=c.some(function(e){return/:(?:root|host)(?![.:#(])/.test(e)})&&/^--\S/.test(e.property),r=/var\(/.test(e.value);return t||r});return c.length||n("selector missing"),{type:"rule",selectors:c,declarations:i}}function y(e){if(!e&&!a())return n("missing '{'");for(var r,o=l();t.length&&(e||"}"!==t[0])&&(r=v()||h());)r.type&&o.push(r),o=o.concat(l());return e||c()?o:n("missing '}'")}return{type:"stylesheet",stylesheet:{rules:y(!0),errors:[]}}}function l(t){var r=e({},{parseHost:!1,store:{},onWarning:function(){}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),n=new RegExp(":".concat(r.parseHost?"host":"root","(?![.:#(])"));
vendor: 1,875 bytes, line 5277
5277return"string"==typeof t&&(t=u(t,r)),t.stylesheet.rules.forEach(function(e){"rule"===e.type&&e.selectors.some(function(e){return n.test(e)})&&e.declarations.forEach(function(e,t){var n=e.property,o=e.value;n&&0===n.indexOf("--")&&(r.store[n]=o)})}),r.store}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,n={charset:function(e){return"@charset "+e.name+";"},comment:function(e){return 0===e.comment.indexOf("__CSSVARSPONYFILL")?"/*"+e.comment+"*/":""},"custom-media":function(e){return"@custom-media "+e.name+" "+e.media+";"},declaration:function(e){return e.property+":"+e.value+";"},document:function(e){return"@"+(e.vendor||"")+"document "+e.document+"{"+o(e.rules)+"}"},"font-face":function(e){return"@font-face{"+o(e.declarations)+"}"},host:function(e){return"@host{"+o(e.rules)+"}"},import:function(e){return"@import "+e.name+";"},keyframe:function(e){return e.values.join(",")+"{"+o(e.declarations)+"}"},keyframes:function(e){return"@"+(e.vendor||"")+"keyframes "+e.name+"{"+o(e.keyframes)+"}"},media:function(e){return"@media "+e.media+"{"+o(e.rules)+"}"},namespace:function(e){return"@namespace "+e.name+";"},page:function(e){return"@page "+(e.selectors.length?e.selectors.join(", "):"")+"{"+o(e.declarations)+"}"},rule:function(e){var t=e.declarations;if(t.length)return e.selectors.join(",")+"{"+o(t)+"}"},supports:function(e){return"@supports "+e.supports+"{"+o(e.rules)+"}"}};function o(e){for(var o="",s=0;s<e.length;s++){var a=e[s];r&&r(a);var c=n[a.type](a);c&&(o+=c,c.length&&a.selectors&&(o+=t))}return o}return o(e.stylesheet.rules)}a.range=i;var d="--",p="var";function m(t){var r=e({},{preserveStatic:!0,preserveVars:!1,variables:{},onWarning:function(){}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return"string"==typeof t&&(t=u(t,r)),function e(t,r){t.rules.forEac
5277h(function(n){n.rules?e(n,r):n.keyframes?n.keyframes.forEach(function(e){"keyframe"===e.type&&r(e.declarations,n)}):n.declarations&&r(n.declarations,t)})}(t.stylesheet,function(e,t){for(var n=0;n<e.length;n++){var o=e[n],s=o.type,a=o.property,c=o.value;if("declaration"===s)if(r.preserveVars||!a||0!==a.indexOf(d)){if(-1!==c.indexOf(p+"(")){var i=h(c,r);i!==o.value&&(i=v(i),r.preserveVars?(e.splice(n,0,{type:s,property:a,value:i}),n++):o.value=i)}}else e.splice(n,1),n--}}),f(t)}function v(e){return(e.match(/calc\(([^)]+)\)/g)||[]).forEach(function(t){var r="calc".concat(t.split("calc").join(""));e=e.replace(t,r)}),e}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(-1===e.indexOf("var("))return e;var n=s("(",")",e);return n?"var"===n.pre.slice(-3)?0===n.body.trim().length?(t.onWarning("var() must contain a non-whitespace string"),e):n.pre.slice(0,-3)+function(e){var n=e.split(",")[0].replace(/[\s\n\t]/g,""),o=(e.match(/(?:\s*,\s*){1}(.*)?/)||[])[1],s=Object.prototype.hasOwnProperty.call(t.variables,n)?String(t.variables[n]):void 0,a=s||(o?String(o):void 0),c=r||e;return s||t.onWarning('variable "'.concat(n,'" is undefined')),a&&"undefined"!==a&&a.length>0?h(a,t,c):"var(".concat(c,")")}(n.body)+h(n.post,t):n.pre+"(".concat(h(n.body,t),")")+h(n.post,t):(-1!==e.indexOf("var(")&&t.onWarning('missing closing ")" in the value "'.concat(e,'"')),e)}var y="undefined"!=typeof window,g=y&&window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)"),S={group:0,job:0},b={rootElement:y?document:null,shadowDOM:!1,include:"style,link[rel=stylesheet]",exclude:"",variables:{},onlyLegacy:!0,preserveStatic:!0,preserveVars:!1,silent:!1,updateDOM:!0,updateURLs:!0,watch:null,onBeforeSend:function(){},onWarning:function(){},onError:function(){},onSuccess:function(){},onComplete:function(){}},E={cssComments:/\/\*[\s\S]+?\*\//g,cssKeyframes:/@(?:-\w*-)?keyframes/,cssMediaQueries:/@media[^{]+\{([\s\S]+?})\s*}/g,cssUrls:/url\((?!['"]?(?:data|http|\/\/):)['"]?([^'")]*)['"]?\)/g,cssVarDeclRules:/(?::(?:root|host)(?![.:#(])[\s,]*[^{]*{\s*[^}]*})/g,cssVarDecls:/(?:[\s;]*)(-{2}\w[\w-]*)(?:\s*:\s*)([^;]*);/g,cssVarFunc:/var\(\s*--[\w-]/,cssVars:/(?:(?::(?:root|host)(?![.:#(])[\s,]*[^{]*{\s*[^;]*;*\s*)|(?:var\(\s*))(--[^:)]+)(?:\s*[:)])/},w={dom:{},job:{},user:{}},C=!1,O=null,A=0,x=null,j=!1;function k(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o="cssVars(): ",s=e({},b,r);function a(e,t,r,n){!s.silent&&window.console&&console.error("".concat(o).concat(e,"\n"),t),s.onError(e,t,r,n)}function c(e){!s.silent&&window.console&&console.warn("".concat(o).concat(e)),s.onWarning(e)}if(y){if(s.watch)return s.watch=b.watch,function(e){function t(e){return"LINK"===e.tagName&&-1!==(e.getAttribute("rel")||"").indexOf("stylesheet")&&!e.disabled}if(!window.MutationObserver)return;O&&(O.disconnect(),O=null);(O=new MutationObserver(function(r){r.some(function(r){var n,o=!1;return"attributes"===r.type?o=t(r.target):"childList"===r.type&&(n=r.addedNodes,o=Array.apply(null,n).some(function(e){var r=1===e.nodeType&&e.hasAttribute("data-cssvars"),n=function(e){return"STYLE"===e.tagName&&!e.disabled}(e)&&E.cssVars.test(e.textContent);return!r&&(t(e)||n)})||function(t){return Array.apply(null,t).some(function(t){var r=1===t.nodeType,n=r&&"out"===t.getAttribute("data-cssvars"),o=r&&"src"===t.getAttribute("data-cssvars"),s=o;if(o||n){var a=t.getAttribute("data-cssvars-group"),c=e.rootElement.querySelector('[data-cssvars-group="'.concat(a,'"]'));o&&(L(e.rootElement),w.dom={}),c&&c.parentNode.removeChild(c)}return s})}(r.removedNodes)),o})&&k(e)})).observe(document.documentElement,{attributes:!0,attributeFilter:["disabled","href"],childList:!0,subtree:!0})}(s),void k(s);if(!1===s.watch&&O&&(O.disconnect(),O=null),!s.__benchmark){if(C===s.rootElement)return void function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;clearTimeout(x),x=setTimeout(function(){e.__benchmark=null,k(e)},t)}(r);if(s.__benchmark=T(),s.exclude=[O?'[data-cssvars]:not([data-cssvars=""])':'[data-cssvars="out"]',s.exclude].filter(function(e){return e}).join(","),s.variables=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=/^-{2}/;return Object.keys(e).reduce(function(r,n){return r[t.test(n)?n:"--".concat(n.replace(/^-+/,""))]=e[n],r},{})}(s.variables),!O)if(Array.apply(null,s.rootElement.querySelectorAll('[data-cssvars="out"]')).forEac
5277h(function(e){var t=e.getAttribute("data-cssvars-group");(t?s.rootElement.querySelector('[data-cssvars="src"][data-cssvars-group="'.concat(t,'"]')):null)||e.parentNode.removeChild(e)}),A){var i=s.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])');i.length<A&&(A=i.length,w.dom={})}}if("loading"!==document.readyState)if(g&&s.onlyLegacy){if(s.updateDOM){var d=s.rootElement.host||(s.rootElement===document?document.documentElement:s.rootElement);Object.keys(s.variables).forEach(function(e){d.style.setProperty(e,s.variables[e])})}}else!j&&(s.shadowDOM||s.rootElement.shadowRoot||s.rootElement.host)?n({rootElement:b.rootElement,include:b.include,exclude:s.exclude,onSuccess:function(e,t,r){return(e=((e=e.replace(E.cssComments,"").replace(E.cssMediaQueries,"")).match(E.cssVarDeclRules)||[]).join(""))||!1},onComplete:function(e,t,r){l(e,{store:w.dom,onWarning:c}),j=!0,k(s)}}):(C=s.rootElement,n({rootElement:s.rootElement,include:s.include,exclude:s.exclude,onBeforeSend:s.onBeforeSend,onError:function(e,t,r){var n=e.responseURL||_(r,location.href),o=e.statusText?"(".concat(e.statusText,")"):"Unspecified Error"+(0===e.status?" (possibly CORS related)":"");a("CSS XHR Error: ".concat(n," ").concat(e.status," ").concat(o),t,e,n)},onSuccess:function(e,t,r){var n=s.onSuccess(e,t,r);return e=void 0!==n&&!1===Boolean(n)?"":n||e,s.updateURLs&&(e=function(e,t){return(e.replace(E.cssComments,"").match(E.cssUrls)||[]).forEach(function(r){var n=r.replace(E.cssUrls,"$1"),o=_(n,t);e=e.replace(r,r.replace(n,o))}),e}(e,r)),e},onComplete:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i={},d=s.updateDOM?w.dom:Object.keys(w.job).length?w.job:w.job=JSON.parse(JSON.stringify(w.dom)),p=!1;if(o.forEach(function(e,t){if(E.cssVars.test(n[t]))try{var r=u(n[t],{preserveStatic:s.preserveStatic,removeComments:!0});l(r,{parseHost:Boolean(s.rootElement.host),store:i,onWarning:c}),e.__cssVars={tree:r}}catch(t){a(t.message,e)}}),s.updateDOM&&e(w.user,s.variables),e(i,s.variables),p=Boolean((document.querySelector("[data-cssvars]")||Object.keys(w.dom).length)&&Object.keys(i).some(function(e){return i[e]!==d[e]})),e(d,w.user,i),p)L(s.rootElement),k(s);else{var v=[],h=[],y=!1;if(w.job={},s.updateDOM&&S.job++,o.forEach(function(t){var r=!t.__cssVars;if(t.__cssVars)try{m(t.__cssVars.tree,e({},s,{variables:d,onWarning:c}));var n=f(t.__cssVars.tree);if(s.updateDOM){if(t.getAttribute("data-cssvars")||t.setAttribute("data-cssvars","src"),n.length){var o=t.getAttribute("data-cssvars-group")||++S.group,i=n.replace(/\s/g,""),u=s.rootElement.querySelector('[data-cssvars="out"][data-cssvars-group="'.concat(o,'"]'))||document.createElement("style");y=y||E.cssKeyframes.test(n),u.hasAttribute("data-cssvars")||u.setAttribute("data-cssvars","out"),i===t.textContent.replace(/\s/g,"")?(r=!0,u&&u.parentNode&&(t.removeAttribute("data-cssvars-group"),u.parentNode.removeChild(u))):i!==u.textContent.replace(/\s/g,"")&&([t,u].forEach(function(e){e.setAttribute("data-cssvars-job",S.job),e.setAttribute("data-cssvars-group",o)}),u.textContent=n,v.push(n),h.push(u),u.parentNode||t.parentNode.insertBefore(u,t.nextSibling))}}else t.textContent.replace(/\s/g,"")!==n&&v.push(n)}catch(e){a(e.message,t)}r&&t.setAttribute("data-cssvars","skip"),t.hasAttribute("data-cssvars-job")||t.setAttribute("data-cssvars-job",S.job)}),A=s.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])').length,s.shadowDOM)for(var g,b=[s.rootElement].concat(t(s.rootElement.querySelectorAll("*"))),O=0;g=b[O];++O)if(g.shadowRoot&&g.shadowRoot.querySelector("style")){var x=e({},s,{rootElement:g.shadowRoot});k(x)}s.updateDOM&&y&&M(s.rootElement),C=!1,s.onComplete(v.join(""),h,JSON.parse(JSON.stringify(d)),T()-s.__benchmark)}}}));else document.addEventListener("DOMContentLoaded",function e(t){k(r),document.removeEventListener("DOMContentLoaded",e)})}}function M(e){var t=["animation-name","-moz-animation-name","-webkit-animation-name"].filter(function(e){return getComputedStyle(document.body)[e]})[0];if(t){for(var r=e.getElementsByTagName("*"),n=[],o=0,s=r.length;o<s;o++){var a=r[o];"none"!==getComputedStyle(a)[t]&&(a.style[t]+="__CSSVARSPONYFILL-KEYFRAMES__",n.push(a))}document.body.offsetHeight;for(var c=0,i=n.length;c<i;c++){var u=n[c].style;u[t]=u[t].replace("__CSSVARSPONYFILL-KEYFRAMES__","")}}}function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,r=document.implementation.createHTMLDocument(""),n=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(o),n.href=t,o.href=e,o.href}function T(){return y&&(window.performance||{}).now?window.performance.now():(new Date).getTime()}function L(e){Array.apply(null,e.querySelectorAll('[data-cssvars="skip"],[data-cssvars="src"]')).forEac
5277h(function(e){return e.setAttribute("data-cssvars","")})}return k.reset=function(){for(var e in C=!1,O&&(O.disconnect(),O=null),A=0,x=null,j=!1,w)w[e]={}},k}); 
5278$(document).ready(() => {
5279    let timer = ''
5280    const informer = document.querySelector('.informer');
5281    window.initInformer = (element, autoClose) => {
5282        clearTimeout(timer);
5283        informer.innerHTML = '';
5284
5285        informer.append(element);
5286        const informerWrapper = informer.querySelector('.informer_wrapper');
5287        const close = informer.querySelector('.informer__close');
5288        if (close) {
5289            close.addEventListener('click', () => {
5290                informerWrapper.classList.add('_hidden');
5291            });
5292        }
5293        if (autoClose) {
5294            informer.classList.add('is-auto-close');
5295            timer = setTimeout(() => {
5296                informerWrapper.classList.add('_hidden');
5297                setTimeout(() => {
5298                    informer.innerHTML = '';
5299                    informer.classList.remove('is-auto-close');
5300                }, 500);
5301            }, 5000)
5302        }
5303    }
5304}); 
5305'use strict';
5306const quickviewInit = () => {
5307
5308    const modalBlock = document.querySelector('.js-quickview-modal-template');
5309    const quickViewBtns = document.querySelectorAll('.js-quick-view-btn');
5310    const quickviewModal = document.querySelector('.js-quickview-modal');
5311    const quickViewClose = modalBlock.querySelector('.js-quickview-close');
5312    let bigPictureList = document.querySelector('.main-list');
5313    let smallPictureList = document.querySelector('.images-carousel__list');
5314
5315    document.addEventListener('click', (e) => {
5316    	if (e.target.classList.contains('js-add-to-cart') || e.target.classList.contains('js-quickview-modal')) {
5317        	closeQuickView();
5318        }
5319    }, true);
5320
5321	$(document).on('click', '.mg-buy-click-button', () => {
5322        closeQuickView();
5323    });
5324
5325    // Закрывает модальное окно:
5326    function closeQuickView() {
5327        quickviewModal.classList.add('hidden');
5328        quickviewModal.classList.remove('modal-grow');
5329        //const overlay = document.querySelector('.main-overlay');
5330        //overlay.classList.add('hidden');
5331        document.querySelector('body').classList.remove('overlay-mode');
5332    }
5333
5334    function startQuickView() {
5335        $(document).on('click', '.js-quick-view-btn', showQuickViewModal);
5336        // quickViewBtns.forEach(btn => {
5337        //     if (!(btn.dataset.init === 'true')) {
5338        //         btn.addEventListener('click', showQuickViewModal);
5339        //         btn.dataset.init = 'true'
5340        //     }
5341        // });
5342    }
5343
5344    function showQuickViewModal(evt) {
5345        evt.preventDefault();
5346
5347        //const overlay = document.querySelector('.main-overlay');
5348        //overlay.classList.remove('hidden');
5349        let clickedBtn = evt.target;
5350
5351        // Вешаем событие клика на кнопку закрытия
5352        if (quickViewClose) {
5353            quickViewClose.addEventListener('click', () => {
5354                closeQuickView();
5355            });
5356        }
5357
5358        // Слушаем нажатие на Esc (и закрываем окно):
5359        document.addEventListener('keydown', function (e) {
5360            if (e.which === 27) {
5361                closeQuickView();
5362            }
5363        });
5364        if (clickedBtn.tagName !== 'BUTTON') {
5365            clickedBtn = evt.target.closest('button');
5366        }
5367        let url = clickedBtn.dataset.itemUrl;
5368        let data = `action=getProduct&actionerClass=Ajaxuser&id=${clickedBtn.dataset.itemId}`;
5369        let productLink = clickedBtn.dataset.itemUrl;
5370        getProductData(url);
5371    }
5372
5373    function getProductData(url) {
5374
5375        $.ajax({
5376            type: "GET",
5377            url: url,
5378            dataType: 'html',
5379            success: function (response) {
5380                $('.h-quickview__container').html($(response).find('.product-page'));
5381                $('.h-quickview__container').find('.a-product-bar').remove();
5382                $('.h-quickview__container .js-size-guide-button').hide();
5383                $('.h-quickview__container').find('.color-block .color:first-of-type').click();
5384                if ($(".rateit").rateit) {
5385                    $(".rateit").rateit();
5386                }
5387                if ($('.js-open-modal-bclick').length && window?.buyOneClickModule.destroy) {
5388                  window.buyOneClickModule.destroy();
5389                  window.buyOneClickModule.init();
5390                  window.buyClickFancyBoxReload();
5391                }
5392                window.secondaryImageSwiper = new Swiper(".js-secondary-img-slider", {
5393                    slidesPerView: 4,
5394                    watchSlidesProgress: true,
5395                    direction: "horizontal",
5396                    navigation: {
5397                      nextEl: ".swiper-button-next",
5398                      prevEl: ".swiper-button-prev",
5399                    },
5400                    breakpoints: {
5401                      450: {
5402                        slidesPerView: 3,
5403                      },
5404                      768: {
5405                        direction: "vertical",
5406                        slidesPerView: 4,
5407                      },
5408                    }
5409                  });
5410                  
5411                  window.mainImageSwiper = new Swiper(".js-main-img-slider", {
5412                    spaceBetween: 10,
5413                    thumbs: {
5414                      swiper: window.secondaryImageSwiper,
5415                    },
5416                  });
5417                  
5418                  $('.swiper-button-next-copy').on('click', () => {
5419                    window.mainImageSwiper.slideNext(100);
5420                  });
5421                  $('.swiper-button-prev-copy').on('click', () => {
5422                    window.mainImageSwiper.slidePrev(100);
5423                  });
5424                  
5425                  window.mainImageSwiper.on('activeIndexChange', () => {
5426                    if (window.mainImageSwiper.isBeginning) {
5427                      $('.swiper-button-prev-copy').addClass('disable');
5428                    } else if (window.mainImageSwiper.isEnd) {
5429                      $('.swiper-button-next-copy').addClass('disable');
5430                    } else {
5431                      $('.swiper-button-next-copy').removeClass('disable');
5432                      $('.swiper-button-prev-copy').removeClass('disable');
5433                    }
5434                  });
5435                const userfieldsButtons = document.querySelectorAll('.js-userFields-button');
5436                if (userfieldsButtons) {
5437                    userfieldsButtons.forEach((item) => {
5438                        item.addEventListener('click', (e) => {
5439                            e.target.closest('.js-userFields-container').classList.toggle('userFields__container_active');
5440                        })
5441                    })
5442                }
5443                function zoom(e) {
5444                    var zoomer = e.currentTarget;
5445                    var offsetX, offsetY, x, y;
5446                    offsetX = e.offsetX;
5447                    offsetY = e.offsetY;
5448                    // e.offsetX ? offsetX = e.offsetX : offsetX = e.touches[0].pageX;
5449                    // e.offsetY ? offsetY = e.offsetY : offsetX = e.touches[0].pageX;
5450
5451                    x = offsetX / zoomer.offsetWidth * 100;
5452                    y = offsetY / zoomer.offsetHeight * 100;
5453
5454                    zoomer.style.backgroundPosition = x + '% ' + y + '%';
5455                }
5456                if ($('.js-zoom-img').length > 0) {
5457                    $('.js-zoom-img').on('mousemove', zoom);
5458                }
5459                $('.zoom-btn').on('click', () => {
5460                    $('.main-product-slide .slick-active .js-images-link').click();
5461                });
5462                $('.deleteItemFromCart').each(function(index,element) {
5463                  if ($('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').closest('.js-product-form').find('.variants-table').length != 0){
5464                      if ($('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').closest('.js-product-form').find('.variants-table input[value='+ $(this).data('variant') +']:checked').length != 0) {
5465                          $('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').addClass('alreadyInCart').find('.a-button__title').text(ButtonInCartModule.inCartText);
5466                      }
5467                  } else {
5468                      $('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').addClass('alreadyInCart').find('.a-button__title').text(ButtonInCartModule.inCartText);
5469                  }
5470                });
5471                quickviewModal.classList.remove('hidden');
5472                quickviewModal.classList.add('modal-grow');
5473                document.querySelector('body').classList.add('overlay-mode');
5474            }
5475        });
5476    }
5477
5478    function renderModalContent(product, productLink) {
5479        modalBlock.querySelector('.h-quickview__title').innerHTML = product.title;
5480        modalBlock.querySelector('.h-quickview__price').textContent = product.price;
5481        modalBlock.querySelector('.h-quickview__description').innerHTML = product.description;
5482        modalBlock.querySelector('.h-quickview__currency').innerHTML = product.currencyMap[product.currency_iso];
5483        modalBlock.querySelector('.h-quickview__link').href = productLink;
5484        renderPictures(product.thumbs);
5485    }
5486
5487    function renderPictures(pictures) {
5488        pictures.forEach(picture => {
5489            let bigPictureItem = document.createElement('div');
5490            let bigPicture = document.createElement('img');
5491            bigPicture.src = picture["70"]["main"];
5492            bigPictureItem.appendChild(bigPicture);
5493            bigPictureList.appendChild(bigPictureItem);
5494            let smallPictureItem = document.createElement('div');
5495            let smallPicture = document.createElement('img');
5496            smallPictureItem.classList.add('h-quickview__mini');
5497            smallPicture.src = picture["30"]["main"];
5498            smallPictureItem.appendChild(smallPicture);
5499            smallPictureList.appendChild(smallPictureItem);
5500        });
5501        slickActivate();
5502    }
5503
5504    function clearList(list) {
5505        list.innerHTML = '';
5506        list.classList.remove('slick-slider');
5507        list.classList.remove('slick-initialized');
5508    }
5509
5510    startQuickView();
5511    closeQuickView();
5512}
5513
5514quickviewInit();
5515
5516 
5517//пересчет цены товара аяксом (страница товара, миникарточка)
5518/**
5519 * Добавляет/убирает разделитель между цветами и размерами в сетке в зависимости от количества строк в сетке
5520 * @param {HTMLElement} variant - элемент в цвето-размерной сетке, который выбрали
5521 */
5522
5523$(document.body).on("change", ".js-onchange-price-recalc", function (e) {
5524    var form = ".js-product-form";
5525    var productList = $(".js-product-page");
5526    var request = $('.js-product-page ' + form).formSerialize();
5527    var productId = $('.js-product-page ' + form).data("product-id");
5528    const target = e.target;
5529    var priceBlock = ".js-change-product-price";
5530    var miniProduct = ".js-catalog-item";
5531    const formdata = document.querySelector(form);
5532    const params = new FormData(formdata);
5533    if ($(this).parents(miniProduct).length) {
5534        // для вызова из каталога
5535        productList = $(this).parents(miniProduct);
5536        form = productList.find(form);
5537        productId = form.data("product-id");
5538        request = productList.find(form).formSerialize();
5539        priceBlock = productList.find(priceBlock);
5540    }
5541
5542    if ($(this).parents(".mg-compare-product").length) {
5543        // для вызова из сравнений
5544        priceBlock = $(this).parents(".mg-compare-product").find(priceBlock);
5545        request = $(this)
5546            .parents(".mg-compare-product")
5547            .find(".property-form")
5548            .formSerialize();
5549        request += "&remInfo=false";
5550        productList = $(this).parents(".mg-compare-product");
5551    }
5552
5553    // для вызова из карточки товара на странице товара
5554    if ($(this).parents(".js-product-page")) {
5555        priceBlock = productList.find(priceBlock);
5556    }
5557
5558    var tempThis = $(this);
5559
5560    // Пересчет цены
5561    $.ajax({
5562        type: "POST",
5563        url: mgBaseDir + "/product/",
5564        data: "calcPrice=1&inCartProductId=" + productId + "&" + request,
5565        dataType: "json",
5566        cache: false,
5567        success: function (response) {
5568            // функция подстановки картинки варианта вместо картинки товара (на странице товара или миникарточке)
5569            if (tempThis.parents('.block-variants').length) {
5570                changeMainImgToVariant(response, productList);
5571            }
5572            if (response.data.wholesalesTable != undefined) {
5573                $(".wholesales-data").html(response.data.wholesalesTable);
5574            }
5575            if (response.data.productOpFields != undefined) {
5576                tempThis
5577                    .parents(".property-form")
5578                    .parents(".product-page")
5579                    .find(".product-page__opfields-container")
5580                    .html(response.data.productOpFields);
5581            }
5582            window.actionInCatalog = response.data.actionInCatalog;
5583            productList.find(".rem-info").hide();
5584            productList.find(".buy-container.product .hidder-element").hide();
5585            const card = target.closest('.js-product-page') || target.closest(miniProduct);
5586            const amount = card.querySelector('.amount_change');
5587            const productPage = target.closest('.js-product-page');
5588            if (productPage) {
5589                const buttonNotAvable = productPage.querySelector('.wrapper-mg-non-available');
5590                if (buttonNotAvable) {
5591                    if ($(".buy-block .count").length > 0 || response.data.count == 0) {
5592                        $(buttonNotAvable).show()
5593                    } else {
5594                        $(buttonNotAvable).hide()
5595                    }
5596                }
5597            }
5598            productList.find('.card__available-wrapper').html(response.data.count_layout);
5599            if ($(".buy-block .count").length > 0 || response.data.count == 0) {
5600                productList.find(".js-product-controls").hide();
5601                productList.find(".c-product__message").show();
5602                productList.find(".js-add-to-cart").hide();
5603
5604                $(amount).hide();
5605            } else {
5606                productList.find(".c-product__message").hide();
5607                productList.find("js-add-to-cart").show();
5608                $(amount).show();
5609            }
5610
5611            if (response.status === "success") {
5612                $('.c-button[rel="nofollow"]').attr(
5613                    "href",
5614                    response.data.buttonMessage
5615                );
5616                if ($(priceBlock).find(".product-default-price").length) {
5617                    $(priceBlock)
5618                        .find(".product-default-price")
5619                        .html(response.data.price);
5620                } else {
5621                    $(priceBlock).html(response.data.price);
5622                }
5623                $(priceBlock).find(".product-default-price").html(response.data.price);
5624                productList.find(".code").text(response.data.code);
5625                var message = "";
5626
5627                if (response.data.title) {
5628                    message =
5629                        locale.countMsg1 +
5630                        response.data.title.replace("'", '"') +
5631                        locale.countMsg2 +
5632                        response.data.code +
5633                        locale.countMsg3;
5634                }
5635
5636                productList
5637                    .find(".rem-info a")
5638                    .attr("href", mgBaseDir + "/feedback?message=" + message);
5639                productList.find(".code-msg").text(response.data.code);
5640                const oldPrice = parseFloat(response.data.old_price.split(' ').join(''));
5641                const currentPrice = parseFloat(response.data.price.split(' ').join(''))
5642                if (oldPrice > currentPrice) {
5643                    productList.find('.js-discount-sticker-container').show();
5644                    let sale = '';
5645                    if (document.querySelector('.product-page')) {
5646                         sale = Math.round(oldPrice - currentPrice);
5647                        sale = + sale + ' ' + window.currency;
5648                    } else {
5649                         sale = Math.round((oldPrice - currentPrice) / (oldPrice / 100));
5650                        sale = '-' + sale + ' %';
5651                    }
5652                    productList.find('.js-discount-sticker').html(sale);
5653                    productList.find('.old-price').text(response.data.old_price);
5654                    productList.find('.old-price').show();
5655                }
5656                else {
5657                    productList.find('.js-discount-sticker-container').hide()
5658                    productList.find('.old-price').text('');
5659                    productList.find('.old-price').hide();
5660                }
5661
5662                var val = response.data.count;
5663
5664                if (val != 0) {
5665                    $(".depletedLanding").hide();
5666                    $(".addToOrderLanding").show();
5667                    productList.find('.js-cart-amount-change').show();
5668                    productList.find(".rem-info").hide();
5669                    productList.find(".js-product-controls").show();
5670                    if ($(".buy-block .count").length > 0) {
5671                        $(".js-product-controls").show();
5672                        $(".c-product__message").hide();
5673                    }
5674                    productList.find(".buy-container.product").show();
5675                    productList.find(".buy-container.product").show();
5676                    if (
5677                        !productList
5678                            .find(".js-product-controls a:visible")
5679                            .hasClass("js-add-to-cart")
5680                    ) {
5681                        if ("false" == window.actionInCatalog) {
5682                            if ($('.js-product-page').length != 0) {
5683                                productList.find(".js-product-more").hide();
5684                                productList.find(".js-add-to-cart").show();
5685                            } else {
5686                                productList.find(".js-product-more").show();
5687                                productList.find(".js-add-to-cart").hide();
5688                            }
5689                        } else {
5690                            productList.find(".js-product-more").hide();
5691                            productList.find(".js-add-to-cart").show();
5692                        }
5693
5694                        productList.find(".js-product-controls").show();
5695                    }
5696                } else {
5697                    $(".depletedLanding").show();
5698                    $(".addToOrderLanding").hide();
5699                    $(".js-product-controls").show();
5700                    productList.find(".rem-info").show();
5701                    if ($(".buy-block .count").length > 0) {
5702                        $('.js-product-controls').hide();
5703                    }
5704                    productList.find(".buy-container.product").hide();
5705                    if (!productList
5706                        .find(".js-product-controls a:visible")
5707                        .hasClass("js-add-to-cart")
5708                    ) {
5709                        productList.find(".js-product-more").show();
5710                        productList.find(".js-add-to-cart").hide();
5711                        // productList.find('.js-product-controls:first').hide();
5712                    }
5713                }
5714                if (response.data.count_layout) {
5715                    if (productList.find(".count").length > 0) {
5716                        productList
5717                            .find(".count")
5718                            .parent()
5719                            .html(response.data.count_layout);
5720                    } else {
5721                        productList
5722                            .find(".in-stock")
5723                            .parent()
5724                            .html(response.data.count_layout);
5725                    }
5726                } else {
5727                    if (val == "\u221E" || val == "" || parseFloat(val) < 0) {
5728                        val =
5729                            '<span itemprop="availability" class="count"><span class="sign">&#10004;</span>' +
5730                            locale.countInStock +
5731                            "</span>";
5732                        productList.find(".rem-info").hide();
5733                    } else {
5734                        val =
5735                            locale.remaining +
5736                            ': <span itemprop="availability" class="label-black count">' +
5737                            val +
5738                            "</span> " +
5739                            locale.pcs;
5740                    }
5741                    productList.find(".count").parent().html(val);
5742                }
5743
5744                productList
5745                    .find(".js-amount-input")
5746                    .data("max-count", response.data.count);
5747                productList.find(".weight").text(response.data.weightCalc);
5748
5749                if (
5750                    parseFloat(productList.find(".js-amount-input").val()) >
5751                    parseFloat(response.data.count)
5752                ) {
5753                    val = response.data.count;
5754                    if (val == "\u221E" || val == "" || parseFloat(val) < 0) {
5755                        val = productList.find(".js-amount-input").val();
5756                    }
5757                    if (val == 0) {
5758                        val = 1;
5759                    }
5760
5761                    productList.find(".js-amount-input").val(val);
5762                }
5763            }
5764
5765            if (
5766                response.data.storage != undefined &&
5767                response.data.storage.length > 0
5768            ) {
5769                maxStorageCount = 0;
5770                for (var i in response.data.storage) {
5771                    $(".count-on-storage[data-id=" + i + "]").html(
5772                        response.data.storage[i]
5773                    );
5774                    if (response.data.storage[i] > maxStorageCount)
5775                        maxStorageCount = response.data.storage[i];
5776                }
5777                $(".actionBuy .amount_input").data("max-count", maxStorageCount);
5778            }
5779        },
5780    });
5781
5782    return false;
5783});
5784$(document).ready(() => {
5785    // Дополнительные поля характеристик
5786    const userfieldsButtons = document.querySelectorAll('.js-userFields-button');
5787    if (userfieldsButtons) {
5788        userfieldsButtons.forEach((item) => {
5789            item.addEventListener('click', (e) => {
5790                e.preventDefault();
5791                e.target.closest('.js-userFields-container').classList.toggle('userFields__container_active');
5792            })
5793        })
5794    }
5795    let buttonReview = document.querySelector('.js-write-review');
5796    let commentsTab = document.querySelector('.js-comment-tab');
5797    if (commentsTab && buttonReview) {
5798        buttonReview.addEventListener('click', () => {
5799            commentsTab.click();
5800            $('html, body').animate({
5801                scrollTop: $('.js-comment-tab').offset().top
5802            }, {
5803                duration: 370,
5804                easing: "linear"
5805            });
5806        });
5807    }
5808}) 
5809$(document).ready(function () {
5810  let amountWrap = '.js-amount-wrap',
5811    amountInput = '.js-amount-input';
5812
5813  // проводит все проверки введенного количества (num)
5814  // запрещается вписывать не кратное минимальному количеству
5815  // округляем в меньшую сторону, до допустимого кратнго значения (minAmount)
5816  // не больше чем есть на складе
5817  function prepareAmount(num, minAmount, maxAmount) {
5818    //console.log(num+','+ minAmount+','+  maxAmount);
5819    if (isNaN(num)) {
5820      num = 0;
5821    }
5822    if (isNaN(minAmount)) {
5823      minAmount = 0;
5824    }
5825    if (isNaN(minAmount)) {
5826      minAmount = 0;
5827    }
5828    minAmount = parseFloat(minAmount);
5829    maxAmount = parseFloat(maxAmount);
5830    num = parseFloat(num);
5831
5832    if (num > 0 && num < minAmount) {
5833      num = minAmount;
5834    }
5835    if (num <= 0) {
5836      num = minAmount;
5837    }
5838    if (num >= maxAmount) {
5839      num = maxAmount;
5840    }
5841
5842    // если значение в поле больше минимально допустимого,
5843    // то вычисляем сколько раз в это значение входит минимально допустимое
5844    if (num > minAmount) {
5845      // точность после запятой
5846      let fix = 0;
5847      let str = minAmount.toString();
5848      if (str) {
5849        let val = str.split('.');
5850        if (val && val.length == 2) {
5851          fix = val[1].length;
5852        }
5853      }
5854      let count = (num / minAmount).toFixed(fix);
5855      count = Math.floor(count);
5856      num = (count * minAmount).toFixed(fix);
5857      if (num > maxAmount) {
5858        num = maxAmount - count;
5859      }
5860    }
5861    return num;
5862  }
5863
5864  //увеличение количества товара (страница товара, миникарточка, корзина, страница заказа)
5865  $('body').on('click', '.js-amount-change-up', function () {
5866    let obj = $(this).parents(amountWrap).find(amountInput);
5867    let val = 1 * obj.val();
5868    let minAmount = obj.data('increment-count') != 0 ? obj.data('increment-count') : 1;
5869    let maxAmount = obj.data('max-count')>0?obj.data('max-count'):99999;
5870    val = val + minAmount;
5871    val = prepareAmount(val, minAmount, maxAmount);
5872    obj.val(val).trigger('change');
5873    return false;
5874  });
5875
5876  //уменьшение количества товара (страница товара, миникарточка, корзина, страница заказа)
5877  $(document.body).on('click', '.js-amount-change-down', function () {
5878    let obj = $(this).parents(amountWrap).find(amountInput);
5879    let val = 1 * obj.val();
5880    let minAmount = obj.data('increment-count') != 0 ? obj.data('increment-count') : 1;
5881    let maxAmount = obj.data('max-count')>0?obj.data('max-count'):99999;
5882
5883    val = val - minAmount;
5884    val = prepareAmount(val, minAmount, maxAmount);
5885    obj.val(val).trigger('change');
5886    return false;
5887  });
5888
5889  // Исключение ввода в поле выбора количества недопустимых значений. (страница товара, миникарточка, корзина, страница заказа)
5890  $(document.body).on('change', amountInput, function () {
5891    let obj = $(this);
5892    let val = 1 * obj.val();
5893    let minAmount = obj.data('increment-count') != 0 ? obj.data('increment-count') : 1;
5894    let maxAmount = obj.data('max-count')>0?obj.data('max-count'):99999;
5895
vendor: 30,675 bytes, lines 5896-5929
5896    obj.val(prepareAmount(val, minAmount, maxAmount));
5897    return false;
5898  });
5899
5900  const amountInputs = document.querySelectorAll(amountInput);
5901  for (const inputAmount of amountInputs) {
5902    inputAmount.addEventListener('keydown', (e) => {
5903      if (e.keyCode === 13) {
5904        e.preventDefault();
5905        let obj = e.target;
5906        let val = 1 * obj.value;
5907        let minAmount = obj.dataset.incrementCount != 0 ? obj.dataset.incrementCount : 1;
5908        let maxAmount = obj.dataset.maxCount > 0 ? obj.dataset.maxCount :9999;
5909
5910        obj.value = prepareAmount(val, minAmount, maxAmount);
5911        return false;
5912      }
5913    });
5914  }
5915});
5916 
5917/**
5918 * Swiper 10.0.4
5919 * Most modern mobile touch slider and framework with hardware accelerated transitions
5920 * https://swiperjs.com
5921 *
5922 * Copyright 2014-2023 Vladimir Kharlampidi
5923 *
5924 * Released under the MIT License
5925 *
5926 * Released on: July 8, 2023
5927 */
5928
5929 var Swiper=function(){"use strict";function e(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function t(s,a){void 0===s&&(s={}),void 0===a&&(a={}),Object.keys(a).forEach((i=>{void 0===s[i]?s[i]=a[i]:e(a[i])&&e(s[i])&&Object.keys(a[i]).length>0&&t(s[i],a[i])}))}const s={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function a(){const e="undefined"!=typeof document?document:{};return t(e,s),e}const i={document:s,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function r(){const e="undefined"!=typeof window?window:{};return t(e,i),e}function n(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function l(){return Date.now()}function o(e,t){void 0===t&&(t="x");const s=r();let a,i,n;const l=function(e){const t=r();let s;return t.getComputedStyle&&(s=t.getComputedStyle(e,null)),!s&&e.currentStyle&&(s=e.currentStyle),s||(s=e.style),s}(e);return s.WebKitCSSMatrix?(i=l.transform||l.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map((e=>e.replace(",","."))).join(", ")),n=new s.WebKitCSSMatrix("none"===i?"":i)):(n=l.MozTransform||l.OTransform||l.MsTransform||l.msTransform||l.transform||l.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),a=n.toString().split(",")),"x"===t&&(i=s.WebKitCSSMatrix?n.m41:16===a.length?parseFloat(a[12]):parseFloat(a[4])),"y"===t&&(i=s.WebKitCSSMatrix?n.m42:16===a.length?parseFloat(a[13]):parseFloat(a[5])),i||0}function d(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function c(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let a=1;a<arguments.length;a+=1){const i=a<0||arguments.length<=a?void 0:arguments[a];if(null!=i&&(s=i,!("undefined"!=typeof window&&void 0!==window.HTMLElement?s instanceof HTMLElement:s&&(1===s.nodeType||11===s.nodeType)))){const s=Object.keys(Object(i)).filter((e=>t.indexOf(e)<0));for(let t=0,a=s.length;t<a;t+=1){const a=s[t],r=Object.getOwnPropertyDescriptor(i,a);void 0!==r&&r.enumerable&&(d(e[a])&&d(i[a])?i[a].__swiper__?e[a]=i[a]:c(e[a],i[a]):!d(e[a])&&d(i[a])?(e[a]={},i[a].__swiper__?e[a]=i[a]:c(e[a],i[a])):e[a]=i[a])}}}var s;return e}function p(e,t,s){e.style.setProperty(t,s)}function u(e){let{swiper:t,targetPosition:s,side:a}=e;const i=r(),n=-t.translate;let l,o=null;const d=t.params.speed;t.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(t.cssModeFrameID);const c=s>n?"next":"prev",p=(e,t)=>"next"===c&&e>=t||"prev"===c&&e<=t,u=()=>{l=(new Date).getTime(),null===o&&(o=l);const e=Math.max(Math.min((l-o)/d,1),0),r=.5-Math.cos(e*Math.PI)/2;let c=n+r*(s-n);if(p(c,s)&&(c=s),t.wrapperEl.scrollTo({[a]:c}),p(c,s))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout((()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[a]:c})})),void i.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=i.requestAnimationFrame(u)};u()}function m(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function h(e,t){return void 0===t&&(t=""),[...e.children].filter((e=>e.matches(t)))}function f(e,t){void 0===t&&(t=[]);const s=document.createElement(e);return s.classList.add(...Array.isArray(t)?t:[t]),s}function g(e){const t=r(),s=a(),i=e.getBoundingClientRect(),n=s.body,l=e.clientTop||n.clientTop||0,o=e.clientLeft||n.clientLeft||0,d=e===t?t.scrollY:e.scrollTop,c=e===t?t.scrollX:e.scrollLeft;return{top:i.top+d-l,left:i.left+c-o}}function v(e,t){return r().getComputedStyle(e,null).getPropertyValue(t)}function w(e){let t,s=e;if(s){for(t=0;null!==(s=s.previousSibling);)1===s.nodeType&&(t+=1);return t}}function b(e,t){const s=[];let a=e.parentElement;for(;a;)t?a.matches(t)&&s.push(a):s.push(a),a=a.parentElement;return s}function y(e,t){t&&e.addEventListener("transitionend",(function s(a){a.target===e&&(t.call(e,a),e.removeEventListener("transitionend",s))}))}function E(e,t,s){const a=r();return s?e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(a.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(a.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom")):e.offsetWidth}let x,S,T;function M(){return x||(x=function(){const e=r(),t=a();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),x}function C(e){return void 0===e&&(e={}),S||(S=function(e){let{userAgent:t}=void 0===e?{}:e;const s=M(),a=r(),i=a.navigator.platform,n=t||a.navigator.userAgent,l={ios:!1,android:!1},o=a.screen.width,d=a.screen.height,c=n.match(/(Android);?[\s\/]+([\d.]+)?/);let p=n.match(/(iPad).*OS\s([\d_]+)/);const u=n.match(/(iPod)(.*OS\s([\d_]+))?/),m=!p&&n.match(/(iPhone\sOS|iOS)\s([\d_]+)/),h="Win32"===i;let f="MacIntel"===i;return!p&&f&&s.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${o}x${d}`)>=0&&(p=n.match(/(Version)\/([\d.]+)/),p||(p=[0,1,"13_0_0"]),f=!1),c&&!h&&(l.os="android",l.android=!0),(p||m||u)&&(l.os="ios",l.ios=!0),l}(e)),S}function P(){return T||(T=function(){const e=r();let t=!1;function s(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(s()){const s=String(e.navigator.userAgent);if(s.includes("Version/")){const[e,a]=s.split("Version/")[1].split(" ")[0].split(".").map((e=>Number(e)));t=e<16||16===e&&a<2}}return{isSafari:t||s(),needPerspectiveFix:t,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),T}var L={on(e,t,s){const a=this;if(!a.eventsListeners||a.destroyed)return a;if("function"!=typeof t)return a;const i=s?"unshift":"push";return e.split(" ").forEach((e=>{a.eventsListeners[e]||(a.eventsListeners[e]=[]),a.eventsListeners[e][i](t)})),a},once(e,t,s){const a=this;if(!a.eventsListeners||a.destroyed)return a;if("function"!=typeof t)return a;function i(){a.off(e,i),i.__emitterProxy&&delete i.__emitterProxy;for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];t.apply(a,r)}return i.__emitterProxy=t,a.on(e,i,s)},onAny(e,t){const s=this;if(!s.eventsListeners||s.destroyed)return s;if("function"!=typeof e)return s;const a=t?"unshift":"push";return s.eventsAnyListeners.indexOf(e)<0&&s.eventsAnyListeners[a](e),s},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsAnyListeners)return t;const s=t.eventsAnyListeners.indexOf(e);return s>=0&&t.eventsAnyListeners.splice(s,1),t},off(e,t){const s=this;return!s.eventsListeners||s.destroyed?s:s.eventsListeners?(e.split(" ").forEach((e=>{void 0===t?s.eventsListeners[e]=[]:s.eventsListeners[e]&&s.eventsListeners[e].forEach(((a,i)=>{(a===t||a.__emitterProxy&&a.__emitterProxy===t)&&s.eventsListeners[e].splice(i,1)}))})),s):s},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,s,a;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];"string"==typeof r[0]||Array.isArray(r[0])?(t=r[0],s=r.slice(1,r.length),a=e):(t=r[0].events,s=r[0].data,a=r[0].context||e),s.unshift(a);return(Array.isArray(t)?t:t.split(" ")).forEach((t=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach((e=>{e.apply(a,[t,...s])})),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach((e=>{e.apply(a,s)}))})),e}};const z=(e,t)=>{if(!e||e.destroyed||!e.params)return;const s=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(s){const t=s.querySelector(`.${e.params.lazyPreloaderClass}`);t&&t.remove()}},A=(e,t)=>{if(!e.slides[t])return;const s=e.slides[t].querySelector('[loading="lazy"]');s&&s.removeAttribute("loading")},$=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const s=e.slides.length;if(!s||!t||t<0)return;t=Math.min(t,s);const a="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),i=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=i,r=[s-t];return r.push(...Array.from({length:t}).map(((e,t)=>s+a+t))),void e.slides.forEach(((t,s)=>{r.includes(t.column)&&A(e,s)}))}const r=i+a-1;if(e.params.rewind||e.params.loop)for(let a=i-t;a<=r+t;a+=1){const t=(a%s+s)%s;(t<i||t>r)&&A(e,t)}else for(let a=Math.max(i-t,0);a<=Math.min(r+t,s-1);a+=1)a!==i&&(a>r||a<i)&&A(e,a)};var I={updateSize:function(){const e=this;let t,s;const a=e.el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:a.clientWidth,s=void 0!==e.params.height&&null!==e.params.height?e.params.height:a.clientHeight,0===t&&e.isHorizontal()||0===s&&e.isVertical()||(t=t-parseInt(v(a,"padding-left")||0,10)-parseInt(v(a,"padding-right")||0,10),s=s-parseInt(v(a,"padding-top")||0,10)-parseInt(v(a,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(s)&&(s=0),Object.assign(e,{width:t,height:s,size:e.isHorizontal()?t:s}))},updateSlides:function(){const e=this;function t(t){return e.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}function s(e,s){return parseFloat(e.getPropertyValue(t(s))||0)}const a=e.params,{wrapperEl:i,slidesEl:r,size:n,rtlTranslate:l,wrongRTL:o}=e,d=e.virtual&&a.virtual.enabled,c=d?e.virtual.slides.length:e.slides.length,u=h(r,`.${e.params.slideClass}, swiper-slide`),m=d?e.virtual.slides.length:u.length;let f=[];const g=[],w=[];let b=a.slidesOffsetBefore;"function"==typeof b&&(b=a.slidesOffsetBefore.call(e));let y=a.slidesOffsetAfter;"function"==typeof y&&(y=a.slidesOffsetAfter.call(e));const x=e.snapGrid.length,S=e.slidesGrid.length;let T=a.spaceBetween,M=-b,C=0,P=0;if(void 0===n)return;"string"==typeof T&&T.indexOf("%")>=0?T=parseFloat(T.replace("%",""))/100*n:"string"==typeof T&&(T=parseFloat(T)),e.virtualSize=-T,u.forEach((e=>{l?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""})),a.centeredSlides&&a.cssMode&&(p(i,"--swiper-centered-offset-before",""),p(i,"--swiper-centered-offset-after",""));const L=a.grid&&a.grid.rows>1&&e.grid;let z;L&&e.grid.initSlides(m);const A="auto"===a.slidesPerView&&a.breakpoints&&Object.keys(a.breakpoints).filter((e=>void 0!==a.breakpoints[e].slidesPerView)).length>0;for(let i=0;i<m;i+=1){let r;if(z=0,u[i]&&(r=u[i]),L&&e.grid.updateSlide(i,r,m,t),!u[i]||"none"!==v(r,"display")){if("auto"===a.slidesPerView){A&&(u[i].style[t("width")]="");const n=getComputedStyle(r),l=r.style.transform,o=r.style.webkitTransform;if(l&&(r.style.transform="none"),o&&(r.style.webkitTransform="none"),a.roundLengths)z=e.isHorizontal()?E(r,"width",!0):E(r,"height",!0);else{const e=s(n,"width"),t=s(n,"padding-left"),a=s(n,"padding-right"),i=s(n,"margin-left"),l=s(n,"margin-right"),o=n.getPropertyValue("box-sizing");if(o&&"border-box"===o)z=e+i+l;else{const{clientWidth:s,offsetWidth:n}=r;z=e+t+a+i+l+(n-s)}}l&&(r.style.transform=l),o&&(r.style.webkitTransform=o),a.roundLengths&&(z=Math.floor(z))}else z=(n-(a.slidesPerView-1)*T)/a.slidesPerView,a.roundLengths&&(z=Math.floor(z)),u[i]&&(u[i].style[t("width")]=`${z}px`);u[i]&&(u[i].swiperSlideSize=z),w.push(z),a.centeredSlides?(M=M+z/2+C/2+T,0===C&&0!==i&&(M=M-n/2-T),0===i&&(M=M-n/2-T),Math.abs(M)<.001&&(M=0),a.roundLengths&&(M=Math.floor(M)),P%a.slidesPerGroup==0&&f.push(M),g.push(M)):(a.roundLengths&&(M=Math.floor(M)),(P-Math.min(e.params.slidesPerGroupSkip,P))%e.params.slidesPerGroup==0&&f.push(M),g.push(M),M=M+z+T),e.virtualSize+=z+T,C=z,P+=1}}if(e.virtualSize=Math.max(e.virtualSize,n)+y,l&&o&&("slide"===a.effect||"coverflow"===a.effect)&&(i.style.width=`${e.virtualSize+T}px`),a.setWrapperSize&&(i.style[t("width")]=`${e.virtualSize+T}px`),L&&e.grid.updateWrapperSize(z,f,t),!a.centeredSlides){const t=[];for(let s=0;s<f.length;s+=1){let i=f[s];a.roundLengths&&(i=Math.floor(i)),f[s]<=e.virtualSize-n&&t.push(i)}f=t,Math.floor(e.virtualSize-n)-Math.floor(f[f.length-1])>1&&f.push(e.virtualSize-n)}if(d&&a.loop){const t=w[0]+T;if(a.slidesPerGroup>1){const s=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/a.slidesPerGroup),i=t*a.slidesPerGroup;for(let e=0;e<s;e+=1)f.push(f[f.length-1]+i)}for(let s=0;s<e.virtual.slidesBefore+e.virtual.slidesAfter;s+=1)1===a.slidesPerGroup&&f.push(f[f.length-1]+t),g.push(g[g.length-1]+t),e.virtualSize+=t}if(0===f.length&&(f=[0]),0!==T){const s=e.isHorizontal()&&l?"marginLeft":t("marginRight");u.filter(((e,t)=>!(a.cssMode&&!a.loop)||t!==u.length-1)).forEach((e=>{e.style[s]=`${T}px`}))}if(a.centeredSlides&&a.centeredSlidesBounds){let e=0;w.forEach((t=>{e+=t+(T||0)})),e-=T;const t=e-n;f=f.map((e=>e<=0?-b:e>t?t+y:e))}if(a.centerInsufficientSlides){let e=0;if(w.forEach((t=>{e+=t+(T||0)})),e-=T,e<n){const t=(n-e)/2;f.forEach(((e,s)=>{f[s]=e-t})),g.forEach(((e,s)=>{g[s]=e+t}))}}if(Object.assign(e,{slides:u,snapGrid:f,slidesGrid:g,slidesSizesGrid:w}),a.centeredSlides&&a.cssMode&&!a.centeredSlidesBounds){p(i,"--swiper-centered-offset-before",-f[0]+"px"),p(i,"--swiper-centered-offset-after",e.size/2-w[w.length-1]/2+"px");const t=-e.snapGrid[0],s=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map((e=>e+t)),e.slidesGrid=e.slidesGrid.map((e=>e+s))}if(m!==c&&e.emit("slidesLengthChange"),f.length!==x&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),g.length!==S&&e.emit("slidesGridLengthChange"),a.watchSlidesProgress&&e.updateSlidesOffset(),!(d||a.cssMode||"slide"!==a.effect&&"fade"!==a.effect)){const t=`${a.containerModifierClass}backface-hidden`,s=e.el.classList.contains(t);m<=a.maxBackfaceHiddenSlides?s||e.el.classList.add(t):s&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,s=[],a=t.virtual&&t.params.virtual.enabled;let i,r=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const n=e=>a?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach((e=>{s.push(e)}));else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const e=t.activeIndex+i;if(e>t.slides.length&&!a)break;s.push(n(e))}else s.push(n(t.activeIndex));for(i=0;i<s.length;i+=1)if(void 0!==s[i]){const e=s[i].offsetHeight;r=e>r?e:r}(r||0===r)&&(t.wrapperEl.style.height=`${r}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,s=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let a=0;a<t.length;a+=1)t[a].swiperSlideOffset=(e.isHorizontal()?t[a].offsetLeft:t[a].offsetTop)-s-e.cssOverflowAdjustment()},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);const t=this,s=t.params,{slides:a,rtlTranslate:i,snapGrid:r}=t;if(0===a.length)return;void 0===a[0].swiperSlideOffset&&t.updateSlidesOffset();let n=-e;i&&(n=e),a.forEach((e=>{e.classList.remove(s.slideVisibleClass)})),t.visibleSlidesIndexes=[],t.visibleSlides=[];let l=s.spaceBetween;"string"==typeof l&&l.indexOf("%")>=0?l=parseFloat(l.replace("%",""))/100*t.size:"string"==typeof l&&(l=parseFloat(l));for(let e=0;e<a.length;e+=1){const o=a[e];let d=o.swiperSlideOffset;s.cssMode&&s.centeredSlides&&(d-=a[0].swiperSlideOffset);const c=(n+(s.centeredSlides?t.minTranslate():0)-d)/(o.swiperSlideSize+l),p=(n-r[0]+(s.centeredSlides?t.minTranslate():0)-d)/(o.swiperSlideSize+l),u=-(n-d),m=u+t.slidesSizesGrid[e];(u>=0&&u<t.size-1||m>1&&m<=t.size||u<=0&&m>=t.size)&&(t.visibleSlides.push(o),t.visibleSlidesIndexes.push(e),a[e].classList.add(s.slideVisibleClass)),o.progress=i?-c:c,o.originalProgress=i?-p:p}},updateProgress:function(e){const t=this;if(void 0===e){const s=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*s||0}const s=t.params,a=t.maxTranslate()-t.minTranslate();let{progress:i,isBeginning:r,isEnd:n,progressLoop:l}=t;const o=r,d=n;if(0===a)i=0,r=!0,n=!0;else{i=(e-t.minTranslate())/a;const s=Math.abs(e-t.minTranslate())<1,l=Math.abs(e-t.maxTranslate())<1;r=s||i<=0,n=l||i>=1,s&&(i=0),l&&(i=1)}if(s.loop){const s=t.getSlideIndexByData(0),a=t.getSlideIndexByData(t.slides.length-1),i=t.slidesGrid[s],r=t.slidesGrid[a],n=t.slidesGrid[t.slidesGrid.length-1],o=Math.abs(e);l=o>=i?(o-i)/n:(o+n-r)/n,l>1&&(l-=1)}Object.assign(t,{progress:i,progressLoop:l,isBeginning:r,isEnd:n}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),r&&!o&&t.emit("reachBeginning toEdge"),n&&!d&&t.emit("reachEnd toEdge"),(o&&!r||d&&!n)&&t.emit("fromEdge"),t.emit("progress",i)},updateSlidesClasses:function(){const e=this,{slides:t,params:s,slidesEl:a,activeIndex:i}=e,r=e.virtual&&s.virtual.enabled,n=e=>h(a,`.${s.slideClass}${e}, swiper-slide${e}`)[0];let l;if(t.forEach((e=>{e.classList.remove(s.slideActiveClass,s.slideNextClass,s.slidePrevClass)})),r)if(s.loop){let t=i-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),l=n(`[data-swiper-slide-index="${t}"]`)}else l=n(`[data-swiper-slide-index="${i}"]`);else l=t[i];if(l){l.classList.add(s.slideActiveClass);let e=function(e,t){const s=[];for(;e.nextElementSibling;){const a=e.nextElementSibling;t?a.matches(t)&&s.push(a):s.push(a),e=a}return s}(l,`.${s.slideClass}, swiper-slide`)[0];s.loop&&!e&&(e=t[0]),e&&e.classList.add(s.slideNextClass);let a=function(e,t){const s=[];for(;e.previousElementSibling;){const a=e.previousElementSibling;t?a.matches(t)&&s.push(a):s.push(a),e=a}return s}(l,`.${s.slideClass}, swiper-slide`)[0];s.loop&&0===!a&&(a=t[t.length-1]),a&&a.classList.add(s.slidePrevClass)}e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,s=t.rtlTranslate?t.translate:-t.translate,{snapGrid:a,params:i,activeIndex:r,realIndex:n,snapIndex:l}=t;let o,d=e;const c=e=>{let s=e-t.virtual.slidesBefore;return s<0&&(s=t.virtual.slides.length+s),s>=t.virtual.slides.length&&(s-=t.virtual.slides.length),s};if(void 0===d&&(d=function(e){const{slidesGrid:t,params:s}=e,a=e.rtlTranslate?e.translate:-e.translate;let i;for(let e=0;e<t.length;e+=1)void 0!==t[e+1]?a>=t[e]&&a<t[e+1]-(t[e+1]-t[e])/2?i=e:a>=t[e]&&a<t[e+1]&&(i=e+1):a>=t[e]&&(i=e);return s.normalizeSlideIndex&&(i<0||void 0===i)&&(i=0),i}(t)),a.indexOf(s)>=0)o=a.indexOf(s);else{const e=Math.min(i.slidesPerGroupSkip,d);o=e+Math.floor((d-e)/i.slidesPerGroup)}if(o>=a.length&&(o=a.length-1),d===r)return o!==l&&(t.snapIndex=o,t.emit("snapIndexChange")),void(t.params.loop&&t.virtual&&t.params.virtual.enabled&&(t.realIndex=c(d)));let p;p=t.virtual&&i.virtual.enabled&&i.loop?c(d):t.slides[d]?parseInt(t.slides[d].getAttribute("data-swiper-slide-index")||d,10):d,Object.assign(t,{previousSnapIndex:l,snapIndex:o,previousRealIndex:n,realIndex:p,previousIndex:r,activeIndex:d}),t.initialized&&$(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),n!==p&&t.emit("realIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&t.emit("slideChange")},updateClickedSlide:function(e){const t=this,s=t.params,a=e.closest(`.${s.slideClass}, swiper-slide`);let i,r=!1;if(a)for(let e=0;e<t.slides.length;e+=1)if(t.slides[e]===a){r=!0,i=e;break}if(!a||!r)return t.clickedSlide=void 0,void(t.clickedIndex=void 0);t.clickedSlide=a,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(a.getAttribute("data-swiper-slide-index"),10):t.clickedIndex=i,s.slideToClickedSlide&&void 0!==t.clickedIndex&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}};var k={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");const{params:t,rtlTranslate:s,translate:a,wrapperEl:i}=this;if(t.virtualTranslate)return s?-a:a;if(t.cssMode)return a;let r=o(i,e);return r+=this.cssOverflowAdjustment(),s&&(r=-r),r||0},setTranslate:function(e,t){const s=this,{rtlTranslate:a,params:i,wrapperEl:r,progress:n}=s;let l,o=0,d=0;s.isHorizontal()?o=a?-e:e:d=e,i.roundLengths&&(o=Math.floor(o),d=Math.floor(d)),s.previousTranslate=s.translate,s.translate=s.isHorizontal()?o:d,i.cssMode?r[s.isHorizontal()?"scrollLeft":"scrollTop"]=s.isHorizontal()?-o:-d:i.virtualTranslate||(s.isHorizontal()?o-=s.cssOverflowAdjustment():d-=s.cssOverflowAdjustment(),r.style.transform=`translate3d(${o}px, ${d}px, 0px)`);const c=s.maxTranslate()-s.minTranslate();l=0===c?0:(e-s.minTranslate())/c,l!==n&&s.updateProgress(e),s.emit("setTranslate",s.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,s,a,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),void 0===a&&(a=!0);const r=this,{params:n,wrapperEl:l}=r;if(r.animating&&n.preventInteractionOnTransition)return!1;const o=r.minTranslate(),d=r.maxTranslate();let c;if(c=a&&e>o?o:a&&e<d?d:e,r.updateProgress(c),n.cssMode){const e=r.isHorizontal();if(0===t)l[e?"scrollLeft":"scrollTop"]=-c;else{if(!r.support.smoothScroll)return u({swiper:r,targetPosition:-c,side:e?"left":"top"}),!0;l.scrollTo({[e?"left":"top"]:-c,behavior:"smooth"})}return!0}return 0===t?(r.setTransition(0),r.setTranslate(c),s&&(r.emit("beforeTransitionStart",t,i),r.emit("transitionEnd"))):(r.setTransition(t),r.setTranslate(c),s&&(r.emit("beforeTransitionStart",t,i),r.emit("transitionStart")),r.animating||(r.animating=!0,r.onTranslateToWrapperTransitionEnd||(r.onTranslateToWrapperTransitionEnd=function(e){r&&!r.destroyed&&e.target===this&&(r.wrapperEl.removeEventListener("transitionend",r.onTranslateToWrapperTransitionEnd),r.onTranslateToWrapperTransitionEnd=null,delete r.onTranslateToWrapperTransitionEnd,s&&r.emit("transitionEnd"))}),r.wrapperEl.addEventListener("transitionend",r.onTranslateToWrapperTransitionEnd))),!0}};function O(e){let{swiper:t,runCallbacks:s,direction:a,step:i}=e;const{activeIndex:r,previousIndex:n}=t;let l=a;if(l||(l=r>n?"next":r<n?"prev":"reset"),t.emit(`transition${i}`),s&&r!==n){if("reset"===l)return void t.emit(`slideResetTransition${i}`);t.emit(`slideChangeTransition${i}`),"next"===l?t.emit(`slideNextTransition${i}`):t.emit(`slidePrevTransition${i}`)}}var D={slideTo:function(e,t,s,a,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),"string"==typeof e&&(e=parseInt(e,10));const r=this;let n=e;n<0&&(n=0);const{params:l,snapGrid:o,slidesGrid:d,previousIndex:c,activeIndex:p,rtlTranslate:m,wrapperEl:h,enabled:f}=r;if(r.animating&&l.preventInteractionOnTransition||!f&&!a&&!i)return!1;const g=Math.min(r.params.slidesPerGroupSkip,n);let v=g+Math.floor((n-g)/r.params.slidesPerGroup);v>=o.length&&(v=o.length-1);const w=-o[v];if(l.normalizeSlideIndex)for(let e=0;e<d.length;e+=1){const t=-Math.floor(100*w),s=Math.floor(100*d[e]),a=Math.floor(100*d[e+1]);void 0!==d[e+1]?t>=s&&t<a-(a-s)/2?n=e:t>=s&&t<a&&(n=e+1):t>=s&&(n=e)}if(r.initialized&&n!==p){if(!r.allowSlideNext&&(m?w>r.translate&&w>r.minTranslate():w<r.translate&&w<r.minTranslate()))return!1;if(!r.allowSlidePrev&&w>r.translate&&w>r.maxTranslate()&&(p||0)!==n)return!1}let b;if(n!==(c||0)&&s&&r.emit("beforeSlideChangeStart"),r.updateProgress(w),b=n>p?"next":n<p?"prev":"reset",m&&-w===r.translate||!m&&w===r.translate)return r.updateActiveIndex(n),l.autoHeight&&r.updateAutoHeight(),r.updateSlidesClasses(),"slide"!==l.effect&&r.setTranslate(w),"reset"!==b&&(r.transitionStart(s,b),r.transitionEnd(s,b)),!1;if(l.cssMode){const e=r.isHorizontal(),s=m?w:-w;if(0===t){const t=r.virtual&&r.params.virtual.enabled;t&&(r.wrapperEl.style.scrollSnapType="none",r._immediateVirtual=!0),t&&!r._cssModeVirtualInitialSet&&r.params.initialSlide>0?(r._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{h[e?"scrollLeft":"scrollTop"]=s}))):h[e?"scrollLeft":"scrollTop"]=s,t&&requestAnimationFrame((()=>{r.wrapperEl.style.scrollSnapType="",r._immediateVirtual=!1}))}else{if(!r.support.smoothScroll)return u({swiper:r,targetPosition:s,side:e?"left":"top"}),!0;h.scrollTo({[e?"left":"top"]:s,behavior:"smooth"})}return!0}return r.setTransition(t),r.setTranslate(w),r.updateActiveIndex(n),r.updateSlidesClasses(),r.emit("beforeTransitionStart",t,a),r.transitionStart(s,b),0===t?r.transitionEnd(s,b):r.animating||(r.animating=!0,r.onSlideToWrapperTransitionEnd||(r.onSlideToWrapperTransitionEnd=function(e){r&&!r.destroyed&&e.target===this&&(r.wrapperEl.removeEventListener("transitionend",r.onSlideToWrapperTransitionEnd),r.onSlideToWrapperTransitionEnd=null,delete r.onSlideToWrapperTransitionEnd,r.transitionEnd(s,b))}),r.wrapperEl.addEventListener("transitionend",r.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,s,a){if(void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),"string"==typeof e){e=parseInt(e,10)}const i=this;let r=e;return i.params.loop&&(i.virtual&&i.params.virtual.enabled?r+=i.virtual.slidesBefore:r=i.getSlideIndexByData(r)),i.slideTo(r,t,s,a)},slideNext:function(e,t,s){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const a=this,{enabled:i,params:r,animating:n}=a;if(!i)return a;let l=r.slidesPerGroup;"auto"===r.slidesPerView&&1===r.slidesPerGroup&&r.slidesPerGroupAuto&&(l=Math.max(a.slidesPerViewDynamic("current",!0),1));const o=a.activeIndex<r.slidesPerGroupSkip?1:l,d=a.virtual&&r.virtual.enabled;if(r.loop){if(n&&!d&&r.loopPreventsSliding)return!1;a.loopFix({direction:"next"}),a._clientLeft=a.wrapperEl.clientLeft}return r.rewind&&a.isEnd?a.slideTo(0,e,t,s):a.slideTo(a.activeIndex+o,e,t,s)},slidePrev:function(e,t,s){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const a=this,{params:i,snapGrid:r,slidesGrid:n,rtlTranslate:l,enabled:o,animating:d}=a;if(!o)return a;const c=a.virtual&&i.virtual.enabled;if(i.loop){if(d&&!c&&i.loopPreventsSliding)return!1;a.loopFix({direction:"prev"}),a._clientLeft=a.wrapperEl.clientLeft}function p(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const u=p(l?a.translate:-a.translate),m=r.map((e=>p(e)));let h=r[m.indexOf(u)-1];if(void 0===h&&i.cssMode){let e;r.forEach(((t,s)=>{u>=t&&(e=s)})),void 0!==e&&(h=r[e>0?e-1:e])}let f=0;if(void 0!==h&&(f=n.indexOf(h),f<0&&(f=a.activeIndex-1),"auto"===i.slidesPerView&&1===i.slidesPerGroup&&i.slidesPerGroupAuto&&(f=f-a.slidesPerViewDynamic("previous",!0)+1,f=Math.max(f,0))),i.rewind&&a.isBeginning){const i=a.params.virtual&&a.params.virtual.enabled&&a.virtual?a.virtual.slides.length-1:a.slides.length-1;return a.slideTo(i,e,t,s)}return a.slideTo(f,e,t,s)},slideReset:function(e,t,s){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,s)},slideToClosest:function(e,t,s,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),void 0===a&&(a=.5);const i=this;let r=i.activeIndex;const n=Math.min(i.params.slidesPerGroupSkip,r),l=n+Math.floor((r-n)/i.params.slidesPerGroup),o=i.rtlTranslate?i.translate:-i.translate;if(o>=i.snapGrid[l]){const e=i.snapGrid[l];o-e>(i.snapGrid[l+1]-e)*a&&(r+=i.params.slidesPerGroup)}else{const e=i.snapGrid[l-1];o-e<=(i.snapGrid[l]-e)*a&&(r-=i.params.slidesPerGroup)}return r=Math.max(r,0),r=Math.min(r,i.slidesGrid.length-1),i.slideTo(r,e,t,s)},slideToClickedSlide:function(){const e=this,{params:t,slidesEl:s}=e,a="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let i,r=e.clickedIndex;const l=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;i=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?r<e.loopedSlides-a/2||r>e.slides.length-e.loopedSlides+a/2?(e.loopFix(),r=e.getSlideIndex(h(s,`${l}[data-swiper-slide-index="${i}"]`)[0]),n((()=>{e.slideTo(r)}))):e.slideTo(r):r>e.slides.length-a?(e.loopFix(),r=e.getSlideIndex(h(s,`${l}[data-swiper-slide-index="${i}"]`)[0]),n((()=>{e.slideTo(r)}))):e.slideTo(r)}else e.slideTo(r)}};var G={loopCreate:function(e){const t=this,{params:s,slidesEl:a}=t;if(!s.loop||t.virtual&&t.params.virtual.enabled)return;h(a,`.${s.slideClass}, swiper-slide`).forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t)})),t.loopFix({slideRealIndex:e,direction:s.centeredSlides?void 0:"next"})},loopFix:function(e){let{slideRealIndex:t,slideTo:s=!0,direction:a,setTranslate:i,activeSlideIndex:r,byController:n,byMousewheel:l}=void 0===e?{}:e;const o=this;if(!o.params.loop)return;o.emit("beforeLoopFix");const{slides:d,allowSlidePrev:c,allowSlideNext:p,slidesEl:u,params:m}=o;if(o.allowSlidePrev=!0,o.allowSlideNext=!0,o.virtual&&m.virtual.enabled)return s&&(m.centeredSlides||0!==o.snapIndex?m.centeredSlides&&o.snapIndex<m.slidesPerView?o.slideTo(o.virtual.slides.length+o.snapIndex,0,!1,!0):o.snapIndex===o.snapGrid.length-1&&o.slideTo(o.virtual.slidesBefore,0,!1,!0):o.slideTo(o.virtual.slides.length,0,!1,!0)),o.allowSlidePrev=c,o.allowSlideNext=p,void o.emit("loopFix");const h="auto"===m.slidesPerView?o.slidesPerViewDynamic():Math.ceil(parseFloat(m.slidesPerView,10));let f=m.loopedSlides||h;f%m.slidesPerGroup!=0&&(f+=m.slidesPerGroup-f%m.slidesPerGroup),o.loopedSlides=f;const g=[],v=[];let w=o.activeIndex;void 0===r?r=o.getSlideIndex(o.slides.filter((e=>e.classList.contains(m.slideActiveClass)))[0]):w=r;
5929const b="next"===a||!a,y="prev"===a||!a;let E=0,x=0;if(r<f){E=Math.max(f-r,m.slidesPerGroup);for(let e=0;e<f-r;e+=1){const t=e-Math.floor(e/d.length)*d.length;g.push(d.length-t-1)}}else if(r>o.slides.length-2*f){x=Math.max(r-(o.slides.length-2*f),m.slidesPerGroup);for(let e=0;e<x;e+=1){const t=e-Math.floor(e/d.length)*d.length;v.push(t)}}if(y&&g.forEach((e=>{o.slides[e].swiperLoopMoveDOM=!0,u.prepend(o.slides[e]),o.slides[e].swiperLoopMoveDOM=!1})),b&&v.forEach((e=>{o.slides[e].swiperLoopMoveDOM=!0,u.append(o.slides[e]),o.slides[e].swiperLoopMoveDOM=!1})),o.recalcSlides(),"auto"===m.slidesPerView&&o.updateSlides(),m.watchSlidesProgress&&o.updateSlidesOffset(),s)if(g.length>0&&y)if(void 0===t){const e=o.slidesGrid[w],t=o.slidesGrid[w+E]-e;l?o.setTranslate(o.translate-t):(o.slideTo(w+E,0,!1,!0),i&&(o.touches[o.isHorizontal()?"startX":"startY"]+=t))}else i&&o.slideToLoop(t,0,!1,!0);else if(v.length>0&&b)if(void 0===t){const e=o.slidesGrid[w],t=o.slidesGrid[w-x]-e;l?o.setTranslate(o.translate-t):(o.slideTo(w-x,0,!1,!0),i&&(o.touches[o.isHorizontal()?"startX":"startY"]+=t))}else o.slideToLoop(t,0,!1,!0);if(o.allowSlidePrev=c,o.allowSlideNext=p,o.controller&&o.controller.control&&!n){const e={slideRealIndex:t,slideTo:!1,direction:a,setTranslate:i,activeSlideIndex:r,byController:!0};Array.isArray(o.controller.control)?o.controller.control.forEach((t=>{!t.destroyed&&t.params.loop&&t.loopFix(e)})):o.controller.control instanceof o.constructor&&o.controller.control.params.loop&&o.controller.control.loopFix(e)}o.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:s}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const a=[];e.slides.forEach((e=>{const t=void 0===e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;a[t]=e})),e.slides.forEach((e=>{e.removeAttribute("data-swiper-slide-index")})),a.forEach((e=>{s.append(e)})),e.recalcSlides(),e.slideTo(e.realIndex,0)}};function H(e){const t=this,s=a(),i=r(),n=t.touchEventsData;n.evCache.push(e);const{params:o,touches:d,enabled:c}=t;if(!c)return;if(!o.simulateTouch&&"mouse"===e.pointerType)return;if(t.animating&&o.preventInteractionOnTransition)return;!t.animating&&o.cssMode&&o.loop&&t.loopFix();let p=e;p.originalEvent&&(p=p.originalEvent);let u=p.target;if("wrapper"===o.touchEventsTarget&&!t.wrapperEl.contains(u))return;if("which"in p&&3===p.which)return;if("button"in p&&p.button>0)return;if(n.isTouched&&n.isMoved)return;const m=!!o.noSwipingClass&&""!==o.noSwipingClass,h=e.composedPath?e.composedPath():e.path;m&&p.target&&p.target.shadowRoot&&h&&(u=h[0]);const f=o.noSwipingSelector?o.noSwipingSelector:`.${o.noSwipingClass}`,g=!(!p.target||!p.target.shadowRoot);if(o.noSwiping&&(g?function(e,t){return void 0===t&&(t=this),function t(s){if(!s||s===a()||s===r())return null;s.assignedSlot&&(s=s.assignedSlot);const i=s.closest(e);return i||s.getRootNode?i||t(s.getRootNode().host):null}(t)}(f,u):u.closest(f)))return void(t.allowClick=!0);if(o.swipeHandler&&!u.closest(o.swipeHandler))return;d.currentX=p.pageX,d.currentY=p.pageY;const v=d.currentX,w=d.currentY,b=o.edgeSwipeDetection||o.iOSEdgeSwipeDetection,y=o.edgeSwipeThreshold||o.iOSEdgeSwipeThreshold;if(b&&(v<=y||v>=i.innerWidth-y)){if("prevent"!==b)return;e.preventDefault()}Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),d.startX=v,d.startY=w,n.touchStartTime=l(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,o.threshold>0&&(n.allowThresholdMove=!1);let E=!0;u.matches(n.focusableElements)&&(E=!1,"SELECT"===u.nodeName&&(n.isTouched=!1)),s.activeElement&&s.activeElement.matches(n.focusableElements)&&s.activeElement!==u&&s.activeElement.blur();const x=E&&t.allowTouchMove&&o.touchStartPreventDefault;!o.touchStartForcePreventDefault&&!x||u.isContentEditable||p.preventDefault(),o.freeMode&&o.freeMode.enabled&&t.freeMode&&t.animating&&!o.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",p)}function X(e){const t=a(),s=this,i=s.touchEventsData,{params:r,touches:n,rtlTranslate:o,enabled:d}=s;if(!d)return;if(!r.simulateTouch&&"mouse"===e.pointerType)return;let c=e;if(c.originalEvent&&(c=c.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&s.emit("touchMoveOpposite",c));const p=i.evCache.findIndex((e=>e.pointerId===c.pointerId));p>=0&&(i.evCache[p]=c);const u=i.evCache.length>1?i.evCache[0]:c,m=u.pageX,h=u.pageY;if(c.preventedByNestedSwiper)return n.startX=m,void(n.startY=h);if(!s.allowTouchMove)return c.target.matches(i.focusableElements)||(s.allowClick=!1),void(i.isTouched&&(Object.assign(n,{startX:m,startY:h,prevX:s.touches.currentX,prevY:s.touches.currentY,currentX:m,currentY:h}),i.touchStartTime=l()));if(r.touchReleaseOnEdges&&!r.loop)if(s.isVertical()){if(h<n.startY&&s.translate<=s.maxTranslate()||h>n.startY&&s.translate>=s.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(m<n.startX&&s.translate<=s.maxTranslate()||m>n.startX&&s.translate>=s.minTranslate())return;if(t.activeElement&&c.target===t.activeElement&&c.target.matches(i.focusableElements))return i.isMoved=!0,void(s.allowClick=!1);if(i.allowTouchCallbacks&&s.emit("touchMove",c),c.targetTouches&&c.targetTouches.length>1)return;n.currentX=m,n.currentY=h;const f=n.currentX-n.startX,g=n.currentY-n.startY;if(s.params.threshold&&Math.sqrt(f**2+g**2)<s.params.threshold)return;if(void 0===i.isScrolling){let e;s.isHorizontal()&&n.currentY===n.startY||s.isVertical()&&n.currentX===n.startX?i.isScrolling=!1:f*f+g*g>=25&&(e=180*Math.atan2(Math.abs(g),Math.abs(f))/Math.PI,i.isScrolling=s.isHorizontal()?e>r.touchAngle:90-e>r.touchAngle)}if(i.isScrolling&&s.emit("touchMoveOpposite",c),void 0===i.startMoving&&(n.currentX===n.startX&&n.currentY===n.startY||(i.startMoving=!0)),i.isScrolling||s.zoom&&s.params.zoom&&s.params.zoom.enabled&&i.evCache.length>1)return void(i.isTouched=!1);if(!i.startMoving)return;s.allowClick=!1,!r.cssMode&&c.cancelable&&c.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&c.stopPropagation();let v=s.isHorizontal()?f:g,w=s.isHorizontal()?n.currentX-n.previousX:n.currentY-n.previousY;r.oneWayMovement&&(v=Math.abs(v)*(o?1:-1),w=Math.abs(w)*(o?1:-1)),n.diff=v,v*=r.touchRatio,o&&(v=-v,w=-w);const b=s.touchesDirection;s.swipeDirection=v>0?"prev":"next",s.touchesDirection=w>0?"prev":"next";const y=s.params.loop&&!r.cssMode;if(!i.isMoved){if(y&&s.loopFix({direction:s.swipeDirection}),i.startTranslate=s.getTranslate(),s.setTransition(0),s.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});
5929s.wrapperEl.dispatchEvent(e)}i.allowMomentumBounce=!1,!r.grabCursor||!0!==s.allowSlideNext&&!0!==s.allowSlidePrev||s.setGrabCursor(!0),s.emit("sliderFirstMove",c)}let E;i.isMoved&&b!==s.touchesDirection&&y&&Math.abs(v)>=1&&(s.loopFix({direction:s.swipeDirection,setTranslate:!0}),E=!0),s.emit("sliderMove",c),i.isMoved=!0,i.currentTranslate=v+i.startTranslate;let x=!0,S=r.resistanceRatio;if(r.touchReleaseOnEdges&&(S=0),v>0?(y&&!E&&i.currentTranslate>(r.centeredSlides?s.minTranslate()-s.size/2:s.minTranslate())&&s.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>s.minTranslate()&&(x=!1,r.resistance&&(i.currentTranslate=s.minTranslate()-1+(-s.minTranslate()+i.startTranslate+v)**S))):v<0&&(y&&!E&&i.currentTranslate<(r.centeredSlides?s.maxTranslate()+s.size/2:s.maxTranslate())&&s.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:s.slides.length-("auto"===r.slidesPerView?s.slidesPerViewDynamic():Math.ceil(parseFloat(r.slidesPerView,10)))}),i.currentTranslate<s.maxTranslate()&&(x=!1,r.resistance&&(i.currentTranslate=s.maxTranslate()+1-(s.maxTranslate()-i.startTranslate-v)**S))),x&&(c.preventedByNestedSwiper=!0),!s.allowSlideNext&&"next"===s.swipeDirection&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!s.allowSlidePrev&&"prev"===s.swipeDirection&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),s.allowSlidePrev||s.allowSlideNext||(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(v)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);
5929if(!i.allowThresholdMove)return i.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,i.currentTranslate=i.startTranslate,void(n.diff=s.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY)}r.followFinger&&!r.cssMode&&((r.freeMode&&r.freeMode.enabled&&s.freeMode||r.watchSlidesProgress)&&(s.updateActiveIndex(),s.updateSlidesClasses()),r.freeMode&&r.freeMode.enabled&&s.freeMode&&s.freeMode.onTouchMove(),s.updateProgress(i.currentTranslate),s.setTranslate(i.currentTranslate))}function Y(e){const t=this,s=t.touchEventsData,a=s.evCache.findIndex((t=>t.pointerId===e.pointerId));if(a>=0&&s.evCache.splice(a,1),["pointercancel","pointerout","pointerleave"].includes(e.type)){if(!("pointercancel"===e.type&&(t.browser.isSafari||t.browser.isWebView)))return}const{params:i,touches:r,rtlTranslate:o,slidesGrid:d,enabled:c}=t;if(!c)return;if(!i.simulateTouch&&"mouse"===e.pointerType)return;let p=e;if(p.originalEvent&&(p=p.originalEvent),s.allowTouchCallbacks&&t.emit("touchEnd",p),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&i.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);i.grabCursor&&s.isMoved&&s.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const u=l(),m=u-s.touchStartTime;if(t.allowClick){const e=p.path||p.composedPath&&p.composedPath();t.updateClickedSlide(e&&e[0]||p.target),t.emit("tap click",p),m<300&&u-s.lastClickTime<300&&t.emit("doubleTap doubleClick",p)}if(s.lastClickTime=l(),n((()=>{t.destroyed||(t.allowClick=!0)})),!s.isTouched||!s.isMoved||!t.swipeDirection||0===r.diff||s.currentTranslate===s.startTranslate)return s.isTouched=!1,s.isMoved=!1,void(s.startMoving=!1);let h;if(s.isTouched=!1,s.isMoved=!1,s.startMoving=!1,h=i.followFinger?o?t.translate:-t.translate:-s.currentTranslate,i.cssMode)return;if(i.freeMode&&i.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:h});let f=0,g=t.slidesSizesGrid[0];for(let e=0;e<d.length;e+=e<i.slidesPerGroupSkip?1:i.slidesPerGroup){const t=e<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;void 0!==d[e+t]?h>=d[e]&&h<d[e+t]&&(f=e,g=d[e+t]-d[e]):h>=d[e]&&(f=e,g=d[d.length-1]-d[d.length-2])}let v=null,w=null;i.rewind&&(t.isBeginning?w=i.virtual&&i.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(v=0));const b=(h-d[f])/g,y=f<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;if(m>i.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(b>=i.longSwipesRatio?t.slideTo(i.rewind&&t.isEnd?v:f+y):t.slideTo(f)),"prev"===t.swipeDirection&&(b>1-i.longSwipesRatio?t.slideTo(f+y):null!==w&&b<0&&Math.abs(b)>i.longSwipesRatio?t.slideTo(w):t.slideTo(f))}else{if(!i.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(p.target===t.navigation.nextEl||p.target===t.navigation.prevEl)?p.target===t.navigation.nextEl?t.slideTo(f+y):t.slideTo(f):("next"===t.swipeDirection&&t.slideTo(null!==v?v:f+y),"prev"===t.swipeDirection&&t.slideTo(null!==w?w:f))}}function B(){const e=this,{params:t,el:s}=e;if(s&&0===s.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:a,allowSlidePrev:i,snapGrid:r}=e,n=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const l=n&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||l?e.params.loop&&!n?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout((()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()}),500)),e.allowSlidePrev=i,e.allowSlideNext=a,e.params.watchOverflow&&r!==e.snapGrid&&e.checkOverflow()}function N(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function R(){const e=this,{wrapperEl:t,rtlTranslate:s,enabled:a}=e;if(!a)return;let i;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const r=e.maxTranslate()-e.minTranslate();i=0===r?0:(e.translate-e.minTranslate())/r,i!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function q(e){const t=this;z(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update(
5929)}let F=!1;function _(){}const V=(e,t)=>{const s=a(),{params:i,el:r,wrapperEl:n,device:l}=e,o=!!i.nested,d="on"===t?"addEventListener":"removeEventListener",c=t;r[d]("pointerdown",e.onTouchStart,{passive:!1}),s[d]("pointermove",e.onTouchMove,{passive:!1,capture:o}),s[d]("pointerup",e.onTouchEnd,{passive:!0}),s[d]("pointercancel",e.onTouchEnd,{passive:!0}),s[d]("pointerout",e.onTouchEnd,{passive:!0}),s[d]("pointerleave",e.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&r[d]("click",e.onClick,!0),i.cssMode&&n[d]("scroll",e.onScroll),i.updateOnWindowResize?e[c](l.ios||l.android?"resize orientationchange observerUpdate":"resize observerUpdate",B,!0):e[c]("observerUpdate",B,!0),r[d]("load",e.onLoad,{capture:!0})};const j=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var W={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function U(e,t){return function(s){void 0===s&&(s={});const a=Object.keys(s)[0],i=s[a];"object"==typeof i&&null!==i?(["navigation","pagination","scrollbar"].indexOf(a)>=0&&!0===e[a]&&(e[a]={auto:!0}),a in e&&"enabled"in i?(!0===e[a]&&(e[a]={enabled:!0}),"object"!=typeof e[a]||"enabled"in e[a]||(e[a].enabled=!0),e[a]||(e[a]={enabled:!1}),c(t,s)):c(t,s)):c(t,s)}}const K={eventsEmitter:L,update:I,translate:k,transition:{setTransition:function(e,t){const s=this;s.params.cssMode||(s.wrapperEl.style.transitionDuration=`${e}ms`),s.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);const s=this,{params:a}=s;a.cssMode||(a.autoHeight&&s.updateAutoHeight(),O({swiper:s,runCallbacks:e,direction:t,step:"Start"}))},transitionEnd:function(e,t){void 0===e&&(e=!0);const s=this,{params:a}=s;s.animating=!1,a.cssMode||(s.setTransition(0),O({swiper:s,runCallbacks:e,direction:t,step:"End"}))}},slide:D,loop:G,grabCursor:{setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const s="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),s.style.cursor="move",s.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1}))},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1})))}},events:{attachEvents:function(){const e=this,t=a(),{params:s}=e;e.onTouchStart=H.bind(e),e.onTouchMove=X.bind(e),e.onTouchEnd=Y.bind(e),s.cssMode&&(e.onScroll=R.bind(e)),e.onClick=N.bind(e),e.onLoad=q.bind(e),F||(t.addEventListener("touchstart",_),F=!0),V(e,"on")},detachEvents:function(){V(this,"off")}},breakpoints:{setBreakpoint:function(){const e=this,{realIndex:t,initialized:s,params:a,el:i}=e,r=a.breakpoints;if(!r||r&&0===Object.keys(r).length)return;
vendor: 52,958 bytes, line 5929
5929const n=e.getBreakpoint(r,e.params.breakpointsBase,e.el);if(!n||e.currentBreakpoint===n)return;const l=(n in r?r[n]:void 0)||e.originalParams,o=j(e,a),d=j(e,l),p=a.enabled;o&&!d?(i.classList.remove(`${a.containerModifierClass}grid`,`${a.containerModifierClass}grid-column`),e.emitContainerClasses()):!o&&d&&(i.classList.add(`${a.containerModifierClass}grid`),(l.grid.fill&&"column"===l.grid.fill||!l.grid.fill&&"column"===a.grid.fill)&&i.classList.add(`${a.containerModifierClass}grid-column`),e.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach((t=>{if(void 0===l[t])return;const s=a[t]&&a[t].enabled,i=l[t]&&l[t].enabled;s&&!i&&e[t].disable(),!s&&i&&e[t].enable()}));const u=l.direction&&l.direction!==a.direction,m=a.loop&&(l.slidesPerView!==a.slidesPerView||u);u&&s&&e.changeDirection(),c(e.params,l);const h=e.params.enabled;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),p&&!h?e.disable():!p&&h&&e.enable(),e.currentBreakpoint=n,e.emit("_beforeBreakpoint",l),m&&s&&(e.loopDestroy(),e.loopCreate(t),e.updateSlides()),e.emit("breakpoint",l)},getBreakpoint:function(e,t,s){if(void 0===t&&(t="window"),!e||"container"===t&&!s)return;let a=!1;const i=r(),n="window"===t?i.innerHeight:s.clientHeight,l=Object.keys(e).map((e=>{if("string"==typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:n*t,point:e}}return{value:e,point:e}}));l.sort(((e,t)=>parseInt(e.value,10)-parseInt(t.value,10)));for(let e=0;e<l.length;e+=1){const{point:r,value:n}=l[e];"window"===t?i.matchMedia(`(min-width: ${n}px)`).matches&&(a=r):n<=s.clientWidth&&(a=r)}return a||"max"}},checkOverflow:{checkOverflow:function(){const e=this,{isLocked:t,params:s}=e,{slidesOffsetBefore:a}=s;if(a){const t=e.slides.length-1,s=e.slidesGrid[t]+e.slidesSizesGrid[t]+2*a;e.isLocked=e.size>s}else e.isLocked=1===e.snapGrid.length;!0===s.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===s.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const e=this,{classNames:t,params:s,rtl:a,el:i,device:r}=e,n=function(e,t){const s=[];return e.forEach((e=>{"object"==typeof e?Object.keys(e).forEach((a=>{e[a]&&s.push(t+a)})):"string"==typeof e&&s.push(t+e)})),s}(["initialized",s.direction,{"free-mode":e.params.freeMode&&s.freeMode.enabled},{autoheight:s.autoHeight},{rtl:a},{grid:s.grid&&s.grid.rows>1},{"grid-column":s.grid&&s.grid.rows>1&&"column"===s.grid.fill},{android:r.android},{ios:r.ios},{"css-mode":s.cssMode},{centered:s.cssMode&&s.centeredSlides},{"watch-progress":s.watchSlidesProgress}],s.containerModifierClass);t.push(...n),i.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e.classList.remove(...t),this.emitContainerClasses()}}},Z={};class Q{constructor(){let e,t;for(var s=arguments.length,i=new Array(s),r=0;r<s;r++)i[r]=arguments[r];1===i.length&&i[0].constructor&&"Object"===Object.prototype.toString.call(i[0]).slice(8,-1)?t=i[0]:[e,t]=i,t||(t={}),t=c({},t),e&&!t.el&&(t.el=e);const n=a();if(t.el&&"string"==typeof t.el&&n.querySelectorAll(t.el).length>1){const e=[];return n.querySelectorAll(t.el).forEach((s=>{const a=c({},t,{el:s});e.push(new Q(a))})),e}const l=this;l.__swiper__=!0,l.support=M(),l.device=C({userAgent:t.userAgent}),l.browser=P(),l.eventsListeners={},l.eventsAnyListeners=[],l.modules=[...l.__modules__],t.modules&&Array.isArray(t.modules)&&l.modules.push(...t.modules);const o={};l.modules.forEach((e=>{e({params:t,swiper:l,extendParams:U(t,o),on:l.on.bind(l),once:l.once.bind(l),off:l.off.bind(l),emit:l.emit.bind(l)})}));const d=c({},W,o);return l.params=c({},d,Z,t),l.originalParams=c({},l.params),l.passedParams=c({},t),l.params&&l.params.on&&Object.keys(l.params.on).forEach((e=>{l.on(e,l.params.on[e])})),l.params&&l.params.onAny&&l.onAny(l.params.onAny),Object.assign(l,{enabled:l.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===l.params.direction,isVertical:()=>"vertical"===l.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:l.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.emit("_swiper"),l.params.init&&l.init(),l}getSlideIndex(e){const{slidesEl:t,params:s}=this,a=w(h(t,`.${s.slideClass}, swiper-slide`)[0]);return w(e)-a}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=h(e,`.${t.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const s=this;e=Math.min(Math.max(e,0),1);const a=s.minTranslate(),i=(s.maxTranslate()-a)*e+a;s.translateTo(i,void 0===t?0:t),s.updateActiveIndex(),s.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter((t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass)));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter((e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass))).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach((s=>{const a=e.getSlideClasses(s);t.push({slideEl:s,classNames:a}),e.emit("_slideClass",s,a)})),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:s,slides:a,slidesGrid:i,slidesSizesGrid:r,size:n,activeIndex:l}=this;let o=1;if(s.centeredSlides){let e,t=a[l]?a[l].swiperSlideSize:0;for(let s=l+1;s<a.length;s+=1)a[s]&&!e&&(t+=a[s].swiperSlideSize,o+=1,t>n&&(e=!0));for(let s=l-1;s>=0;s-=1)a[s]&&!e&&(t+=a[s].swiperSlideSize,o+=1,t>n&&(e=!0))}else if("current"===e)for(let e=l+1;e<a.length;e+=1){(t?i[e]+r[e]-i[l]<n:i[e]-i[l]<n)&&(o+=1)}else for(let e=l-1;e>=0;e-=1){i[l]-i[e]<n&&(o+=1)}return o}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:s}=e;function a(){const t=e.rtlTranslate?-1*e.translate:e.translate,s=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(s),e.updateActiveIndex(),e.updateSlidesClasses()}let i;if(s.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach((t=>{t.complete&&z(e,t)})),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),s.freeMode&&s.freeMode.enabled&&!s.cssMode)a(),s.autoHeight&&e.updateAutoHeight();else{if(("auto"===s.slidesPerView||s.slidesPerView>1)&&e.isEnd&&!s.centeredSlides){const t=e.virtual&&s.virtual.enabled?e.virtual.slides:e.slides;i=e.slideTo(t.length-1,0,!1,!0)}else i=e.slideTo(e.activeIndex,0,!1,!0);i||a()}s.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const s=this,a=s.params.direction;return e||(e="horizontal"===a?"vertical":"horizontal"),e===a||"horizontal"!==e&&"vertical"!==e||(s.el.classList.remove(`${s.params.containerModifierClass}${a}`),s.el.classList.add(`${s.params.containerModifierClass}${e}`),s.emitContainerClasses(),s.params.direction=e,s.slides.forEach((t=>{"vertical"===e?t.style.width="":t.style.height=""})),s.emit("changeDirection"),t&&s.update()),s}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let s=e||t.params.el;if("string"==typeof s&&(s=document.querySelector(s)),!s)return!1;s.swiper=t,s.parentNode&&s.parentNode.host&&(t.isElement=!0);const a=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let i=(()=>{if(s&&s.shadowRoot&&s.shadowRoot.querySelector){return s.shadowRoot.querySelector(a())}return h(s,a())[0]})();return!i&&t.params.createElements&&(i=f("div",t.params.wrapperClass),s.append(i),h(s,`.${t.params.slideClass}`).forEach((e=>{i.append(e)}))),Object.assign(t,{el:s,wrapperEl:i,slidesEl:t.isElement?s.parentNode.host:i,hostEl:t.isElement?s.parentNode.host:s,mounted:!0,rtl:"rtl"===s.dir.toLowerCase()||"rtl"===v(s,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===s.dir.toLowerCase()||"rtl"===v(s,"direction")),wrongRTL:"-webkit-box"===v(i,"display")}),!0}init(e){const t=this;if(t.initialized)return t;return!1===t.mount(e)||(t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach((e=>{e.complete?z(t,e):e.addEventListener("load",(e=>{z(t,e.target)}))})),$(t),t.initialized=!0,$(t),t.emit("init"),t.emit("afterInit")),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const s=this,{params:a,el:i,wrapperEl:r,slides:n}=s;return void 0===s.params||s.destroyed||(s.emit("beforeDestroy"),s.initialized=!1,s.detachEvents(),a.loop&&s.loopDestroy(),t&&(s.removeClasses(),i.removeAttribute("style"),r.removeAttribute("style"),n&&n.length&&n.forEach((e=>{e.classList.remove(a.slideVisibleClass,a.slideActiveClass,a.slideNextClass,a.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")}))),s.emit("destroy"),Object.keys(s.eventsListeners).forEach((e=>{s.off(e)})),!1!==e&&(s.el.swiper=null,function(e){const t=e;Object.keys(t).forEach((e=>{try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}}))}(s)),s.destroyed=!0),null}static extendDefaults(e){c(Z,e)}static get extendedDefaults(){return Z}static get defaults(){return W}static installModule(e){Q.prototype.__modules__||(Q.prototype.__modules__=[]);const t=Q.prototype.__modules__;"function"==typeof e&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach((e=>Q.installModule(e))),Q):(Q.installModule(e),Q)}}function J(e,t,s,a){return e.params.createElements&&Object.keys(a).forEach((i=>{if(!s[i]&&!0===s.auto){let r=h(e.el,`.${a[i]}`)[0];r||(r=f("div",a[i]),r.className=a[i],e.el.append(r)),s[i]=r,t[i]=r}})),s}function ee(e){return void 0===e&&(e=""),`.${e.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function te(e){const t=this,{params:s,slidesEl:a}=t;s.loop&&t.loopDestroy();const i=e=>{if("string"==typeof e){const t=document.createElement("div");t.innerHTML=e,a.append(t.children[0]),t.innerHTML=""}else a.append(e)};if("object"==typeof e&&"length"in e)for(let t=0;t<e.length;t+=1)e[t]&&i(e[t]);else i(e);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update()}function se(e){const t=this,{params:s,activeIndex:a,slidesEl:i}=t;s.loop&&t.loopDestroy();let r=a+1;const n=e=>{if("string"==typeof e){const t=document.createElement("div");t.innerHTML=e,i.prepend(t.children[0]),t.innerHTML=""}else i.prepend(e)};if("object"==typeof e&&"length"in e){for(let t=0;t<e.length;t+=1)e[t]&&n(e[t]);r=a+e.length}else n(e);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update(),t.slideTo(r,0,!1)}function ae(e,t){const s=this,{params:a,activeIndex:i,slidesEl:r}=s;let n=i;a.loop&&(n-=s.loopedSlides,s.loopDestroy(),s.recalcSlides());const l=s.slides.length;if(e<=0)return void s.prependSlide(t);if(e>=l)return void s.appendSlide(t);let o=n>e?n+1:n;const d=[];for(let t=l-1;t>=e;t-=1){const e=s.slides[t];e.remove(),d.unshift(e)}if("object"==typeof t&&"length"in t){for(let e=0;e<t.length;e+=1)t[e]&&r.append(t[e]);o=n>e?n+t.length:n}else r.append(t);for(let e=0;e<d.length;e+=1)r.append(d[e]);s.recalcSlides(),a.loop&&s.loopCreate(),a.observer&&!s.isElement||s.update(),a.loop?s.slideTo(o+s.loopedSlides,0,!1):s.slideTo(o,0,!1)}function ie(e){const t=this,{params:s,activeIndex:a}=t;let i=a;s.loop&&(i-=t.loopedSlides,t.loopDestroy());let r,n=i;if("object"==typeof e&&"length"in e){for(let s=0;s<e.length;s+=1)r=e[s],t.slides[r]&&t.slides[r].remove(),r<n&&(n-=1);n=Math.max(n,0)}else r=e,t.slides[r]&&t.slides[r].remove(),r<n&&(n-=1),n=Math.max(n,0);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update(),s.loop?t.slideTo(n+t.loopedSlides,0,!1):t.slideTo(n,0,!1)}function re(){const e=this,t=[];for(let s=0;s<e.slides.length;s+=1)t.push(s);e.removeSlide(t)}function ne(e){const{effect:t,swiper:s,on:a,setTranslate:i,setTransition:r,overwriteParams:n,perspective:l,recreateShadows:o,getEffectParams:d}=e;let c;a("beforeInit",(()=>{if(s.params.effect!==t)return;s.classNames.push(`${s.params.containerModifierClass}${t}`),l&&l()&&s.classNames.push(`${s.params.containerModifierClass}3d`);const e=n?n():{};Object.assign(s.params,e),Object.assign(s.originalParams,e)})),a("setTranslate",(()=>{s.params.effect===t&&i()})),a("setTransition",((e,a)=>{s.params.effect===t&&r(a)})),a("transitionEnd",(()=>{if(s.params.effect===t&&o){if(!d||!d().slideShadows)return;s.slides.forEach((e=>{e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((e=>e.remove()))})),o()}})),a("virtualUpdate",(()=>{s.params.effect===t&&(s.slides.length||(c=!0),requestAnimationFrame((()=>{c&&s.slides&&s.slides.length&&(i(),c=!1)})))}))}function le(e,t){const s=m(t);return s!==t&&(s.style.backfaceVisibility="hidden",s.style["-webkit-backface-visibility"]="hidden"),s}function oe(e){let{swiper:t,duration:s,transformElements:a,allSlides:i}=e;const{activeIndex:r}=t;if(t.params.virtualTranslate&&0!==s){let e,s=!1;e=i?a:a.filter((e=>{const s=e.classList.contains("swiper-slide-transform")?(e=>{if(!e.parentElement)return t.slides.filter((t=>t.shadowRoot&&t.shadowRoot===e.parentNode))[0];return e.parentElement})(e):e;return t.getSlideIndex(s)===r})),e.forEach((e=>{y(e,(()=>{if(s)return;if(!t||t.destroyed)return;s=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(e)}))}))}}function de(e,t,s){const a=`swiper-slide-shadow${s?`-${s}`:""}${e?` swiper-slide-shadow-${e}`:""}`,i=m(t);let r=i.querySelector(`.${a.split(" ").join(".")}`);return r||(r=f("div",a.split(" ")),i.append(r)),r}Object.keys(K).forEach((e=>{Object.keys(K[e]).forEach((t=>{Q.prototype[t]=K[e][t]}))})),Q.use([function(e){let{swiper:t,on:s,emit:a}=e;const i=r();let n=null,l=null;const o=()=>{t&&!t.destroyed&&t.initialized&&(a("beforeResize"),a("resize"))},d=()=>{t&&!t.destroyed&&t.initialized&&a("orientationchange")};s("init",(()=>{t.params.resizeObserver&&void 0!==i.ResizeObserver?t&&!t.destroyed&&t.initialized&&(n=new ResizeObserver((e=>{l=i.requestAnimationFrame((()=>{const{width:s,height:a}=t;let i=s,r=a;e.forEach((e=>{let{contentBoxSize:s,contentRect:a,target:n}=e;n&&n!==t.el||(i=a?a.width:(s[0]||s).inlineSize,r=a?a.height:(s[0]||s).blockSize)})),i===s&&r===a||o()}))})),n.observe(t.el)):(i.addEventListener("resize",o),i.addEventListener("orientationchange",d))})),s("destroy",(()=>{l&&i.cancelAnimationFrame(l),n&&n.unobserve&&t.el&&(n.unobserve(t.el),n=null),i.removeEventListener("resize",o),i.removeEventListener("orientationchange",d)}))},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const n=[],l=r(),o=function(e,s){void 0===s&&(s={});const a=new(l.MutationObserver||l.WebkitMutationObserver)((e=>{if(t.__preventObserver__)return;if(1===e.length)return void i("observerUpdate",e[0]);const s=function(){i("observerUpdate",e[0])};l.requestAnimationFrame?l.requestAnimationFrame(s):l.setTimeout(s,0)}));a.observe(e,{attributes:void 0===s.attributes||s.attributes,childList:void 0===s.childList||s.childList,characterData:void 0===s.characterData||s.characterData}),n.push(a)};s({observer:!1,observeParents:!1,observeSlideChildren:!1}),a("init",(()=>{if(t.params.observer){if(t.params.observeParents){const e=b(t.el);for(let t=0;t<e.length;t+=1)o(e[t])}o(t.el,{childList:t.params.observeSlideChildren}),o(t.wrapperEl,{attributes:!1})}})),a("destroy",(()=>{n.forEach((e=>{e.disconnect()})),n.splice(0,n.length)}))}]);const ce=[function(e){let t,{swiper:s,extendParams:i,on:r,emit:n}=e;i({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});const l=a();s.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const o=l.createElement("div");function d(e,t){const a=s.params.virtual;if(a.cache&&s.virtual.cache[t])return s.virtual.cache[t];let i;return a.renderSlide?(i=a.renderSlide.call(s,e,t),"string"==typeof i&&(o.innerHTML=i,i=o.children[0])):i=s.isElement?f("swiper-slide"):f("div",s.params.slideClass),i.setAttribute("data-swiper-slide-index",t),a.renderSlide||(i.innerHTML=e),a.cache&&(s.virtual.cache[t]=i),i}function c(e){const{slidesPerView:t,slidesPerGroup:a,centeredSlides:i,loop:r}=s.params,{addSlidesBefore:l,addSlidesAfter:o}=s.params.virtual,{from:c,to:p,slides:u,slidesGrid:m,offset:f}=s.virtual;s.params.cssMode||s.updateActiveIndex();const g=s.activeIndex||0;let v,w,b;v=s.rtlTranslate?"right":s.isHorizontal()?"left":"top",i?(w=Math.floor(t/2)+a+o,b=Math.floor(t/2)+a+l):(w=t+(a-1)+o,b=(r?t:a)+l);let y=g-b,E=g+w;r||(y=Math.max(y,0),E=Math.min(E,u.length-1));let x=(s.slidesGrid[y]||0)-(s.slidesGrid[0]||0);function S(){s.updateSlides(),s.updateProgress(),s.updateSlidesClasses(),n("virtualUpdate")}if(r&&g>=b?(y-=b,i||(x+=s.slidesGrid[0])):r&&g<b&&(y=-b,i&&(x+=s.slidesGrid[0])),Object.assign(s.virtual,{from:y,to:E,offset:x,slidesGrid:s.slidesGrid,slidesBefore:b,slidesAfter:w}),c===y&&p===E&&!e)return s.slidesGrid!==m&&x!==f&&s.slides.forEach((e=>{e.style[v]=x-Math.abs(s.cssOverflowAdjustment())+"px"})),s.updateProgress(),void n("virtualUpdate");if(s.params.virtual.renderExternal)return s.params.virtual.renderExternal.call(s,{offset:x,from:y,to:E,slides:function(){const e=[];for(let t=y;t<=E;t+=1)e.push(u[t]);return e}()}),void(s.params.virtual.renderExternalUpdate?S():n("virtualUpdate"));const T=[],M=[],C=e=>{let t=e;return e<0?t=u.length+e:t>=u.length&&(t-=u.length),t};if(e)s.slidesEl.querySelectorAll(`.${s.params.slideClass}, swiper-slide`).forEach((e=>{e.remove()}));else for(let e=c;e<=p;e+=1)if(e<y||e>E){const t=C(e);s.slidesEl.querySelectorAll(`.${s.params.slideClass}[data-swiper-slide-index="${t}"], swiper-slide[data-swiper-slide-index="${t}"]`).forEach((e=>{e.remove()}))}const P=r?-u.length:0,L=r?2*u.length:u.length;for(let t=P;t<L;t+=1)if(t>=y&&t<=E){const s=C(t);void 0===p||e?M.push(s):(t>p&&M.push(s),t<c&&T.push(s))}if(M.forEach((e=>{s.slidesEl.append(d(u[e],e))})),r)for(let e=T.length-1;e>=0;e-=1){const t=T[e];s.slidesEl.prepend(d(u[t],t))}else T.sort(((e,t)=>t-e)),T.forEach((e=>{s.slidesEl.prepend(d(u[e],e))}));h(s.slidesEl,".swiper-slide, swiper-slide").forEach((e=>{e.style[v]=x-Math.abs(s.cssOverflowAdjustment())+"px"})),S()}r("beforeInit",(()=>{if(!s.params.virtual.enabled)return;let e;if(void 0===s.passedParams.virtual.slides){const t=[...s.slidesEl.children].filter((e=>e.matches(`.${s.params.slideClass}, swiper-slide`)));t&&t.length&&(s.virtual.slides=[...t],e=!0,t.forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t),s.virtual.cache[t]=e,e.remove()})))}e||(s.virtual.slides=s.params.virtual.slides),s.classNames.push(`${s.params.containerModifierClass}virtual`),s.params.watchSlidesProgress=!0,s.originalParams.watchSlidesProgress=!0,s.params.initialSlide||c()})),r("setTranslate",(()=>{s.params.virtual.enabled&&(s.params.cssMode&&!s._immediateVirtual?(clearTimeout(t),t=setTimeout((()=>{c()}),100)):c())})),r("init update resize",(()=>{s.params.virtual.enabled&&s.params.cssMode&&p(s.wrapperEl,"--swiper-virtual-size",`${s.virtualSize}px`)})),Object.assign(s.virtual,{appendSlide:function(e){if("object"==typeof e&&"length"in e)for(let t=0;t<e.length;t+=1)e[t]&&s.virtual.slides.push(e[t]);else s.virtual.slides.push(e);c(!0)},prependSlide:function(e){const t=s.activeIndex;let a=t+1,i=1;if(Array.isArray(e)){for(let t=0;t<e.length;t+=1)e[t]&&s.virtual.slides.unshift(e[t]);a=t+e.length,i=e.length}else s.virtual.slides.unshift(e);if(s.params.virtual.cache){const e=s.virtual.cache,t={};Object.keys(e).forEach((s=>{const a=e[s],r=a.getAttribute("data-swiper-slide-index");r&&a.setAttribute("data-swiper-slide-index",parseInt(r,10)+i),t[parseInt(s,10)+i]=a})),s.virtual.cache=t}c(!0),s.slideTo(a,0)},removeSlide:function(e){if(null==e)return;let t=s.activeIndex;if(Array.isArray(e))for(let a=e.length-1;a>=0;a-=1)s.virtual.slides.splice(e[a],1),s.params.virtual.cache&&delete s.virtual.cache[e[a]],e[a]<t&&(t-=1),t=Math.max(t,0);else s.virtual.slides.splice(e,1),s.params.virtual.cache&&delete s.virtual.cache[e],e<t&&(t-=1),t=Math.max(t,0);c(!0),s.slideTo(t,0)},removeAllSlides:function(){s.virtual.slides=[],s.params.virtual.cache&&(s.virtual.cache={}),c(!0),s.slideTo(0,0)},update:c})},function(e){let{swiper:t,extendParams:s,on:i,emit:n}=e;const l=a(),o=r();function d(e){if(!t.enabled)return;const{rtlTranslate:s}=t;let a=e;a.originalEvent&&(a=a.originalEvent);const i=a.keyCode||a.charCode,r=t.params.keyboard.pageUpDown,d=r&&33===i,c=r&&34===i,p=37===i,u=39===i,m=38===i,h=40===i;if(!t.allowSlideNext&&(t.isHorizontal()&&u||t.isVertical()&&h||c))return!1;if(!t.allowSlidePrev&&(t.isHorizontal()&&p||t.isVertical()&&m||d))return!1;if(!(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey||l.activeElement&&l.activeElement.nodeName&&("input"===l.activeElement.nodeName.toLowerCase()||"textarea"===l.activeElement.nodeName.toLowerCase()))){if(t.params.keyboard.onlyInViewport&&(d||c||p||u||m||h)){let e=!1;if(b(t.el,`.${t.params.slideClass}, swiper-slide`).length>0&&0===b(t.el,`.${t.params.slideActiveClass}`).length)return;const a=t.el,i=a.clientWidth,r=a.clientHeight,n=o.innerWidth,l=o.innerHeight,d=g(a);s&&(d.left-=a.scrollLeft);const c=[[d.left,d.top],[d.left+i,d.top],[d.left,d.top+r],[d.left+i,d.top+r]];for(let t=0;t<c.length;t+=1){const s=c[t];if(s[0]>=0&&s[0]<=n&&s[1]>=0&&s[1]<=l){if(0===s[0]&&0===s[1])continue;e=!0}}if(!e)return}t.isHorizontal()?((d||c||p||u)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),((c||u)&&!s||(d||p)&&s)&&t.slideNext(),((d||p)&&!s||(c||u)&&s)&&t.slidePrev()):((d||c||m||h)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),(c||h)&&t.slideNext(),(d||m)&&t.slidePrev()),n("keyPress",i)}}function c(){t.keyboard.enabled||(l.addEventListener("keydown",d),t.keyboard.enabled=!0)}function p(){t.keyboard.enabled&&(l.removeEventListener("keydown",d),t.keyboard.enabled=!1)}t.keyboard={enabled:!1},s({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}}),i("init",(()=>{t.params.keyboard.enabled&&c()})),i("destroy",(()=>{t.keyboard.enabled&&p()})),Object.assign(t.keyboard,{enable:c,disable:p})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const o=r();let d;s({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),t.mousewheel={enabled:!1};let c,p=l();const u=[];function m(){t.enabled&&(t.mouseEntered=!0)}function h(){t.enabled&&(t.mouseEntered=!1)}function f(e){return!(t.params.mousewheel.thresholdDelta&&e.delta<t.params.mousewheel.thresholdDelta)&&(!(t.params.mousewheel.thresholdTime&&l()-p<t.params.mousewheel.thresholdTime)&&(e.delta>=6&&l()-p<60||(e.direction<0?t.isEnd&&!t.params.loop||t.animating||(t.slideNext(),i("scroll",e.raw)):t.isBeginning&&!t.params.loop||t.animating||(t.slidePrev(),i("scroll",e.raw)),p=(new o.Date).getTime(),!1)))}function g(e){let s=e,a=!0;if(!t.enabled)return;if(e.target.closest(`.${t.params.mousewheel.noMousewheelClass}`))return;const r=t.params.mousewheel;t.params.cssMode&&s.preventDefault();let o=t.el;"container"!==t.params.mousewheel.eventsTarget&&(o=document.querySelector(t.params.mousewheel.eventsTarget));const p=o&&o.contains(s.target);if(!t.mouseEntered&&!p&&!r.releaseOnEdges)return!0;s.originalEvent&&(s=s.originalEvent);let m=0;const h=t.rtlTranslate?-1:1,g=function(e){let t=0,s=0,a=0,i=0;return"detail"in e&&(s=e.detail),"wheelDelta"in e&&(s=-e.wheelDelta/120),"wheelDeltaY"in e&&(s=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=s,s=0),a=10*t,i=10*s,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(a=e.deltaX),e.shiftKey&&!a&&(a=i,i=0),(a||i)&&e.deltaMode&&(1===e.deltaMode?(a*=40,i*=40):(a*=800,i*=800)),a&&!t&&(t=a<1?-1:1),i&&!s&&(s=i<1?-1:1),{spinX:t,spinY:s,pixelX:a,pixelY:i}}(s);if(r.forceToAxis)if(t.isHorizontal()){if(!(Math.abs(g.pixelX)>Math.abs(g.pixelY)))return!0;m=-g.pixelX*h}else{if(!(Math.abs(g.pixelY)>Math.abs(g.pixelX)))return!0;m=-g.pixelY}else m=Math.abs(g.pixelX)>Math.abs(g.pixelY)?-g.pixelX*h:-g.pixelY;if(0===m)return!0;r.invert&&(m=-m);let v=t.getTranslate()+m*r.sensitivity;if(v>=t.minTranslate()&&(v=t.minTranslate()),v<=t.maxTranslate()&&(v=t.maxTranslate()),a=!!t.params.loop||!(v===t.minTranslate()||v===t.maxTranslate()),a&&t.params.nested&&s.stopPropagation(),t.params.freeMode&&t.params.freeMode.enabled){const e={time:l(),delta:Math.abs(m),direction:Math.sign(m)},a=c&&e.time<c.time+500&&e.delta<=c.delta&&e.direction===c.direction;if(!a){c=void 0;let l=t.getTranslate()+m*r.sensitivity;const o=t.isBeginning,p=t.isEnd;if(l>=t.minTranslate()&&(l=t.minTranslate()),l<=t.maxTranslate()&&(l=t.maxTranslate()),t.setTransition(0),t.setTranslate(l),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses(),(!o&&t.isBeginning||!p&&t.isEnd)&&t.updateSlidesClasses(),t.params.loop&&t.loopFix({direction:e.direction<0?"next":"prev",byMousewheel:!0}),t.params.freeMode.sticky){clearTimeout(d),d=void 0,u.length>=15&&u.shift();const s=u.length?u[u.length-1]:void 0,a=u[0];if(u.push(e),s&&(e.delta>s.delta||e.direction!==s.direction))u.splice(0);else if(u.length>=15&&e.time-a.time<500&&a.delta-e.delta>=1&&e.delta<=6){const s=m>0?.8:.2;c=e,u.splice(0),d=n((()=>{t.slideToClosest(t.params.speed,!0,void 0,s)}),0)}d||(d=n((()=>{c=e,u.splice(0),t.slideToClosest(t.params.speed,!0,void 0,.5)}),500))}if(a||i("scroll",s),t.params.autoplay&&t.params.autoplayDisableOnInteraction&&t.autoplay.stop(),l===t.minTranslate()||l===t.maxTranslate())return!0}}else{const s={time:l(),delta:Math.abs(m),direction:Math.sign(m),raw:e};u.length>=2&&u.shift();const a=u.length?u[u.length-1]:void 0;if(u.push(s),a?(s.direction!==a.direction||s.delta>a.delta||s.time>a.time+150)&&f(s):f(s),function(e){const s=t.params.mousewheel;if(e.direction<0){if(t.isEnd&&!t.params.loop&&s.releaseOnEdges)return!0}else if(t.isBeginning&&!t.params.loop&&s.releaseOnEdges)return!0;return!1}(s))return!0}return s.preventDefault?s.preventDefault():s.returnValue=!1,!1}function v(e){let s=t.el;"container"!==t.params.mousewheel.eventsTarget&&(s=document.querySelector(t.params.mousewheel.eventsTarget)),s[e]("mouseenter",m),s[e]("mouseleave",h),s[e]("wheel",g)}function w(){return t.params.cssMode?(t.wrapperEl.removeEventListener("wheel",g),!0):!t.mousewheel.enabled&&(v("addEventListener"),t.mousewheel.enabled=!0,!0)}function b(){return t.params.cssMode?(t.wrapperEl.addEventListener(event,g),!0):!!t.mousewheel.enabled&&(v("removeEventListener"),t.mousewheel.enabled=!1,!0)}a("init",(()=>{!t.params.mousewheel.enabled&&t.params.cssMode&&b(),t.params.mousewheel.enabled&&w()})),a("destroy",(()=>{t.params.cssMode&&w(),t.mousewheel.enabled&&b()})),Object.assign(t.mousewheel,{enable:w,disable:b})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;s({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};const r=e=>(Array.isArray(e)||(e=[e].filter((e=>!!e))),e);function n(e){let s;return e&&"string"==typeof e&&t.isElement&&(s=t.el.querySelector(e),s)?s:(e&&("string"==typeof e&&(s=[...document.querySelectorAll(e)]),t.params.uniqueNavElements&&"string"==typeof e&&s.length>1&&1===t.el.querySelectorAll(e).length&&(s=t.el.querySelector(e))),e&&!s?e:s)}function l(e,s){const a=t.params.navigation;(e=r(e)).forEach((e=>{e&&(e.classList[s?"add":"remove"](...a.disabledClass.split(" ")),"BUTTON"===e.tagName&&(e.disabled=s),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](a.lockClass))}))}function o(){const{nextEl:e,prevEl:s}=t.navigation;if(t.params.loop)return l(s,!1),void l(e,!1);l(s,t.isBeginning&&!t.params.rewind),l(e,t.isEnd&&!t.params.rewind)}function d(e){e.preventDefault(),(!t.isBeginning||t.params.loop||t.params.rewind)&&(t.slidePrev(),i("navigationPrev"))}function c(e){e.preventDefault(),(!t.isEnd||t.params.loop||t.params.rewind)&&(t.slideNext(),i("navigationNext"))}function p(){const e=t.params.navigation;if(t.params.navigation=J(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!e.nextEl&&!e.prevEl)return;let s=n(e.nextEl),a=n(e.prevEl);Object.assign(t.navigation,{nextEl:s,prevEl:a}),s=r(s),a=r(a);const i=(s,a)=>{s&&s.addEventListener("click","next"===a?c:d),!t.enabled&&s&&s.classList.add(...e.lockClass.split(" "))};s.forEach((e=>i(e,"next"))),a.forEach((e=>i(e,"prev")))}function u(){let{nextEl:e,prevEl:s}=t.navigation;e=r(e),s=r(s);const a=(e,s)=>{e.removeEventListener("click","next"===s?c:d),e.classList.remove(...t.params.navigation.disabledClass.split(" "))};e.forEach((e=>a(e,"next"))),s.forEach((e=>a(e,"prev")))}a("init",(()=>{!1===t.params.navigation.enabled?m():(p(),o())})),a("toEdge fromEdge lock unlock",(()=>{o()})),a("destroy",(()=>{u()})),a("enable disable",(()=>{let{nextEl:e,prevEl:s}=t.navigation;e=r(e),s=r(s),[...e,...s].filter((e=>!!e)).forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.navigation.lockClass)))})),a("click",((e,s)=>{let{nextEl:a,prevEl:n}=t.navigation;a=r(a),n=r(n);const l=s.target;if(t.params.navigation.hideOnClick&&!n.includes(l)&&!a.includes(l)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===l||t.pagination.el.contains(l)))return;let e;a.length?e=a[0].classList.contains(t.params.navigation.hiddenClass):n.length&&(e=n[0].classList.contains(t.params.navigation.hiddenClass)),i(!0===e?"navigationShow":"navigationHide"),[...a,...n].filter((e=>!!e)).forEach((e=>e.classList.toggle(t.params.navigation.hiddenClass)))}}));const m=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),u()};Object.assign(t.navigation,{enable:()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),p(),o()},disable:m,update:o,init:p,destroy:u})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const r="swiper-pagination";let n;s({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:e=>e,formatFractionTotal:e=>e,bulletClass:`${r}-bullet`,bulletActiveClass:`${r}-bullet-active`,modifierClass:`${r}-`,currentClass:`${r}-current`,totalClass:`${r}-total`,hiddenClass:`${r}-hidden`,progressbarFillClass:`${r}-progressbar-fill`,progressbarOppositeClass:`${r}-progressbar-opposite`,clickableClass:`${r}-clickable`,lockClass:`${r}-lock`,horizontalClass:`${r}-horizontal`,verticalClass:`${r}-vertical`,paginationDisabledClass:`${r}-disabled`}}),t.pagination={el:null,bullets:[]};let l=0;const o=e=>(Array.isArray(e)||(e=[e].filter((e=>!!e))),e);function d(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&0===t.pagination.el.length}function c(e,s){const{bulletActiveClass:a}=t.params.pagination;e&&(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&(e.classList.add(`${a}-${s}`),(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&e.classList.add(`${a}-${s}-${s}`))}function p(e){const s=e.target.closest(ee(t.params.pagination.bulletClass));if(!s)return;e.preventDefault();const a=w(s)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===a)return;const e=t.getSlideIndexByData(a),s=t.getSlideIndexByData(t.realIndex);e>t.slides.length-t.loopedSlides&&t.loopFix({direction:e>s?"next":"prev",activeSlideIndex:e,slideTo:!1}),t.slideToLoop(a)}else t.slideTo(a)}function u(){const e=t.rtl,s=t.params.pagination;if(d())return;let a,r,p=t.pagination.el;p=o(p);const u=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,m=t.params.loop?Math.ceil(u/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(r=t.previousRealIndex||0,a=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):void 0!==t.snapIndex?(a=t.snapIndex,r=t.previousSnapIndex):(r=t.previousIndex||0,a=t.activeIndex||0),"bullets"===s.type&&t.pagination.bullets&&t.pagination.bullets.length>0){const i=t.pagination.bullets;let o,d,u;if(s.dynamicBullets&&(n=E(i[0],t.isHorizontal()?"width":"height",!0),p.forEach((e=>{e.style[t.isHorizontal()?"width":"height"]=n*(s.dynamicMainBullets+4)+"px"})),s.dynamicMainBullets>1&&void 0!==r&&(l+=a-(r||0),l>s.dynamicMainBullets-1?l=s.dynamicMainBullets-1:l<0&&(l=0)),o=Math.max(a-l,0),d=o+(Math.min(i.length,s.dynamicMainBullets)-1),u=(d+o)/2),i.forEach((e=>{const t=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((e=>`${s.bulletActiveClass}${e}`))].map((e=>"string"==typeof e&&e.includes(" ")?e.split(" "):e)).flat();e.classList.remove(...t)})),p.length>1)i.forEach((e=>{const i=w(e);i===a?e.classList.add(...s.bulletActiveClass.split(" ")):t.isElement&&e.setAttribute("part","bullet"),s.dynamicBullets&&(i>=o&&i<=d&&e.classList.add(...`${s.bulletActiveClass}-main`.split(" ")),i===o&&c(e,"prev"),i===d&&c(e,"next"))}));else{const e=i[a];if(e&&e.classList.add(...s.bulletActiveClass.split(" ")),t.isElement&&i.forEach(((e,t)=>{e.setAttribute("part",t===a?"bullet-active":"bullet")})),s.dynamicBullets){const e=i[o],t=i[d];for(let e=o;e<=d;e+=1)i[e]&&i[e].classList.add(...`${s.bulletActiveClass}-main`.split(" "));c(e,"prev"),c(t,"next")}}if(s.dynamicBullets){const a=Math.min(i.length,s.dynamicMainBullets+4),r=(n*a-n)/2-u*n,l=e?"right":"left";i.forEach((e=>{e.style[t.isHorizontal()?l:"top"]=`${r}px`}))}}p.forEach(((e,r)=>{if("fraction"===s.type&&(e.querySelectorAll(ee(s.currentClass)).forEach((e=>{e.textContent=s.formatFractionCurrent(a+1)})),e.querySelectorAll(ee(s.totalClass)).forEach((e=>{e.textContent=s.formatFractionTotal(m)}))),"progressbar"===s.type){let i;i=s.progressbarOpposite?t.isHorizontal()?"vertical":"horizontal":t.isHorizontal()?"horizontal":"vertical";const r=(a+1)/m;let n=1,l=1;"horizontal"===i?n=r:l=r,e.querySelectorAll(ee(s.progressbarFillClass)).forEach((e=>{e.style.transform=`translate3d(0,0,0) scaleX(${n}) scaleY(${l})`,e.style.transitionDuration=`${t.params.speed}ms`}))}"custom"===s.type&&s.renderCustom?(e.innerHTML=s.renderCustom(t,a+1,m),0===r&&i("paginationRender",e)):(0===r&&i("paginationRender",e),i("paginationUpdate",e)),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](s.lockClass)}))}function m(){const e=t.params.pagination;if(d())return;const s=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length;let a=t.pagination.el;a=o(a);let r="";if("bullets"===e.type){let a=t.params.loop?Math.ceil(s/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&a>s&&(a=s);for(let s=0;s<a;s+=1)e.renderBullet?r+=e.renderBullet.call(t,s,e.bulletClass):r+=`<${e.bulletElement} ${t.isElement?'part="bullet"':""} class="${e.bulletClass}"></${e.bulletElement}>`}"fraction"===e.type&&(r=e.renderFraction?e.renderFraction.call(t,e.currentClass,e.totalClass):`<span class="${e.currentClass}"></span> / <span class="${e.totalClass}"></span>`),"progressbar"===e.type&&(r=e.renderProgressbar?e.renderProgressbar.call(t,e.progressbarFillClass):`<span class="${e.progressbarFillClass}"></span>`),t.pagination.bullets=[],a.forEach((s=>{"custom"!==e.type&&(s.innerHTML=r||""),"bullets"===e.type&&t.pagination.bullets.push(...s.querySelectorAll(ee(e.bulletClass)))})),"custom"!==e.type&&i("paginationRender",a[0])}function h(){t.params.pagination=J(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const e=t.params.pagination;if(!e.el)return;let s;"string"==typeof e.el&&t.isElement&&(s=t.el.querySelector(e.el)),s||"string"!=typeof e.el||(s=[...document.querySelectorAll(e.el)]),s||(s=e.el),s&&0!==s.length&&(t.params.uniqueNavElements&&"string"==typeof e.el&&Array.isArray(s)&&s.length>1&&(s=[...t.el.querySelectorAll(e.el)],s.length>1&&(s=s.filter((e=>b(e,".swiper")[0]===t.el))[0])),Array.isArray(s)&&1===s.length&&(s=s[0]),Object.assign(t.pagination,{el:s}),s=o(s),s.forEach((s=>{"bullets"===e.type&&e.clickable&&s.classList.add(e.clickableClass),s.classList.add(e.modifierClass+e.type),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass),"bullets"===e.type&&e.dynamicBullets&&(s.classList.add(`${e.modifierClass}${e.type}-dynamic`),l=0,e.dynamicMainBullets<1&&(e.dynamicMainBullets=1)),"progressbar"===e.type&&e.progressbarOpposite&&s.classList.add(e.progressbarOppositeClass),e.clickable&&s.addEventListener("click",p),t.enabled||s.classList.add(e.lockClass)})))}function f(){const e=t.params.pagination;if(d())return;let s=t.pagination.el;s&&(s=o(s),s.forEach((s=>{s.classList.remove(e.hiddenClass),s.classList.remove(e.modifierClass+e.type),s.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),e.clickable&&s.removeEventListener("click",p)}))),t.pagination.bullets&&t.pagination.bullets.forEach((t=>t.classList.remove(...e.bulletActiveClass.split(" "))))}a("changeDirection",(()=>{if(!t.pagination||!t.pagination.el)return;const e=t.params.pagination;let{el:s}=t.pagination;s=o(s),s.forEach((s=>{s.classList.remove(e.horizontalClass,e.verticalClass),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass)}))})),a("init",(()=>{!1===t.params.pagination.enabled?g():(h(),m(),u())})),a("activeIndexChange",(()=>{void 0===t.snapIndex&&u()})),a("snapIndexChange",(()=>{u()})),a("snapGridLengthChange",(()=>{m(),u()})),a("destroy",(()=>{f()})),a("enable disable",(()=>{let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass))))})),a("lock unlock",(()=>{u()})),a("click",((e,s)=>{const a=s.target,r=o(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&r&&r.length>0&&!a.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&a===t.navigation.nextEl||t.navigation.prevEl&&a===t.navigation.prevEl))return;const e=r[0].classList.contains(t.params.pagination.hiddenClass);i(!0===e?"paginationShow":"paginationHide"),r.forEach((e=>e.classList.toggle(t.params.pagination.hiddenClass)))}}));const g=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList.add(t.params.pagination.paginationDisabledClass)))),f()};Object.assign(t.pagination,{enable:()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList.remove(t.params.pagination.paginationDisabledClass)))),h(),m(),u()},disable:g,render:m,update:u,init:h,destroy:f})},function(e){let{swiper:t,extendParams:s,on:i,emit:r}=e;const l=a();let o,d,c,p,u=!1,m=null,h=null;function v(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:e,rtlTranslate:s}=t,{dragEl:a,el:i}=e,r=t.params.scrollbar,n=t.params.loop?t.progressLoop:t.progress;let l=d,o=(c-d)*n;s?(o=-o,o>0?(l=d-o,o=0):-o+d>c&&(l=c+o)):o<0?(l=d+o,o=0):o+d>c&&(l=c-o),t.isHorizontal()?(a.style.transform=`translate3d(${o}px, 0, 0)`,a.style.width=`${l}px`):(a.style.transform=`translate3d(0px, ${o}px, 0)`,a.style.height=`${l}px`),r.hide&&(clearTimeout(m),i.style.opacity=1,m=setTimeout((()=>{i.style.opacity=0,i.style.transitionDuration="400ms"}),1e3))}function w(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:e}=t,{dragEl:s,el:a}=e;s.style.width="",s.style.height="",c=t.isHorizontal()?a.offsetWidth:a.offsetHeight,p=t.size/(t.virtualSize+t.params.slidesOffsetBefore-(t.params.centeredSlides?t.snapGrid[0]:0)),d="auto"===t.params.scrollbar.dragSize?c*p:parseInt(t.params.scrollbar.dragSize,10),t.isHorizontal()?s.style.width=`${d}px`:s.style.height=`${d}px`,a.style.display=p>=1?"none":"",t.params.scrollbar.hide&&(a.style.opacity=0),t.params.watchOverflow&&t.enabled&&e.el.classList[t.isLocked?"add":"remove"](t.params.scrollbar.lockClass)}function b(e){return t.isHorizontal()?e.clientX:e.clientY}function y(e){const{scrollbar:s,rtlTranslate:a}=t,{el:i}=s;let r;r=(b(e)-g(i)[t.isHorizontal()?"left":"top"]-(null!==o?o:d/2))/(c-d),r=Math.max(Math.min(r,1),0),a&&(r=1-r);const n=t.minTranslate()+(t.maxTranslate()-t.minTranslate())*r;t.updateProgress(n),t.setTranslate(n),t.updateActiveIndex(),t.updateSlidesClasses()}function E(e){const s=t.params.scrollbar,{scrollbar:a,wrapperEl:i}=t,{el:n,dragEl:l}=a;u=!0,o=e.target===l?b(e)-e.target.getBoundingClientRect()[t.isHorizontal()?"left":"top"]:null,e.preventDefault(),e.stopPropagation(),i.style.transitionDuration="100ms",l.style.transitionDuration="100ms",y(e),clearTimeout(h),n.style.transitionDuration="0ms",s.hide&&(n.style.opacity=1),t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="none"),r("scrollbarDragStart",e)}function x(e){const{scrollbar:s,wrapperEl:a}=t,{el:i,dragEl:n}=s;u&&(e.preventDefault?e.preventDefault():e.returnValue=!1,y(e),a.style.transitionDuration="0ms",i.style.transitionDuration="0ms",n.style.transitionDuration="0ms",r("scrollbarDragMove",e))}function S(e){const s=t.params.scrollbar,{scrollbar:a,wrapperEl:i}=t,{el:l}=a;u&&(u=!1,t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="",i.style.transitionDuration=""),s.hide&&(clearTimeout(h),h=n((()=>{l.style.opacity=0,l.style.transitionDuration="400ms"}),1e3)),r("scrollbarDragEnd",e),s.snapOnRelease&&t.slideToClosest())}function T(e){const{scrollbar:s,params:a}=t,i=s.el;if(!i)return;const r=i,n=!!a.passiveListeners&&{passive:!1,capture:!1},o=!!a.passiveListeners&&{passive:!0,capture:!1};if(!r)return;const d="on"===e?"addEventListener":"removeEventListener";r[d]("pointerdown",E,n),l[d]("pointermove",x,n),l[d]("pointerup",S,o)}function M(){const{scrollbar:e,el:s}=t;t.params.scrollbar=J(t,t.originalParams.scrollbar,t.params.scrollbar,{el:"swiper-scrollbar"});const a=t.params.scrollbar;if(!a.el)return;let i,r;"string"==typeof a.el&&t.isElement&&(i=t.el.querySelector(a.el)),i||"string"!=typeof a.el?i||(i=a.el):i=l.querySelectorAll(a.el),t.params.uniqueNavElements&&"string"==typeof a.el&&i.length>1&&1===s.querySelectorAll(a.el).length&&(i=s.querySelector(a.el)),i.length>0&&(i=i[0]),i.classList.add(t.isHorizontal()?a.horizontalClass:a.verticalClass),i&&(r=i.querySelector(`.${t.params.scrollbar.dragClass}`),r||(r=f("div",t.params.scrollbar.dragClass),i.append(r))),Object.assign(e,{el:i,dragEl:r}),a.draggable&&t.params.scrollbar.el&&t.scrollbar.el&&T("on"),i&&i.classList[t.enabled?"remove":"add"](t.params.scrollbar.lockClass)}function C(){const e=t.params.scrollbar,s=t.scrollbar.el;s&&s.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),t.params.scrollbar.el&&t.scrollbar.el&&T("off")}s({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),t.scrollbar={el:null,dragEl:null},i("init",(()=>{!1===t.params.scrollbar.enabled?P():(M(),w(),v())})),i("update resize observerUpdate lock unlock",(()=>{w()})),i("setTranslate",(()=>{v()})),i("setTransition",((e,s)=>{!function(e){t.params.scrollbar.el&&t.scrollbar.el&&(t.scrollbar.dragEl.style.transitionDuration=`${e}ms`)}(s)})),i("enable disable",(()=>{const{el:e}=t.scrollbar;e&&e.classList[t.enabled?"remove":"add"](t.params.scrollbar.lockClass)})),i("destroy",(()=>{C()}));const P=()=>{t.el.classList.add(t.params.scrollbar.scrollbarDisabledClass),t.scrollbar.el&&t.scrollbar.el.classList.add(t.params.scrollbar.scrollbarDisabledClass),C()};Object.assign(t.scrollbar,{enable:()=>{t.el.classList.remove(t.params.scrollbar.scrollbarDisabledClass),t.scrollbar.el&&t.scrollbar.el.classList.remove(t.params.scrollbar.scrollbarDisabledClass),M(),w(),v()},disable:P,updateSize:w,setTranslate:v,init:M,destroy:C})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({parallax:{enabled:!1}});const i=(e,s)=>{const{rtl:a}=t,i=a?-1:1,r=e.getAttribute("data-swiper-parallax")||"0";let n=e.getAttribute("data-swiper-parallax-x"),l=e.getAttribute("data-swiper-parallax-y");const o=e.getAttribute("data-swiper-parallax-scale"),d=e.getAttribute("data-swiper-parallax-opacity"),c=e.getAttribute("data-swiper-parallax-rotate");if(n||l?(n=n||"0",l=l||"0"):t.isHorizontal()?(n=r,l="0"):(l=r,n="0"),n=n.indexOf("%")>=0?parseInt(n,10)*s*i+"%":n*s*i+"px",l=l.indexOf("%")>=0?parseInt(l,10)*s+"%":l*s+"px",null!=d){const t=d-(d-1)*(1-Math.abs(s));e.style.opacity=t}let p=`translate3d(${n}, ${l}, 0px)`;if(null!=o){p+=` scale(${o-(o-1)*(1-Math.abs(s))})`}if(c&&null!=c){p+=` rotate(${c*s*-1}deg)`}e.style.transform=p},r=()=>{const{el:e,slides:s,progress:a,snapGrid:r}=t;h(e,"[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").forEach((e=>{i(e,a)})),s.forEach(((e,s)=>{let n=e.progress;t.params.slidesPerGroup>1&&"auto"!==t.params.slidesPerView&&(n+=Math.ceil(s/2)-a*(r.length-1)),n=Math.min(Math.max(n,-1),1),e.querySelectorAll("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale], [data-swiper-parallax-rotate]").forEach((e=>{i(e,n)}))}))};a("beforeInit",(()=>{t.params.parallax.enabled&&(t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0)})),a("init",(()=>{t.params.parallax.enabled&&r()})),a("setTranslate",(()=>{t.params.parallax.enabled&&r()})),a("setTransition",((e,s)=>{t.params.parallax.enabled&&function(e){void 0===e&&(e=t.params.speed);const{el:s}=t;s.querySelectorAll("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").forEach((t=>{let s=parseInt(t.getAttribute("data-swiper-parallax-duration"),10)||e;0===e&&(s=0),t.style.transitionDuration=`${s}ms`}))}(s)}))},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const n=r();s({zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),t.zoom={enabled:!1};let l,d,c=1,p=!1;const u=[],m={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},f={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},v={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let w=1;function y(){if(u.length<2)return 1;const e=u[0].pageX,t=u[0].pageY,s=u[1].pageX,a=u[1].pageY;return Math.sqrt((s-e)**2+(a-t)**2)}function E(e){const s=t.isElement?"swiper-slide":`.${t.params.slideClass}`;return!!e.target.matches(s)||t.slides.filter((t=>t.contains(e.target))).length>0}function x(e){if("mouse"===e.pointerType&&u.splice(0,u.length),!E(e))return;const s=t.params.zoom;if(l=!1,d=!1,u.push(e),!(u.length<2)){if(l=!0,m.scaleStart=y(),!m.slideEl){m.slideEl=e.target.closest(`.${t.params.slideClass}, swiper-slide`),m.slideEl||(m.slideEl=t.slides[t.activeIndex]);let a=m.slideEl.querySelector(`.${s.containerClass}`);if(a&&(a=a.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=a,m.imageWrapEl=a?b(m.imageEl,`.${s.containerClass}`)[0]:void 0,!m.imageWrapEl)return void(m.imageEl=void 0);m.maxRatio=m.imageWrapEl.getAttribute("data-swiper-zoom")||s.maxRatio}if(m.imageEl){const[e,t]=function(){if(u.length<2)return{x:null,y:null};const e=m.imageEl.getBoundingClientRect();return[(u[0].pageX+(u[1].pageX-u[0].pageX)/2-e.x)/c,(u[0].pageY+(u[1].pageY-u[0].pageY)/2-e.y)/c]}();m.originX=e,m.originY=t,m.imageEl.style.transitionDuration="0ms"}p=!0}}function S(e){if(!E(e))return;const s=t.params.zoom,a=t.zoom,i=u.findIndex((t=>t.pointerId===e.pointerId));i>=0&&(u[i]=e),u.length<2||(d=!0,m.scaleMove=y(),m.imageEl&&(a.scale=m.scaleMove/m.scaleStart*c,a.scale>m.maxRatio&&(a.scale=m.maxRatio-1+(a.scale-m.maxRatio+1)**.5),a.scale<s.minRatio&&(a.scale=s.minRatio+1-(s.minRatio-a.scale+1)**.5),m.imageEl.style.transform=`translate3d(0,0,0) scale(${a.scale})`))}function T(e){if(!E(e))return;if("mouse"===e.pointerType&&"pointerout"===e.type)return;const s=t.params.zoom,a=t.zoom,i=u.findIndex((t=>t.pointerId===e.pointerId));i>=0&&u.splice(i,1),l&&d&&(l=!1,d=!1,m.imageEl&&(a.scale=Math.max(Math.min(a.scale,m.maxRatio),s.minRatio),m.imageEl.style.transitionDuration=`${t.params.speed}ms`,m.imageEl.style.transform=`translate3d(0,0,0) scale(${a.scale})`,c=a.scale,p=!1,a.scale>1&&m.slideEl?m.slideEl.classList.add(`${s.zoomedSlideClass}`):a.scale<=1&&m.slideEl&&m.slideEl.classList.remove(`${s.zoomedSlideClass}`),1===a.scale&&(m.originX=0,m.originY=0,m.slideEl=void 0)))}function M(e){if(!E(e)||!function(e){const s=`.${t.params.zoom.containerClass}`;return!!e.target.matches(s)||[...t.el.querySelectorAll(s)].filter((t=>t.contains(e.target))).length>0}(e))return;const s=t.zoom;if(!m.imageEl)return;if(!f.isTouched||!m.slideEl)return;f.isMoved||(f.width=m.imageEl.offsetWidth,f.height=m.imageEl.offsetHeight,f.startX=o(m.imageWrapEl,"x")||0,f.startY=o(m.imageWrapEl,"y")||0,m.slideWidth=m.slideEl.offsetWidth,m.slideHeight=m.slideEl.offsetHeight,m.imageWrapEl.style.transitionDuration="0ms");const a=f.width*s.scale,i=f.height*s.scale;if(a<m.slideWidth&&i<m.slideHeight)return;f.minX=Math.min(m.slideWidth/2-a/2,0),f.maxX=-f.minX,f.minY=Math.min(m.slideHeight/2-i/2,0),f.maxY=-f.minY,f.touchesCurrent.x=u.length>0?u[0].pageX:e.pageX,f.touchesCurrent.y=u.length>0?u[0].pageY:e.pageY;if(Math.max(Math.abs(f.touchesCurrent.x-f.touchesStart.x),Math.abs(f.touchesCurrent.y-f.touchesStart.y))>5&&(t.allowClick=!1),!f.isMoved&&!p){if(t.isHorizontal()&&(Math.floor(f.minX)===Math.floor(f.startX)&&f.touchesCurrent.x<f.touchesStart.x||Math.floor(f.maxX)===Math.floor(f.startX)&&f.touchesCurrent.x>f.touchesStart.x))return void(f.isTouched=!1);if(!t.isHorizontal()&&(Math.floor(f.minY)===Math.floor(f.startY)&&f.touchesCurrent.y<f.touchesStart.y||Math.floor(f.maxY)===Math.floor(f.startY)&&f.touchesCurrent.y>f.touchesStart.y))return void(f.isTouched=!1)}e.cancelable&&e.preventDefault(),e.stopPropagation(),f.isMoved=!0;const r=(s.scale-c)/(m.maxRatio-t.params.zoom.minRatio),{originX:n,originY:l}=m;f.currentX=f.touchesCurrent.x-f.touchesStart.x+f.startX+r*(f.width-2*n),f.currentY=f.touchesCurrent.y-f.touchesStart.y+f.startY+r*(f.height-2*l),f.currentX<f.minX&&(f.currentX=f.minX+1-(f.minX-f.currentX+1)**.8),f.currentX>f.maxX&&(f.currentX=f.maxX-1+(f.currentX-f.maxX+1)**.8),f.currentY<f.minY&&(f.currentY=f.minY+1-(f.minY-f.currentY+1)**.8),f.currentY>f.maxY&&(f.currentY=f.maxY-1+(f.currentY-f.maxY+1)**.8),v.prevPositionX||(v.prevPositionX=f.touchesCurrent.x),v.prevPositionY||(v.prevPositionY=f.touchesCurrent.y),v.prevTime||(v.prevTime=Date.now()),v.x=(f.touchesCurrent.x-v.prevPositionX)/(Date.now()-v.prevTime)/2,v.y=(f.touchesCurrent.y-v.prevPositionY)/(Date.now()-v.prevTime)/2,Math.abs(f.touchesCurrent.x-v.prevPositionX)<2&&(v.x=0),Math.abs(f.touchesCurrent.y-v.prevPositionY)<2&&(v.y=0),v.prevPositionX=f.touchesCurrent.x,v.prevPositionY=f.touchesCurrent.y,v.prevTime=Date.now(),m.imageWrapEl.style.transform=`translate3d(${f.currentX}px, ${f.currentY}px,0)`}function C(){const e=t.zoom;m.slideEl&&t.activeIndex!==t.slides.indexOf(m.slideEl)&&(m.imageEl&&(m.imageEl.style.transform="translate3d(0,
59290,0) scale(1)"),m.imageWrapEl&&(m.imageWrapEl.style.transform="translate3d(0,0,0)"),m.slideEl.classList.remove(`${t.params.zoom.zoomedSlideClass}`),e.scale=1,c=1,m.slideEl=void 0,m.imageEl=void 0,m.imageWrapEl=void 0,m.originX=0,m.originY=0)}function P(e){const s=t.zoom,a=t.params.zoom;if(!m.slideEl){e&&e.target&&(m.slideEl=e.target.closest(`.${t.params.slideClass}, swiper-slide`)),m.slideEl||(t.params.virtual&&t.params.virtual.enabled&&t.virtual?m.slideEl=h(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:m.slideEl=t.slides[t.activeIndex]);let s=m.slideEl.querySelector(`.${a.containerClass}`);s&&(s=s.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=s,m.imageWrapEl=s?b(m.imageEl,`.${a.containerClass}`)[0]:void 0}if(!m.imageEl||!m.imageWrapEl)return;let i,r,l,o,d,p,u,v,w,y,E,x,S,T,M,C,P,L;t.params.cssMode&&(t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.touchAction="none"),m.slideEl.classList.add(`${a.zoomedSlideClass}`),void 0===f.touchesStart.x&&e?(i=e.pageX,r=e.pageY):(i=f.touchesStart.x,r=f.touchesStart.y);const z="number"==typeof e?e:null;1===c&&z&&(i=void 0,r=void 0),s.scale=z||m.imageWrapEl.getAttribute("data-swiper-zoom")||a.maxRatio,c=z||m.imageWrapEl.getAttribute("data-swiper-zoom")||a.maxRatio,!e||1===c&&z?(u=0,v=0):(P=m.slideEl.offsetWidth,L=m.slideEl.offsetHeight,l=g(m.slideEl).left+n.scrollX,o=g(m.slideEl).top+n.scrollY,d=l+P/2-i,p=o+L/2-r,w=m.imageEl.offsetWidth,y=m.imageEl.offsetHeight,E=w*s.scale,x=y*s.scale,S=Math.min(P/2-E/2,0),T=Math.min(L/2-x/2,0),M=-S,C=-T,u=d*s.scale,v=p*s.scale,u<S&&(u=S),u>M&&(u=M),v<T&&(v=T),v>C&&(v=C)),z&&1===s.scale&&(m.originX=0,m.originY=0),m.imageWrapEl.style.transitionDuration="300ms",m.imageWrapEl.style.transform=`translate3d(${u}px, ${v}px,0)`,m.imageEl.style.transitionDuration="300ms",m.imageEl.style.transform=`translate3d(0,0,0) scale(${s.scale})`}function L(){const e=t.zoom,s=t.params.zoom;if(!m.slideEl){t.params.virtual&&t.params.virtual.enabled&&t.virtual?m.slideEl=h(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:m.slideEl=t.slides[t.activeIndex];let e=m.slideEl.querySelector(`.${s.containerClass}`);e&&(e=e.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=e,m.imageWrapEl=e?b(m.imageEl,`.${s.containerClass}`)[0]:void 0}m.imageEl&&m.imageWrapEl&&(t.params.cssMode&&(t.wrapperEl.style.overflow="",t.wrapperEl.style.touchAction=""),e.scale=1,c=1,m.imageWrapEl.style.transitionDuration="300ms",m.imageWrapEl.style.transform="translate3d(0,0,0)",m.imageEl.style.transitionDuration="300ms",m.imageEl.style.transform="translate3d(0,0,0) scale(1)",m.slideEl.classList.remove(`${s.zoomedSlideClass}`),m.slideEl=void 0,m.originX=0,m.originY=0)}function z(e){const s=t.zoom;s.scale&&1!==s.scale?L():P(e)}function A(){return{passiveListener:!!t.params.passiveListeners&&{passive:!0,capture:!1},activeListenerWithCapture:!t.params.passiveListeners||{passive:!1,capture:!0}}}function $(){const e=t.zoom;if(e.enabled)return;e.enabled=!0;const{passiveListener:s,activeListenerWithCapture:a}=A();t.wrapperEl.addEventListener("pointerdown",x,s),t.wrapperEl.addEventListener("pointermove",S,a),["pointerup","pointercancel","pointerout"].forEach((e=>{t.wrapperEl.addEventListener(e,T,s)}
vendor: 32,471 bytes, line 5929
5929)),t.wrapperEl.addEventListener("pointermove",M,a)}function I(){const e=t.zoom;if(!e.enabled)return;e.enabled=!1;const{passiveListener:s,activeListenerWithCapture:a}=A();t.wrapperEl.removeEventListener("pointerdown",x,s),t.wrapperEl.removeEventListener("pointermove",S,a),["pointerup","pointercancel","pointerout"].forEach((e=>{t.wrapperEl.removeEventListener(e,T,s)})),t.wrapperEl.removeEventListener("pointermove",M,a)}Object.defineProperty(t.zoom,"scale",{get:()=>w,set(e){if(w!==e){const t=m.imageEl,s=m.slideEl;i("zoomChange",e,t,s)}w=e}}),a("init",(()=>{t.params.zoom.enabled&&$()})),a("destroy",(()=>{I()})),a("touchStart",((e,s)=>{t.zoom.enabled&&function(e){const s=t.device;if(!m.imageEl)return;if(f.isTouched)return;s.android&&e.cancelable&&e.preventDefault(),f.isTouched=!0;const a=u.length>0?u[0]:e;f.touchesStart.x=a.pageX,f.touchesStart.y=a.pageY}(s)})),a("touchEnd",((e,s)=>{t.zoom.enabled&&function(){const e=t.zoom;if(!m.imageEl)return;if(!f.isTouched||!f.isMoved)return f.isTouched=!1,void(f.isMoved=!1);f.isTouched=!1,f.isMoved=!1;let s=300,a=300;const i=v.x*s,r=f.currentX+i,n=v.y*a,l=f.currentY+n;0!==v.x&&(s=Math.abs((r-f.currentX)/v.x)),0!==v.y&&(a=Math.abs((l-f.currentY)/v.y));const o=Math.max(s,a);f.currentX=r,f.currentY=l;const d=f.width*e.scale,c=f.height*e.scale;f.minX=Math.min(m.slideWidth/2-d/2,0),f.maxX=-f.minX,f.minY=Math.min(m.slideHeight/2-c/2,0),f.maxY=-f.minY,f.currentX=Math.max(Math.min(f.currentX,f.maxX),f.minX),f.currentY=Math.max(Math.min(f.currentY,f.maxY),f.minY),m.imageWrapEl.style.transitionDuration=`${o}ms`,m.imageWrapEl.style.transform=`translate3d(${f.currentX}px, ${f.currentY}px,0)`}()})),a("doubleTap",((e,s)=>{!t.animating&&t.params.zoom.enabled&&t.zoom.enabled&&t.params.zoom.toggle&&z(s)})),a("transitionEnd",(()=>{t.zoom.enabled&&t.params.zoom.enabled&&C()})),a("slideChange",(()=>{t.zoom.enabled&&t.params.zoom.enabled&&t.params.cssMode&&C()})),Object.assign(t.zoom,{enable:$,disable:I,in:P,out:L,toggle:z})},function(e){let{swiper:t,extendParams:s,on:a}=e;function i(e,t){const s=function(){let e,t,s;return(a,i)=>{for(t=-1,e=a.length;e-t>1;)s=e+t>>1,a[s]<=i?t=s:e=s;return e}}();let a,i;return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(i=s(this.x,e),a=i-1,(e-this.x[a])*(this.y[i]-this.y[a])/(this.x[i]-this.x[a])+this.y[a]):0},this}function r(){t.controller.control&&t.controller.spline&&(t.controller.spline=void 0,delete t.controller.spline)}s({controller:{control:void 0,inverse:!1,by:"slide"}}),t.controller={control:void 0},a("beforeInit",(()=>{if("undefined"!=typeof window&&("string"==typeof t.params.controller.control||t.params.controller.control instanceof HTMLElement)){const e=document.querySelector(t.params.controller.control);if(e&&e.swiper)t.controller.control=e.swiper;else if(e){const s=a=>{t.controller.control=a.detail[0],t.update(),e.removeEventListener("init",s)};e.addEventListener("init",s)}}else t.controller.control=t.params.controller.control})),a("update",(()=>{r()})),a("resize",(()=>{r()})),a("observerUpdate",(()=>{r()})),a("setTranslate",((e,s,a)=>{t.controller.control&&!t.controller.control.destroyed&&t.controller.setTranslate(s,a)})),a("setTransition",((e,s,a)=>{t.controller.control&&!t.controller.control.destroyed&&t.controller.setTransition(s,a)})),Object.assign(t.controller,{setTranslate:function(e,s){const a=t.controller.control;let r,n;const l=t.constructor;function o(e){if(e.destroyed)return;const s=t.rtlTranslate?-t.translate:t.translate;"slide"===t.params.controller.by&&(!function(e){t.controller.spline=t.params.loop?new i(t.slidesGrid,e.slidesGrid):new i(t.snapGrid,e.snapGrid)}(e),n=-t.controller.spline.interpolate(-s)),n&&"container"!==t.params.controller.by||(r=(e.maxTranslate()-e.minTranslate())/(t.maxTranslate()-t.minTranslate()),!Number.isNaN(r)&&Number.isFinite(r)||(r=1),n=(s-t.minTranslate())*r+e.minTranslate()),t.params.controller.inverse&&(n=e.maxTranslate()-n),e.updateProgress(n),e.setTranslate(n,t),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(a))for(let e=0;e<a.length;e+=1)a[e]!==s&&a[e]instanceof l&&o(a[e]);else a instanceof l&&s!==a&&o(a)},setTransition:function(e,s){const a=t.constructor,i=t.controller.control;let r;function l(s){s.destroyed||(s.setTransition(e,t),0!==e&&(s.transitionStart(),s.params.autoHeight&&n((()=>{s.updateAutoHeight()})),y(s.wrapperEl,(()=>{i&&s.transitionEnd()}))))}if(Array.isArray(i))for(r=0;r<i.length;r+=1)i[r]!==s&&i[r]instanceof a&&l(i[r]);else i instanceof a&&s!==i&&l(i)}})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null}}),t.a11y={clicked:!1};let i=null;function r(e){const t=i;0!==t.length&&(t.innerHTML="",t.innerHTML=e)}const n=e=>(Array.isArray(e)||(e=[e].filter((e=>!!e))),e);function l(e){(e=n(e)).forEach((e=>{e.setAttribute("tabIndex","0")}))}function o(e){(e=n(e)).forEach((e=>{e.setAttribute("tabIndex","-1")}))}function d(e,t){(e=n(e)).forEach((e=>{e.setAttribute("role",t)}))}function c(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-roledescription",t)}))}function p(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-label",t)}))}function u(e){(e=n(e)).forEach((e=>{e.setAttribute("aria-disabled",!0)}))}function m(e){(e=n(e)).forEach((e=>{e.setAttribute("aria-disabled",!1)}))}function h(e){if(13!==e.keyCode&&32!==e.keyCode)return;const s=t.params.a11y,a=e.target;t.pagination&&t.pagination.el&&(a===t.pagination.el||t.pagination.el.contains(e.target))&&!e.target.matches(ee(t.params.pagination.bulletClass))||(t.navigation&&t.navigation.nextEl&&a===t.navigation.nextEl&&(t.isEnd&&!t.params.loop||t.slideNext(),t.isEnd?r(s.lastSlideMessage):r(s.nextSlideMessage)),t.navigation&&t.navigation.prevEl&&a===t.navigation.prevEl&&(t.isBeginning&&!t.params.loop||t.slidePrev(),t.isBeginning?r(s.firstSlideMessage):r(s.prevSlideMessage)),t.pagination&&a.matches(ee(t.params.pagination.bulletClass))&&a.click())}function g(){return t.pagination&&t.pagination.bullets&&t.pagination.bullets.length}function v(){return g()&&t.params.pagination.clickable}const b=(e,t,s)=>{l(e),"BUTTON"!==e.tagName&&(d(e,"button"),e.addEventListener("keydown",h)),p(e,s),function(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-controls",t)}))}(e,t)},y=()=>{t.a11y.clicked=!0},E=()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.destroyed||(t.a11y.clicked=!1)}))}))},x=e=>{if(t.a11y.clicked)return;const s=e.target.closest(`.${t.params.slideClass}, swiper-slide`);if(!s||!t.slides.includes(s))return;const a=t.slides.indexOf(s)===t.activeIndex,i=t.params.watchSlidesProgress&&t.visibleSlides&&t.visibleSlides.includes(s);a||i||e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||(t.isHorizontal()?t.el.scrollLeft=0:t.el.scrollTop=0,t.slideTo(t.slides.indexOf(s),0))},S=()=>{const e=t.params.a11y;e.itemRoleDescriptionMessage&&c(t.slides,e.itemRoleDescriptionMessage),e.slideRole&&d(t.slides,e.slideRole);const s=t.slides.length;e.slideLabelMessage&&t.slides.forEach(((a,i)=>{const r=t.params.loop?parseInt(a.getAttribute("data-swiper-slide-index"),10):i;p(a,e.slideLabelMessage.replace(/\{\{index\}\}/,r+1).replace(/\{\{slidesLength\}\}/,s))}))},T=()=>{const e=t.params.a11y;t.el.append(i);const s=t.el;e.containerRoleDescriptionMessage&&c(s,e.containerRoleDescriptionMessage),e.containerMessage&&p(s,e.containerMessage);const a=t.wrapperEl,r=e.id||a.getAttribute("id")||`swiper-wrapper-${l=16,void 0===l&&(l=16),"x".repeat(l).replace(/x/g,(()=>Math.round(16*Math.random()).toString(16)))}`;var l;const o=t.params.autoplay&&t.params.autoplay.enabled?"off":"polite";var d;d=r,n(a).forEach((e=>{e.setAttribute("id",d)})),function(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-live",t)}))}(a,o),S();let{nextEl:u,prevEl:m}=t.navigation?t.navigation:{};if(u=n(u),m=n(m),u&&u.forEach((t=>b(t,r,e.nextSlideMessage))),m&&m.forEach((t=>b(t,r,e.prevSlideMessage))),v()){(Array.isArray(t.pagination.el)?t.pagination.el:[t.pagination.el]).forEach((e=>{e.addEventListener("keydown",h)}))}t.el.addEventListener("focus",x,!0),t.el.addEventListener("pointerdown",y,!0),t.el.addEventListener("pointerup",E,!0)};a("beforeInit",(()=>{i=f("span",t.params.a11y.notificationClass),i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true")})),a("afterInit",(()=>{t.params.a11y.enabled&&T()})),a("slidesLengthChange snapGridLengthChange slidesGridLengthChange",(()=>{t.params.a11y.enabled&&S()})),a("fromEdge toEdge afterInit lock unlock",(()=>{t.params.a11y.enabled&&function(){if(t.params.loop||t.params.rewind||!t.navigation)return;const{nextEl:e,prevEl:s}=t.navigation;s&&(t.isBeginning?(u(s),o(s)):(m(s),l(s))),e&&(t.isEnd?(u(e),o(e)):(m(e),l(e)))}()})),a("paginationUpdate",(()=>{t.params.a11y.enabled&&function(){const e=t.params.a11y;g()&&t.pagination.bullets.forEach((s=>{t.params.pagination.clickable&&(l(s),t.params.pagination.renderBullet||(d(s,"button"),p(s,e.paginationBulletMessage.replace(/\{\{index\}\}/,w(s)+1)))),s.matches(ee(t.params.pagination.bulletActiveClass))?s.setAttribute("aria-current","true"):s.removeAttribute("aria-current")}))}()})),a("destroy",(()=>{t.params.a11y.enabled&&function(){i&&i.remove();let{nextEl:e,prevEl:s}=t.navigation?t.navigation:{};e=n(e),s=n(s),e&&e.forEach((e=>e.removeEventListener("keydown",h))),s&&s.forEach((e=>e.removeEventListener("keydown",h))),v()&&(Array.isArray(t.pagination.el)?t.pagination.el:[t.pagination.el]).forEach((e=>{e.removeEventListener("keydown",h)}));t.el.removeEventListener("focus",x,!0),t.el.removeEventListener("pointerdown",y,!0),t.el.removeEventListener("pointerup",E,!0)}()}))},function(e){let{swiper:t,extendParams:s,on:a}=e;s({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let i=!1,n={};const l=e=>e.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),o=e=>{const t=r();let s;s=e?new URL(e):t.location;const a=s.pathname.slice(1).split("/").filter((e=>""!==e)),i=a.length;return{key:a[i-2],value:a[i-1]}},d=(e,s)=>{const a=r();if(!i||!t.params.history.enabled)return;let n;n=t.params.url?new URL(t.params.url):a.location;const o=t.slides[s];let d=l(o.getAttribute("data-history"));if(t.params.history.root.length>0){let s=t.params.history.root;"/"===s[s.length-1]&&(s=s.slice(0,s.length-1)),d=`${s}/${e?`${e}/`:""}${d}`}else n.pathname.includes(e)||(d=`${e?`${e}/`:""}${d}`);t.params.history.keepQuery&&(d+=n.search);const c=a.history.state;c&&c.value===d||(t.params.history.replaceState?a.history.replaceState({value:d},null,d):a.history.pushState({value:d},null,d))},c=(e,s,a)=>{if(s)for(let i=0,r=t.slides.length;i<r;i+=1){const r=t.slides[i];if(l(r.getAttribute("data-history"))===s){const s=t.getSlideIndex(r);t.slideTo(s,e,a)}}else t.slideTo(0,e,a)},p=()=>{n=o(t.params.url),c(t.params.speed,n.value,!1)};a("init",(()=>{t.params.history.enabled&&(()=>{const e=r();if(t.params.history){if(!e.history||!e.history.pushState)return t.params.history.enabled=!1,void(t.params.hashNavigation.enabled=!0);i=!0,n=o(t.params.url),n.key||n.value?(c(0,n.value,t.params.runCallbacksOnInit),t.params.history.replaceState||e.addEventListener("popstate",p)):t.params.history.replaceState||e.addEventListener("popstate",p)}})()})),a("destroy",(()=>{t.params.history.enabled&&(()=>{const e=r();t.params.history.replaceState||e.removeEventListener("popstate",p)})()})),a("transitionEnd _freeModeNoMomentumRelease",(()=>{i&&d(t.params.history.key,t.activeIndex)})),a("slideChange",(()=>{i&&t.params.cssMode&&d(t.params.history.key,t.activeIndex)}))},function(e){let{swiper:t,extendParams:s,emit:i,on:n}=e,l=!1;const o=a(),d=r();s({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(e,s){if(t.virtual&&t.params.virtual.enabled){const e=t.slides.filter((e=>e.getAttribute("data-hash")===s))[0];if(!e)return 0;return parseInt(e.getAttribute("data-swiper-slide-index"),10)}return t.getSlideIndex(h(t.slidesEl,`.${t.params.slideClass}[data-hash="${s}"], swiper-slide[data-hash="${s}"]`)[0])}}});const c=()=>{i("hashChange");const e=o.location.hash.replace("#",""),s=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex];if(e!==(s?s.getAttribute("data-hash"):"")){const s=t.params.hashNavigation.getSlideIndex(t,e);if(void 0===s||Number.isNaN(s))return;t.slideTo(s)}},p=()=>{if(!l||!t.params.hashNavigation.enabled)return;const e=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex],s=e?e.getAttribute("data-hash")||e.getAttribute("data-history"):"";t.params.hashNavigation.replaceState&&d.history&&d.history.replaceState?(d.history.replaceState(null,null,`#${s}`||""),i("hashSet")):(o.location.hash=s||"",i("hashSet"))};n("init",(()=>{t.params.hashNavigation.enabled&&(()=>{if(!t.params.hashNavigation.enabled||t.params.history&&t.params.history.enabled)return;l=!0;const e=o.location.hash.replace("#","");if(e){const s=0,a=t.params.hashNavigation.getSlideIndex(t,e);t.slideTo(a||0,s,t.params.runCallbacksOnInit,!0)}t.params.hashNavigation.watchState&&d.addEventListener("hashchange",c)})()})),n("destroy",(()=>{t.params.hashNavigation.enabled&&t.params.hashNavigation.watchState&&d.removeEventListener("hashchange",c)})),n("transitionEnd _freeModeNoMomentumRelease",(()=>{l&&p()})),n("slideChange",(()=>{l&&t.params.cssMode&&p()}))},function(e){let t,s,{swiper:i,extendParams:r,on:n,emit:l,params:o}=e;i.autoplay={running:!1,paused:!1,timeLeft:0},r({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let d,c,p,u,m,h,f,g=o&&o.autoplay?o.autoplay.delay:3e3,v=o&&o.autoplay?o.autoplay.delay:3e3,w=(new Date).getTime;function b(e){i&&!i.destroyed&&i.wrapperEl&&e.target===i.wrapperEl&&(i.wrapperEl.removeEventListener("transitionend",b),M())}const y=()=>{if(i.destroyed||!i.autoplay.running)return;i.autoplay.paused?c=!0:c&&(v=d,c=!1);const e=i.autoplay.paused?d:w+v-(new Date).getTime();i.autoplay.timeLeft=e,l("autoplayTimeLeft",e,e/g),s=requestAnimationFrame((()=>{y()}))},E=e=>{if(i.destroyed||!i.autoplay.running)return;cancelAnimationFrame(s),y();let a=void 0===e?i.params.autoplay.delay:e;g=i.params.autoplay.delay,v=i.params.autoplay.delay;const r=(()=>{let e;if(e=i.virtual&&i.params.virtual.enabled?i.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:i.slides[i.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(r)&&r>0&&void 0===e&&(a=r,g=r,v=r),d=a;const n=i.params.speed,o=()=>{i&&!i.destroyed&&(i.params.autoplay.reverseDirection?!i.isBeginning||i.params.loop||i.params.rewind?(i.slidePrev(n,!0,!0),l("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(i.slides.length-1,n,!0,!0),l("autoplay")):!i.isEnd||i.params.loop||i.params.rewind?(i.slideNext(n,!0,!0),l("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(0,n,!0,!0),l("autoplay")),i.params.cssMode&&(w=(new Date).getTime(),requestAnimationFrame((()=>{E()}))))};return a>0?(clearTimeout(t),t=setTimeout((()=>{o()}),a)):requestAnimationFrame((()=>{o()})),a},x=()=>{i.autoplay.running=!0,E(),l("autoplayStart")},S=()=>{i.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(s),l("autoplayStop")},T=(e,s)=>{if(i.destroyed||!i.autoplay.running)return;clearTimeout(t),e||(f=!0);const a=()=>{l("autoplayPause"),i.params.autoplay.waitForTransition?i.wrapperEl.addEventListener("transitionend",b):M()};if(i.autoplay.paused=!0,s)return h&&(d=i.params.autoplay.delay),h=!1,void a();const r=d||i.params.autoplay.delay;d=r-((new Date).getTime()-w),i.isEnd&&d<0&&!i.params.loop||(d<0&&(d=0),a())},M=()=>{i.isEnd&&d<0&&!i.params.loop||i.destroyed||!i.autoplay.running||(w=(new Date).getTime(),f?(f=!1,E(d)):E(),i.autoplay.paused=!1,l("autoplayResume"))},C=()=>{if(i.destroyed||!i.autoplay.running)return;const e=a();"hidden"===e.visibilityState&&(f=!0,T(!0)),"visible"===e.visibilityState&&M()},P=e=>{"mouse"===e.pointerType&&(f=!0,T(!0))},L=e=>{"mouse"===e.pointerType&&i.autoplay.paused&&M()};n("init",(()=>{i.params.autoplay.enabled&&(i.params.autoplay.pauseOnMouseEnter&&(i.el.addEventListener("pointerenter",P),i.el.addEventListener("pointerleave",L)),a().addEventListener("visibilitychange",C),w=(new Date).getTime(),x())})),n("destroy",(()=>{i.el.removeEventListener("pointerenter",P),i.el.removeEventListener("pointerleave",L),a().removeEventListener("visibilitychange",C),i.autoplay.running&&S()})),n("beforeTransitionStart",((e,t,s)=>{!i.destroyed&&i.autoplay.running&&(s||!i.params.autoplay.disableOnInteraction?T(!0,!0):S())})),n("sliderFirstMove",(()=>{!i.destroyed&&i.autoplay.running&&(i.params.autoplay.disableOnInteraction?S():(p=!0,u=!1,f=!1,m=setTimeout((()=>{f=!0,u=!0,T(!0)}),200)))})),n("touchEnd",(()=>{if(!i.destroyed&&i.autoplay.running&&p){if(clearTimeout(m),clearTimeout(t),i.params.autoplay.disableOnInteraction)return u=!1,void(p=!1);u&&i.params.cssMode&&M(),u=!1,p=!1}})),n("slideChange",(()=>{!i.destroyed&&i.autoplay.running&&(h=!0)})),Object.assign(i.autoplay,{start:x,stop:S,pause:T,resume:M})},function(e){let{swiper:t,extendParams:s,on:i}=e;s({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let r=!1,n=!1;function l(){const e=t.thumbs.swiper;if(!e||e.destroyed)return;const s=e.clickedIndex,a=e.clickedSlide;if(a&&a.classList.contains(t.params.thumbs.slideThumbActiveClass))return;if(null==s)return;let i;i=e.params.loop?parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10):s,t.params.loop?t.slideToLoop(i):t.slideTo(i)}function o(){const{thumbs:e}=t.params;if(r)return!1;r=!0;const s=t.constructor;if(e.swiper instanceof s)t.thumbs.swiper=e.swiper,Object.assign(t.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(t.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper.update();else if(d(e.swiper)){const a=Object.assign({},e.swiper);Object.assign(a,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper=new s(a),n=!0}return t.thumbs.swiper.el.classList.add(t.params.thumbs.thumbsContainerClass),t.thumbs.swiper.on("tap",l),!0}function c(e){const s=t.thumbs.swiper;if(!s||s.destroyed)return;const a="auto"===s.params.slidesPerView?s.slidesPerViewDynamic():s.params.slidesPerView;let i=1;const r=t.params.thumbs.slideThumbActiveClass;if(t.params.slidesPerView>1&&!t.params.centeredSlides&&(i=t.params.slidesPerView),t.params.thumbs.multipleActiveThumbs||(i=1),i=Math.floor(i),s.slides.forEach((e=>e.classList.remove(r))),s.params.loop||s.params.virtual&&s.params.virtual.enabled)for(let e=0;e<i;e+=1)h(s.slidesEl,`[data-swiper-slide-index="${t.realIndex+e}"]`).forEach((e=>{e.classList.add(r)}));else for(let e=0;e<i;e+=1)s.slides[t.realIndex+e]&&s.slides[t.realIndex+e].classList.add(r);const n=t.params.thumbs.autoScrollOffset,l=n&&!s.params.loop;if(t.realIndex!==s.realIndex||l){const i=s.activeIndex;let r,o;if(s.params.loop){const e=s.slides.filter((e=>e.getAttribute("data-swiper-slide-index")===`${t.realIndex}`))[0];r=s.slides.indexOf(e),o=t.activeIndex>t.previousIndex?"next":"prev"}else r=t.realIndex,o=r>t.previousIndex?"next":"prev";l&&(r+="next"===o?n:-1*n),s.visibleSlidesIndexes&&s.visibleSlidesIndexes.indexOf(r)<0&&(s.params.centeredSlides?r=r>i?r-Math.floor(a/2)+1:r+Math.floor(a/2)-1:r>i&&s.params.slidesPerGroup,s.slideTo(r,e?0:void 0))}}t.thumbs={swiper:null},i("beforeInit",(()=>{const{thumbs:e}=t.params;if(e&&e.swiper)if("string"==typeof e.swiper||e.swiper instanceof HTMLElement){const s=a(),i=()=>{const a="string"==typeof e.swiper?s.querySelector(e.swiper):e.swiper;if(a&&a.swiper)e.swiper=a.swiper,o(),c(!0);else if(a){const s=i=>{e.swiper=i.detail[0],a.removeEventListener("init",s),o(),c(!0),e.swiper.update(),t.update()};a.addEventListener("init",s)}return a},r=()=>{if(t.destroyed)return;i()||requestAnimationFrame(r)};requestAnimationFrame(r)}else o(),c(!0)})),i("slideChange update resize observerUpdate",(()=>{c()})),i("setTransition",((e,s)=>{const a=t.thumbs.swiper;a&&!a.destroyed&&a.setTransition(s)})),i("beforeDestroy",(()=>{const e=t.thumbs.swiper;e&&!e.destroyed&&n&&e.destroy()})),Object.assign(t.thumbs,{init:o,update:c})},function(e){let{swiper:t,extendParams:s,emit:a,once:i}=e;s({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}}),Object.assign(t,{freeMode:{onTouchStart:function(){if(t.params.cssMode)return;const e=t.getTranslate();t.setTranslate(e),t.setTransition(0),t.touchEventsData.velocities.length=0,t.freeMode.onTouchEnd({currentPos:t.rtl?t.translate:-t.translate})},onTouchMove:function(){if(t.params.cssMode)return;const{touchEventsData:e,touches:s}=t;0===e.velocities.length&&e.velocities.push({position:s[t.isHorizontal()?"startX":"startY"],time:e.touchStartTime}),e.velocities.push({position:s[t.isHorizontal()?"currentX":"currentY"],time:l()})},onTouchEnd:function(e){let{currentPos:s}=e;if(t.params.cssMode)return;const{params:r,wrapperEl:n,rtlTranslate:o,snapGrid:d,touchEventsData:c}=t,p=l()-c.touchStartTime;if(s<-t.minTranslate())t.slideTo(t.activeIndex);else if(s>-t.maxTranslate())t.slides.length<d.length?t.slideTo(d.length-1):t.slideTo(t.slides.length-1);else{if(r.freeMode.momentum){if(c.velocities.length>1){const e=c.velocities.pop(),s=c.velocities.pop(),a=e.position-s.position,i=e.time-s.time;t.velocity=a/i,t.velocity/=2,Math.abs(t.velocity)<r.freeMode.minimumVelocity&&(t.velocity=0),(i>150||l()-e.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=r.freeMode.momentumVelocityRatio,c.velocities.length=0;let e=1e3*r.freeMode.momentumRatio;const s=t.velocity*e;let p=t.translate+s;o&&(p=-p);let u,m=!1;const h=20*Math.abs(t.velocity)*r.freeMode.momentumBounceRatio;let f;if(p<t.maxTranslate())r.freeMode.momentumBounce?(p+t.maxTranslate()<-h&&(p=t.maxTranslate()-h),u=t.maxTranslate(),m=!0,c.allowMomentumBounce=!0):p=t.maxTranslate(),r.loop&&r.centeredSlides&&(f=!0);else if(p>t.minTranslate())r.freeMode.momentumBounce?(p-t.minTranslate()>h&&(p=t.minTranslate()+h),u=t.minTranslate(),m=!0,c.allowMomentumBounce=!0):p=t.minTranslate(),r.loop&&r.centeredSlides&&(f=!0);else if(r.freeMode.sticky){let e;for(let t=0;t<d.length;t+=1)if(d[t]>-p){e=t;break}p=Math.abs(d[e]-p)<Math.abs(d[e-1]-p)||"next"===t.swipeDirection?d[e]:d[e-1],p=-p}if(f&&i("transitionEnd",(()=>{t.loopFix()})),0!==t.velocity){if(e=o?Math.abs((-p-t.translate)/t.velocity):Math.abs((p-t.translate)/t.velocity),r.freeMode.sticky){const s=Math.abs((o?-p:p)-t.translate),a=t.slidesSizesGrid[t.activeIndex];e=s<a?r.speed:s<2*a?1.5*r.speed:2.5*r.speed}}else if(r.freeMode.sticky)return void t.slideToClosest();r.freeMode.momentumBounce&&m?(t.updateProgress(u),t.setTransition(e),t.setTranslate(p),t.transitionStart(!0,t.swipeDirection),t.animating=!0,y(n,(()=>{t&&!t.destroyed&&c.allowMomentumBounce&&(a("momentumBounce"),t.setTransition(r.speed),setTimeout((()=>{t.setTranslate(u),y(n,(()=>{t&&!t.destroyed&&t.transitionEnd()}))}),0))}))):t.velocity?(a("_freeModeNoMomentumRelease"),t.updateProgress(p),t.setTransition(e),t.setTranslate(p),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,y(n,(()=>{t&&!t.destroyed&&t.transitionEnd()})))):t.updateProgress(p),t.updateActiveIndex(),t.updateSlidesClasses()}else{if(r.freeMode.sticky)return void t.slideToClosest();r.freeMode&&a("_freeModeNoMomentumRelease")}(!r.freeMode.momentum||p>=r.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}}}})},function(e){let t,s,a,{swiper:i,extendParams:r}=e;r({grid:{rows:1,fill:"column"}});const n=()=>{let e=i.params.spaceBetween;return"string"==typeof e&&e.indexOf("%")>=0?e=parseFloat(e.replace("%",""))/100*i.size:"string"==typeof e&&(e=parseFloat(e)),e};i.grid={initSlides:e=>{const{slidesPerView:r}=i.params,{rows:n,fill:l}=i.params.grid;a=Math.floor(e/n),t=Math.floor(e/n)===e/n?e:Math.ceil(e/n)*n,"auto"!==r&&"row"===l&&(t=Math.max(t,r*n)),s=t/n},updateSlide:(e,r,l,o)=>{const{slidesPerGroup:d}=i.params,c=n(),{rows:p,fill:u}=i.params.grid;let m,h,f;if("row"===u&&d>1){const s=Math.floor(e/(d*p)),a=e-p*d*s,i=0===s?d:Math.min(Math.ceil((l-s*p*d)/p),d);f=Math.floor(a/i),h=a-f*i+s*d,m=h+f*t/p,r.style.order=m}else"column"===u?(h=Math.floor(e/p),f=e-h*p,(h>a||h===a&&f===p-1)&&(f+=1,f>=p&&(f=0,h+=1))):(f=Math.floor(e/s),h=e-f*s);r.row=f,r.column=h,r.style[o("margin-top")]=0!==f?c&&`${c}px`:""},updateWrapperSize:(e,s,a)=>{const{centeredSlides:r,roundLengths:l}=i.params,o=n(),{rows:d}=i.params.grid;if(i.virtualSize=(e+o)*t,i.virtualSize=Math.ceil(i.virtualSize/d)-o,i.wrapperEl.style[a("width")]=`${i.virtualSize+o}px`,r){const e=[];for(let t=0;t<s.length;t+=1){let a=s[t];l&&(a=Math.floor(a)),s[t]<i.virtualSize+s[0]&&e.push(a)}s.splice(0,s.length),s.push(...e)}}}},function(e){let{swiper:t}=e;Object.assign(t,{appendSlide:te.bind(t),prependSlide:se.bind(t),addSlide:ae.bind(t),removeSlide:ie.bind(t),removeAllSlides:re.bind(t)})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({fadeEffect:{crossFade:!1}}),ne({effect:"fade",swiper:t,on:a,setTranslate:()=>{const{slides:e}=t;t.params.fadeEffect;for(let s=0;s<e.length;s+=1){const e=t.slides[s];let a=-e.swiperSlideOffset;t.params.virtualTranslate||(a-=t.translate);let i=0;t.isHorizontal()||(i=a,a=0);const r=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(e.progress),0):1+Math.min(Math.max(e.progress,-1),0),n=le(0,e);n.style.opacity=r,n.style.transform=`translate3d(${a}px, ${i}px, 0px)`}},setTransition:e=>{const s=t.slides.map((e=>m(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`})),oe({swiper:t,duration:e,transformElements:s,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const i=(e,t,s)=>{let a=s?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),i=s?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=f("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(s?"left":"top")).split(" ")),e.append(a)),i||(i=f("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(s?"right":"bottom")).split(" ")),e.append(i)),a&&(a.style.opacity=Math.max(-t,0)),i&&(i.style.opacity=Math.max(t,0))};ne({effect:"cube",swiper:t,on:a,setTranslate:()=>{const{el:e,wrapperEl:s,slides:a,width:r,height:n,rtlTranslate:l,size:o,browser:d}=t,c=t.params.cubeEffect,p=t.isHorizontal(),u=t.virtual&&t.params.virtual.enabled;let m,h=0;c.shadow&&(p?(m=t.wrapperEl.querySelector(".swiper-cube-shadow"),m||(m=f("div","swiper-cube-shadow"),t.wrapperEl.append(m)),m.style.height=`${r}px`):(m=e.querySelector(".swiper-cube-shadow"),m||(m=f("div","swiper-cube-shadow"),e.append(m))));for(let e=0;e<a.length;e+=1){const t=a[e];let s=e;u&&(s=parseInt(t.getAttribute("data-swiper-slide-index"),10));let r=90*s,n=Math.floor(r/360);l&&(r=-r,n=Math.floor(-r/360));const d=Math.max(Math.min(t.progress,1),-1);let m=0,f=0,g=0;s%4==0?(m=4*-n*o,g=0):(s-1)%4==0?(m=0,g=4*-n*o):(s-2)%4==0?(m=o+4*n*o,g=o):(s-3)%4==0&&(m=-o,g=3*o+4*o*n),l&&(m=-m),p||(f=m,m=0);const v=`rotateX(${p?0:-r}deg) rotateY(${p?r:0}deg) translate3d(${m}px, ${f}px, ${g}px)`;d<=1&&d>-1&&(h=90*s+90*d,l&&(h=90*-s-90*d)),t.style.transform=v,c.slideShadows&&i(t,d,p)}if(s.style.transformOrigin=`50% 50% -${o/2}px`,s.style["-webkit-transform-origin"]=`50% 50% -${o/2}px`,c.shadow)if(p)m.style.transform=`translate3d(0px, ${r/2+c.shadowOffset}px, ${-r/2}px) rotateX(90deg) rotateZ(0deg) scale(${c.shadowScale})`;else{const e=Math.abs(h)-90*Math.floor(Math.abs(h)/90),t=1.5-(Math.sin(2*e*Math.PI/360)/2+Math.cos(2*e*Math.PI/360)/2),s=c.shadowScale,a=c.shadowScale/t,i=c.shadowOffset;m.style.transform=`scale3d(${s}, 1, ${a}) translate3d(0px, ${n/2+i}px, ${-n/2/a}px) rotateX(-90deg)`}const g=(d.isSafari||d.isWebView)&&d.needPerspectiveFix?-o/2:0;s.style.transform=`translate3d(0px,0,${g}px) rotateX(${t.isHorizontal()?0:h}deg) rotateY(${t.isHorizontal()?-h:0}deg)`,s.style.setProperty("--swiper-cube-translate-z",`${g}px`)},setTransition:e=>{const{el:s,slides:a}=t;if(a.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),t.params.cubeEffect.shadow&&!t.isHorizontal()){const t=s.querySelector(".swiper-cube-shadow");t&&(t.style.transitionDuration=`${e}ms`)}},recreateShadows:()=>{const e=t.isHorizontal();t.slides.forEach((t=>{const s=Math.max(Math.min(t.progress,1),-1);i(t,s,e)}))},getEffectParams:()=>t.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({flipEffect:{slideShadows:!0,limitRotation:!0}});const i=(e,s)=>{let a=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),i=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=de("flip",e,t.isHorizontal()?"left":"top")),i||(i=de("flip",e,t.isHorizontal()?"right":"bottom")),a&&(a.style.opacity=Math.max(-s,0)),i&&(i.style.opacity=Math.max(s,0))};ne({effect:"flip",swiper:t,on:a,setTranslate:()=>{const{slides:e,rtlTranslate:s}=t,a=t.params.flipEffect;for(let r=0;r<e.length;r+=1){const n=e[r];let l=n.progress;t.params.flipEffect.limitRotation&&(l=Math.max(Math.min(n.progress,1),-1));const o=n.swiperSlideOffset;let d=-180*l,c=0,p=t.params.cssMode?-o-t.translate:-o,u=0;t.isHorizontal()?s&&(d=-d):(u=p,p=0,c=-d,d=0),n.style.zIndex=-Math.abs(Math.round(l))+e.length,a.slideShadows&&i(n,l);const m=`translate3d(${p}px, ${u}px, 0px) rotateX(${c}deg) rotateY(${d}deg)`;le(0,n).style.transform=m}},setTransition:e=>{const s=t.slides.map((e=>m(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oe({swiper:t,duration:e,transformElements:s})},recreateShadows:()=>{t.params.flipEffect,t.slides.forEach((e=>{let s=e.progress;t.params.flipEffect.limitRotation&&(s=Math.max(Math.min(e.progress,1),-1)),i(e,s)}))},getEffectParams:()=>t.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),ne({effect:"coverflow",swiper:t,on:a,setTranslate:()=>{const{width:e,height:s,slides:a,slidesSizesGrid:i}=t,r=t.params.coverflowEffect,n=t.isHorizontal(),l=t.translate,o=n?e/2-l:s/2-l,d=n?r.rotate:-r.rotate,c=r.depth;for(let e=0,t=a.length;e<t;e+=1){const t=a[e],s=i[e],l=(o-t.swiperSlideOffset-s/2)/s,p="function"==typeof r.modifier?r.modifier(l):l*r.modifier;let u=n?d*p:0,m=n?0:d*p,h=-c*Math.abs(p),f=r.stretch;"string"==typeof f&&-1!==f.indexOf("%")&&(f=parseFloat(r.stretch)/100*s);let g=n?0:f*p,v=n?f*p:0,w=1-(1-r.scale)*Math.abs(p);Math.abs(v)<.001&&(v=0),Math.abs(g)<.001&&(g=0),Math.abs(h)<.001&&(h=0),Math.abs(u)<.001&&(u=0),Math.abs(m)<.001&&(m=0),Math.abs(w)<.001&&(w=0);const b=`translate3d(${v}px,${g}px,${h}px)  rotateX(${m}deg) rotateY(${u}deg) scale(${w})`;if(le(0,t).style.transform=b,t.style.zIndex=1-Math.abs(Math.round(p)),r.slideShadows){let e=n?t.querySelector(".swiper-slide-shadow-left"):t.querySelector(".swiper-slide-shadow-top"),s=n?t.querySelector(".swiper-slide-shadow-right"):t.querySelector(".swiper-slide-shadow-bottom");e||(e=de("coverflow",t,n?"left":"top")),s||(s=de("coverflow",t,n?"right":"bottom")),e&&(e.style.opacity=p>0?p:0),s&&(s.style.opacity=-p>0?-p:0)}}},setTransition:e=>{t.slides.map((e=>
5929m(e))).forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))}))},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const i=e=>"string"==typeof e?e:`${e}px`;ne({effect:"creative",swiper:t,on:a,setTranslate:()=>{const{slides:e,wrapperEl:s,slidesSizesGrid:a}=t,r=t.params.creativeEffect,{progressMultiplier:n}=r,l=t.params.centeredSlides;if(l){const e=a[0]/2-t.params.slidesOffsetBefore||0;s.style.transform=`translateX(calc(50% - ${e}px))`}for(let s=0;s<e.length;s+=1){const a=e[s],o=a.progress,d=Math.min(Math.max(a.progress,-r.limitProgress),r.limitProgress);let c=d;l||(c=Math.min(Math.max(a.originalProgress,-r.limitProgress),r.limitProgress));const p=a.swiperSlideOffset,u=[t.params.cssMode?-p-t.translate:-p,0,0],m=[0,0,0];let h=!1;t.isHorizontal()||(u[1]=u[0],u[0]=0);let f={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};d<0?(f=r.next,h=!0):d>0&&(f=r.prev,h=!0),u.forEach(((e,t)=>{u[t]=`calc(${e}px + (${i(f.translate[t])} * ${Math.abs(d*n)}))`})),m.forEach(((e,t)=>{m[t]=f.rotate[t]*Math.abs(d*n)})),a.style.zIndex=-Math.abs(Math.round(o))+e.length;const g=u.join(", "),v=`rotateX(${m[0]}deg) rotateY(${m[1]}deg) rotateZ(${m[2]}deg)`,w=c<0?`scale(${1+(1-f.scale)*c*n})`:`scale(${1-(1-f.scale)*c*n})`,b=c<0?1+(1-f.opacity)*c*n:1-(1-f.opacity)*c*n,y=`translate3d(${g}) ${v} ${w}`;if(h&&f.shadow||!h){let e=a.querySelector(".swiper-slide-shadow");if(!e&&f.shadow&&(e=de("creative",a)),e){const t=r.shadowPerProgress?d*(1/r.limitProgress):d;e.style.opacity=Math.min(Math.max(Math.abs(t),0),1)}}const E=le(0,a);E.style.transform=y,E.style.opacity=b,f.origin&&(E.style.transformOrigin=f.origin)}},setTransition:e=>{const s=t.slides.map((e=>m(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oe({swiper:t,duration:e,transformElements:s,allSlides:!0})},perspective:()=>t.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}}),ne({effect:"cards",swiper:t,on:a,setTranslate:()=>{const{slides:e,activeIndex:s,rtlTranslate:a}=t,i=t.params.cardsEffect,{startTranslate:r,isTouched:n}=t.touchEventsData,l=a?-t.translate:t.translate;for(let o=0;o<e.length;o+=1){const d=e[o],c=d.progress,p=Math.min(Math.max(c,-4),4);let u=d.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(u-=e[0].swiperSlideOffset);let m=t.params.cssMode?-u-t.translate:-u,h=0;const f=-100*Math.abs(p);let g=1,v=-i.perSlideRotate*p,w=i.perSlideOffset-.75*Math.abs(p);const b=t.virtual&&t.params.virtual.enabled?t.virtual.from+o:o,y=(b===s||b===s-1)&&p>0&&p<1&&(n||t.params.cssMode)&&l<r,E=(b===s||b===s+1)&&p<0&&p>-1&&(n||t.params.cssMode)&&l>r;if(y||E){const e=(1-Math.abs((Math.abs(p)-.5)/.5))**.5;v+=-28*p*e,g+=-.5*e,w+=96*e,h=-25*e*Math.abs(p)+"%"}if(m=p<0?`calc(${m}px ${a?"-":"+"} (${w*Math.abs(p)}%))`:p>0?`calc(${m}px ${a?"-":"+"} (-${w*Math.abs(p)}%))`:`${m}px`,!t.isHorizontal()){const e=h;h=m,m=e}const x=p<0?""+(1+(1-g)*p):""+(1-(1-g)*p),S=`\n        translate3d(${m}, ${h}, ${f}px)\n        rotateZ(${i.rotate?a?-v:v:0}deg)\n        scale(${x})\n      `;if(i.slideShadows){let e=d.querySelector(".swiper-slide-shadow");e||(e=de("cards",d)),e&&(e.style.opacity=Math.min(Math.max((Math.abs(p)-.5)/.5,0),1))}d.style.zIndex=-Math.abs(Math.round(c))+e.length;le(0,d).style.transform=S}},setTransition:e=>{const s=t.slides.map((e=>m(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oe({swiper:t,duration:e,transformElements:s})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}];return Q.use(ce),Q}();
5930 //# sourceMappingURL=swiper-bundle.js.map 
5931// ==================================================
5932// fancyBox v3.5.2
5933//
5934// Licensed GPLv3 for open source use
5935// or fancyBox Commercial License for commercial use
5936//
5937// http://fancyapps.com/fancybox/
5938// Copyright 2018 fancyApps
5939//
5940// ==================================================
5941!function(t,e,n,o){"use strict";function a(t,e){var o,a,i,s=[],r=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},t&&t.data&&(e=h(t.data.options,e)),o=e.$target||n(t.currentTarget).trigger("blur"),i=n.fancybox.getInstance(),i&&i.$trigger&&i.$trigger.is(o)||(e.selector?s=n(e.selector):(a=o.attr("data-fancybox")||"",a?(s=t.data?t.data.items:[],s=s.length?s.filter('[data-fancybox="'+a+'"]'):n('[data-fancybox="'+a+'"]')):s=[o]),r=n(s).index(o),r<0&&(r=0),i=n.fancybox.open(s,e,r),i.$trigger=o))}if(t.console=t.console||{info:function(t){}}
vendor: 4,684 bytes, line 5941
5941,n){if(n.fn.fancybox)return void console.info("fancyBox already initialized");var i={closeExisting:!1,loop:!1,gutter:50,keyboard:!0,preventCaptionOverlap:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","slideShow","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen allow="autoplay; fullscreen" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},video:{tpl:'<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}"><source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!</video>',format:"",autoStart:!0},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div></button>',smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg></button>'},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{preventCaptionOverlap:!1,idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/>
5941 Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Maßstab"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),f=function(){var t,n=e.createElement("fakeelement"),a={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in a)if(n.style[t]!==o)return a[t];return"transitionend"}(),p=function(t){return t&&t.length&&t[0].offsetHeight},h=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},g=function(t){var o,a;return!(!t||t.ownerDocument!==e)&&(n(".fancybox-container").css("pointer-events","none"),o={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2},a=e.elementFromPoint(o.x,o.y)===t,n(".fancybox-container").css("pointer-events",""),a)},b=function(t,e,o){var a=this;a.opts=h({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(a.opts=h(a.opts,e)),n.fancybox.isMobile&&(a.opts=h(a.opts,a.opts.mobile)),a.id=a.opts.id||++c,a.currIndex=parseInt(a.opts.index,10)||0,a.prevIndex=null,a.prevPos=null,a.currPos=0,a.firstRun=!0,a.group=[],a.slides={},a.addContent(t),a.group.length&&a.init()};n.extend(b.prototype,{init:function(){var o,a,i=this,s=i.group[i.currIndex],r=s.opts;r.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&r.hideScrollbar!==!1&&!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:'+(t.innerWidth-e.documentElement.clientWidth)+"px;}</style>"),n("body").addClass("compensate-for-scrollbar")),a="",n.each(r.buttons,function(t,e){a+=r.btnTpl[e]||""}),o=n(i.translate(i,r.baseTpl.replace("{{buttons}}",a).replace("{{arrows}}",r.btnTpl.arrowLeft+r.btnTpl.arrowRight))).attr("id","fancybox-container-"+i.id).addClass(r.baseClass).data("FancyBox",i).appendTo(r.parentEl),i.$refs={container:o},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){i.$refs[t]=o.find(".fancybox-"+t)}),i.trigger("onInit"),i.activate(),i.jumpTo(i.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang]||t.opts.i18n.en;return e.replace(/\{\{(\w+)\}\}/g,function(t,e){var a=n[e];return a===o?t:a})},addContent:function(t){var e,a=this,i=n.makeArray(t);n.each(i,function(t,e){var i,s,r,c,l,d={},u={};n.isPlainObject(e)?(d=e,u=e.opts||e):"object"===n.type(e)&&n(e).length?(i=n(e),u=i.data()||{},u=n.extend(!0,{},u,u.options),u.$orig=i,d.src=a.opts.src||u.src||i.attr("href"),d.type||d.src||(d.type="inline",d.src=e)):d={type:"html",src:e+""},d.opts=n.extend(!0,{},a.opts,u),n.isArray(u.buttons)&&(d.opts.buttons=u.buttons),n.fancybox.isMobile&&d.opts.mobile&&(d.opts=h(d.opts,d.opts.mobile)),s=d.type||d.opts.type,c=d.src||"",!s&&c&&((r=c.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(s="video",d.opts.video.format||(d.opts.video.format="video/"+("ogv"===r[1]?"ogg":r[1]))):c.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?s="image":c.match(/\.(pdf)((\?|#).*)?$/i)?(s="iframe",d=n.extend(!0,d,{contentType:"pdf",opts:{iframe:{preload:!1}}})):"#"===c.charAt(0)&&(s="inline")),s?d.type=s:a.trigger("objectNeedsType",d),d.contentType||(d.contentType=n.inArray(d.type,["html","inline","ajax"])>-1?"html":d.type),d.index=a.group.length,"auto"==d.opts.smallBtn&&(d.opts.smallBtn=n.inArray(d.type,["html","inline","ajax"])>-1),"auto"===d.opts.toolbar&&(d.opts.toolbar=!d.opts.smallBtn),d.$thumb=d.opts.$thumb||null,d.opts.$trigger&&d.index===a.opts.index&&(d.$thumb=d.opts.$trigger.find("img:first"),d.$thumb.length&&(d.opts.$orig=d.opts.$trigger)),d.$thumb&&d.$thumb.length||!d.opts.$orig||(d.$thumb=d.opts.$orig.find("img:first")),d.$thumb&&!d.$thumb.length&&(d.$thumb=null),d.thumb=d.opts.thumb||(d.$thumb?d.$thumb[0].src:null),"function"===n.type(d.opts.caption)&&(d.opts.caption=d.opts.caption.apply(e,[a,d])),"function"===n.type(a.opts.caption)&&(d.opts.caption=a.opts.caption.apply(e,[a,d])),d.opts.caption instanceof n||(d.opts.caption=d.opts.caption===o?"":d.opts.caption+""),"ajax"===d.type&&(l=c.split(/\s+/,2),l.length>1&&(d.src=l.shift(),d.opts.filter=l.shift())),d.opts.modal&&(d.opts=n.extend(!0,d.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),a.group.push(d)}),Object.keys(a.slides).length&&(a.updateControls(),e=a.Thumbs,e&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var e=this;e.removeEvents(),e.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),e.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),e.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),e.next()}).on("click.fb","[data-fancybox-zoom]",function(t){e[e.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(e.requestId&&u(e.requestId),e.requestId=d(function(){e.update(t)})):(e.current&&"iframe"===e.current.type&&e.$refs.stage.hide(),setTimeout(function(){e.$refs.stage.show(),e.update(t)},n.fancybox.isMobile?600:250))}
vendor: 19,475 bytes, line 5941
5941),r.on("keydown.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null,a=o.current,i=t.keyCode||t.which;if(9==i)return void(a.opts.trapFocus&&e.focus(t));if(!(!a.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input")||n(t.target).is("textarea")))return 8===i||27===i?(t.preventDefault(),void e.close(t)):37===i||38===i?(t.preventDefault(),void e.previous()):39===i||40===i?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,i)}),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){e.idleSecondsCounter=0,e.isIdle&&e.showControls(),e.isIdle=!1}),e.idleInterval=t.setInterval(function(){e.idleSecondsCounter++,e.idleSecondsCounter>=e.group[e.currIndex].opts.idleTime&&!e.isDragging&&(e.isIdle=!0,e.idleSecondsCounter=0,e.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var a,i,s,r,c,l,d,u,f,h=this,g=h.group.length;if(!(h.isDragging||h.isClosing||h.isAnimating&&h.firstRun)){if(t=parseInt(t,10),s=h.current?h.current.opts.loop:h.opts.loop,!s&&(t<0||t>=g))return!1;if(a=h.firstRun=!Object.keys(h.slides).length,c=h.current,h.prevIndex=h.currIndex,h.prevPos=h.currPos,r=h.createSlide(t),g>1&&((s||r.index<g-1)&&h.createSlide(t+1),(s||r.index>0)&&h.createSlide(t-1)),h.current=r,h.currIndex=r.index,h.currPos=r.pos,h.trigger("beforeShow",a),h.updateControls(),r.forcedDuration=o,n.isNumeric(e)?r.forcedDuration=e:e=r.opts[a?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=h.isMoved(r),r.$slide.addClass("fancybox-slide--current"),a)return r.opts.animationEffect&&e&&h.$refs.container.css("transition-duration",e+"ms"),h.$refs.container.addClass("fancybox-is-open").trigger("focus"),h.loadSlide(r),void h.preload("image");l=n.fancybox.getTranslate(c.$slide),d=n.fancybox.getTranslate(h.$refs.stage),n.each(h.slides,function(t,e){n.fancybox.stop(e.$slide,!0)}),c.pos!==r.pos&&(c.isComplete=!1),c.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"),i?(f=l.left-(c.pos*l.width+c.pos*c.opts.gutter),n.each(h.slides,function(t,o){o.$slide.removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});var a=o.pos*l.width+o.pos*o.opts.gutter;n.fancybox.setTranslate(o.$slide,{top:0,left:a-d.left+f}),o.pos!==r.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>r.pos?"next":"previous")),p(o.$slide),n.fancybox.animate(o.$slide,{top:0,left:(o.pos-r.pos)*l.width+(o.pos-r.pos)*o.opts.gutter},e,function(){o.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===h.currPos&&h.complete()})})):e&&r.opts.transitionEffect&&(u="fancybox-animated fancybox-fx-"+r.opts.transitionEffect,c.$slide.addClass("fancybox-slide--"+(c.pos>r.pos?"next":"previous")),n.fancybox.animate(c.$slide,u,e,function(){c.$slide.removeClass(u).removeClass("fancybox-slide--next fancybox-slide--previous")},!1)),r.isLoaded?h.revealContent(r):h.loadSlide(r),h.preload("image")}},createSlide:function(t){var e,o,a=this;return o=t%a.group.length,o=o<0?a.group.length+o:o,!a.slides[t]&&a.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(a.$refs.stage),a.slides[t]=n.extend(!0,{},a.group[o],{pos:t,$slide:e,isLoaded:!1}),a.updateSlide(a.slides[t])),a.slides[t]},scaleToActual:function(t,e,a){var i,s,r,c,l,d=this,u=d.current,f=u.$content,p=n.fancybox.getTranslate(u.$slide).width,h=n.fancybox.getTranslate(u.$slide).height,g=u.width,b=u.height;d.isAnimating||d.isMoved()||!f||"image"!=u.type||!u.isLoaded||u.hasError||(d.isAnimating=!0,n.fancybox.stop(f),t=t===o?.5*p:t,e=e===o?.5*h:e,i=n.fancybox.getTranslate(f),i.top-=n.fancybox.getTranslate(u.$slide).top,i.left-=n.fancybox.getTranslate(u.$slide).left,c=g/i.width,l=b/i.height,s=.5*p-.5*g,r=.5*h-.5*b,g>p&&(s=i.left*c-(t*c-t),s>0&&(s=0),s<p-g&&(s=p-g)),b>h&&(r=i.top*l-(e*l-e),r>0&&(r=0),r<h-b&&(r=h-b)),d.updateCursor(g,b),n.fancybox.animate(f,{top:r,left:s,scaleX:c,scaleY:l},a||330,function(){d.isAnimating=!1}),d.SlideShow&&d.SlideShow.isActive&&d.SlideShow.stop())},scaleToFit:function(t){var e,o=this,a=o.current,i=a.$content;o.isAnimating||o.isMoved()||!i||"image"!=a.type||!a.isLoaded||a.hasError||(o.isAnimating=!0,n.fancybox.stop(i),e=o.getFitPos(a),o.updateCursor(e.width,e.height),n.fancybox.animate(i,{top:e.top,left:e.left,scaleX:e.width/i.width(),scaleY:e.height/i.height()},t||330,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,a,i,s=this,r=t.$content,c=t.$slide,l=t.width||t.opts.width,d=t.height||t.opts.height,u={};return!!(t.isLoaded&&r&&r.length)&&(e=n.fancybox.getTranslate(s.$refs.stage).width,o=n.fancybox.getTranslate(s.$refs.stage).height,e-=parseFloat(c.css("paddingLeft"))+parseFloat(c.css("paddingRight"))+parseFloat(r.css("marginLeft"))+parseFloat(r.css("marginRight")),o-=parseFloat(c.css("paddingTop"))+parseFloat(c.css("paddingBottom"))+parseFloat(r.css("marginTop"))+parseFloat(r.css("marginBottom")),l&&d||(l=e,d=o),a=Math.min(1,e/l,o/d),l=a*l,d=a*d,l>e-.5&&(l=e),d>o-.5&&(d=o),"image"===t.type?(u.top=Math.floor(.5*(o-d))+parseFloat(c.css("paddingTop")),u.left=Math.floor(.5*(e-l))+parseFloat(c.css("paddingLeft"))):"video"===t.contentType&&(i=t.opts.width&&t.opts.height?l/d:t.opts.ratio||16/9,d>l/i?d=l/i:l>d*i&&(l=d*i)),u.width=l,u.height=d,u)},update:function(t){var e=this;n.each(e.slides,function(n,o){e.updateSlide(o,t)})},updateSlide:function(t,e){var o=this,a=t&&t.$content,i=t.width||t.opts.width,s=t.height||t.opts.height,r=t.$slide;o.adjustCaption(t),a&&(i||s||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(a),n.fancybox.setTranslate(a,o.getFitPos(t)),t.pos===o.currPos&&(o.isAnimating=!1,o.updateCursor())),o.adjustLayout(t),r.length&&(r.trigger("refresh"),t.pos===o.currPos&&o.$refs.toolbar.add(o.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",r.get(0).scrollHeight>r.get(0).clientHeight)),o.trigger("onUpdate",t,e)},centerSlide:function(t){var e=this,a=e.current,i=a.$slide;!e.isClosing&&a&&(i.siblings().css({transform:"",opacity:""}),i.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next"),n.fancybox.animate(i,{top:0,left:0,opacity:1},t===o?0:t,function(){i.css({transform:"",opacity:""}),a.isComplete||e.complete()},!1))},isMoved:function(t){var e,o,a=t||this.current;return!!a&&(o=n.fancybox.getTranslate(this.$refs.stage),e=n.fancybox.getTranslate(a.$slide),!a.$slide.hasClass("fancybox-animated")&&(Math.abs(e.top-o.top)>.5||Math.abs(e.left-o.left)>.5))},updateCursor:function(t,e){var o,a,i=this,s=i.current,r=i.$refs.container;s&&!i.isClosing&&i.Guestures&&(r.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),o=i.canPan(t,e),a=!!o||i.isZoomable(),r.toggleClass("fancybox-is-zoomable",a),n("[data-fancybox-zoom]").prop("disabled",!a),o?r.addClass("fancybox-can-pan"):a&&("zoom"===s.opts.clickContent||n.isFunction(s.opts.clickContent)&&"zoom"==s.opts.clickContent(s))?r.addClass("fancybox-can-zoomIn"):s.opts.touch&&(s.opts.touch.vertical||i.group.length>1)&&"video"!==s.contentType&&r.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if(t=e.getFitPos(n),t&&(n.width>t.width||n.height>t.height))return!0}return!1},isScaledDown:function(t,e){var a=this,i=!1,s=a.current,r=s.$content;return t!==o&&e!==o?i=t<s.width&&e<s.height:r&&(i=n.fancybox.getTranslate(r),i=i.width<s.width&&i.height<s.height),i},canPan:function(t,e){var a=this,i=a.current,s=null,r=!1;return"image"===i.type&&(i.isComplete||t&&e)&&!i.hasError&&(r=a.getFitPos(i),t!==o&&e!==o?s={width:t,height:e}:i.isComplete&&(s=n.fancybox.getTranslate(i.$content)),s&&r&&(r=Math.abs(s.width-r.width)>1.5||Math.abs(s.height-r.height)>1.5)),r},loadSlide:function(t){var e,o,a,i=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,i.trigger("beforeLoad",t)===!1)return t.isLoading=!1,!1;switch(e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":i.setImage(t);break;case"iframe":i.setIframe(t);break;case"html":i.setContent(t,t.src||t.content);break;case"video":i.setContent(t,t.opts.video.tpl.replace(/\{\{src\}\}/gi,t.src).replace("{{format}}",t.opts.videoFormat||t.opts.video.format||"").replace("{{poster}}",t.thumb||""));break;case"inline":n(t.src).length?i.setContent(t,n(t.src)):i.setError(t);break;case"ajax":i.showLoading(t),a=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&i.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&i.setError(t)}})),o.one("onReset",function(){a.abort()});break;default:i.setError(t)}return!0}},setImage:function(t){var o,a=this;setTimeout(function(){var e=t.$image;a.isClosing||!t.isLoading||e&&e.length&&e[0].complete||t.hasError||a.showLoading(t)},50),a.checkSrcset(t),t.$content=n('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(t.$slide.addClass("fancybox-slide--image")),t.opts.preload!==!1&&t.opts.width&&t.opts.height&&t.thumb&&(t.width=t.opts.width,t.height=t.opts.height,o=e.createElement("img"),o.onerror=function(){n(this).remove(),t.$ghost=null},o.onload=function(){a.afterLoad(t)},t.$ghost=n(o).addClass("fancybox-image").appendTo(t.$content).attr("src",t.thumb)),a.setBigImage(t)},checkSrcset:function(e){var n,o,a,i,s=e.opts.srcset||e.opts.image.srcset;if(s){a=t.devicePixelRatio||1,i=t.innerWidth*a,o=s.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);return 0===n?e.url=t:void(o&&(e.value=o,e.postfix=t[t.length-1]))}),e}),o.sort(function(t,e){return t.value-e.value});for(var r=0;r<o.length;r++){var c=o[r];if("w"===c.postfix&&c.value>=i||"x"===c.postfix&&c.value>=a){n=c;break}}!n&&o.length&&(n=o[o.length-1]),n&&(e.src=n.url,e.width&&e.height&&"w"==n.postfix&&(e.height=e.width/e.height*n.value,e.width=n.value),e.opts.srcset=s)}},setBigImage:function(t){var o=this,a=e.createElement("img"),i=n(a);t.$image=i.one("error",function(){o.setError(t)}).one("load",function(){var e;t.$ghost||(o.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),o.afterLoad(t)),o.isClosing||(t.opts.srcset&&(e=t.opts.sizes,e&&"auto"!==e||(e=(t.width/t.height>1&&s.width()/s.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),i.attr("sizes",e).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout(function(){t.$ghost&&!o.isClosing&&t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))),o.hideLoading(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(a.complete||"complete"==a.readyState)&&i.naturalWidth&&i.naturalHeight?i.trigger("load"):a.error&&i.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),a=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),a>0&&(t.width=Math.floor(a*e/n),t.height=a)},setIframe:function(t){var e,a=this,i=t.opts.iframe,s=t.$slide;n.fancybox.isMobile&&(i.css.overflow="scroll"),t.$content=n('<div class="fancybox-content'+(i.preload?" fancybox-is-hidden":"")+'"></div>').css(i.css).appendTo(s),s.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(i.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(i.attr).appendTo(t.$content),i.preload?(a.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),a.afterLoad(t)}),s.on("refresh.fb",function(){var n,a,r=t.$content,c=i.css.width,l=i.css.height;if(1===e[0].isReady){try{n=e.contents(),a=n.find("body")}catch(t){}a&&a.length&&a.children().length&&(s.css("overflow","visible"),r.css({width:"100%","max-width":"100%",height:"9999px"}),c===o&&(c=Math.ceil(Math.max(a[0].clientWidth,a.outerWidth(!0)))),r.css("width",c?c:"").css("max-width",""),l===o&&(l=Math.ceil(Math.max(a[0].clientHeight,a.outerHeight(!0)))),r.css("height",l?l:""),s.css("overflow","auto")),r.removeClass("fancybox-is-hidden")}})):a.afterLoad(t),e.attr("src",t.src),s.one("onReset",function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1,t.isRevealed=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&e.parent().length?((e.hasClass("fancybox-content")||e.parent().hasClass("fancybox-content"))&&e.parents(".fancybox-slide").trigger("onReset"),t.$placeholder=n("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents()),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("<div></div>").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),o.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;t=t||e.current,t&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){var e=this;t=t||e.current,t&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e=this,n=t||e.current,o=n.opts.caption,a=e.$refs.caption,i=!1;n.opts.preventCaptionOverlap&&o&&o.length&&(n.pos!==e.currPos?(a=a.clone().empty().appendTo(a.parent()),a.html(o),i=a.outerHeight(!0),a.empty().remove()):e.$caption&&(i=e.$caption.outerHeight(!0)),n.$slide.css("padding-bottom",i||""))},adjustLayout:function(t){var e,n,o,a,i=this,s=t||i.current;s.isLoaded&&s.opts.disableLayoutFix!==!0&&(s.$content.css("margin-bottom",""),s.$content.outerHeight()>s.$slide.height()+.5&&(o=s.$slide[0].style["padding-bottom"],a=s.$slide.css("padding-bottom"),parseFloat(a)>0&&(e=s.$slide[0].scrollHeight,s.$slide.css("padding-bottom",0),Math.abs(e-s.$slide[0].scrollHeight)<1&&(n=a),s.$slide.css("padding-bottom",o))),s.$content.css("margin-bottom",n))},revealContent:function(t){var e,a,i,s,r=this,c=t.$slide,l=!1,d=!1,u=r.isMoved(t),f=t.isRevealed;return t.isRevealed=!0,e=t.opts[r.firstRun?"animationEffect":"transitionEffect"],i=t.opts[r.firstRun?"animationDuration":"transitionDuration"],i=parseInt(t.forcedDuration===o?i:t.forcedDuration,10),!u&&t.pos===r.currPos&&i||(e=!1),"zoom"===e&&(t.pos===r.currPos&&i&&"image"===t.type&&!t.hasError&&(d=r.getThumbPos(t))?l=r.getFitPos(t):e="fade"),"zoom"===e?(r.isAnimating=!0,l.scaleX=l.width/d.width,l.scaleY=l.height/d.height,s=t.opts.zoomOpacity,"auto"==s&&(s=Math.abs(t.width/t.height-d.width/d.height)>.1),s&&(d.opacity=.1,l.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),d),p(t.$content),void n.fancybox.animate(t.$content,l,i,function(){r.isAnimating=!1,r.complete()})):(r.updateSlide(t),e?(n.fancybox.stop(c),a="fancybox-slide--"+(t.pos>=r.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,c.addClass(a).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),p(c),"image"!==t.type&&t.$content.hide().show(0),void n.fancybox.animate(c,"fancybox-slide--current",i,function(){c.removeClass(a).css({transform:"",opacity:""}),t.pos===r.currPos&&r.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),f||!u||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===r.currPos&&r.complete())))},getThumbPos:function(t){var e,o,a,i,s,r=!1,c=t.$thumb;return!(!c||!g(c[0]))&&(e=n.fancybox.getTranslate(c),o=parseFloat(c.css("border-top-width")||0),a=parseFloat(c.css("border-right-width")||0),i=parseFloat(c.css("border-bottom-width")||0),s=parseFloat(c.css("border-left-width")||0),r={top:e.top+o,left:e.left+s,width:e.width-a-s,height:e.height-o-i,scaleX:1,scaleY:1},e.width>0&&e.height>0&&r)},complete:function(){var t,e=this,o=e.current,a={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),p(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?a[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),e.slides=a),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()}),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],e=o.slides[o.currPos-1],e&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,o){var a,i,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(a=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),a=a.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),a.length?(i=a.index(e.activeElement),t&&t.shiftKey?(i<0||0==i)&&(t.preventDefault(),a.eq(a.length-1).trigger("focus")):(i<0||i==a.length-1)&&(t&&t.preventDefault(),a.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");
5941e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,a,i,s,r,c,l,u=this,f=u.current,h=function(){u.cleanUp(t)};return!u.isClosing&&(u.isClosing=!0,u.trigger("beforeClose",t)===!1?(u.isClosing=!1,d(function(){u.update()}),!1):(u.removeEvents(),i=f.$content,o=f.opts.animationEffect,a=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),t!==!0?n.fancybox.stop(f.$slide):o=!1,f.$slide.siblings().trigger("onReset").remove(),a&&u.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",a+"ms"),u.hideLoading(f),u.hideControls(!0),u.updateCursor(),"zoom"!==o||i&&a&&"image"===f.type&&!u.isMoved()&&!f.hasError&&(l=u.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(i),s=n.fancybox.getTranslate(i),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=f.opts.zoomOpacity,"auto"==r&&(r=Math.abs(f.width/f.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(i,c),p(i),n.fancybox.animate(i,l,a,h),!0):(o&&a?n.fancybox.animate(f.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,a,h):t===!0?setTimeout(h,a):h(),
5942!0)))},cleanUp:function(e){var o,a,i,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(a=t.scrollX,i=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(i).scrollLeft(a))),s.current=null,o=n.fancybox.getInstance(),o?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,a=Array.prototype.slice.call(arguments,1),i=this,s=e&&e.opts?e:i.current;return s?a.unshift(s):s=i,a.unshift(i),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,a)),o===!1?o:void("afterClose"!==t&&i.$refs?i.$refs.container.trigger(t+".fb",a):r.trigger(t+".fb",a))},updateControls:function(){var t=this,o=t.current,a=o.index,i=t.$refs.container,s=t.$refs.caption,r=o.opts.caption;o.$slide.trigger("refresh"),t.$caption=r&&r.length?s.html(r):null,t.hasHiddenControls||t.isIdle||t.showControls(),i.find("[data-fancybox-count]").html(t.group.length),i.find("[data-fancybox-index]").html(a+1),i.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&a<=0),i.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&a>=t.group.length-1),"image"===o.type?i.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&i.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=this,n=["infobar","toolbar","nav"];!t&&e.current.opts.preventCaptionOverlap||n.push("caption"),this.$refs.container.removeClass(n.map(function(t){return"fancybox-show-"+t}).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.5.2",defaults:i,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof b&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new b(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),t===!0&&this.close(t))}
5942,destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",a={};if(t&&e)return e.left===o&&e.top===o||(n=(e.left===o?t.position().left:e.left)+"px, "+(e.top===o?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),e.scaleX!==o&&e.scaleY!==o?n+=" scale("+e.scaleX+", "+e.scaleY+")":e.scaleX!==o&&(n+=" scaleX("+e.scaleX+")"),n.length&&(a.transform=n),e.opacity!==o&&(a.opacity=e.opacity),e.width!==o&&(a.width=e.width),e.height!==o&&(a.height=e.height),t.css(a)},animate:function(t,e,a,i,s){var r,c=this;n.isFunction(a)&&(i=a,a=null),c.stop(t),r=c.getTranslate(t),t.on(f,function(l){(!l||!l.originalEvent||t.is(l.originalEvent.target)&&"z-index"!=l.originalEvent.propertyName)&&(c.stop(t),n.isNumeric(a)&&t.css("transition-duration",""),n.isPlainObject(e)?e.scaleX!==o&&e.scaleY!==o&&c.setTranslate(t,{top:e.top,left:e.left,width:r.width*e.scaleX,height:r.height*e.scaleY,scaleX:1,scaleY:1}):s!==!0&&t.removeClass(e),n.isFunction(i)&&i(l))}),n.isNumeric(a)&&t.css("transition-duration",a+"ms"),n.isPlainObject(e)?(e.scaleX!==o&&e.scaleY!==o&&(delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger(f)},a+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(f),t.off(f).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},a):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},a),this},r.on("click.fb-start","[data-fancybox]",a),r.on("click.fb-start","[data-fancybox-trigger]",function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})}),function(){var t=".fancybox-button",e="fancybox-focus",o=null;r.on("mousedown mouseup focus blur",t,function(a){switch(a.type){case"mousedown":o=n(this);break;case"mouseup":o=null;break;case"focusin":n(t).removeClass(e),n(this).is(o)||n(this).is("[disabled]")||n(this).addClass(e);break;case"focusout":n(t).removeClass(e)}})}()}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"//www.youtube-nocookie.com/embed/$4",thumb:"//img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",function(o,a,i){var s,r,c,l,d,u,f,p=i.src||"",h=!1;s=t.extend(!0,{},e,i.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var a=0;a<d.length;++a){var s=d[a].split("=",2);2==s.length&&(u[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,i.opts[e],u),p="function"===t.type(o.url)?o.url.call(this,c,l,i):n(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,i):n(o.thumb,c),"youtube"===e?p=p.replace(/&t=((\d+)m)?(\d+)s/,function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))}):"vimeo"===e&&(p=p.replace("&%23","#")),!1}}),h?(i.opts.thumb||i.opts.$thumb&&i.opts.$thumb.length||(i.opts.thumb=r),"iframe"===h&&(i.opts=t.extend(!0,i.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}}
vendor: 6,830 bytes, line 5942
5942)),t.extend(i,{type:h,src:p,origSrc:i.src,contentSource:f,contentType:"image"===h?"image":"gmap_place"==f||"gmap_search"==f?"map":"video"})):p&&(i.type=i.opts.defaultType)});var o={youtube:{src:"https://www.youtube.com/iframe_api",class:"YT",loading:!1,loaded:!1},vimeo:{src:"https://player.vimeo.com/api/player.js",class:"Vimeo",loading:!1,loaded:!1},load:function(t){var e,n=this;return this[t].loaded?void setTimeout(function(){n.done(t)}):void(this[t].loading||(this[t].loading=!0,e=document.createElement("script"),e.type="text/javascript",e.src=this[t].src,"youtube"===t?window.onYouTubeIframeAPIReady=function(){n[t].loaded=!0,n.done(t)}:e.onload=function(){n[t].loaded=!0,n.done(t)},document.body.appendChild(e)))},done:function(e){var n,o,a;"youtube"===e&&delete window.onYouTubeIframeAPIReady,n=t.fancybox.getInstance(),n&&(o=n.current.$content.find("iframe"),"youtube"===e&&void 0!==YT&&YT?a=new YT.Player(o.attr("id"),{events:{onStateChange:function(t){0==t.data&&n.next()}}}):"vimeo"===e&&void 0!==Vimeo&&Vimeo&&(a=new Vimeo.Player(o),a.on("ended",function(){n.next()})))}};t(document).on({"afterShow.fb":function(t,e,n){e.group.length>1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),a=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),i=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,a=o.length;e<a;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],a=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,i=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return a||i},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),n(e).off(".fb.touch"),t.requestId&&(a(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},d.prototype.ontouchstart=function(o){var a=this,c=n(o.target),d=a.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&a.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||u.$slide.hasClass("fancybox-animated"))return o.stopPropagation(),void o.preventDefault();a.realPoints=a.startPoints=i(o),a.startPoints.length&&(u.touch&&o.stopPropagation(),a.startEvent=o,a.canTap=!0,a.$target=c,a.$content=p,a.opts=u.opts.touch,a.isPanning=!1,a.isSwiping=!1,a.isZooming=!1,a.isScrolling=!1,a.canPan=d.canPan(),a.startTime=(new Date).getTime(),a.distanceX=a.distanceY=a.distance=0,a.canvasWidth=Math.round(f[0].clientWidth),a.canvasHeight=Math.round(f[0].clientHeight),a.contentLastPos=null,a.contentStartPos=n.fancybox.getTranslate(a.$content)||{top:0,left:0},a.sliderStartPos=n.fancybox.getTranslate(f),a.stagePos=n.fancybox.getTranslate(d.$refs.stage),a.sliderStartPos.top-=a.stagePos.top,a.sliderStartPos.left-=a.stagePos.left,a.contentStartPos.top-=a.stagePos.top,a.contentStartPos.left-=a.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(a,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(a,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",a.onscroll,!0),((a.opts||a.canPan)&&(c.is(a.$stage)||a.$stage.find(c).length)||(c.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&c.hasClass("fancybox-caption")))&&(a.isScrollable=l(c)||l(c.parent()),n.fancybox.isMobile&&a.isScrollable||o.preventDefault(),(1===a.startPoints.length||u.hasError)&&(a.canPan?(n.fancybox.stop(a.$content),a.isPanning=!0):a.isSwiping=!0,a.$container.addClass("fancybox-is-grabbing")),2===a.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(a.canTap=!1,a.isSwiping=!1,a.isPanning=!1,a.isZooming=!0,n.fancybox.stop(a.$content),a.centerPointStartX=.5*(a.startPoints[0].x+a.startPoints[1].x)-n(t).scrollLeft(),a.centerPointStartY=.5*(a.startPoints[0].y+a.startPoints[1].y)-n(t).scrollTop(),a.percentageOfImageAtPinchPointX=(a.centerPointStartX-a.contentStartPos.left)/a.contentStartPos.width,a.percentageOfImageAtPinchPointY=(a.centerPointStartY-a.contentStartPos.top)/a.contentStartPos.height,a.startDistanceBetweenFingers=s(a.startPoints[0],a.startPoints[1]))))}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=i(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&e.isSwiping===!0||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var i,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(c!==!0)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(a(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;
5942n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||s.opts.vertical===!1||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(i=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=i>45&&i<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,function(t,e){var o,a;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),a=n.fancybox.getTranslate(r.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===r.current.pos&&(s.sliderStartPos.top=o.top-a.top,s.sliderStartPos.left=o.left-a.left),n.fancybox.setTranslate(e.$slide,{top:o.top-a.top,left:o.left-a.left})}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;return s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5)?void(t.startPoints=t.newPoints):(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&a(t.requestId),void(t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})))},d.prototype.limitMovement=function(){var t,e,n,o,a,i,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return a=h>r?f+l:f,i=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&a>t&&(a=t-1+Math.pow(-t+f+l,.8)||0),l<0&&a<n&&(a=n+1-Math.pow(n-f-l,.8)||0),d>0&&i>e&&(i=e-1+Math.pow(-e+p+d,.8)||0),d<0&&i<o&&(i=o+1-Math.pow(o-p-d,.8)||0),{top:i,left:a}},d.prototype.limitPosition=function(t,e,n,o){var a=this,i=a.canvasWidth,s=a.canvasHeight;return n>i?(t=t>0?0:t,t=t<i-n?i-n:t):t=Math.max(0,i/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},d.prototype.onZoom=function(){var e=this,i=e.contentStartPos,r=i.width,c=i.height,l=i.left,d=i.top,u=s(e.newPoints[0],e.newPoints[1]),f=u/e.startDistanceBetweenFingers,p=Math.floor(r*f),h=Math.floor(c*f),g=(r-p)*e.percentageOfImageAtPinchPointX,b=(c-h)*e.percentageOfImageAtPinchPointY,m=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),v=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=m-e.centerPointStartX,x=v-e.centerPointStartY,w=l+(g+y),$=d+(b+x),S={top:$,left:w,scaleX:f,scaleY:f};e.canTap=!1,e.newWidth=p,e.newHeight=h,e.contentLastPos=S,e.requestId&&a(e.requestId),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},d.prototype.ontouchend=function(t){var o=this,s=o.isSwiping,r=o.isPanning,c=o.isZooming,l=o.isScrolling;return o.endPoints=i(t),o.dMs=Math.max((new Date).getTime()-o.startTime,1),o.$container.removeClass("fancybox-is-grabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(a(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap?o.onTap(t):(o.speed=100,o.velocityX=o.distanceX/o.dMs*.5,o.velocityY=o.distanceY/o.dMs*.5,void(r?o.endPanning():c?o.endZooming():o.endSwiping(s,l)))},d.prototype.endSwiping=function(t,e){var o=this,a=!1,i=o.instance.group.length,s=Math.abs(o.distanceX),r="x"==t&&i>1&&(o.dMs>130&&s>10||s>50),c=300;o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),a=o.instance.close(!0,250)):r&&o.distanceX>0?a=o.instance.previous(c):r&&o.distanceX<0&&(a=o.instance.next(c)),a!==!1||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,a=this;a.contentLastPos&&(a.opts.momentum===!1||a.dMs>350?(t=a.contentLastPos.left,e=a.contentLastPos.top):(t=a.contentLastPos.left+500*a.velocityX,e=a.contentLastPos.top+500*a.velocityY),o=a.limitPosition(t,e,a.contentStartPos.width,a.contentStartPos.height),o.width=a.contentStartPos.width,o.height=a.contentStartPos.height,n.fancybox.animate(a.$content,o,330))},d.prototype.endZooming=function(){var t,e,o,a,i=this,s=i.instance.current,r=i.newWidth,c=i.newHeight;i.contentLastPos&&(t=i.contentLastPos.left,e=i.contentLastPos.top,a={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(i.$content,a),r<i.canvasWidth&&c<i.canvasHeight?i.instance.scaleToFit(150):r>s.width||c>s.height?i.instance.scaleToActual(i.centerPointStartX,i.centerPointStartY,150):(o=i.limitPosition(t,e,r,c),n.fancybox.animate(i.$content,o,150)))},d.prototype.onTap=function(e){var o,a=this,s=n(e.target),r=a.instance,c=r.current,l=e&&i(e)||a.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-a.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-a.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close"
vendor: 3,682 bytes, line 5942
5942:r.close(a.startEvent);break;case"toggleControls":r.toggleControls();break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(a.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(a.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(a.tapped){if(clearTimeout(a.tapped),a.tapped=null,Math.abs(d-a.tapX)>50||Math.abs(u-a.tapY)>50)return this;f("dblclick"+o)}else a.tapX=d,a.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?a.tapped=setTimeout(function(){a.tapped=null,r.isAnimating||f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))}).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg></button>'},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('<div class="fancybox-progress"></div>').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,a=o.current;a&&(t===!0||a.opts.loop||o.currIndex<o.group.length-1)?n.isActive&&"video"!==a.contentType&&(n.$progress&&e.fancybox.animate(n.$progress.show(),{scaleX:1},a.opts.slideShow.speed),n.timer=setTimeout(function(){o.current.opts.loop||o.current.index!=o.group.length-1?o.next():o.jumpTo(0)},a.opts.slideShow.speed)):(n.stop(),o.idleSecondsCounter=0,o.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null,t.$progress&&t.$progress.removeAttr("style").hide()},start:function(){var t=this,e=t.instance.current;e&&(t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.isActive=!0,e.isComplete&&t.set(!0),t.instance.trigger("onSlideShowChange",!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1,t.instance.trigger("onSlideShowChange",!1),t.$progress&&t.$progress.removeAttr("style").hide()},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var a=e&&e.SlideShow;o?a&&n.opts.slideShow.autoStart&&a.start():a&&a.isActive&&a.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,a,i,s){var r=o&&o.SlideShow;!r||!a.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(i.preventDefault(),r.toggle(
5942))},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,jQuery),function(t,e){"use strict";var n=function(){for(var e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n={},o=0;o<e.length;o++){var a=e[o];if(a&&a[1]in t){for(var i=0;i<a.length;i++)n[e[0][i]]=a[i];return n}}return!1}();if(n){var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.current.$content.css("transition","none"),n.isAnimating=!1,n.update(!0,!0,0)),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})}e(t).on({"onInit.fb":function(t,e){var a;return n?void(e&&e.group[e.currIndex].opts.fullScreen?(a=e.$refs.container,a.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&e.opts.fullScreen.autoStart===!0&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()):void e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove()},"afterKeydown.fb":function(t,e,n,o,a){e&&e.FullScreen&&70===a&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs",o=n+"-active";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var a=function(t){this.init(t)};e.extend(a.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,t.Thumbs=e,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var a=0,i=n.length;a<i&&(n[a].thumb&&o++,!(o>1));a++);o>1&&e.opts?(e.$button.removeAttr("style").on("click",function(){e.toggle(
vendor: 5,050 bytes, lines 5942-5943
5942)}),e.isActive=!0):e.$button.hide()},create:function(){var t,o=this,a=o.instance,i=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('<div class="'+n+" "+n+"-"+o.opts.axis+'"></div>').appendTo(a.$refs.container.find(i).addBack().filter(i)),o.$grid.on("click","a",function(){a.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e('<div class="'+n+'__list">').appendTo(o.$grid)),e.each(a.group,function(e,n){t=n.thumb,t||"image"!==n.type||(t=n.src),s.push('<a role="button" href="javascript:;" tabindex="0" data-index="'+e+'"'+(t&&t.length?' style="background-image:url('+t+')"':'class="fancybox-thumbs-missing"')+"></a>")}),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+a.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,a=this,i=a.$list,s=a.$grid;a.instance.current&&(e=i.children().removeClass(o).filter('[data-index="'+a.instance.current.index+'"]').addClass(o),n=e.position(),"y"===a.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===a.opts.axis&&(n.left<s.scrollLeft()||n.left>s.scrollLeft()+(s.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new a(e),n.isActive&&n.opts.autoStart===!0&&n.show())},"beforeShow.fb":function(t,e,n,o){var a=e&&e.Thumbs;a&&a.isVisible&&a.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,a){var i=e&&e.Thumbs;i&&i.isActive&&71===a&&(o.preventDefault(),i.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&n.opts.hideOnClose!==!1&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p></div>'
5943}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,a=e.fancybox.getInstance(),i=a.current||null;i&&("function"===e.type(i.opts.share.url)&&(t=i.opts.share.url.apply(i,[a,i])),o=i.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===i.type?encodeURIComponent(i.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,a.$caption?encodeURIComponent(a.$caption.text()):""),e.fancybox.open({src:a.translate(a,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){a.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})}
5943,mobile:{autoFocus:!1}}}))})}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,a=n.join("-");return{hash:e,index:o<1?1:o,gallery:a}}function a(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function i(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""),""!==n&&n)}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)}),n(function(){n.fancybox.defaults.hash!==!1&&(n(e).on({"onInit.fb":function(t,e){var n,a;e.group[e.currIndex].opts.hash!==!1&&(n=o(),a=i(e),a&&n.gallery&&a==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,a,s){var r;a&&a.opts.hash!==!1&&(r=i(o),r&&(o.currentHash=r+(o.group.length>1?"-"+(a.index+1):""),t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null},300))))},"beforeClose.fb":function(n,o,a){a.opts.hash!==!1&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),function(t,o){var a=n(o).data("FancyBox");if(a&&a.currentHash)return e=a,!1}),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&a(t)}),setTimeout(function(){n.fancybox.getInstance()||a(o())},50))})}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,a=(new Date).getTime();e.group.length<2||o.opts.wheel===!1||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,a-n<250||(n=a,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery); 
5944$(document).ready(() => {
5945
5946  var swiper = new Swiper(".js-secondary-img-slider", {
5947    slidesPerView: 4,
5948    watchSlidesProgress: true,
5949    direction: "horizontal",
5950    navigation: {
5951      nextEl: ".swiper-button-next",
5952      prevEl: ".swiper-button-prev",
5953    },
5954    breakpoints: {
5955      450: {
5956        slidesPerView: 3,
5957      },
5958      769: {
5959        direction: "vertical",
5960        slidesPerView: 4,
5961      },
5962    }
5963  });
5964  window.mainImageSwiper = swiper;
5965  var swiper2 = new Swiper(".js-main-img-slider", {
5966    spaceBetween: 10,
5967    thumbs: {
5968      swiper: swiper,
5969    },
5970  });
5971  window.secondaryImageSwiper = swiper2;
5972  $('.swiper-button-next-copy').on('click', () => {
5973    swiper2.slideNext(100);
5974  });
5975  $('.swiper-button-prev-copy').on('click', () => {
5976    swiper2.slidePrev(100);
5977  });
5978
5979  swiper2.on('activeIndexChange', () => {
5980    $('.swiper-button-next-copy').removeClass('disable');
5981    $('.swiper-button-prev-copy').removeClass('disable');
5982    if (swiper2.isBeginning) {
5983      $('.swiper-button-prev-copy').addClass('disable');
5984    }
5985    if (swiper2.isEnd) {
5986      $('.swiper-button-next-copy').addClass('disable');
5987    }
5988  });
5989});
5990 
5991$(document).ready(() => {
5992    const body = document.querySelector('body');
5993    $('body').on('click', '.js-size-guide-button' ,(e) => {
5994        e.preventDefault();
5995        body.classList.add('size-guide-open');
5996    });
5997    $('.js-size-guide-close').on('click', (e) => {
5998        e.preventDefault();
5999        body.classList.remove('size-guide-open');
6000    });
6001    $('.js-size-guide-dropdown').on('click', (e) => {
6002        if (e.target.classList.contains('js-size-guide-dropdown')) {
6003            body.classList.remove('size-guide-open');
6004        }
6005    });
6006    $(document).on('keydown', (e) => {
6007        if (e.keyCode == '27') {
6008            $(body).removeClass('size-guide-open');
6009        }
6010    })
6011}); 
6012$(document).ready(function () {
6013    var sizeMapObject;
6014    // флаг из настройки checkbox_save_variant, при смене цвета оставлять выбранный размер или нет
6015    let flagSave = document.querySelector('.block-variants')?.dataset.saveVariant;
6016    // функция кликов по размерной сетке (страница товара и миникарточка)
6017    function sizeMapShow(id, search) {
6018        if (sizeMapObject == undefined) return false;
6019
6020        var show = 'color';
6021        if (search == 'color') {
6022            show = 'size';
6023        }
6024
6025        sizeMapObject.find('.' + show).hide();
6026        var toCheck = '';
6027        sizeMapObject.find('.variants-table .variant-tr').each(function () {
6028            if ($(this).data(search) == id) {
6029                if (sizeMapObject.find(this).data('size') != '') {
6030                    const dataIdAttribute = sizeMapObject.find(this).data(show) ?
6031                        '.' + show + '[data-id=' + sizeMapObject.find(this).data(show) + ']' :
6032                        '.' + show + '[data-id]';
6033                    sizeMapObject.find(dataIdAttribute).show();
6034                    if ($(this).data('count') == 0) {
6035                        sizeMapObject.find(dataIdAttribute).addClass('inactive');
6036                    } else {
6037                        sizeMapObject.find(dataIdAttribute).removeClass('inactive');
6038                    }
6039                    if (toCheck == '') {
6040                        toCheck = sizeMapObject.find(dataIdAttribute);
6041                    }
6042                }
6043            }
6044        });
6045        if (flagSave == 'true') {
6046            let currentCheck = sizeMapObject.find('.' + show + '.active');
6047            if (currentCheck.css('display') != 'none') {
6048                toCheck = currentCheck;
6049            }
6050        }
6051        if (toCheck != '') {
6052            toCheck.click();
6053        }
6054    }
6055
6056    // функция выбора варианта после клика по размерной сетке (страница товара и миникарточка)
6057    function choseVariant() {
6058        if (sizeMapObject == undefined) return false;
6059        var color = '';
6060        var size = '';
6061        if (sizeMapObject.find('.color').length != 0) {
6062            color = '[data-color=' + sizeMapObject.find('.color.active').data('id') + ']';
6063        }
6064        if (sizeMapObject.find('.size').length != 0) {
6065            size = '[data-size=' + sizeMapObject.find('.size.active').data('id') + ']';
6066        }
6067        sizeMapObject.find('.variants-table .variant-tr' + color + size + ' input[type=radio]').click();
6068    }
6069
6070    $(document.body).on('change', '.block-variants input[type=radio]', function (e) {
6071        //подстановка картинки варианта вместо картинки товара (страница товара и миникарточка)
6072        //changeMainImgToVariant($(this));
6073
6074        $(this).parents('tbody').find('tr label').removeClass('active');
6075        $(this).parents('tr').find('label').addClass('active');
6076
6077        if (!$('.mg-product-slides').length) {
6078            var obj = $(this).parents('.js-catalog-item');
6079            var count = $(this).data('count');
6080            if (!obj.length) {
6081                obj = $(this).parents('.mg-compare-product');
6082            }
6083
6084            var form = $(this).parents('form');
6085
6086            if (form.hasClass('actionView')) {
6087                return false;
6088            }
6089
6090            var buttonbuy = $(obj).find('.js-product-controls a:visible').hasClass('js-add-to-cart');
6091
6092            if (count != '0' && !buttonbuy) {
6093                if ('false' == window.actionInCatalog) {
6094                    $(obj).find('.js-product-more').show();
6095                    $(obj).find('.js-add-to-cart').hide();
6096                } else {
6097                    $(obj).find('.js-product-more').hide();
6098                    $(obj).find('.js-add-to-cart').show();
6099                }
6100            } else if (count == '0' && buttonbuy == true) {
6101                $(obj).find('.js-product-more').show();
6102                $(obj).find('.js-add-to-cart').hide();
6103            }
6104        }
6105    });
6106
6107
6108    // делает активными нужные элементы размерной сетки при изменении варианта товара (страница товара и миникарточка)
6109    $(document.body).on('click', '.variants-table tr input[type=radio]', function () {
6110        sizeMapObject = $(this).closest('form');
6111        sizeMapObject.find('.color').removeClass('active');
6112        sizeMapObject.find('.size').removeClass('active');
6113
6114        var tmp = $(this).closest('tr').data('color');
6115        if (tmp != undefined && tmp != '') {
6116            sizeMapObject.find('.color[data-id=' + $(this).closest('tr').data('color') + ']').addClass('active');
6117        }
6118        tmp = $(this).closest('tr').data('size');
6119        if (tmp != undefined && tmp != '') {
6120            sizeMapObject.find('.size[data-id=' + $(this).closest('tr').data('size') + ']').addClass('active');
6121        }
6122    });
6123
6124    // обработчик кликов по размерной сетке (страница товара и миникарточка)
6125    $(document.body).on('click', '.color', function () {
6126        sizeMapObject = $(this).parents('form');
6127        if (typeof (sizeMapMod) != undefined && sizeMapMod !== 'size') {
6128            sizeMapObject.find('.color').removeClass('active');
6129            $(this).addClass('active');
6130            sizeMapShow($(this).data('id'), 'color');
6131            if (sizeMapObject.find('.size').length == 0) {
6132                choseVariant();
6133            }
6134        } else {
6135            sizeMapObject.find('.color').removeClass('active');
6136            $(this).addClass('active');
6137            choseVariant();
6138        }
6139    });
6140
6141    $(document.body).on('click', '.size', function () {
6142        sizeMapObject = $(this).parents('form');
6143        if (typeof (sizeMapMod) != undefined && sizeMapMod === 'size') {
6144            sizeMapObject.find('.size').removeClass('active');
6145            $(this).addClass('active');
6146            sizeMapShow($(this).data('id'), 'size');
6147            if (sizeMapObject.find('.color').length == 0) {
6148                choseVariant();
6149            }
6150        } else {
6151            sizeMapObject.find('.size').removeClass('active');
6152            $(this).addClass('active');
6153            choseVariant();
6154        }
6155    });
6156
6157
6158    // делает активными нужные элементы размерной сетки (страница товара и миникарточка)
6159    $('.variants-table').each(function () {
6160        var tmp = $(this).closest('form').attr('data-product-color');
6161        if (tmp == undefined || tmp == '') {
6162            tmp = $(this).find('tr:eq(0)').data('color');
6163        }
6164        if (tmp != undefined && tmp != '') {
6165            $(this).parents('form').find('.color[data-id=' + tmp + ']').addClass('active');
6166        } 
6167        var tmp = $(this).closest('form').attr('data-product-size');
6168        if (tmp == undefined || tmp == '') {
6169        tmp = $(this).find('tr:eq(0)').data('size');
6170        }
6171        if (tmp != undefined && tmp != '') {
6172            $(this).parents('form').find('.size[data-id=' + tmp + ']').addClass('active');
6173        }
6174    });
6175
6176    $('.color-block .color.active').click();
6177    $('.size.active').click();
6178    // костыль для верстки чекбокса выбранного варианта в таблице вариантов товара без размерной сетки (страница товара и миникарточка)
6179    $('.variant__column input[name=variant][checked=checked]').each(function () {
6180        const form = $(this).closest('form'); 
6181        form.attr("data-product-variant")
6182        form.find('.variant__column input[name=variant][value="'+form.attr("data-product-variant")+'"]').parents('.c-form').addClass('active');
6183        //$(this).parents('.c-form').addClass('active');
6184    });
6185
6186    // для выбора варианта по якорю
6187    if (varHashProduct === 'true' || varHashProduct === true) {
6188        if (location.hash != '') {
6189            code = location.hash.replace('#', '');
6190            code = decodeURI(code);
6191            if (typeof (sizeMapMod) != undefined && sizeMapMod == 'size' && $('[data-code="' + code + '"]:eq(0)').closest('tr[data-size!=\'\']').length) {
6192                size = $('[data-code="' + code + '"]:eq(0)').closest('tr').data('size');
6193                $('.size[data-id=' + size + ']').trigger('click');
6194            } else if ($('[data-code="' + code + '"]:eq(0)').closest('tr[data-color!=\'\']').length) {
6195                color = $('[data-code="' + code + '"]:eq(0)').closest('tr').data('color');
6196                $('.color[data-id=' + color + ']').trigger('click');
6197            }
6198            $('[data-code="' + code + '"]:eq(0)').click();
6199        }
6200
6201        // подстановка якоря в url
6202        $(document.body).on('click', '.variants-table tr input[type=radio]', function () {
6203            data = $(this).data('code');
6204            if (data != undefined) location.hash = data;
6205        });
6206    }
6207
6208});
6209
6210
6211// Функция получает изображение варианта и подменяет его в карусели
6212function changeMainImgToVariant(response, page) {
6213    var secondarySlider = $('.js-secondary-img-slider');
6214    var activeLink = $('.js-main-img-slider .js-images-link');
6215    var firstSlide = secondarySlider.find('.swiper-slide').first();
6216    // Если пришла не заглушка, то продолжаем
6217    if (response.data.image_orig !== '' && !response.data.image_orig.includes('no-img.jpg')) {
6218        // Если это миникарточка
6219        if (page.hasClass('js-catalog-item')) {
6220            // Находим изображение товара в миникарточке
6221            var itemImg = page.find('.js-catalog-item-image');
6222            // Заменяем его, а также hover-изображение
6223            if (response.data.image_thumbs && response.data.image_thumbs.length != 0) {
6224                changeImgSrc(
6225                    itemImg,
6226                    '70',
6227                    response.data.image_thumbs,
6228                );
6229            }
6230        }
6231
6232        // Если это страница товара
6233        else {
6234            // Если у товара не одно изображение
6235            if (secondarySlider.length) {
6236                if (window.mainImageSwiper && window.secondaryImageSwiper) {
6237                    window.secondaryImageSwiper.slideTo(0, 0);
6238                    window.mainImageSwiper.slideTo(0, 0);
6239                }
6240                // Открываем первый слайд
6241                firstSlide.click();
6242
6243                // меняем первое изображение товара в карусели миниатюр
6244                if (response.data.image_thumbs && response.data.image_thumbs.length != 0) {
6245                    changeImgSrc(
6246                        firstSlide.find('.js-img-preview'),
6247                        '30',
6248                        response.data.image_thumbs,
6249                    );
6250                }
6251                activeLink = $('.js-main-img-slider .js-images-link').first();
6252                // Меняем первое изображение товара в основном слайдере
6253                if (response.data.image_thumbs && response.data.image_thumbs.length != 0) {
6254                    changeImgSrc(
6255                        activeLink.find('.js-product-img'),
6256                        '70',
6257                        response.data.image_thumbs,
6258                    );
6259                }
6260            } else {
6261                // Меняем единственное изображение товара
6262                if (response.data.image_thumbs && response.data.image_thumbs.length != 0) {
6263                    changeImgSrc(
6264                        $('.js-product-img'),
6265                        '70',
6266                        response.data.image_thumbs,
6267                    );
6268                }
6269            }
6270            if (response.data.image_thumbs && response.data.image_thumbs.length != 0) {
6271                // Меняем изображение в ссылке на fancybox
6272                $('.js-main-img-slider .bottom-images__img-container').attr('href', response.data.image_orig);
6273                activeLink.attr('href', response.data.image_orig);
6274                // Меняем изображение показыващееся при наведении на основное (лупа)
6275                activeLink.find('.js-zoom-img')
6276                    .attr('style', 'background-image: url("' + response.data.image_orig + '")');
6277            }
6278        }
6279    }
6280    // Смена остатков по складам если они выводятся
6281    if (typeof (response.data.storage) != 'undefined') {
6282        for (key in response.data.storage) {
6283            let countGoodsStorages = document.querySelector('.storage-field .count-on-storage[data-id="' + key + '"]');
6284            if (countGoodsStorages) {
6285                countGoodsStorages.innerHTML = response.data.storage[key];
6286            }
6287        }
6288    }
6289}
6290
6291// Минифункция меняющая src и srcset у тега img
6292function changeImgSrc(imgElem, size, thumbsArr) {
6293    imgElem.attr('src', thumbsArr[size])
6294        .attr('srcset', thumbsArr['2x' + size] + ' 2x');
6295} 
6296$('.js-iframe-button-video').on('click', function() {
6297    if ($('.modal-video').length  == 0) {
6298
6299        $('body').append(`<div class="modal-video">
6300        <button class="modal-video__close">
6301        <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
6302        <g id="Menu / Close_MD">
6303        <path id="Vector" d="M18 18L12 12M12 12L6 6M12 12L18 6M12 12L6 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
6304        </g>
6305        </svg>
6306        </button>
6307        <div class="modal-video__container"></div>
6308        </div>`);
6309    }
6310    $('.modal-video').show();
6311    $('.modal-video').on('click', (e) => {
6312        if (e.target.classList.contains('modal-video')) {
6313            $('.modal-video').hide();
6314            $('.modal-video__container').html('');
6315        }
6316    })
6317    $('.modal-video__container').html($(this).attr('data-url'));
6318    $('.modal-video__close').on('click', () => {
6319        $('.modal-video').hide();
6320        $('.modal-video__container').html('');
6321    });
6322}); 
6323
6324/**
6325 * Находит элемент меню: .js-main-menu и место для переноса js-main-menu-mobile и переносит 
6326 * menu.children[0]. У js-main-menu используются дата атрибуты mobile="true" || "false" и transition="true" || "false".
6327 * @returns 
6328 */
6329// const transitionMenu = (width) => {
6330//     const menu = document.querySelector('.js-main-menu');
6331//     const menuTarget = document.querySelector('.js-main-menu-mobile');
6332//     const windowWidth  = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
6333//     if (windowWidth <= width) {
6334//         if (menu.dataset.mobile === 'false') {
6335//             menu.dataset.mobile = 'true';
6336//             menu.dataset.transition = 'false';
6337//         }
6338//         else {
6339//             menu.dataset.transition = 'true';
6340//         }
6341//     }
6342//     else {
6343//         if (menu.dataset.mobile === 'true') {
6344//             menu.dataset.mobile = 'false';
6345//             menu.dataset.transition = 'false';
6346//         }
6347//         else {
6348//             menu.dataset.transition = 'true';
6349//         }
6350//     }
6351//     if (menu.dataset.transition === 'true') {
6352//         return;
6353//     }
6354//     if (menu.dataset.mobile === 'true') {
6355//         menuTarget.append(menu.children[0]);
6356//         menu.dataset.transition = 'true';
6357//         initDropdownMainMenu(mainMenuArray, submenuArray);
6358//         return;
6359//     }
6360//     menu.dataset.transition = 'true';
6361//     menu.append(menuTarget.children[0]);
6362//     removeDropdownMainMenu(mainMenuArray, submenuArray);
6363// }
6364// transitionMenu(1050);
6365// $(document).ready(function() {
6366//     $(window).resize(() => {
6367//         transitionMenu(1050);
6368//     });
6369// }); 
6370// Функция для создания карточки найденного товара
6371const createSearchItem = (item) => {
6372    // Копируем шаблон карточки из search/template/template.php
6373    const elem = document.querySelector('#search-template').content.cloneNode(true);
6374    // Находим элементы карточки
6375    const link = elem.querySelector('.search-item__main');
6376    const img = elem.querySelector('.search-item__img');
6377    const title = elem.querySelector('.search-item__title');
6378    const code = elem.querySelector('.search-item__art');
6379    const codeMobile = elem.querySelector('.search-item__art-mobile');
6380    const priceCurrent = elem.querySelector('.search-item__current-price');
6381    const priceOld = elem.querySelector('.search-item__old-price');
6382    const sale = elem.querySelector('.search-item__sale');
6383    const stickerSale = elem.querySelector('.card__sticker-sale');
6384    const stickerHit = elem.querySelector('.card__sticker-hit');
6385    const stickerNew = elem.querySelector('.card__sticker-new');
6386    const available = elem.querySelector('.c-product__stock');
6387    const productCode = elem.querySelector('.card__product-code');
6388    const cardTitleLink = elem.querySelector('.card__title a');
6389    const cardPrice = elem.querySelector('.card__price');
6390    const cardOldPrice = elem.querySelector('.card__old-price');
6391    const cardButton = elem.querySelector('.card__buttons .default-btn');
6392    const cardQuickView = elem.querySelector('.js-quick-view-btn');
6393    const cardImageBox = elem.querySelector('.card__image-box');
6394    const priceBlock = elem.querySelector('.search-item__price-container');
6395    const hasRequestPrice = $(priceBlock).hasClass('requestPrice');
6396    const compareBtn = elem.querySelector('.js-add-to-compare');
6397    const addFavorite = elem.querySelector('.js-add-to-favorites');
6398    const removeFavorite = elem.querySelector('.js-remove-to-favorites');
6399    // Начало карточки в списке
6400    img.src = item.image_url;
6401    title.textContent = item.title.replace(/&quot;/g, "'");
6402    cardImageBox.href = item.link;
6403    link.href = item.link;
6404    if (code) {
6405        code.textContent = item.code;
6406    }
6407    if (codeMobile) {
6408        codeMobile.textContent = item.code;
6409    }
6410    priceCurrent.textContent = item.price + ' ' + window.currency;
6411
6412    if (item.old_price && parseInt(item.price.replace(' ', '')) < parseInt(item.old_price.replace(' ', ''))) {
6413        priceOld.textContent = item.old_price + ' ' + window.currency;
6414        const price = parseFloat(item.price.replace(' ', ''));
6415        const oldPrice = parseFloat(item.old_price);
6416        sale.textContent = Math.round(((oldPrice - price) / oldPrice * 100)) + '%';
6417        stickerSale.style.display = 'block';
6418    } else {
6419        stickerSale.style.display = 'none';
6420        priceOld.style.display = 'none';
6421        sale.style.display = 'none';
6422    }
6423
6424    // Начало карточки появляющейся при наведении
6425    if (item.new == '1') {
6426        stickerNew.style.display = 'block';
6427    } else {
6428        stickerNew.style.display = 'none';
6429    }
6430    if (item.recommend == '1') {
6431        stickerHit.style.display = 'block';
6432    } else {
6433        stickerHit.style.display = 'none';
6434    }
6435
6436    if (hasRequestPrice) {
6437        if (item.price == '0') {
6438            priceBlock.style.display = 'none';
6439        }
6440    }
6441
6442    // если есть варианты проверяем наличие товаров в них, если хоть в одном есть в наличии выводим это в карточке
6443    if (item.variants) {
6444        let countFlag = false
6445        item.variants.forEach(variant => {
6446            if (variant.count !== 0 && variant.count !== '0') {
6447                countFlag = true;
6448            }
6449        });
6450        if (countFlag) {
6451            available.classList.add('c-product__stock--in');
6452            available.querySelector('.c-product__stock--span').textContent = window.locale.available;
6453        } else {
6454            available.classList.add('c-product__stock--out');
6455            available.querySelector('.c-product__stock--span').textContent = window.locale.notAvailable;
6456        }
6457        //если вариантов нет то смотрим по count
6458    } else {
6459        if (item.count == '0') {
6460            available.classList.add('c-product__stock--out');
6461            available.querySelector('.c-product__stock--span').textContent = window.locale.notAvailable;
6462        } else {
6463            available.classList.add('c-product__stock--in');
6464            available.querySelector('.c-product__stock--span').textContent = window.locale.available;
6465        }
6466    }
6467    if (productCode) {
6468        productCode.textContent += ' ' + item.code;
6469    }
6470    cardTitleLink.textContent = item.title.replace(/&quot;/g, "'");
6471    cardTitleLink.html = item.link;
6472
6473    // Если вдруг кто то включит плагин запросить цену то элементов с ценой не будет
6474    if (cardPrice) {
6475        const cardPriceText = cardPrice.querySelector('.card__price-text');
6476        const cardPriceCurrency = cardPrice.querySelector('.card__currency');
6477        cardPriceText.textContent = item.price;
6478        cardPriceCurrency.textContent = ' ' + window.currency;
6479
6480    } else {
6481        const requestPriceLink = elem.querySelector('.card__price-box .default-btn');
6482        requestPriceLink.href = item.link;
6483    }
6484    // Аналогично со старой ценой
6485    if (cardOldPrice) {
6486        const cardOldPriceText = cardOldPrice.querySelector('.card__old-price-text');
6487        const cardOldPriceCurrency = cardOldPrice.querySelector('.card__currency');
6488        if (item.price < item.old_price) {
6489            cardOldPriceText.textContent = item.oldPrice;
6490            cardOldPriceCurrency.textContent = ' ' + window.currency;
6491        } else {
6492            cardOldPrice.style.display = 'none';
6493        }
6494    }
6495    const settingRenderBuyBtn = document.querySelector('.c-search__container')?.dataset.renderBuyBtn;
6496
6497    if (item.variants || settingRenderBuyBtn == 'false') {
6498        cardButton.href = item.link;
6499        cardButton.classList.add('product-info');
6500        cardButton.querySelector('.a-button__title').textContent = locale.moreButton;
6501    } else if (item.count == '0') {
6502        cardButton.href = item.link;
6503        cardButton.classList.add('product-info');
6504        cardButton.querySelector('.a-button__title').textContent = locale.moreButton;
6505    } else {
6506        cardButton.href = window.location.origin + '/catalog?inCartProductId=' + item.id + '&amount_input=' + item.multiplicity;
6507        cardButton.classList.remove('a-button_muted', 'product-info');
6508        cardButton.classList.add('addToCart', 'card__add-button', 'card__button', 'js-add-to-cart');
6509        cardButton.dataset.itemId = item.id;
6510        cardButton.querySelector('.a-button__title').textContent = locale.buyBtn;
6511    }
6512    cardQuickView.dataset.itemId = item.id;
6513    cardQuickView.dataset.itemUrl = item.link;
6514    if (compareBtn) {
6515        if (compareListArr && compareListArr[item.cat_id] && compareListArr[item.cat_id][item.id]) {
6516            compareBtn.classList.add('_active')
6517        } else {
6518            compareBtn.classList.remove('_active')
6519        }
6520        compareBtn.href += item.id;
6521        compareBtn.dataset.itemId = item.id;
6522    }
6523    if (addFavorite) {
6524        addFavorite.dataset.itemId = item.id
6525    }
6526    if (removeFavorite) {
6527        const cookie = document.cookie;
6528        const cookieFavoritesStart = cookie.search('favorites');
6529        const cookieFavoritesEnd = cookie.indexOf(';', cookieFavoritesStart) === -1 ? 0 : cookie.indexOf(';', cookieFavoritesStart);
6530        const cookieFavorites = cookie.slice(cookieFavoritesStart, cookieFavoritesEnd).replace('favorites=', '');
6531        const cookieFavoritesArr = cookieFavorites.split('%2C');
6532        if (!cookieFavoritesArr.includes(item.id)) {
6533            removeFavorite.style.display = 'none';
6534            addFavorite.style.display = 'inline-flex';
6535        } else {
6536            removeFavorite.style.display = 'inline-flex';
6537            addFavorite.style.display = 'none';
6538        }
6539        removeFavorite.dataset.itemId = item.id
6540    }
6541    addImagesToCard(item, elem);
6542    return elem;
6543}
6544
6545const addImagesToCard = (item, elem) => {
6546    const imagesContainer = elem.querySelector('.item-image-slider__container');
6547    const dotsContainer = elem.querySelector('.item-image-slider__dots');
6548    const imageCard = imagesContainer.querySelector('.js-catalog-item-image');
6549    const dotCard = dotsContainer.querySelector('.item-image-slider__dot');
6550    dotsContainer.innerHTML = '';
6551    imagesContainer.innerHTML = '';
6552    imagesContainer.append(dotsContainer);
6553    item.thumbs.forEach(image => {
6554        const cloneImage = imageCard.cloneNode(false);
6555        const cloneDot = dotCard.cloneNode(false);
6556        cloneImage.src = image['70']['2x'];
6557        cloneImage.srcset = '';
6558        imagesContainer.append(cloneImage);
6559        dotsContainer.append(cloneDot);
6560    });
6561}
6562let compareListArr;
6563$(document).ready(function () {
6564    // Обработка ввода поисковой фразы в поле поиска
6565    $('body').on('keyup', 'input[name=search]', function () {
6566        var text = $(this).val();
6567        var lang = '';
6568        if (langP != 'LANG' && langP != 'default') {
6569            lang = '/' + langP;
6570        }
6571        if (text.length >= 2) {
6572            const getSearchData = function () {
6573                return $.ajax({
6574                    type: "POST",
6575                    url: mgBaseDir + lang + "/ajax",
6576                    data: {
6577                        action: "getSearchData",
6578                        actionerClass: "Ajaxuser",
6579                        text: text,
6580                    },
6581                    dataType: "json",
6582                    cache: false,
6583
6584                })
6585            }
6586            const getCompareList = function () {
6587                return $.ajax({
6588                    type: "POST",
6589                    url: mgBaseDir + lang + "/ajax",
6590                    data: {
6591                        action: "getCompareList",
6592                        actionerClass: "Ajaxuser",
6593                    },
6594                    dataType: "json",
6595                    cache: false,
6596                })
6597            }
6598            $.when(getSearchData,
6599                getCompareList,
6600            ).done(function (searchData, compareList) {
6601                compareList().then((compareListData) => {
6602                    compareListArr = compareListData;
6603                })
6604                searchData().then((data) => {
6605                    if ('success' == data.status && data.item.items.catalogItems.length > 0) {
6606                        $('.fastResult').html('');
6607                        // заполняем новые товары
6608                        data.item.items.catalogItems.forEach((element, index) => {
6609                            $('.fastResult').append(createSearchItem(element, compareList));
6610                        });
6611                        window.initImageSlider();
6612                        $('.search-item__card').on('click', '.card__buttons *', function (e) {
6613                            $('.c-search__dropdown').hide();
6614                        });
6615                        $('.fastResult').show();
6616                        $('.wraper-fast-result').show();
6617                        //запрос всех картинок товара
6618                        // убираем прошлые товары
6619
6620                    } else {
6621
6622                        $('.fastResult').hide();
6623                    }
6624                })
6625
6626            });
6627        } else {
6628            $('.fastResult').hide();
6629        }
6630    });
6631
6632    // клик вне поиска
6633    $(document).mousedown(function (e) {
6634        var container = $(".wraper-fast-result");
6635        if (container.has(e.target).length === 0 && $(".search-block").has(e.target).length === 0) {
6636            container.hide();
6637        }
6638    });
6639
6640}); 
6641window.initImageSlider = () => {
6642    const items = document.querySelectorAll('.js-card-slider');
6643    if (items && items.length > 0) {
6644        items.forEach((item) => {
6645            if (item.dataset.initSlider && item.dataset.initSlider == "true") return;
6646            item.dataset.initSlider = "true"
6647            const imageContainer = item.querySelector('.card__image-box');
6648            const imageArray = item.querySelectorAll('.item-image-slider__img');
6649            const dotsArray = item.querySelectorAll('.item-image-slider__dot');
6650            if (imageContainer && imageArray && imageArray.length < 1) return;
6651            if (imageArray.length == 1) {
6652                imageArray[0].classList.add('item-image-slider__img_active');
6653                dotsArray[0].style.display = "none";
6654                return;
6655            }
6656            imageArray[0].classList.add('item-image-slider__img_active');
6657            dotsArray[0].classList.add('item-image-slider__dot_active');
6658            imageContainer.addEventListener('mousemove', (e) => {
6659                let x = e.clientX;
6660                const rect = imageContainer.getBoundingClientRect();
6661                const positionRelativeContainer = x - rect.left;
6662                const width = imageContainer.offsetWidth;
6663                const partWidth = width / imageArray.length;
6664                let numberOfVisibleImage = Math.floor(positionRelativeContainer / partWidth);
6665                if (numberOfVisibleImage < 0) {
6666                    numberOfVisibleImage = 0;
6667                } else if (numberOfVisibleImage > imageArray.length - 1) {
6668                    numberOfVisibleImage = imageArray.length - 1;
6669                }
6670                imageArray.forEach((image) => {
6671                    image.classList.remove('item-image-slider__img_active');
6672                })
6673                dotsArray.forEach((dot) => {
6674                    dot.classList.remove('item-image-slider__dot_active');
6675                })
6676                imageArray[numberOfVisibleImage].classList.add('item-image-slider__img_active');
6677                dotsArray[numberOfVisibleImage].classList.add('item-image-slider__dot_active');
6678            }, { passive: true })
6679            let touchstartX = 0;
6680            let currentImage = 0;
6681            imageContainer.addEventListener('touchstart', (e) => {
6682                touchstartX = e.changedTouches[0].clientX;
6683            }, { passive: true })
6684            imageContainer.addEventListener('touchend', (e) => {
6685                let touchendX = e.changedTouches[0].clientX;
6686                if (touchstartX > touchendX) {
6687                    currentImage += 1;
6688                } else {
6689                    currentImage -= 1;
6690                }
6691                if (currentImage > imageArray.length - 1) {
6692                    currentImage = imageArray.length - 1;
6693                } else if (currentImage < 0) {
6694                    currentImage = 0;
6695                }
6696                imageArray.forEach((image) => {
6697                    image.classList.remove('item-image-slider__img_active');
6698                })
6699                dotsArray.forEach((dot) => {
6700                    dot.classList.remove('item-image-slider__dot_active');
6701                })
6702                imageArray[currentImage].classList.add('item-image-slider__img_active');
6703                dotsArray[currentImage].classList.add('item-image-slider__dot_active');
6704            }, { passive: true })
6705        })
6706    }
6707}
6708
6709window.initImageSlider(); 
6710$(document).ready(function() {
6711    // добавление в избранное
6712    var counter = $('.js-favourite-count'),
6713        informer = $('.js-favorites-informer'),
6714        informerWindow = document.querySelector('#template-favorites-informer'),
6715        informerOpenedClass = 'favourite--open',
6716        btnAddClass = '.js-add-to-favorites',
6717        btnRemoveClass = '.js-remove-to-favorites';
6718
6719
6720    $('body').on('click', btnAddClass, function(e) {
6721        e.preventDefault();
6722        obj = $(this);
6723        $.ajax({
6724            type: "POST",
6725            url: mgBaseDir + "/favorites/",
6726            data: { 'addFav': '1', 'id': $(this).data('item-id') },
6727            dataType: "json",
6728            cache: false,
6729            success: function(response) {
6730                obj.hide();
6731                obj.parent().find(btnRemoveClass).show();
6732                counter.html(response);
6733
6734                informer.removeClass(informerOpenedClass);
6735
6736                setTimeout(function() {
6737                    informer.addClass(informerOpenedClass);
6738                }, 0);
6739
6740                // Показываем уведомление
6741                const cloneInformer = informerWindow.content.querySelector('.informer_wrapper').cloneNode(true);
6742                const productTitle = obj.closest('.js-catalog-item').find('.card__title a');
6743                if (productTitle.length != 0) {
6744                    const informerProduct = $(cloneInformer).find('.favorites__informer-product-link');
6745                    informerProduct.text(productTitle.text() + '\u00A0');
6746                    informerProduct.attr('href', productTitle.attr('href'));
6747                }
6748                $(cloneInformer).find('.favorites__informer-product').text(window.locale.orderProduct + '\u00A0');
6749                $(cloneInformer).find('.favorites__informer-text').text(window.locale.favoritesAdded + '\u00A0');
6750                $(cloneInformer).find('.favorites__informer-link').text(window.locale.favoritesInformerLink + '!');
6751                window.initInformer(cloneInformer, true);
6752            }
6753        });
6754    });
6755
6756    // удаление из избранного
6757    $('body').on('click', btnRemoveClass, function(e) {
6758        e.preventDefault();
6759        obj = $(this);
6760        $.ajax({
6761            type: "POST",
6762            url: mgBaseDir + "/favorites/",
6763            data: { 'delFav': '1', 'id': $(this).data('item-id') },
6764            dataType: "json",
6765            cache: false,
6766            success: function(response) {
6767                obj.hide();
6768                obj.parent().find(btnAddClass).show();
6769                counter.html(response);
6770
6771                // Показываем уведомление
6772
6773                const cloneInformer = informerWindow.content.querySelector('.informer_wrapper').cloneNode(true);
6774                const productTitle = obj.closest('.js-catalog-item').find('.card__title a');
6775                if (productTitle.length != 0) {
6776                    const informerProduct = $(cloneInformer).find('.favorites__informer-product-link');
6777                    informerProduct.text(productTitle.text() + '\u00A0');
6778                    informerProduct.attr('href', productTitle.attr('href'));
6779                }
6780                $(cloneInformer).find('.favorites__informer-product').text(window.locale.orderProduct + '\u00A0');
6781                $(cloneInformer).find('.favorites__informer-text').text(window.locale.favoritesRemoved + '\u00A0');
6782                $(cloneInformer).find('.favorites__informer-link').text(window.locale.favoritesInformerLinkRemove + '!');
6783                window.initInformer(cloneInformer, true);
6784            }
6785        });
6786    });
6787}); 
6788$(document).ready(function() {
6789    // Удаление товара из корзины аяксом
6790    $('body').on('click', '.js-delete-from-cart', function() {
6791        var $this = $(this);
6792        var itemId = $this.data('delete-item-id');
6793        var property = $this.data('property');
6794        var $vari = $this.data('variant');
6795        const fullSummElem = $('.full-summ');
6796        $.ajax({
6797            type: "POST",
6798            url: mgBaseDir + "/cart",
6799            data: {
6800                action: "cart", // название действия в пользовательском класса Ajaxuser
6801                delFromCart: 1,
6802                itemId: itemId,
6803                property: property,
6804                variantId: $vari
6805            },
6806            dataType: "json",
6807            cache: false,
6808            success: function(response) {
6809                if ('success' == response.status) {
6810                    if (response.deliv && response.curr) {
6811                        var i = 0;
6812                        response.deliv.forEach(function(element, index, arr) {
6813                            $('.delivery-details-list li:eq(' + i + ') .deliveryPrice').html('&nbsp;' + element);
6814                            if ($('.delivery-details-list input[type=radio]:eq(' + i + ')').is(':checked')) {
6815                                if (element == 0) {
6816                                    if (fullSummElem.length === 0) {
6817                                        $('.summ-info .delivery-summ').html('');
6818                                    } else {
6819                                        $('.summ-info .delivery-summ').html('<span class="order-delivery-summ">' + element + ' ' + response.curr + '</span>');
6820                                    }
6821                                } else {
6822                                    if (fullSummElem.length === 0) {
6823                                        $('.summ-info .delivery-summ').html(locale.deliveryInformation + ' <span class="order-delivery-summ">' + element + ' ' + response.curr + '</span>');
6824                                    } else {
6825                                        $('.summ-info .delivery-summ').html('<span class="order-delivery-summ">' + element + ' ' + response.curr + '</span>');
6826                                    }
6827                                }
6828                            } 
6829                            i++;
6830                        });
6831                    }
6832                    if (!$vari) $vari = 0;
6833                    var table = $('.deleteItemFromCart[data-property="' + property + '"][data-delete-item-id="' + itemId + '"][data-variant="' + $vari + '"]').parents('table');
6834                    if ($vari) {
6835                        $('.deleteItemFromCart[data-property="' + property + '"][data-delete-item-id="' + itemId + '"][data-variant="' + $vari + '"]').parents('.js-minicart-item').remove();
6836                        $('.deleteItemFromCart[data-property="' + property + '"][data-delete-item-id="' + itemId + '"][data-variant="' + $vari + '"]').parents('article').remove();
6837                    } else {
6838                        $('.deleteItemFromCart[data-property="' + property + '"][data-delete-item-id="' + itemId + '"]').parents('.js-minicart-item').remove();
6839                        $('.deleteItemFromCart[data-property="' + property + '"][data-delete-item-id="' + itemId + '"]').parents('article').remove();
6840                    }
6841
6842                    var i = 1;
6843                    table.find('.index').each(function() {
6844                        $(this).text(i++);
6845                    });
6846                    $('.total-sum strong,.total .total-sum span,.mg-desktop-cart .total-sum span,.mg-fake-cart .total-sum span').text(response.data.cart_price_wc);
6847                    response.data.cart_price = response.data.cart_price ? response.data.cart_price : 0;
6848                    response.data.cart_count = response.data.cart_count ? response.data.cart_count : 0;
6849                    $('.pricesht').html(response.data.cart_price + '&nbsp;');
6850                    $('.js-cart-popup-total').text(response.data.cart_price);
6851                    $('.countsht').text(response.data.cart_count);
6852                    $('.cart-table .total-sum-cell strong').text(response.data.cart_price_wc);
6853                    if (window.fullSumm) {
6854                        window.fullSumm.value = parseFloat(response.data.cart_price.replace(',', '.').replaceAll(' ', ''));
6855                    }
6856                    if (response.data.cart_count === 0) {
6857                        let miniCartDropdownContent = document.querySelector('.js-mini-cart-dropdown-content');
6858                        const miniCartDropdownFooter = document.querySelector('.js-minicart-footer');
6859                        const miniCartDropdownEmptyAlert = document.querySelector('.js-minicart-alert-empty');
6860                        let cartPopupContent = document.querySelector('.js-cart-popup-content');
6861                        let orderContainer = document.querySelector('.js-order-container');
6862                        $('.a-cart-table').hide();
6863                        $('.c-table__total').hide();
6864                        const miniCartPopupButtonToCart = document.querySelector('.js-popup-order');
6865                        if (miniCartPopupButtonToCart) {
6866                            miniCartPopupButtonToCart.classList.remove('popup__order_active');
6867                        }
6868                        // Если есть выпадающая корзина, то вставляем блок с текстом "Ваша корзина пуста"
6869                        if (miniCartDropdownContent) {
6870                            miniCartDropdownContent.classList.remove('minicart__dropdown-content_active');
6871                            miniCartDropdownFooter.classList.remove('minicart__footer_active');
6872                            miniCartDropdownEmptyAlert.classList.add('alert-primary_active');
6873                        }
6874                        // Если есть всплывающая мини-корзина, то вставляем блок с текстом "Ваша корзина пуста" и туда
6875                        if (cartPopupContent) {
6876                            cartPopupContent.innerHTML = '<tr><td class="text-center p-1 a-cart__empty" colspan="4"><div class="alert alert-primary mb-0" role="alert">Ваша корзина пуста</div></td></tr>';
6877                            cartPopupContent.classList.add('popup__cart-content_empty');
6878                        }
6879                        // Если есть блок с оформлением заказа, то скрываем его
6880                        if (orderContainer) {
6881                            orderContainer.classList.add('_hide');
6882                        }
6883
6884                        $('.js-cart-empty').show();
6885                        $('.a-cart__remove-all').hide();
6886                        $('.js-footer-cart').hide();
6887                        $('.js-minicart-footer').hide();
6888                        $('.cart__total-wrapper').hide();
6889                    }
6890                }
6891            }
6892        });
6893        return false;
6894    });
6895
6896    $(document).on('click', '.js-cart-item-more', (e) => {
6897        e.preventDefault();
6898        const container = e.target.closest('.cart-item__buttons')
6899        $(container).find('.js-cart-item-more-dropdown').toggleClass('_active');
6900    });
6901    
6902    $(document).on('click', (e) => {
6903        if (!e.target.classList.contains('js-cart-item-more') && !e.target.closest('.cart-item__buttons')) {
6904            $('.js-cart-item-more-dropdown').removeClass('_active');
6905        }
6906    });
6907    
6908    const minicartCloseBtn = $('.js-cart-dropdown-close');
6909    const minicartBtn = document.querySelector('.c-cart__small');
6910    const minicart = document.querySelector('.js-mini-cart-dropdown');
6911    const minicartShadow = document.querySelector('.js-cart-dropdown-shadow');
6912    if (minicartCloseBtn.length != 0 && minicartBtn && minicart && minicartShadow) {
6913        minicartCloseBtn.on('click', () => {
6914            minicart.classList.remove('a-cart__dropdown_active');
6915            setTimeout(() => {
6916                minicartShadow.classList.remove('minicart__dropdown-shadow_active');
6917            }, 400);
6918        })
6919        minicartBtn.addEventListener('click', () => {
6920            minicartShadow.classList.add('minicart__dropdown-shadow_active');
6921            setTimeout(() => {
6922                minicart.classList.add('a-cart__dropdown_active');
6923            }, 0);
6924        })
6925        minicartShadow.addEventListener('click', (e) => {
6926            if (e.target.classList.contains('js-cart-dropdown-shadow')) {
6927                minicart.classList.remove('a-cart__dropdown_active');
6928                setTimeout(() => {
6929                    minicartShadow.classList.remove('minicart__dropdown-shadow_active');
6930                }, 400);
6931            }
6932        })
6933        document.addEventListener('keydown', (e) => {
6934            if (e.key === 'Escape') {
6935                minicart.classList.remove('a-cart__dropdown_active');
6936                setTimeout(() => {
6937                    minicartShadow.classList.remove('minicart__dropdown-shadow_active');
6938                }, 400);
6939            }
6940        })
6941    }
6942}); 
6943$(document).on('click', '.js-minicart-item-more', (e) => {
6944    e.preventDefault();
6945    const container = e.target.closest('.minicart-item__buttons')
6946    $(container).find('.js-minicart-item-more-dropdown').toggleClass('_active');
6947});
6948
6949$(document).on('click', (e) => {
6950    if (!e.target.classList.contains('js-minicart-item-more') && !e.target.closest('.minicart-item__buttons')) {
6951        $('.js-minicart-item-more-dropdown').removeClass('_active');
6952    }
6953});
6954
6955$('.a-cart__remove-all').on('click', () => {
6956    $('.a-cart__remove-all').hide();
6957    $('.js-minicart-item').hide();
6958    $('.js-delete-from-cart').click();
6959    $('.js-minicart-footer').hide();
6960}); 
6961$(document).ready(function () {
6962    let amountWrap = '.js-cart-amount-container',
6963        amountInput = '.js-minicart-amount-input';
6964
6965    // проводит все проверки введенного количества (num)
6966    // запрещается вписывать не кратное минимальному количеству
6967    // округляем в меньшую сторону, до допустимого кратнго значения (minAmount)
6968    // не больше чем есть на складе
6969    function prepareAmount(num, minAmount, maxAmount) {
6970        //console.log(num+','+ minAmount+','+  maxAmount);
6971        if (isNaN(num)) {
6972            num = 0;
6973        }
6974        if (isNaN(minAmount)) {
6975            minAmount = 0;
6976        }
6977        if (isNaN(minAmount)) {
6978            minAmount = 0;
6979        }
6980        if (num > 0 && num < minAmount) {
6981            num = minAmount;
6982        }
6983        if (num <= 0) {
6984            num = minAmount;
6985        }
6986        if (num >= maxAmount) {
6987            num = maxAmount;
6988        }
6989
6990        // если значение в поле больше минимально допустимого,
6991        // то вычисляем сколько раз в это значение входит минимально допустимое
6992        if (num > minAmount) {
6993            // точность после запятой
6994            let fix = 0;
6995            let str = minAmount.toString();
6996            if (str) {
6997                let val = str.split('.');
6998                if (val && val.length == 2) {
6999                    fix = val[1].length;
7000                }
7001            }
7002            let count = (num / minAmount).toFixed(fix);
7003            count = Math.floor(count);
7004            num = (count * minAmount).toFixed(fix);
7005        }
7006        return num;
7007    }
7008
7009    //увеличение количества товара (страница товара, миникарточка, корзина, страница заказа)
7010    $('body').on('click', '.js-minicart-amount-change-up', function () {
7011        let obj = $(this).parents(amountWrap).find(amountInput);
7012        let val = 1 * obj.val();
7013        let minAmount = obj.data('increment-count') != 0 ? obj.data('increment-count') : 1;
7014        let maxAmount = obj.data('max-count') > 0 ? obj.data('max-count') : 99999;
7015        val = val + minAmount;
7016        val = prepareAmount(val, minAmount, maxAmount);
7017        obj.val(val).trigger('change');
7018        return false;
7019    });
7020
7021    //уменьшение количества товара (страница товара, миникарточка, корзина, страница заказа)
7022    $(document.body).on('click', '.js-minicart-amount-change-down', function () {
7023        let obj = $(this).parents(amountWrap).find(amountInput);
7024        let val = 1 * obj.val();
7025        let minAmount = obj.data('increment-count') != 0 ? obj.data('increment-count') : 1;
7026        let maxAmount = obj.data('max-count') > 0 ? obj.data('max-count') : 99999;
7027
7028        val = val - minAmount;
7029        val = prepareAmount(val, minAmount, maxAmount);
7030        obj.val(val).trigger('change');
7031        return false;
7032    });
7033
7034    // Исключение ввода в поле выбора количества недопустимых значений. (страница товара, миникарточка, корзина, страница заказа)
7035    $(document.body).on('change', amountInput, function () {
7036        let obj = $(this);
7037        let val = 1 * obj.val();
7038        let minAmount = obj.data('increment-count') != 0 ? obj.data('increment-count') : 1;
7039        let maxAmount = obj.data('max-count') > 0 ? obj.data('max-count') : 99999;
7040
7041        obj.val(prepareAmount(val, minAmount, maxAmount));
7042        return false;
7043    });
7044
7045    const amountInputs = document.querySelectorAll(amountInput);
7046    for (const inputAmount of amountInputs) {
7047        inputAmount.addEventListener('keydown', (e) => {
7048            if (e.keyCode === 13) {
7049                e.preventDefault();
7050                let obj = e.target;
7051                let val = 1 * obj.value;
7052                let minAmount = obj.dataset.incrementCount != 0 ? obj.dataset.incrementCount : 1;
7053                let maxAmount = obj.dataset.maxCount > 0 ? obj.dataset.maxCount : 99999;
7054
7055                obj.value = prepareAmount(val, minAmount, maxAmount);
7056                return false;
7057            }
7058        });
7059    }
7060});
7061
7062$(document).ready(function () {
7063    var changeAmountBtnClass = '.js-minicart-amount-change',
7064        cartFormClass = '.js-minicart-form',
7065        changeAmountInputClass = '.js-minicart-amount-input';
7066
7067    // Пересчет цены и количества (используется в корзине и странице заказа)
7068    $('body').on('click', changeAmountBtnClass, function () {
7069        var request = '';
7070        const cartForms = document.querySelectorAll(cartFormClass);
7071        cartForms.forEach(item => {
7072            request += $(item).formSerialize() + '&';
7073        });
7074        var buttons = $(this).parent().find(changeAmountBtnClass);
7075        updateCartCount(request, buttons);
7076        buttons.prop('disabled', true).addClass('disabled');
7077        return false;
7078    });
7079    $('body').on('keydown', changeAmountInputClass, function () {
7080        if (event.key === 'Enter') {
7081            var count = $(this).val();
7082            var buttons = $(this).parent().find(changeAmountBtnClass);
7083            if (count == 0) {
7084                $(this).parents('tr').find('.js-delete-from-cart').trigger('click');
7085            } else {
7086                var request = '';
7087                const cartForms = document.querySelectorAll(cartFormClass);
7088                cartForms.forEach(item => {
7089                    request += $(item).formSerialize() + '&';
7090                });
7091                updateCartCount(request, buttons);
7092            }
7093            buttons.prop('disabled', true).addClass('disabled');
7094            return false;
7095        }
7096    });
7097
7098    // ввод количества покупаемого товара в корзине, пересчет корзины (используется в корзине и странице заказа)
7099    $('body').on('blur', changeAmountInputClass, function () {
7100        var count = $(this).val();
7101        var buttons = $(this).parent().find(changeAmountBtnClass);
7102        if (count == 0) {
7103            $(this).parents('tr').find('.js-delete-from-cart').trigger('click');
7104        } else {
7105            var request = '';
7106            const cartForms = document.querySelectorAll(cartFormClass);
7107            cartForms.forEach(item => {
7108                request += $(item).formSerialize() + '&';
7109            });
7110            updateCartCount(request, buttons);
7111        }
7112        buttons.prop('disabled', true).addClass('disabled');
7113        return false;
7114    });
7115});
7116
7117
7118// функция пересчёта корзины при изменении количества товаров (используется в корзине и странице заказа)
7119function updateCartCount(request, buttons) {
7120    if (typeof storage == 'undefined') {
7121        window.storage = {
7122            counterToChangeCountProduct: 0,
7123            changeNameButtonOrder: false,
7124        };
7125    }
7126    storage.counterToChangeCountProduct++;
7127    storage.changeNameButtonOrder = true;
7128
7129    setTimeout(function () {
7130        if (storage.changeNameButtonOrder) {
7131            $('[name=toOrder]').val(locale.waitCalc);
7132            storage.changeNameButtonOrder = false;
7133        }
7134    }, 500);
7135
7136    $.ajax({
7137        type: "POST",
7138        url: mgBaseDir + "/cart",
7139        data: "refresh=1&count_change=1&" + request,
7140        dataType: "json",
7141        cache: false,
7142        success: function (response) {
7143            if (response.deliv && response.curr) {
7144                var i = 0;
7145                response.deliv.forEach(function (element, index, arr) {
7146                    $('.delivery-details-list li:eq(' + i + ') .deliveryPrice').html('&nbsp;' + element);
7147                    if ($('.delivery-details-list input[type=radio]:eq(' + i + ')').is(':checked')) {
7148                        if (element == 0) {
7149                            $('.summ-info .delivery-summ').html('');
7150                        } else {
7151                            $('.summ-info .delivery-summ').html(locale.deliveryInformation + ' <span class="order-delivery-summ">' + element + ' ' + response.curr + '</span>');
7152                        }
7153                    }
7154                    i++;
7155                });
7156            }
7157            storage.counterToChangeCountProduct--;
7158            if (storage.counterToChangeCountProduct == 0) {
7159                $('[name=toOrder]').val(locale.checkout);
7160                storage.changeNameButtonOrder = false;
7161            }
7162            if (response.data) {
7163                response.data.dataCart.forEach(function (element, index, arr) {
7164                    var varBlock = '';
7165                    if (parseInt(element.variantId) > 0) {
7166                        varBlock = '[data-variant=' + (element.variantId) + ']';
7167                    }
7168                    let elementSelector = '.deleteItemFromCart[data-delete-item-id=' + element.id + ']';
7169                    if (element.property) {
7170                        elementSelector += '[data-property=' + element.property + ']';
7171                    }
7172
7173                    var tr = $(elementSelector + varBlock).closest('article');
7174                    if (tr.length) {
7175                        const price = new Intl.NumberFormat('ru-RU').format(
7176                            element.price,
7177                        )
7178                        tr.find('.js-smallCartAmount').text(element.countInCart);
7179                        tr.find('.js-cartPrice').text(element.priceInCart);
7180                        tr.find('.cart-item__price-one').text(price + ' ' + window.currency);
7181                        tr.find('.minicart-item__price-one').text(price + ' ' + window.currency);
7182                        if (Number(tr.find('.cart_form input[name="item_' + element.id + '[]"]').val()) >= Number(element.count) && Number(element.count) != -1) {
7183                            tr.find('.cart_form .maxCount').detach();
7184                            tr.find('.cart_form').append('<span class="maxCount" style="display:block;text-align:center;">' + locale.MAX + ': ' + element.count + '</span>');
7185                            tr.find('.cart_form input[name="item_' + element.id + '[]"]').data('max-count', element.count);
7186                        } else {
7187                            tr.find('.cart_form .maxCount').detach();
7188                        }
7189                    }
7190                    $(elementSelector + varBlock).closest('article').find('.js-minicart-amount-input').val(element.countInCart);
7191                    $(elementSelector + varBlock).closest('article').find('.js-amount-input').val(element.countInCart);
7192                });
7193                $('.total .total-sum span').text(response.data.cart_price_wc);
7194                $('.pricesht').text(response.data.cart_price);
7195                $('.countsht').text(response.data.cart_count);
7196                $('.cart-wrapper .total-sum strong').text(response.data.cart_price_wc);
7197            }
7198            buttons.prop('disabled', false).removeClass('disabled');
7199            $('.payment-details-list input:checked').click();
7200
7201            // Обновляем полную стоимость, если мы на странице оформления заказа
7202            if (window.location.pathname.indexOf('/order') !== -1) {
7203                //window.cart.updateFullPrice($('.order-delivery-summ').text());
7204                $('.total-sum strong').text(response.data.cart_price_wc);
7205                $('.a-cart-table__image-counter').each((index, item) => {
7206                    $(item).text(response.data.cart[index].count);
7207                })
7208            }
7209        }
7210    });
7211}
7212 
7213const megaMenuList = $('.menu-cat .menu-cat__item');
7214const megaMenuItems = $('.menu-cat .mega-menu');
7215
7216megaMenuList.on('mouseenter', function (e) {
7217  megaMenuItems.removeClass('open');
7218  if (this.classList.contains('menu-cat__item_mega')) {
7219    const idCat = $(this).attr('data-id-cat');
7220    $('.menu-cat .mega-menu[data-id-cat="' + idCat + '"]').addClass('open');
7221  }
7222}) 
7223$('.js-m-phone-btn').on('click', () => {
7224    $('.js-m-phone-shadow').addClass('_active');
7225});
7226$('.js-m-phone-shadow').on('click', (e) => {
7227    if (e.target.classList.contains('js-m-phone-shadow')) {
7228        $('.js-m-phone-shadow').removeClass('_active');
7229    }
7230})
7231$('.js-phone-btn-close').on('click', () => {
7232    $('.js-m-phone-shadow').removeClass('_active');
7233}); 
7234$('.js-menu-pages-back').on('click', (e) => {
7235    let container = $(e.target).closest('.main-menu__dropdown-item');
7236    if (container.length == 0) {
7237        container = $(e.target).closest('.main-menu__item');
7238    }
7239
7240    let dropdown = container.find('.dropdown__container');
7241
7242    if (dropdown.length == 0) {
7243        dropdown = container.find('.js-sub-dropdown');
7244    }
7245    dropdown.removeClass('_active');
7246});
7247
7248$('.js-main-menu-child-btn').on('click', (e) => {
7249    let container = $(e.target).closest('.main-menu__dropdown-item');
7250    if (container.length == 0) {
7251        container = $(e.target).closest('.main-menu__item');
7252    }
7253
7254    let dropdown = container.find('.dropdown__container');
7255
7256    if (dropdown.length == 0) {
7257        dropdown = container.find('.js-sub-dropdown');
7258    }
7259    dropdown.addClass('_active');
7260});
7261
7262$('.js-m-header-close').on('click', () => {
7263    $('.m-header-menu').removeClass('_active');
7264});
7265
7266$('.js-header-mobile-menu-open').on('click', () => {
7267    $('.m-header-menu').addClass('_active');
7268});
7269
7270$('.js-m-currency-btn').on('click', () => {
7271    $('.js-m-currency-shadow').addClass('_active');
7272});
7273$('.js-m-currency-shadow').on('click', (e) => {
7274    if (e.target.classList.contains('js-m-currency-shadow')) {
7275        $('.js-m-currency-shadow').removeClass('_active');
7276    }
7277})
7278$('.js-currency-btn-close').on('click', () => {
7279    $('.js-m-currency-shadow').removeClass('_active');
7280});
7281
7282$('.js-m-lang-btn').on('click', () => {
7283    $('.js-m-lang-shadow').addClass('_active');
7284});
7285$('.js-m-lang-shadow').on('click', (e) => {
7286    if (e.target.classList.contains('js-m-lang-shadow')) {
7287        $('.js-m-lang-shadow').removeClass('_active');
7288    }
7289})
7290$('.js-lang-btn-close').on('click', () => {
7291    $('.js-m-lang-shadow').removeClass('_active');
7292}); 
7293
7294$('.js-header-sticky-search').on('click', () => {
7295    $('.mobile-search').addClass('_active');
7296    setTimeout(() => {
7297        document.querySelector('.c-search__form input').focus();
7298    }, 300);
7299});
7300
7301$('.js-mobile-search-close').on('click', () => {
7302    $('.mobile-search').removeClass('_active');
7303}); 
7304const onClickNextCategories = (e) => {
7305    e.target.closest('.catalog-mobile__item').querySelector('.catalog-mobile').classList.add('_active');
7306}
7307
7308const onClickBackCategories = (e) => {
7309    e.target.closest('.catalog-mobile').classList.remove('_active');
7310}
7311
7312const createCategoryMenu = (categoriesArray, linkCategory, titleCategory) => {
7313    const container = document.querySelector('#mobile-catalog__container').content.cloneNode(true);
7314    const title = container.querySelector('.catalog-mobile__title');
7315    const content = container.querySelector('.catalog-mobile__content');
7316    const btnBack = container.querySelector('.js-mobile-catalog-back');
7317    btnBack.addEventListener('click', onClickBackCategories);
7318    title.href = linkCategory;
7319    title.textContent = titleCategory;
7320    categoriesArray = Array.from(categoriesArray);
7321    categoriesArray.forEach( element => {
7322        if (element.invisible == '1' || element.activity == '0') {
7323            return;
7324        } 
7325        let item = document.querySelector('#mobile-catalog__item').content.cloneNode(true);
7326        const tempElement = document.createElement('div');
7327        tempElement.append(item);
7328        item = tempElement.querySelector('.catalog-mobile__item'); 
7329        const itemLink = tempElement.querySelector('.catalog-mobile__link');
7330        itemLink.href = element.link;
7331        if (itemLink.dataset.count == 'true') {
7332            itemLink.textContent = element.menu_title ? element.menu_title : element.title + ' (' + element.countProduct + ')';
7333        } else {
7334            itemLink.textContent = element.menu_title ? element.menu_title : element.title;
7335        }
7336        if (element.child) {
7337            const buttton = document.querySelector('#mobile-catalog__button-next').content.cloneNode(true);
7338            item.append(buttton);
7339            item.querySelector('.js-catalog-mobile-next').addEventListener('click', onClickNextCategories);
7340            item.append(createCategoryMenu(element.child, element.link, itemLink.textContent));
7341        }
7342
7343        content.append(item);
7344    });
7345    return container;
7346}
7347
7348$('.js-catalog-mobile-next').on('click', (e) => {
7349    e.preventDefault();
7350    const loaded = e.target.closest('.loaded'); 
7351    const load = e.target.closest('.load'); 
7352    if (loaded) return;
7353    if (load) {
7354        e.target.closest('.catalog-mobile__item').querySelector('.catalog-mobile').classList.add('_active');
7355        return;
7356    }
7357    const item = e.target.closest('.catalog-mobile__item');
7358    item.classList.add('loaded');
7359    const link = item.querySelector('.catalog-mobile__link').href;
7360    const title = item.querySelector('.catalog-mobile__link').textContent;
7361    $.ajax({
7362        type: "POST",
7363        url: "ajax",
7364        data: {
7365            action: "getCategory",
7366            actionerClass: "Ajaxuser",
7367            id: item.dataset.id
7368        },
7369        dataType: "json",
7370        cache: false,
7371        success: function (data) {
7372            item.append(createCategoryMenu(data, link, title));
7373            item.classList.remove('loaded');
7374            item.classList.add('load');
7375            e.target.closest('.catalog-mobile__item').querySelector('.catalog-mobile').classList.add('_active');
7376        }
7377    });
7378});
7379const openMenuCategories = document.querySelector('.js-header-sticky-catalog');
7380openMenuCategories.addEventListener('click', () => {
7381    const catalogMobile = document.querySelector('.catalog-mobile');
7382    catalogMobile.classList.add('_active');
7383});
7384const closeBtnCategories = document.querySelector('.js-mobile-catalog-back');
7385closeBtnCategories.addEventListener('click', (e) => {
7386    e.target.closest('.catalog-mobile').classList.remove('_active');
7387}) 
7388$(document).ready(() => {
7389    const body = document.querySelector('body');
7390    let scrollPosition = 0;
7391    document.addEventListener('scroll', (e) => {
7392        if (scrollPosition < $(window).scrollTop()) {
7393            scrollPosition = $(window).scrollTop();
7394            body.classList.remove('sticky-open');
7395        } else {
7396            body.classList.add('sticky-open');
7397            scrollPosition = $(window).scrollTop();
7398        }
7399    })
7400}); 
7401"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}var Spoiler=function(){function t(e){_classCallCheck(this,t),this._spoiler=e,this._spoilerTitle=this._spoiler.querySelector(".spoiler-title"),this._spoilerContent=this._spoiler.querySelector(".spoiler-content"),this._spolierIsClosed=!0}return _createClass(t,[{key:"init",value:function(){this._spoilerTitle.addEventListener("click",this._slideToggleSpoilerContent.bind(this))}},{key:"_slideToggleSpoilerContent",value:function(){var e;this._spolierIsClosed?(this._spoilerContent.style.display="block",e=this._spoilerContent.scrollHeight,this._spoilerContent.style.height="".concat(e,"px"),this._spolierIsClosed=!1):(this._spoilerContent.style.height=0,this._spolierIsClosed=!0)}}]),t}();document.querySelectorAll(".spoiler").forEach(function(e){return new Spoiler(e).init()});
7402 
7403/**
7404 *  Добавляет слушатель по клику который открывает выпадающее меню в футере при ширине меньше переданной.
7405 *  Класс кнопки: js-footer-btn, класс выпадающего меню js-footer-dropdown.
7406 *  При клике добавляется класс footer__title_active для стилей.
7407 * @param {Array} footerColumns - массив колонок 
7408 * @param {Number} maxWidth - ширина окна
7409 * @returns 
7410 */
7411
7412const footerAddDropdown = (footerColumns, maxWidth) => {
7413    if (!footerColumns || footerColumns.length < 1) {
7414        return;
7415    }
7416    footerColumns.forEach((elem) => {
7417        elem.addEventListener('click', (e) => {
7418            const footerButton = e.target.closest('.js-footer-btn');
7419            const footerDropdown = elem.querySelector('.js-footer-dropdown');
7420            const windowWidth  = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
7421            if (!footerButton || windowWidth > maxWidth) {
7422                return;
7423            }
7424            footerButton.classList.toggle('footer__title_acitve');
7425            $(footerDropdown).slideToggle();
7426        })
7427    })
7428};
7429
7430$(document).ready(function() {
7431    const footerColumns = document.querySelectorAll('.js-footer-column');
7432    footerAddDropdown(footerColumns, 767);
7433    $(window).resize(() => {
7434        const windowWidth  = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
7435        const dropdown = $('.js-footer-dropdown');
7436        const footerButton =  $('.js-footer-btn');
7437        if (windowWidth > 767) {
7438            dropdown.slideDown();
7439            footerButton.removeClass('footer__title_acitve');
7440            return;
7441        }
7442        dropdown.slideUp();
7443        footerButton.removeClass('footer__title_acitve');
7444    })
7445})
7446 
7447
7448$('.js-back-ring').append($('.wrapper-back-ring').find('button')); 
7449'use strict';
7450
7451const authPopupClose = document.querySelector('.js-popup-auth-close');
7452const authPopup = document.querySelector('.js-auth-popup');
7453const authPopupOpen = $('.js-login-btn');
7454if (authPopupOpen.length != 0) {
7455  authPopup.addEventListener('click', (e) => {
7456    if (e.target.classList.contains('js-auth-popup')) {
7457      authPopup.classList.add('hidden');
7458      document.querySelector('body').classList.remove('overlay-mode');
7459    }
7460  });
7461  window.addEventListener('keydown', (e) => {
7462    if (e.code == "Escape") {
7463      authPopup.classList.add('hidden');
7464      document.querySelector('body').classList.remove('overlay-mode');
7465    }
7466  });
7467
7468  authPopupOpen.on('click', evt => {
7469    evt.preventDefault();
7470    authPopup.classList.remove('hidden');
7471    document.querySelector('body').classList.add('overlay-mode');
7472  });
7473  authPopupClose.addEventListener('click', () => {
7474    authPopup.classList.add('hidden');
7475    document.querySelector('body').classList.remove('overlay-mode');
7476  });
7477} 
7478 
7479// Polyfill for css vars
7480cssVars();
7481const transitionBlocks = (className) => {
7482    const transitionItems = document.querySelectorAll(className);
7483    const transitionBlock = (item, target, width) => {
7484        const windowWidth = window.innerWidth;
7485        if (windowWidth <= width) {
7486            if (item.dataset.mobile === 'false') {
7487                item.dataset.mobile = 'true';
7488                item.dataset.transition = 'false';
7489            } else {
7490                item.dataset.transition = 'true';
7491            }
7492        } else {
7493            if (item.dataset.mobile === 'true') {
7494                item.dataset.mobile = 'false';
7495                item.dataset.transition = 'false';
7496            } else {
7497                item.dataset.transition = 'true';
7498            }
7499        }
7500        if (item.dataset.transition === 'true') {
7501            return;
7502        }
7503        const targetBlock = document.querySelector(target);
7504        if (item.dataset.mobile === 'true') {
7505            if (!item.children[0]) return;
7506            targetBlock.append(item.children[0]);
7507            item.dataset.transition = 'true';
7508            return;
7509        }
7510        item.dataset.transition = 'true';
7511        if (!targetBlock.children[0]) return;
7512        item.append(targetBlock.children[0]);
7513    }
7514
7515    transitionItems.forEach((item) => {
7516        const width = item.dataset.width;
7517        const target = item.dataset.target;
7518
7519        transitionBlock(item, target, width);
7520        item.classList.remove('hidden');
7521    });
7522
7523    $('body').on('click', '.js-show-pass', function (e) {
7524        e.preventDefault();
7525        let input = $(this).closest('.js-show-pass-container').find('input');
7526        let attr = $(input).attr('type');
7527        if (attr == 'password') {
7528            $(this).find('svg use').attr('xlink:href', '#eye-close-icon');
7529            $(input).attr('type', 'text');
7530        } else {
7531            $(this).find('svg use').attr('xlink:href', '#eye-icon');
7532            $(input).attr('type', 'password');
7533        }
7534    });
7535
7536    $(document).ready(function() {
7537        $(window).resize(() => {
7538            clearTimeout(window.localStorage.getItem('timer'));
7539            window.localStorage.setItem('timer', setTimeout(() => {
7540                transitionItems.forEach((item) => {
7541                    const width = item.dataset.width;
7542                    const target = item.dataset.target;
7543                    transitionBlock(item, target, width);
7544                })
7545            }, 1000))
7546        });
7547    });
7548}
7549
7550var ButtonInCartModule = (function() {
7551	return {
7552		init: function() { 
7553
7554			ButtonInCartModule.inCartText = locale.inCartText;
7555
7556			var initialBuyButton = locale.buyBtn;
7557
7558			$('.deleteItemFromCart').each(function(index,element) {
7559                if ($('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').closest('.js-product-form').find('.variants-table').length != 0){
7560                    if ($('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').closest('.js-product-form').find('.variants-table input[value='+ $(this).data('variant') +']:checked').length != 0) {
7561                        $('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').addClass('alreadyInCart').find('.a-button__title').text(ButtonInCartModule.inCartText);
7562                    }
7563                } else {
7564                    $('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').addClass('alreadyInCart').find('.a-button__title').text(ButtonInCartModule.inCartText);
7565                }
7566			});
7567
7568            $(document.body).on('change', '.block-variants input[type=radio]', function (e) {
7569                const btnAdd =  $(this).closest('.js-product-form').find('.addToCart');
7570                if (btnAdd.hasClass('product-info')) return;
7571                if ($('.deleteItemFromCart[data-variant=' + $(this).val() + '][data-delete-item-id=' + btnAdd.data('item-id') + ']').length !=0) {
7572                    btnAdd.addClass('alreadyInCart').find('.a-button__title').text(ButtonInCartModule.inCartText);
7573                } else {
7574                    btnAdd.removeClass('alreadyInCart').find('.a-button__title').text(initialBuyButton);
7575                }
7576            });
7577
7578			$('body').on('click', '.addToCart', function() {
7579                if ($(this).hasClass('product-info')) return;
7580				$(this).addClass('alreadyInCart').find('.a-button__title').text(ButtonInCartModule.inCartText);
7581			});
7582
7583			$('body').on('click', '.deleteItemFromCart', function() {
7584                if ($('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').closest('.js-product-form').find('.variants-table').length != 0) {
7585                    if ($('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').closest('.js-product-form').find('.variants-table input[value='+ $(this).data('variant') +']:checked').length != 0) {
7586                        $('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').removeClass('alreadyInCart').find('.a-button__title').text(initialBuyButton);
7587                    }
7588                } else {
7589                    $('.addToCart[data-item-id='+$(this).data('delete-item-id')+']').removeClass('alreadyInCart').find('.a-button__title').text(initialBuyButton);
7590                }
7591			});
7592		},
7593	};
7594})();
7595$(document).ready(function() {
7596	ButtonInCartModule.init();
7597});
7598
7599$(document).ready(function() {
7600
7601    // меняем текст плагина "Хочу скидку" на иконку
7602    // ------------------------------------------------------------
7603    $('.card .btn.addToWishList').html('<svg class=""><use xlink:href="#discount_icon"></use></svg>');
7604
7605    // add active link
7606    // ------------------------------------------------------------
7607    $('nav a').each(function() {
7608        var location = window.location.href;
7609        var link = this.href;
7610        if (location == link) {
7611            $(this).addClass('active');
7612        }
7613    });
7614
7615    // plugin "slider-action"
7616    // ------------------------------------------------------------
7617    $(document).ready(function() {
7618        $('.m-p-slider-wrapper').addClass('show');
7619    });
7620    
7621    // plugin "product-slider"
7622    // ------------------------------------------------------------
7623    $(document).ready(function() {
7624        $('.mg-advise').addClass('mg-advise--active');
7625    });
7626    
7627    $('.spoiler-title').on('click', function() {
7628        $(this).parents('.spoiler').toggleClass('_active');
7629    });
7630
7631    // agreement
7632    // ------------------------------------------------------------
7633    $('.l-body').on('change', '[type="checkbox"]', function() {
7634        if ($(this).prop('checked')) {
7635            $(this).closest('label').removeClass('nonactive').addClass('active');
7636        } else {
7637            $(this).closest('label').removeClass('active').addClass('nonactive');
7638        }
7639    });
7640    
7641    // op-field-check
7642    // ------------------------------------------------------------
7643    $('.l-body').on('change', '.op-field-check [type="radio"]', function() {
7644        $('.op-field-check [name=' + $(this).attr('name') + ']').closest('label').removeClass('active').addClass('nonactive');
7645        if ($(this).prop('checked')) {
7646            $(this).closest('label').removeClass('nonactive').addClass('active');
7647        } else {
7648            $(this).closest('label').removeClass('active').addClass('nonactive');
7649        }
7650    });
7651
7652    // order
7653    // ------------------------------------------------------------
7654    $('.c-order__checkbox label').on('click', function() {
7655        if ($(this).children('[type="checkbox"]').is(':checked')) {
7656            $(this).removeClass('nonactive').addClass('active');
7657        } else {
7658            $(this).removeClass('active').addClass('nonactive');
7659        }
7660    });
7661    $('.c-order__radiobutton label, .order-storage label').on('click', function() {
7662        if ($(this).children('[type="radio"]').is(':checked')) {
7663            $(this).removeClass('nonactive').addClass('active');
7664            $(this).siblings('label').removeClass('active');
7665        }
7666    });
7667
7668    //эмуляция радиокнопок в форме характеристик продукта (страница товара, миникарточка, корзина, страница заказа)
7669    var form = $('.js-product-form');
7670    $(form).on('change', '[type=radio]', function() {
7671        $(this).parents('p').find('input[type=radio]').prop('checked', false);
7672        $(this).prop('checked', true);
7673        $(this).parents('p').find('label').removeClass('active');
7674        if ($(this).parents('p').length) {
7675            $(this).parent().addClass('active');
7676        }
7677    });
7678
7679    //эмуляция чекбоксов в форме характеристик продукта (страница товара, миникарточка, корзина, страница заказа)
7680    $(form).on('change', '[type=checkbox]', function() {
7681        $(this).parent().toggleClass('active');
7682    });
7683    $('.accordeon__btn').on('click', function() {
7684        $(this).closest('.accordeon').toggleClass('active');
7685        $(this).closest('.accordeon').find('.accordeon__dropdown').slideToggle();
7686    });
7687    if ($('body .admin-bar').length > 0) {
7688        $('.m-header-menu').css('top', 70);
7689        $('.catalog-mobile').css('top', 70);
7690        $('.mobile-search').css('top', 70);
7691    }
7692
7693}); // end ready
7694transitionBlocks('.js-transition-item');
7695$('input, textarea').each(function() {
7696    var $elem = $(this);
7697    if ($elem.attr('placeholder') && !$elem[0].placeholder) {
7698        var $label = $('<label class="placeholder"></label>').text($elem.attr('placeholder'));
7699        $elem.before($label);
7700        $elem.blur();
7701        if ($elem.val() === '') {
7702            $label.addClass('visible');
7703        }
7704        $label.click(function() {
7705            $label.removeClass('visible');
7706            $elem.focus();
7707        });
7708        $elem.focus(function() {
7709            if ($elem.val() === '') {
7710                $label.removeClass('visible');
7711            }
7712        });
7713        $elem.blur(function() {
7714            if ($elem.val() === '') {
7715                $label.addClass('visible');
7716            }
7717        });
7718    }
7719});

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