PageSourceSearch

https://paperpal.com/blog/wp-content/themes/soledad/js/main.js?ver=8.7.6

js paperpal.com collected 2026-09-24 08:48:22 UTC 135,814 bytes, 4,039 lines download raw bytes

1/* Debounce */
2(
3  function (b, c) {
4    var $ = b.jQuery || b.Cowboy || (
5      b.Cowboy = {}
6    ), a
7    $.throttle = a = function (e, f, j, i) {
8      var h, d = 0
9      if (typeof f !== 'boolean') {
10        i = j
11        j = f
12        f = c
13      }
14
15      function g () {
16        var o = this, m = +new Date() - d, n = arguments
17
18        function l () {
19          d = +new Date()
20          j.apply(o, n)
21        }
22
23        function k () {
24          h = c
25        }
26
27        if (i && !h) {
28          l()
29        }
30        h && clearTimeout(h)
31        if (i === c && m > e) {
32          l()
33        } else {
34          if (f !== true) {
35            h = setTimeout(i ? k : l, i === c ? e - m : e)
36          }
37        }
38      }
39
40      if ($.guid) {
41        g.guid = j.guid = j.guid || $.guid++
42      }
43      return g
44    }
45    $.debounce = function (d, e, f) {
46      return f === c ? a(d, e, false) : a(d, f, e !== false)
47    }
48  }
49)(this);
50
51/* global PENCILOCALIZE */
52(
53  function ($) {
54    'use strict'
55    var PENCI = PENCI || {}
56
57    /* General functions
58 ---------------------------------------------------------------*/
59    PENCI.animatesearch = function (elems, placeholders) {
60      elems.each(function () {
61        let elem = $(this);
62        let current = 0;
63        let typing, erasing;
64        let stopped = false;
65    
66        function changePlaceholder() {
67          if (stopped) return;
68          elem.attr("placeholder", "");
69          let text = placeholders[current];
70          let i = 0;
71    
72          typing = setInterval(function () {
73            elem.attr("placeholder", text.substring(0, i + 1));
74            i++;
75            if (i === text.length) {
76              clearInterval(typing);
77              setTimeout(erasePlaceholder, 1500);
78            }
79          }, 100);
80        }
81    
82        function erasePlaceholder() {
83          if (stopped) return;
84          let text = placeholders[current];
85          let i = text.length;
86    
87          erasing = setInterval(function () {
88            elem.attr("placeholder", text.substring(0, i - 1));
89            i--;
90            if (i === 0) {
91              clearInterval(erasing);
92              current = (current + 1) % placeholders.length;
93              setTimeout(changePlaceholder, 500);
94            }
95          }, 50);
96        }
97    
98        changePlaceholder();
99      });
100    }
101    
102    PENCI.general = function () {
103      $('body').removeClass('penci-no-js');
104      // Top search
105      $('.pcheader-icon a.search-click').on('click', function (e) {
106        var $this = $(this),
107          $body = $('body'),
108          $container = $this.closest('.container')
109
110        $('body').find('.search-input').removeClass('active')
111        $container.find('.search-input').toggleClass('active')
112
113        if ($body.find('.header-search-style-overlay').length || $body.find('.header-search-style-showup').length || $body.find('.header-search-style-popup').length ) {
114          $container.find('.show-search').toggleClass('active')
115        } else {
116          $this.next().fadeToggle()
117        }
118
119        var opentimeout = setTimeout(function () {
120          var element = document.querySelector('.search-input.active')
121          if (element !== null) {
122            element.focus({
123              preventScroll: true,
124            })
125          }
126        }, 200, function () {
127          clearTimeout(opentimeout)
128        })
129
130        $body.addClass('search-open')
131        e.preventDefault()
132        e.stopPropagation()
133        return false
134      })
135
136      $('.pcheader-icon .close-search, .pc-search-popup-overlay').on('click', function (e) {
137
138        if ($('body').find('.header-search-style-overlay').length ||
139          $('body').find('.header-search-style-popup').length ||
140          $('body').find('.header-search-style-showup').length) {
141          $('body').find('.show-search').each(function () {
142            $(this).removeClass('active')
143          })
144        } else {
145          $(this).closest('.show-search').fadeToggle()
146        }
147        $('body').removeClass('search-open')
148        $('body').find('.search-input').each(function () {
149          $(this).removeClass('active')
150        })
151        return false
152      })
153
154      $(document).keyup(function (e) {
155        var bd = $('body')
156        if (e.key === 'Escape' && ( bd.hasClass('pchds-overlay') || bd.hasClass('pchds-popup') ) &&
157          bd.hasClass('search-open')) {
158          bd.removeClass('search-open')
159          if ($('body').find('.header-search-style-overlay').length ||
160          $('body').find('.header-search-style-popup').length || 
161            $('body').find('.header-search-style-showup').length) {
162            $('body').find('.show-search').each(function () {
163              $(this).removeClass('active')
164            })
165          } else {
166            $('body').find('.show-search').fadeToggle()
167          }
168          $('body').find('.search-input, .show-search').each(function () {
169            $(this).removeClass('active')
170          })
171        }
172        return false
173      })
174
175      // Go to top
176      $('.go-to-top, .penci-go-to-top-floating').on('click', function () {
177        $('html, body').animate({ scrollTop: 0 }, 700)
178        return false
179      })
180
181      // Go to top button
182      var $goto_button = $('.penci-go-to-top-floating')
183      if ($goto_button.length) {
184        $(document).on('scroll', $.debounce(200, function () {
185          var y = $(this).scrollTop()
186          if (y > 300) {
187            $goto_button.addClass('show-up')
188            $('body').addClass('penci-gtt-enable')
189          } else {
190            $goto_button.removeClass('show-up')
191            $('body').removeClass('penci-gtt-enable')
192          }
193        }))
194      }
195
196      // Call back fitvid when click load more button on buddypress
197      $('body.buddypress .activity .load-more a').on('click', function () {
198        $(document).ajaxStop(function () {
199          $('.container').fitVids({ ignore: '.penci-sticky-video' })
200        })
201      })
202
203      $(document).on('click', '.menu-item-has-anchor a[href^="#"]', function (e) {
204        e.preventDefault();
205        $('body').removeClass('open-sidebar-nav penci-menuhbg-open open-mobile-builder-sidebar-nav');
206
207        const href = $(this).attr('href');
208        const $target = $(href);
209        if (!$target.length) {
210          console.error('Target element not found for:', href);
211          return;
212        }
213        const offset = -120;
214        const targetOffset = $target.offset().top;
215        $('html, body').animate({ scrollTop: targetOffset + offset }, 600);
216      });
217
218      if ( ajax_var_more.search_multi ) {
219        PENCI.animatesearch(
220          $('input.search-input, input.wp-block-search__input'),
221          ajax_var_more.search_multi_txt
222        );
223      }
224
225      $('.penci-arfilter-item').on('change', function (e) {
226        var form = $(this).closest('form')
227        form.submit()
228      })
229
230      $(document).on('click', '.pcauthor-tabs', function (e) {
231        e.preventDefault()
232
233        if ($(this).hasClass('active')) {
234          return
235        }
236
237        var tab = $(this).attr('data-tab'),
238          wrapper = $(this).closest('.post-author')
239
240        wrapper.find('.author-tab-content').removeClass('active')
241        wrapper.find('.pcauthor-tabs').removeClass('active')
242        wrapper.find('#' + tab).addClass('active')
243        $(this).addClass('active')
244      })
245
246      $(document).
247        on('click', '.penci-category-description-button a', function (e) {
248          e.preventDefault()
249          $(this).closest('.penci-category-description').toggleClass('active')
250        })
251
252      $(document).on('click', '.penci-wuser-gps', function (e) {
253        e.preventDefault()
254        var t = $(this),
255          parent = t.closest('.penci-weather-widget'),
256          id = parent.attr('data-id'),
257          forecast_days = parent.attr('data-forecast_days'),
258          units = parent.attr('data-units')
259
260        parent.addClass('loading')
261
262        $.ajax({
263          type: 'GET',
264          url: ajax_var_more.url,
265          data: {
266            action: 'penci_get_weather_loc',
267            id: id,
268            forecast_days: forecast_days,
269            units: units,
270          },
271          success: function (response) {
272            var z = response.data.html,
273              v = $(z).html()
274            parent.html(v)
275            parent.removeClass('loading')
276          },
277        })
278      })
279
280      $(document).on('click','.pc-comment-s1-button a',function(e) {
281        e.preventDefault()
282        $('.pc-comment-s1').toggleClass('active')
283      })
284      
285      $(document).on('click','.new-ver-share.post-share-link',function(e) {
286        e.preventDefault()
287        var link = $(this).attr('href');
288        navigator.clipboard.writeText(link);
289      })
290
291      $(document).on('click','.penci_cmrm',function(e){
292        e.preventDefault()
293        $(this).closest('.comment-text').addClass('showfull')
294        $(this).remove()
295      })
296
297      $(document).on('click','.penci-mtp-filters-mobile',function(e){
298        e.preventDefault()
299        $(this).addClass('active')
300        $('.penci-mtp-filters-main').addClass('active')
301        $('.penci-mtp-filters-close').addClass('active')
302      })
303
304      $(document).on('click','.penci-mtp-filters-close',function(e){
305        e.preventDefault()
306        $(this).removeClass('active')
307        $('.penci-mtp-filters-mobile').removeClass('active')
308        $('.penci-mtp-filters-main').removeClass('active')
309      })
310
311      $(document).on('click','.penci-post-share-box-btn',function(e){
312        e.preventDefault()
313        var t = $(this).closest('.list-post-3')
314        t.find('.penci-post-box-meta').toggleClass('active')
315      })
316      
317      $(document).on('click','.penci-bmca',function(e){
318        e.preventDefault()
319        var t = $(this).closest('.penci-sg-cth')
320        t.addClass('show-full')
321        $(this).remove()
322      })
323
324      $(document).on('click tap', '.item-content', function() {
325        var link = $(this).attr("data-excerpt-link");
326        if (link) {
327            window.location.href = link;
328        }
329      });
330
331      $('.menu-item-has-children, .penci-mega-menu').on('mouseenter', function () {
332        if ($('body').hasClass('penci-hsubmenu-overlay')) {
333          $('body').addClass('menu-hover');
334        }
335      });
336      
337      $('.menu-item-has-children, .penci-mega-menu').on('mouseleave', function () {
338        if ($('body').hasClass('penci-hsubmenu-overlay')) {
339          $('body').removeClass('menu-hover');
340        }
341      });      
342
343      return false
344    }
345
346    PENCI.rdatetime = function () {
347      function formatDate(date, format, locale = 'en-US') {
348        const map = {
349            'd': ('0' + date.getDate()).slice(-2),           // Day of the month (01 to 31)
350            'D': date.toLocaleDateString(locale, { weekday: 'short' }),  // Short textual day
351            'j': date.getDate(),                             // Day of the month (1 to 31)
352            'l': date.toLocaleDateString(locale, { weekday: 'long' }),   // Full textual day
353            'F': date.toLocaleDateString(locale, { month: 'long' }),     // Full textual month
354            'm': ('0' + (date.getMonth() + 1)).slice(-2),    // Month (01 to 12)
355            'M': date.toLocaleDateString(locale, { month: 'short' }),    // Short month (Jan, Feb)
356            'n': date.getMonth() + 1,                        // Month without leading zeros (1 to 12)
357            'Y': date.getFullYear(),                         // Full year (2024)
358            'y': ('' + date.getFullYear()).slice(-2),        // Short year (24)
359            'H': ('0' + date.getHours()).slice(-2),          // 24-hour format (00 to 23)
360            'h': ('0' + (date.getHours() % 12 || 12)).slice(-2),  // 12-hour format (01 to 12)
361            'i': ('0' + date.getMinutes()).slice(-2),        // Minutes (00 to 59)
362            's': ('0' + date.getSeconds()).slice(-2),        // Seconds (00 to 59)
363            'a': date.getHours() < 12 ? 'am' : 'pm',         // am/pm lowercase
364            'A': date.getHours() < 12 ? 'AM' : 'PM',         // AM/PM uppercase
365        };
366
367        return format.replace(/[a-zA-Z]/g, function(match) {
368            return map[match] !== undefined ? map[match] : match;
369        });
370      }
371
372      function applyRealTimeDate() {
373        const locale = document.documentElement.lang || 'en-US';
374
375        const elements = document.querySelectorAll('.penci-dtf-real');
376
377        elements.forEach(el => {
378            const format = el.getAttribute('data-format');
379
380            const currentDate = new Date();
381
382            const formattedDate = formatDate(currentDate, format, locale);
383
384            el.textContent = formattedDate;
385        });
386      }
387
388      applyRealTimeDate();
389
390    }
391
392    PENCI.videofloat = function () {
393      $('body.single .post').each(function (e) {
394
395        var wrapper = $(this),
396          t = wrapper.find('.post-image'),
397          h = t.height(),
398          f = t.find('iframe'),
399          p
400
401        if (f.length && ajax_var_more.vfloat) {
402
403          t.addClass(ajax_var_more.vfloatp)
404
405          var z = h + t.offset().top
406
407          $(document).on('scroll', function () {
408
409            if (t.hasClass('disable-sticky')) {
410              return
411            }
412            var y = $(this).scrollTop()
413            if (y > z) {
414              t.addClass('stick-video-enable')
415              if (t.find('.stick-video-enable-remove').length == 0) {
416                t.append(
417                  '<span class="stick-video-enable-remove"><i class="penciicon-close-button"></i></span>')
418              }
419              if (!wrapper.hasClass('penci-apply-padding')) {
420                wrapper.addClass('penci-apply-padding').css('padding-top', h)
421              }
422            } else {
423              t.removeClass('stick-video-enable')
424              t.find('.stick-video-enable-remove').remove()
425              wrapper.removeClass('penci-apply-padding')
426              wrapper.css('padding-top', 0)
427            }
428          })
429        }
430
431      })
432
433      $(document).on('click', '.stick-video-enable-remove', function (e) {
434        e.preventDefault()
435        var t = $(this).closest('.post-image')
436
437        t.find('.stick-video-enable-remove').remove()
438        t.removeClass('stick-video-enable').addClass('disable-sticky')
439      })
440
441      $(document).on('mouseenter', '.penci-preview-thumb', function () {
442        var t = $(this),
443          ow = t.outerWidth(),
444          oh = t.outerHeight(),
445          w = t.outerHeight() * 16 / 9,
446          h = t.outerHeight(),
447          type = $(this).attr('data-type'),
448          url = $(this).attr('data-url')
449
450        if ( w < ow ) { 
451          w = ow
452          h = oh
453        }
454
455        t.addClass('active')
456
457        if (t.find('video').length == 0 && type == 'self') {
458          t.append('<video src="' + url + '" loop muted></video>')
459        }
460
461        if (t.find('iframe').length == 0 && type !== 'self') {
462          t.append('<div class="penci-preview-iframe"><iframe src="' + url +
463            '" frameborder="0"></iframe></div>')
464          $(this).find('iframe').width(w).height(h).fadeIn()
465        }
466
467        if ($(this).find('video').length !== 0) {
468          $(this).find('video').fadeIn()
469          $(this).find('video')[0].play()
470        }
471
472        if ($(this).find('iframe').length !== 0) {
473          $(this).find('iframe').fadeIn()
474        }
475
476      }).on('mouseleave', '.penci-preview-thumb', function () {
477        if ($(this).find('video').length !== 0) {
478          $(this).find('video')[0].pause()
479          $(this).find('video').fadeOut()
480        }
481        if ($(this).find('iframe').length !== 0) {
482          $(this).find('iframe').fadeOut()
483        }
484        $(this).removeClass('active')
485      })
486    }
487
488    /* Font Size Changer
489---------------------------------------------------------------*/
490    PENCI.fontsizeChanger = function () {
491
492      if ($('.penci-font-changer').length) {
493
494        var c = Cookies.get('penci-font-changer') ? Cookies.get(
495            'penci-font-changer') : 1,
496          pr = $('.penci-font-changer'),
497          w = $('#main').width(),
498          step = .1
499
500        if ($('body').hasClass('elementor-default')) {
501          w = $('article.post').width()
502        }
503
504        pr.attr('data-size', c)
505
506        var penci_apply_fontsize = function ($csize = null) {
507          var size = parseFloat(pr.attr('data-size'))
508
509          size = $csize ? parseFloat($csize) : size
510
511          size = size > 1.5 ? size = 1.5 : (
512            size < -1.5 ? size = -1.5 : size
513          )
514
515          $('.entry-content').css({
516            'transform': 'scale(' + size + ')',
517            'transform-origin': '0 0 0',
518            'overflow': 'hidden',
519            'width': parseInt(w / size) + 'px',
520          })
521
522          if ($('body').hasClass('rtl')) {
523            $('.entry-content').css({
524              'transform-origin': '100% 0',
525            })
526          }
527
528          $('.entry-content p,.entry-content iframe,.entry-content audio,.entry-content div,.entry-content ol, .entry-content ul, .entry-content blockquote, .entry-content h1, .entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content h6').
529            css({
530              'max-width': parseInt(w / size) + 'px',
531            })
532
533          if ($('.entry-content .penci-toc-container-wrapper').length) {
534            $('.penci-toc-container-wrapper, .penci-toc-container-wrapper div, .penci-toc-container-wrapper ul, .penci-toc-container-wrapper span, .penci-toc-container-wrapper p').
535              css({ 'max-width': '' })
536          }
537
538          $('.penci-single-block').each(function(e){
539              
540            if ( ! $(this).hasClass('pcapply_fs') ) {
541            
542                $(this).addClass('pcapply_fs');
543                
544                var t = $(this).find('.entry-content'),
545                    p = $(this).find('.post-entry'),
546                    h = t[0].getBoundingClientRect().height;
547  
548                    p.css({
549                      'height': h + 'px',
550                      'transform': 'none',
551                    })
552                
553            }
554
555          });
556        }
557
558        penci_apply_fontsize()
559
560        if ($.isFunction($.fn.jRange)) {
561          var def = Cookies.get('penci-font-changer') ? Cookies.get(
562            'penci-font-changer') : '1'
563          $('.penci-font-changer-slider').each(function () {
564            $(this).jRange({
565              from: 0.5,
566              to: 1.5,
567              step: 0.1,
568              scale: [0.5, 0, 1.0, 1.5],
569              format: '%s',
570              width: 120,
571              showLabels: false,
572              showScale: false,
573              snap: true,
574              theme: 'penci-fs-slider',
575              onstatechange: function (size) {
576                penci_apply_fontsize(size)
577                Cookies.set('penci-font-changer', size)
578              },
579            })
580            $(this).jRange('setValue', def)
581          })
582        }
583
584        $('body').on('single_loaded_more', function (e) {
585          penci_apply_fontsize()
586          if ($.isFunction($.fn.jRange)) {
587            var def = Cookies.get('penci-font-changer') ? Cookies.get(
588              'penci-font-changer') : '1'
589            $('.penci-font-changer-slider').each(function () {
590              $(this).jRange({
591                from: 0.5,
592                to: 1.5,
593                step: 0.1,
594                scale: [0.5, 0, 1.0, 1.5],
595                format: '%s',
596                width: 120,
597                showLabels: false,
598                showScale: false,
599                snap: true,
600                theme: 'penci-fs-slider',
601                onstatechange: function (size) {
602                  penci_apply_fontsize(size)
603                  Cookies.set('penci-font-changer', size)
604                },
605              })
606              $(this).jRange('setValue', def)
607            })
608          }
609        })
610
611        $(document).on('click', '.penci-font-changer-reset', function (e) {
612          e.preventDefault()
613          $('.penci-font-changer-slider').jRange('setValue', '1')
614          Cookies.set('penci-font-changer', 1)
615        })
616
617        $(document).on('click', '.penci-font-changer-btn', function (e) {
618          e.preventDefault()
619          $(this).closest('.penci-font-changer-popup').addClass('active')
620        })
621
622        $(document).on('click', function (e) {
623          var container = $('.penci-font-changer-popup')
624
625          if (!container.is(e.target) && container.has(e.target).length === 0) {
626            container.removeClass('active')
627          }
628        })
629      }
630
631    }
632
633    /* Block Heading Lists
634 ---------------------------------------------------------------*/
635    PENCI.blockheadinglist = function () {
636      $('.pcnav-lgroup').each(function () {
637        var lgroup = $(this),
638          maintitle = $(this).closest('.penci-homepage-title'),
639          maintitlew = maintitle.width(),
640          mainwrap = lgroup.find('ul.pcflx'),
641          titlew = maintitle.find('.inner-arrow span').width(),
642          nav = maintitle.find('.pcflx-nav').length ? maintitle.find(
643            '.pcflx-nav').width() : 0,
644          extrabtn = maintitle.find('.pcbh-extrabtn').length ? maintitle.find(
645            '.pcbh-extrabtn').width() : 0,
646          maxwidthc = 0,
647          childlists = $(
648            '<li class="more"><a class="more-click" href="#"><i class="fa fa-ellipsis-v"></i></a><ul class="pcflx-sub"></ul></li>'),
649          width = maintitlew - titlew - nav,
650          oldlist
651
652        if (maintitle.hasClass('pcalign-center')) {
653          width = maintitlew / 2 - titlew / 2 - 30
654        }
655
656        if (maintitle.hasClass('pciconp-left') ||
657          maintitle.hasClass('pciconp-right')) {
658          width = width - 36
659        }
660
661        lgroup.css('width', width)
662        maintitle.css('--extrabtn', extrabtn + 'px')
663
664        //reset
665        oldlist = mainwrap.find('.pcflx-sub').html()
666        mainwrap.find('.more').remove()
667        mainwrap.append(oldlist)
668
669        mainwrap.find('li').each(function () {
670          maxwidthc = maxwidthc + $(this).outerWidth()
671          if (maxwidthc > width - 60) {
672            $(childlists).find('.pcflx-sub').append($(this))
673          }
674        })
675        if ($(childlists).find('.pcflx-sub li').length) {
676          mainwrap.append(childlists)
677        }
678        maintitle.parent().addClass('pc-flexmnld')
679        lgroup.addClass('loaded')
680      })
681      $(document).on('click', '.pcnav-lgroup .more-click', function (e) {
682        e.preventDefault()
683      })
684
685      $('.pcnav-lgroup a').on('click', function () {
686        var t = $(this),
687          pr = t.closest('.pcnav-lgroup')
688
689        if (!t.hasClass('pcaj-nav-link')) {
690          pr.find('a').removeClass('clactive')
691          t.addClass('clactive')
692        }
693
694      })
695    }
696
697    /* Share Expand
698 ---------------------------------------------------------------*/
699    PENCI.shareexpand = function () {
700
701      if (!$('.tags-share-box').length) {
702        return
703      }
704
705      $('.tags-share-box').each(function () {
706        var tag = $(this)
707
708        if (tag.hasClass('disable-btnplus')) {
709          tag.css('opacity', '1')
710          return
711        }
712
713        if (tag.length) {
714          var sharew = 0,
715            sexpand = false,
716            maxw = tag.width(),
717            $count = 1,
718            exspace,
719            dsharew = tag.find('.post-share-expand').outerWidth()
720
721          if (tag.find('.penci-social-share-text').length) {
722            maxw = maxw - tag.find('.penci-social-share-text').outerWidth(true)
723          }
724
725          if (tag.find('.post-share-plike').length) {
726            maxw = maxw - tag.find('.post-share-plike').outerWidth(true)
727          }
728
729          if (tag.find('.new-ver-share').length) {
730            exspace = tag.find('.new-ver-share').outerWidth(true) -
731              tag.find('.new-ver-share').outerWidth()
732          }
733
734          tag.find('.post-share-expand').
735            removeClass('auto-hidden').
736            removeClass('showing').
737            removeClass('hidden')
738
739          tag.find('.new-ver-share').each(function () {
740            $(this).removeClass('auto-hidden').removeClass('show')
741            sharew += $(this).outerWidth(true)
742            if (sharew > maxw + exspace) {
743              $(this).addClass('auto-hidden').removeClass('show')
744              sexpand = true
745            } else {
746              $(this).removeClass('auto-hidden').addClass('show')
747            }
748            $count++
749          })
750
751          if (sexpand) {
752            tag.find('.post-share-expand').
753              removeClass('auto-hidden').
754              addClass('showing')
755
756            tag.find('.new-ver-share.show').each(function () {
757              dsharew += $(this).outerWidth(true)
758              if (dsharew >= maxw - exspace) {
759                $(this).addClass('auto-hidden').removeClass('show')
760              }
761            })
762
763          } else {
764            tag.find('.post-share-expand').addClass('hidden')
765          }
766
767          $('.post-share-item.post-share-expand').
768            off().
769            on('click', function (e) {
770              e.preventDefault()
771              var parent = $(this).closest('.post-share')
772              parent.find('.auto-hidden').toggleClass('active')
773              parent.toggleClass('showing-hidden')
774            })
775
776          tag.css('opacity', '1')
777        }
778      })
779
780    }
781
782    /* Smooth Scroll */
783    PENCI.smoothlinkscroll = function () {
784      $('a[href^="#"]').on('click', function (e) {
785        // e.preventDefault();
786
787        var target = this.hash,
788          $target = $(target)
789
790        $('html, body').stop().animate({
791          'scrollTop': $target.offset().top - 70,
792        }, 900, 'swing', function () {
793          window.location.hash = target
794        })
795      })
796    }
797    /* Cookie Law
798 ---------------------------------------------------------------*/
799    PENCI.cookie = function () {
800      var wrapCookie = '.penci-wrap-gprd-law',
801        $wrapCookie = $(wrapCookie),
802        classAction = 'penci-wrap-gprd-law-close',
803        penciCookieName = 'penci_law_footer_new'
804
805      if (!$wrapCookie.length) {
806        return false
807      }
808
809      var penciCookie = {
810        set: function (name, value) {
811          var date = new Date()
812          date.setTime(date.getTime() + (
813            31536000000
814          ))
815          var expires = '; expires=' + date.toGMTString()
816          document.cookie = name + '=' + value + expires + '; path=/'
817        },
818        read: function (name) {
819          var namePre = name + '='
820          var cookieSplit = document.cookie.split(';')
821          for (var i = 0; i < cookieSplit.length; i++) {
822            var cookie = cookieSplit[i]
823            while (cookie.charAt(0) == ' ') {
824              cookie = cookie.substring(1, cookie.length)
825            }
826            if (cookie.indexOf(namePre) === 0) {
827              return cookie.substring(namePre.length, cookie.length)
828            }
829          }
830          return null
831        },
832        erase: function (name) {
833          this.set(name, '', -1)
834        },
835        exists: function (name) {
836          return (
837            this.read(name) !== null
838          )
839        },
840      }
841
842      $wrapCookie.removeClass('penci-close-all')
843      if (!penciCookie.exists(penciCookieName) ||
844        (
845          penciCookie.exists(penciCookieName) && 1 ==
846          penciCookie.read(penciCookieName)
847        )) {
848        $wrapCookie.removeClass(classAction)
849      } else {
850        $wrapCookie.addClass(classAction)
851      }
852
853      $('.penci-gprd-accept, .penci-gdrd-show').on('click', function (e) {
854        e.preventDefault()
855
856        var $this = $(this),
857          $parent_law = $this.closest(wrapCookie)
858
859        $parent_law.toggleClass(classAction)
860
861        if ($parent_law.hasClass(classAction)) {
862          penciCookie.set(penciCookieName, '2')
863        } else {
864          penciCookie.set(penciCookieName, '1')
865        }
866
867        return false
868      })
869    }
870
871    /* Sticky main navigation
872 ---------------------------------------------------------------*/
873    PENCI.main_sticky = function () {
874      if ($('nav#navigation').length && $().pensticky &&
875        !$('nav#navigation').hasClass('penci-disable-sticky-nav')) {
876        var spaceTop = 0
877        if ($('body').hasClass('admin-bar')) {
878          spaceTop = 32
879        }
880        $('nav#navigation').each(function () {
881          $(this).pensticky({ topSpacing: spaceTop })
882        })
883      } // sticky
884    }
885
886    /* Homepage Featured Slider
887 ---------------------------------------------------------------*/
888    PENCI.featured_slider = function () {
889
890      const owl_fslider_name = {}
891
892      $('.featured-area .penci-owl-featured-area').each(function () {
893
894        var $this = $(this),
895          $style = $this.data('style'),
896          $auto = false,
897          $autotime = $this.data('autotime'),
898          $speed = $this.data('speed'),
899          $loop = $this.data('loop'),
900          $item = 1,
901          $slideby = 1,
902          $nav = true,
903          $dots = false,
904          $rtl = false,
905          $items_desktop = 1,
906          $items_tablet = 1,
907          $items_tabsmall = 1,
908          $items_mobile = 1,
909          $spaceBetween = 0,
910          $ctyle = ajax_var_more.fcarousel_e,
911          $sstyle = ajax_var_more.fslider_e,
912          $id = 'fetured-swiper-' + Math.floor(Math.random() * (
913            1 - 999999
914          ) + 1) + 1
915
916        if ($this.attr('data-id')) {
917          $id = $this.attr('data-id')
918        }
919
920        $this.addClass($id)
921
922        if ($this.hasClass('no-df-swiper')) {
923          return
924        }
925        
926        if ($this.hasClass('penci-owl-loaded')) {
927          return
928        }
929
930        if ($this.attr('data-ceffect')) {
931          $ctyle = $this.attr('data-ceffect')
932        }
933
934        if ($this.attr('data-seffect')) {
935          $sstyle = $this.attr('data-seffect')
936        }
937
938        if ($('html').attr('dir') === 'rtl') {
939          $rtl = true
940        }
941        if ($this.attr('data-auto') === 'true') {
942          $auto = true
943        }
944        if ($this.attr('data-nav') === 'false') {
945          $nav = false
946        }
947        if ($this.attr('data-dots') === 'true') {
948          $dots = true
949          $this.append('<div class="penci-owl-dots"></div>')
950        }
951        if ($this.attr('data-item')) {
952          $item = parseInt($this.data('item'))
953          $slideby = $item
954        }
955        if ($this.attr('data-desktop')) {
956          $items_desktop = parseInt($this.data('desktop'))
957        }
958        if ($this.attr('data-tablet')) {
959          $items_tablet = parseInt($this.data('tablet'))
960        }
961        if ($this.attr('data-tabsmall')) {
962          $items_tabsmall = parseInt($this.data('tabsmall'))
963        }
964        if ($this.attr('data-mobile')) {
965          $items_mobile = parseInt($this.data('mobile'))
966        }
967        if ($this.attr('data-slideby')) {
968          $slideby = parseInt($this.data('slideby'))
969        }
970
971        if ($item > 1) {
972          $this.addClass('swiper-multi-items')
973        }
974
975        let a = 0,
976          e = $(this),
977          t = !1
978
979        var interleaveOffset = 0.5
980
981        if ($style === 'style-2') {
982          $spaceBetween = 10
983          $loop = true
984        } else if ($style === 'style-28') {
985          $items_desktop = $item = 6
986        } else if ($style === 'style-38') {
987          $spaceBetween = 5
988          $items_desktop = $item = 5
989        } else if ($style === 'style-43') {
990          $spaceBetween = 0
991        }
992
993        var swiper_arg = {
994          loop: $loop,
995          autoplay: $auto,
996          spaceBetween: $spaceBetween,
997          slidesPerView: $item,
998          speed: $speed,
999          slideActiveClass: 'active',
1000          watchSlidesProgress: true,
1001          navigation: {
1002            nextEl: '.' + $id + ' .owl-next',
1003            prevEl: '.' + $id + ' .owl-prev',
1004          },
1005          on: {
1006            init: function () {
1007              $this.addClass('penci-owl-loaded')
1008            },
1009            afterInit: function () {
1010              $this.addClass('penci-featured-loaded')
1011            },
1012            setTransition: function (swiper, speed) {
1013
1014              if (swiper.slides) {
1015
1016                for (var i = 0; i < swiper.slides.length; i++) {
1017                  if (swiper.slides[i].querySelector('.slide-inner') !== null &&
1018                    $sstyle == 'creative') {
1019                    swiper.slides[i].style.transition = speed + 'ms'
1020                    swiper.slides[i].querySelector(
1021                      '.slide-inner').style.transition = speed + 'ms'
1022                  }
1023                  if (swiper.slides[i].querySelector('.penci-swiper-mask') !==
1024                    null && $sstyle == 'creative') {
1025                    swiper.slides[i].style.transition = speed + 'ms'
1026                    swiper.slides[i].querySelector(
1027                      '.penci-swiper-mask').style.transition = speed + 'ms'
1028                  }
1029                }
1030
1031              }
1032
1033            },
1034            touchStart (...n) {
1035              if ($item > 1) {
1036                t = !0, e.on && e.on.touchStart && e.on.touchStart(...n)
1037              }
1038              var swiper = this
1039              for (var i = 0; i < swiper.slides.length; i++) {
1040                if (swiper.slides[i].querySelector('.slide-inner') !== null &&
1041                  $sstyle == 'creative') {
1042                  swiper.slides[i].style.transition = ''
1043                }
1044                if (swiper.slides[i].querySelector('.penci-swiper-mask') !==
1045                  null && $sstyle == 'creative') {
1046                  swiper.slides[i].style.transition = ''
1047                }
1048              }
1049            },
1050            touchEnd (...n) {
1051              if ($item > 1) {
1052                t = !1, e.on && e.on.touchStart && e.on.touchEnd(...n)
1053              }
1054            },
1055            progress (n, u) {
1056              if (t) {
1057                return
1058              }
1059              if ($item > 1 && $ctyle == 'swing') {
1060                n.on && n.on.progress && n.on.progress(n, u)
1061                const g = n.progress > a ? 'next' : 'prev'
1062                a = n.progress
1063                const y = n.params.speed / 16,
1064                  f = n.visibleSlidesIndexes ? n.visibleSlidesIndexes : [],
1065                  h = f[0],
1066                  m = f[f.length - 1],
1067                  v = (l, c) => {
1068                    g === 'next' && c >= h ? l.style.transitionDelay = `${(c -
1069                      h + 1) * y}ms` : g === 'prev' && c <= m + 1
1070                      ? l.style.transitionDelay = `${(m - c + 1) * y}ms`
1071                      : l.style.transitionDelay = `${0}ms`
1072                  }
1073                n.slides.forEach((l, c) => {
1074                  n.animating
1075                    ? (l.style.transitionDelay = '0ms', requestAnimationFrame(
1076                      () => {
1077                        v(l, c)
1078                      }))
1079                    : v(l, c)
1080                })
1081              }
1082
1083              var swiper = this
1084              for (var i = 0; i < swiper.slides.length; i++) {
1085                var slideProgress = swiper.slides[i].progress
1086                var innerOffset = swiper.width * interleaveOffset
1087                var innerTranslate = slideProgress * innerOffset
1088                if (swiper.slides[i].querySelector('.slide-inner') !== null &&
1089                  $sstyle == 'creative') {
1090                  swiper.slides[i].querySelector(
1091                    '.slide-inner').style.transform = 'translate3d(' +
1092                    innerTranslate + 'px, 0, 0)'
1093                }
1094                if (swiper.slides[i].querySelector('.penci-swiper-mask') !==
1095                  null && $sstyle == 'creative') {
1096                  swiper.slides[i].querySelector(
1097                    '.penci-swiper-mask').style.transform = 'translate3d(' +
1098                    innerTranslate + 'px, 0, 0)'
1099                }
1100              }
1101
1102            },
1103          },
1104        }
1105
1106        if ($this.attr('data-slidespg')) {
1107          swiper_arg['slidesPerGroup'] = $this.attr('data-slidespg')
1108        }
1109
1110        if ($auto) {
1111          swiper_arg['autoplay'] = {
1112            delay: $autotime,
1113            disableOnInteraction: false,
1114            pauseOnMouseEnter: true,
1115          }
1116        }
1117
1118        if ($style === 'style-2' || $style === 'style-38') {
1119          swiper_arg['centeredSlides'] = true
1120          swiper_arg['loop'] = true
1121          swiper_arg['slidesPerView'] = 'auto'
1122        }
1123
1124        if ($style === 'style-43' ) {
1125          swiper_arg['centeredSlides'] = true
1126          swiper_arg['loop'] = true
1127        }
1128
1129        if ($this.find('.swiper-mark-item').length) {
1130          swiper_arg['parallax'] = true
1131        }
1132
1133        if ($style === 'style-2') {
1134          swiper_arg['loopAddBlankSlides'] = true
1135          swiper_arg['watchSlidesProgress'] = false
1136          swiper_arg['centerInsufficientSlides'] = true
1137        }
1138
1139        if ($style === 'style-38') {
1140          swiper_arg['loopAddBlankSlides'] = true
1141          swiper_arg['watchSlidesProgress'] = false
1142          swiper_arg['centerInsufficientSlides'] = true
1143        }
1144
1145        if ($dots) {
1146          swiper_arg['pagination'] = {
1147            el: '.' + $id + ' .penci-owl-dots',
1148            type: 'bullets',
1149            bulletElement: 'div',
1150            clickable: true,
1151            bulletClass: 'penci-owl-dot',
1152            bulletActiveClass: 'active',
1153            renderBullet: function (index, className) {
1154              return '<div class="' + className + '"><span></span></div>'
1155            },
1156          }
1157        }
1158
1159        if ($item == 1 && $style !== 'style-38') {
1160
1161          if ($sstyle === 'creative') {
1162            swiper_arg['effect'] = 'slide'
1163          } else {
1164            swiper_arg['effect'] = $sstyle
1165          }
1166        }
1167
1168        if ($style == 'style-28' || $style == 'style-2' || $style ==
1169          'style-38') {
1170          swiper_arg['effect'] = 'side'
1171          swiper_arg['slidesPerView'] = 'auto'
1172        }
1173
1174        if (swiper_arg['effect'] == 'fade') {
1175          swiper_arg['fadeEffect'] = {
1176            crossFade: true,
1177          }
1178        }
1179
1180        if ($ctyle == 'swing' && $item > 1) {
1181          swiper_arg['speed'] = $speed
1182          swiper_arg['loop'] = false
1183
1184          if ($style !== 'style-38') {
1185            swiper_arg['rewind'] = true
1186          }
1187
1188          swiper_arg['effect'] = 'creative'
1189          swiper_arg['followFinger'] = !1
1190          swiper_arg['creativeEffect'] = {
1191            limitProgress: 100,
1192            prev: {
1193              translate: ['-100%', 0, 0],
1194            },
1195            next: {
1196              translate: ['100%', 0, 0],
1197            },
1198          }
1199        }
1200
1201        if (swiper_arg['slidesPerView'] !== 'auto') {
1202          swiper_arg['breakpoints'] = {
1203            0: {
1204              slidesPerView: $items_mobile,
1205            },
1206            480: {
1207              slidesPerView: $items_tabsmall,
1208            },
1209            768: {
1210              slidesPerView: $items_tablet,
1211            },
1212            1170: {
1213              slidesPerView: $items_desktop,
1214            },
1215          }
1216        }
1217
1218        owl_fslider_name[$id] = new Swiper('.' + $id, swiper_arg)
1219
1220        owl_fslider_name[$id].update()
1221
1222        if ($this.attr('data-slideTo')) {
1223          owl_fslider_name[$id].slideTo($this.attr('data-slideTo'), 0)
1224        } else if ($style == 'style-38') {
1225          owl_fslider_name[$id].slideTo(4, 0)
1226        } else if ($style == 'style-2') {
1227          owl_fslider_name[$id].slideTo(4, 0)
1228        } else if ($style == 'style-43') {
1229          owl_fslider_name[$id].slideTo(2, 0)
1230        }
1231
1232        if ($('body').hasClass('rtl')) {
1233          owl_fslider_name[$id].changeLanguageDirection('ltr')
1234        }
1235      })
1236    }
1237
1238    /* Owl Slider General
1239 ---------------------------------------------------------------*/
1240    PENCI.owl_slider = function () {
1241
1242      const owl_slider_name = {}
1243
1244      $('.penci-owl-carousel-slider').each(function () {
1245        var $this = $(this),
1246          $parent = $this.parent(),
1247          $auto = true,
1248          $dots = false,
1249          $nav = true,
1250          $loop = true,
1251          $rtl = false,
1252          $items_desktop = 1,
1253          $items_tablet = 1,
1254          $items_tabsmall = 1,
1255          $items_mobile = 1,
1256          $speed = 600,
1257          $item = 1,
1258          $slideby = 1,
1259          $margin = 0,
1260          $autotime = 5000,
1261          $height = true,
1262          $datalazy = false,
1263          $carousel_effect = ajax_var_more.carousel_e,
1264          $slide_effect = ajax_var_more.slider_e,
1265          $direction = 'horizontal',
1266          $disable_effect = false,
1267          $e = false,
1268          $thumbs = $this.attr('data-thumbs'),
1269          $id = 'fetured-swiper-' + Math.floor(Math.random() * (
1270            1 - 999999
1271          ) + 1) + 1
1272
1273        if ($this.hasClass('no-df')) {
1274          return
1275        }
1276        
1277        if ($this.hasClass('penci-owl-loaded')) {
1278          return
1279        }
1280
1281        if ($this.hasClass('nav-thumb-creative')) {
1282          return
1283        }
1284
1285        if ($this.hasClass('penci-featured-loaded')) {
1286          return
1287        }
1288
1289        if ($this.attr('data-id')) {
1290          $id = $this.attr('data-id')
1291        }
1292
1293        if ($this.attr('data-ceffect')) {
1294          $carousel_effect = $this.attr('data-ceffect')
1295        }
1296
1297        if ($this.attr('data-seffect')) {
1298          $slide_effect = $this.attr('data-seffect')
1299        }
1300
1301        $this.addClass($id)
1302
1303        $this.find('.swiper-slide').removeClass('penci-ajrs-animate')
1304
1305        if ($this.attr('data-nav') !== 'false') {
1306          $this.append(
1307            '<div class="penci-owl-nav"><div class="owl-prev"><i class="penciicon-left-chevron"></i></div><div class="owl-next"><i class="penciicon-right-chevron"></i></div></div>')
1308        }
1309
1310        if ($('html').attr('dir') === 'rtl') {
1311          $rtl = true
1312        }
1313        if ($this.attr('data-dots') === 'true') {
1314          $dots = true
1315          if (!$this.find('.penci-owl-dots').length) {
1316            $this.append('<div class="penci-owl-dots"></div>')
1317          }
1318        }
1319        if ($this.attr('data-loop') === 'false') {
1320          $loop = false
1321        }
1322        if ($this.attr('data-nav') === 'false') {
1323          $nav = false
1324        }
1325        if ($this.attr('data-auto') === 'false') {
1326          $auto = false
1327        }
1328
1329        if ($this.attr('data-margin')) {
1330          $margin = parseInt($this.data('margin'))
1331        }
1332        if ($this.attr('data-desktop')) {
1333          $items_desktop = $this.data('desktop') == 'auto' ? 'auto' : parseInt($this.data('desktop'))
1334        }
1335        if ($this.attr('data-tablet')) {
1336          $items_tablet = $this.data('tablet') == 'auto' ? 'auto' : parseInt($this.data('tablet'))
1337        }
1338        if ($this.attr('data-tabsmall')) {
1339          $items_tabsmall = $this.data('tabsmall') == 'auto' ? 'auto' : parseInt($this.data('tabsmall'))
1340        }
1341        if ($this.attr('data-mobile')) {
1342          $items_mobile = $this.data('mobile') == 'auto' ? 'auto' : parseInt($this.data('mobile'))
1343        }
1344        if ($this.attr('data-speed')) {
1345          $speed = parseInt($this.data('speed'))
1346        }
1347        if ($this.attr('data-autotime')) {
1348          $autotime = parseInt($this.data('autotime'))
1349        }
1350        if ($this.attr('data-item')) {
1351          $item = $slideby = parseInt($this.data('item'))
1352        }
1353        if ($this.attr('data-lazy')) {
1354          $datalazy = true
1355        }
1356        if ($this.attr('data-height')) {
1357          $height = $this.attr('data-height')
1358        }
1359
1360        if ($this.attr('data-direction')) {
1361          $direction = $this.attr('data-direction')
1362        }
1363
1364        if ( $direction == 'vertical' || $this.attr('data-e') == 'false' ) {
1365          $disable_effect = true;
1366        }
1367
1368        let a = 0,
1369          t = !1
1370
1371        var interleaveOffset = 0.5
1372
1373        var swiper_arg = {
1374          loop: $loop,
1375          spaceBetween: $margin,
1376          slidesPerView: $item,
1377          speed: $speed,
1378          autoplay: $auto,
1379          pauseOnMouseEnter: true,
1380          autoHeight: $height,
1381          slideActiveClass: 'active',
1382          watchSlidesProgress: true,
1383          lazyLoading: $datalazy,
1384          direction: $direction,
1385          navigation: {
1386            nextEl: '.' + $id + ' .owl-next',
1387            prevEl: '.' + $id + ' .owl-prev',
1388          },
1389          breakpoints: {
1390            320: {
1391              slidesPerView: $items_mobile,
1392              direction: 'horizontal',
1393            },
1394            768: {
1395              slidesPerView: $items_tablet,
1396              direction: 'horizontal',
1397            },
1398            1170: {
1399              slidesPerView: $items_desktop,
1400            },
1401          },
1402          on: {
1403            init: function () {
1404              $this.addClass('penci-owl-loaded')
1405            },
1406            afterInit: function () {
1407              $this.addClass('penci-featured-loaded')
1408            },
1409            touchStart (slider) {
1410
1411              if ($item > 1) {
1412                t = !0, slider.on && slider.on.touchStart &&
1413                slider.on.touchStart(slider)
1414              } else {
1415                var swiper = this
1416                for (var i = 0; i < swiper.slides.length; i++) {
1417                  if (swiper.slides[i].querySelector('.slide-inner') !== null &&
1418                    $slide_effect == 'creative') {
1419                    swiper.slides[i].style.transition = ''
1420                  }
1421                  if (swiper.slides[i].querySelector('.penci-swiper-mask') !==
1422                    null && $slide_effect == 'creative') {
1423                    swiper.slides[i].style.transition = ''
1424                  }
1425                }
1426              }
1427            },
1428            touchEnd (slider) {
1429
1430              if ($item > 1) {
1431                t = !1, slider.on && slider.on.touchStart &&
1432                slider.on.touchEnd(slider)
1433              }
1434            },
1435            setTransition: function (swiper, speed) {
1436
1437              if ( $disable_effect ) {
1438                return;
1439              }
1440
1441              if (swiper.slides) {
1442
1443                for (var i = 0; i < swiper.slides.length; i++) {
1444
1445                  if (swiper.slides[i].querySelector('.slide-inner') !== null &&
1446                    $slide_effect == 'creative') {
1447                    swiper.slides[i].style.transition = speed + 'ms'
1448                    swiper.slides[i].querySelector(
1449                      '.slide-inner').style.transition = speed + 'ms'
1450                  }
1451                  if (swiper.slides[i].querySelector('.penci-ctslide-bg') !==
1452                    null && $slide_effect == 'creative') {
1453                    swiper.slides[i].style.transition = speed + 'ms'
1454                    swiper.slides[i].querySelector(
1455                      '.penci-ctslide-bg').style.transition = speed + 'ms'
1456                  }
1457                  if (swiper.slides[i].querySelector('.penci-swiper-mask') !==
1458                    null && $slide_effect == 'creative') {
1459                    swiper.slides[i].style.transition = speed + 'ms'
1460                    swiper.slides[i].querySelector(
1461                      '.penci-swiper-mask').style.transition = speed + 'ms'
1462                  }
1463                }
1464
1465              }
1466
1467            },
1468            progress (n, u) {
1469              if (t) {
1470                return
1471              }
1472
1473              if ( $disable_effect ) {
1474                return;
1475              }
1476
1477              if ($item > 1 && $carousel_effect === 'swing') {
1478
1479                n.on && n.on.progress && n.on.progress(n, u)
1480                const g = n.progress > a ? 'next' : 'prev'
1481                a = n.progress
1482                const y = n.params.speed / 16,
1483                  f = n.visibleSlidesIndexes ? n.visibleSlidesIndexes : [],
1484                  h = f[0],
1485                  m = f[f.length - 1],
1486                  v = (l, c) => {
1487                    g === 'next' && c >= h ? l.style.transitionDelay = `${(c -
1488                      h + 1) * y}ms` : g === 'prev' && c <= m + 1
1489                      ? l.style.transitionDelay = `${(m - c + 1) * y}ms`
1490                      : l.style.transitionDelay = `${0}ms`
1491                  }
1492                n.slides.forEach((l, c) => {
1493                  n.animating
1494                    ? (l.style.transitionDelay = '0ms', requestAnimationFrame(
1495                      () => {
1496                        v(l, c)
1497                      }))
1498                    : v(l, c)
1499                })
1500
1501              } else {
1502
1503                var swiper = this
1504                for (var i = 0; i < swiper.slides.length; i++) {
1505                  var slideProgress = swiper.slides[i].progress
1506                  var innerOffset = swiper.width * interleaveOffset
1507                  var innerTranslate = slideProgress * innerOffset
1508                  if (swiper.slides[i].querySelector('.slide-inner') !== null &&
1509                    $slide_effect === 'creative') {
1510                    swiper.slides[i].querySelector(
1511                      '.slide-inner').style.transform = 'translate3d(' +
1512                      innerTranslate + 'px, 0, 0)'
1513                  }
1514                  if (swiper.slides[i].querySelector('.penci-ctslide-bg') !==
1515                    null && $slide_effect === 'creative') {
1516                    swiper.slides[i].querySelector(
1517                      '.penci-ctslide-bg').style.transform = 'translate3d(' +
1518                      innerTranslate + 'px, 0, 0)'
1519                  }
1520                  if (swiper.slides[i].querySelector('.penci-swiper-mask') !==
1521                    null && $slide_effect === 'creative') {
1522                    swiper.slides[i].querySelector(
1523                      '.penci-swiper-mask').style.transform = 'translate3d(' +
1524                      innerTranslate + 'px, 0, 0)'
1525                  }
1526                }
1527              }
1528            },
1529          },
1530        }
1531
1532        if ($carousel_effect === 'swing' && $item > 1 && !$disable_effect) {
1533          $this.addClass('penci-swing-ef')
1534          swiper_arg['speed'] = $speed
1535          swiper_arg['loop'] = false
1536          swiper_arg['rewind'] = true
1537          swiper_arg['effect'] = 'creative'
1538          swiper_arg['followFinger'] = !1
1539          swiper_arg['creativeEffect'] = {
1540            limitProgress: 100,
1541            prev: {
1542              translate: ['-100%', 0, 0],
1543            },
1544            next: {
1545              translate: ['100%', 0, 0],
1546            },
1547          }
1548        } else if ($item == 1 && !$disable_effect) {
1549          swiper_arg['effect'] = $slide_effect
1550        }
1551
1552        if ((
1553          swiper_arg['effect'] === 'flip' || swiper_arg['effect'] === 'cards'
1554        ) && $item == 1) {
1555          swiper_arg['loop'] = false
1556        }
1557
1558        if (swiper_arg['effect'] === 'creative' && $item === 1) {
1559          swiper_arg['creativeEffect'] = {
1560            shadowPerProgress: true,
1561            prev: {
1562              translate: ['-100%', 0, 0],
1563              opacity: 0.5,
1564            },
1565            next: {
1566              translate: ['100%', 0, 0],
1567              opacity: 1,
1568            },
1569          }
1570        }
1571
1572        if ($dots) {
1573          swiper_arg['pagination'] = {
1574            el: '.' + $id + ' .penci-owl-dots',
1575            type: 'bullets',
1576            bulletElement: 'div',
1577            clickable: true,
1578            bulletClass: 'penci-owl-dot',
1579            bulletActiveClass: 'active',
1580            renderBullet: function (index, className) {
1581              return '<div class="' + className + '"><span></span></div>'
1582            },
1583          }
1584        }
1585
1586        if ($this.attr('data-thumbs-id')) {
1587          swiper_arg['thumbs'] = {
1588            swiper: owl_slider_name[$this.attr('data-thumbs-id')],
1589          }
1590        }
1591
1592        if ($this.attr('data-thumb')) {
1593          swiper_arg['slideToClickedSlide'] = true
1594        }
1595
1596        if ($parent.hasClass('penci-topbar-trending')) {
1597
1598          swiper_arg['navigation'] = {
1599            nextEl: '.penci-slider-next',
1600            prevEl: '.penci-slider-prev',
1601          }
1602
1603          swiper_arg['autoHeight'] = false
1604
1605          if ($this.attr('data-anim')) {
1606            swiper_arg['slideActiveClass'] = 'animated'
1607          }
1608
1609          if ($this.attr('data-anim') === 'slideInUp') {
1610            swiper_arg['effect'] = 'creative'
1611            swiper_arg['creativeEffect'] = {
1612              shadowPerProgress: true,
1613              prev: {
1614                translate: [0, '-100%', 0],
1615                opacity: 0,
1616              },
1617              next: {
1618                translate: [0, '100%', 0],
1619                opacity: 1,
1620              },
1621            }
1622          }
1623
1624          if ($this.attr('data-anim') === 'slideInRight') {
1625            swiper_arg['effect'] = 'creative'
1626            swiper_arg['creativeEffect'] = {
1627              shadowPerProgress: false,
1628              perspective: true,
1629
1630              prev: {
1631                translate: ['20px', 0, 0],
1632                opacity: 0,
1633              },
1634              next: {
1635                translate: ['20px', 0, 0],
1636                opacity: 0,
1637              },
1638            }
1639          }
1640
1641          if ($this.attr('data-anim') === 'fadeIn') {
1642            swiper_arg['effect'] = 'fade'
1643            swiper_arg['fadeEffect'] = {
1644              crossFade: true,
1645            }
1646          }
1647        }
1648
1649        if ($auto) {
1650          swiper_arg['autoplay'] = {
1651            delay: $autotime,
1652            disableOnInteraction: false,
1653            pauseOnMouseEnter: true,
1654          }
1655        }
1656
1657        owl_slider_name[$id] = new Swiper('.' + $id, swiper_arg)
1658
1659        if ($this.attr('data-thumbs-id')) {
1660          owl_slider_name[$this.attr('data-thumbs-id')].update()
1661        }
1662
1663        owl_slider_name[$id].update()
1664
1665      })
1666
1667    }
1668
1669    /* Slick Slider w Thumbnails
1670     ---------------------------------------------------------------*/
1671    PENCI.slick_slider = function () {
1672
1673      $('.penci-image-gallery-thumbnail-slider').each(function () {
1674
1675        var main_slider = $(this).find('.pcthumb-s-msl').attr('data-id'),
1676          thumb_slider = $(this).find('.pcthumb-s-csl').attr('data-id'),
1677          thumb_total = $(this).find('.pcthumb-s-csl').attr('data-total')
1678
1679        var swiper_thumb_slider = new Swiper('.' + thumb_slider, {
1680          loop: true,
1681          slidesPerView: 'auto',
1682          spaceBetween: 0,
1683          slideToClickedSlide: true,
1684          on: {
1685            init: function (e) {
1686              $('.' + thumb_slider).addClass('slick-initialized')
1687            },
1688          },
1689          navigation: {
1690            nextEl: '.' + thumb_slider + ' .slick-next',
1691            prevEl: '.' + thumb_slider + ' .slick-prev',
1692          },
1693        })
1694
1695        var swiper_slider = new Swiper('.' + main_slider, {
1696          slidesPerView: 1,
1697          autoHeight: true,
1698          loop: true,
1699          thumbs: {
1700            swiper: swiper_thumb_slider,
1701          },
1702          on: {
1703            init: function (e) {
1704              $('.' + main_slider).addClass('slick-initialized')
1705            },
1706            slideChange: function (e) {
1707              var number = e.realIndex,
1708                number = number == 0 ? 1 : number
1709              $('.' + thumb_slider).
1710                find('.pcslick-nav-area').
1711                find('.current').
1712                html(number)
1713            },
1714          },
1715        })
1716
1717        swiper_thumb_slider.update()
1718        swiper_slider.update()
1719
1720      })
1721
1722    }
1723
1724    /* Fitvids
1725 ---------------------------------------------------------------*/
1726    PENCI.fitvids = function () {
1727      // Target your .container, .wrapper, .post, etc.
1728      if ($().fitVids) {
1729        $('.container').fitVids({ ignore: '.penci-sticky-video' })
1730      }
1731    }
1732
1733    /* Sticky sidebar
1734 ----------------------------------------------------------------*/
1735    PENCI.sticky_sidebar = function () {
1736      if ($().theiaStickySidebar) {
1737        var top_margin = 80
1738        if ($('body').hasClass('admin-bar') &&
1739          $('body').hasClass('penci-vernav-enable')) {
1740          top_margin = 52
1741        } else if (!$('body').hasClass('admin-bar') &&
1742          $('body').hasClass('penci-vernav-enable')) {
1743          top_margin = 20
1744        } else if ($('body').hasClass('admin-bar') &&
1745          !$('body').hasClass('penci-vernav-enable')) {
1746          top_margin = 112
1747        }
1748
1749        if ($('.pc-wrapbuilder-header').length) {
1750          var headerdesktop = $('.penci_builder_sticky_header_desktop')
1751          top_margin = 20
1752          if (headerdesktop.length &&
1753            !headerdesktop.hasClass('hide-scroll-down')) {
1754            top_margin = headerdesktop.height() + 20
1755          }
1756          if ($('body').hasClass('admin-bar')) {
1757            top_margin = top_margin + 32
1758          }
1759        }
1760
1761        $('.pc-container-sticky').each(function () {
1762          var t = $(this)
1763          if (t.find('.theiaStickySidebar').length === 0) {
1764            t.wrapInner('<div class="theiaStickySidebar"></div>')
1765          }
1766        })
1767
1768        if ($(
1769          '.penci-vc-sticky-sidebar > .penci-vc-row > .penci-vc-column').length) {
1770          $('.penci-vc-sticky-sidebar > .penci-vc-row > .penci-vc-column').
1771            theiaStickySidebar({
1772              additionalMarginTop: top_margin,
1773              'minWidth': 961,
1774            })
1775        }
1776
1777        if ($('.penci-enSticky .penci-sticky-sb').length) {
1778          $('.penci-enSticky .penci-sticky-sb,.penci-enSticky .penci-sticky-ct').
1779            theiaStickySidebar({
1780              additionalMarginTop: top_margin,
1781              'minWidth': 961,
1782            })
1783        }
1784        $('#main.penci-main-sticky-sidebar, #sidebar.penci-sticky-sidebar').
1785          theiaStickySidebar({
1786            // settings
1787            additionalMarginTop: top_margin,
1788          })
1789      } // if sticky
1790    }
1791
1792    /* Mega menu
1793 ----------------------------------------------------------------*/
1794    PENCI.mega_menu = function () {
1795      // Hover parent
1796      $('#navigation ul.menu > li.penci-mega-menu').
1797        on('mouseenter', function () {
1798          var $this = $(this),
1799            $row_active = $this.find('.row-active'),
1800            $rowsLazy = $row_active.find('.penci-lazy')
1801          $row_active.fadeIn('200').css('display', 'inline-block')
1802        })
1803
1804      $('#navigation .penci-mega-child-categories a').
1805        on('mouseenter', function () {
1806          if ($(this).hasClass('mega-normal-child')) {
1807            return
1808          }
1809          if (!$(this).hasClass('cat-active')) {
1810            var $this = $(this),
1811              $row_active = $this.data('id'),
1812              $parentA = $this.parent().children('a'),
1813              $parent = $this.closest('.penci-megamenu'),
1814              $rows = $this.closest('.penci-megamenu').
1815                find('.penci-mega-latest-posts').
1816                children('.penci-mega-row'),
1817              $rowsLazy = $rows.find('.penci-lazy')
1818            $parentA.removeClass('cat-active')
1819            $this.addClass('cat-active')
1820            $rows.hide()
1821            $rows.removeClass('row-active')
1822            $parent.find('.' + $row_active).
1823              fadeIn('300').
1824              css('display', 'inline-block').
1825              addClass('row-active')
1826          }
1827        })
1828    }
1829
1830    PENCI.categories_lists = function () {
1831      // Add indicator
1832
1833      $('.pc-advanced-cat li').each(function (e) {
1834        if ($(this).find('.children').length) {
1835          $(this).addClass('has-children')
1836          $(this).find('.children').hide()
1837          $(this).
1838            append('<u class="indicator"><i class="fa fa-angle-down"></i></u>')
1839        }
1840      })
1841
1842      // indicator click
1843      $('.pc-advanced-cat .indicator').on('click', function (e) {
1844        var $this = $(this)
1845        e.preventDefault()
1846        $this.children().toggleClass('fa-angle-up')
1847        $this.closest('li').find('.children').slideToggle('fast')
1848      })
1849
1850      $(document).on('mouseenter', '.penci-mega-menu', function (e) {
1851        var t = $(this),
1852            w = t.find('.penci-megamenu')
1853            if ( w.hasClass('loading') || t.hasClass('pcmn-ajxd') ) {
1854              return
1855            }
1856            if ( ! w.hasClass('loaded') ) {
1857              var menu = w.attr('data-menu'),
1858                  item = w.attr('data-item'),
1859                  catid = w.attr('data-catid'),
1860                  number = w.attr('data-number'),
1861                  style = w.attr('data-style'),
1862                  rid = w.attr('data-id'),
1863                  position = w.attr('data-position')
1864
1865              w.addClass('loading')
1866
1867              if ( menu && item && catid && number && style && rid && position ) {
1868
1869                var save_name = 'penci_megamn_'+menu+item+catid+number+style+position;
1870
1871                if (sessionStorage.getItem(save_name) ) {
1872                  w.append(sessionStorage.getItem(save_name))
1873                  w.removeClass('loading')
1874                  w.addClass('loaded')
1875
1876                  var $row_active = w.find('.row-active')
1877                  $row_active.fadeIn('200').css('display', 'inline-block')
1878
1879                  $('body').trigger('penci-ajax-menu-loaded')
1880                } else {
1881
1882                  $.get(
1883                    ajax_var_more.megamenu_url,
1884                    {
1885                      menu: menu,
1886                      item: item,
1887                      catid: catid,
1888                      number: number,
1889                      style: style,
1890                      position: position,
1891                      id: rid,
1892                      action: 'penci_html_mega_menu',
1893                      _: Date.now()
1894                    },
1895                    function (response) {
1896                      sessionStorage.setItem(save_name, response.data);
1897
1898                      w.append(response.data);
1899                      w.removeClass('loading').addClass('loaded');
1900
1901                      var $row_active = w.find('.row-active');
1902                      $row_active.fadeIn(200).css('display', 'inline-block');
1903
1904                      $('body').trigger('penci-ajax-menu-loaded');
1905                    },
1906                    'json'
1907                  );
1908                }
1909              }
1910            }
1911      })
1912    }
1913
1914    /* Mobile AJAX Menu
1915    ----------------------------------------------------------------*/
1916    PENCI.mobile_ajax_menu = function () {
1917        $('.penci-megamenu').each(function (index, element) {
1918          var w = $(this);
1919              if ( w.hasClass('loadingm') ) {
1920                return
1921              }
1922              if ( ! w.hasClass('loaded') ) {
1923                var menu = w.attr('data-menu'),
1924                    item = w.attr('data-item'),
1925                    catid = w.attr('data-catid'),
1926                    number = w.attr('data-number'),
1927                    style = w.attr('data-style'),
1928                    rid = w.attr('data-id'),
1929                    position = w.attr('data-position')
1930
1931                w.addClass('loadingm')
1932
1933                if ( menu && item && catid && number && style && rid && position ) {
1934
1935                  var save_name = 'penci_megamn_m_'+menu+item+catid+number+style+position;
1936
1937                  if (sessionStorage.getItem(save_name) ) {
1938                    w.append(sessionStorage.getItem(save_name))
1939                    w.removeClass('loadingm')
1940                    w.addClass('loaded')
1941
1942                    var $row_active = w.find('.row-active')
1943                    $row_active.fadeIn('200').css('display', 'inline-block')
1944
1945                    $('body').trigger('penci-ajax-menu-loaded')
1946                  } else {
1947
1948                    $.get(
1949                      ajax_var_more.megamenu_url,
1950                      {
1951                        menu: menu,
1952                        item: item,
1953                        catid: catid,
1954                        number: number,
1955                        style: style,
1956                        position: position,
1957                        id: rid,
1958                        action: 'penci_html_mega_menu',
1959                        _: Date.now() // prevent caching issues
1960                      },
1961                      function (response) {
1962                        sessionStorage.setItem(save_name, response.data);
1963
1964                        w.append(response.data);
1965                        w.removeClass('loadingm').addClass('loaded');
1966
1967                        var $row_active = w.find('.row-active');
1968                        $row_active.fadeIn(200).css('display', 'inline-block');
1969
1970                        $('body').trigger('penci-ajax-menu-loaded');
1971                      },
1972                      'json'
1973                    );
1974                  }
1975                }
1976              }
1977        })
1978    }
1979
1980    /* Mobile menu responsive
1981 ----------------------------------------------------------------*/
1982    PENCI.mobile_menu = function () {
1983      // Add indicator
1984      $('#sidebar-nav .menu li.menu-item-has-children > a').
1985        append('<u class="indicator"><i class="fa fa-angle-down"></i></u>')
1986
1987      // Toggle menu when click show/hide menu
1988      $('#navigation .button-menu-mobile').on('click', function () {
1989        $('body').addClass('open-sidebar-nav')
1990      })
1991
1992      // indicator click
1993      $('#sidebar-nav .menu li a .indicator').on('click', function (e) {
1994        if ($('body').hasClass('penci-vernav-cparent')) {
1995          return
1996        }
1997        var $this = $(this)
1998        e.preventDefault()
1999        $this.children().toggleClass('fa-angle-up')
2000        $this.parent().next().slideToggle('fast')
2001      })
2002
2003      $('.penci-vernav-cparent #sidebar-nav .menu li.menu-item-has-children > a').
2004        on('click', function (e) {
2005          var $this = $(this)
2006          e.preventDefault()
2007          $this.children().children().toggleClass('fa-angle-up')
2008          $this.next().slideToggle('fast')
2009        })
2010
2011      // Close sidebar nav
2012      $('body').on('click', '#close-sidebar-nav', function (e) {
2013        e.preventDefault()
2014        $('body').removeClass('open-sidebar-nav')
2015      })
2016    }
2017
2018    PENCI.toggleMenuHumburger = function () {
2019      var $menuhumburger = $('.penci-menu-hbg')
2020      if ($menuhumburger.length) {
2021        var $body = $('body'),
2022          $button = $(
2023            '.penci-vernav-toggle,.penci-menuhbg-toggle,#penci-close-hbg,.penci-menu-hbg
2023-overlay'),
2024          sidebarClass = 'penci-menuhbg-open'
2025
2026        // Add indicator
2027        $('.penci-menu-hbg .menu li.menu-item-has-children > a').
2028          append('<u class="indicator"><i class="fa fa-angle-down"></i></u>')
2029
2030        // indicator click
2031        $('.penci-menu-hbg .menu li a .indicator').on('click', function (e) {
2032          if ($('body').hasClass('penci-hbg-cparent') &&
2033            !$menuhumburger.hasClass('penci-builder-mobile-sidebar-nav')) {
2034            return
2035          }
2036          if ($menuhumburger.hasClass('penci-builder-mobile-sidebar-nav') &&
2037            $menuhumburger.find('.pchb-cparent').length) {
2038            return
2039          }
2040          var $this = $(this)
2041          e.preventDefault()
2042          $this.children().toggleClass('fa-angle-up')
2043          $this.parent().next().slideToggle('fast')
2044        })
2045
2046        $('.penci-hbg-cparent .penci-menu-hbg .menu li.menu-item-has-children > a').
2047          on('click', function (e) {
2048            var $this = $(this)
2049            e.preventDefault()
2050            $this.children().children().toggleClass('fa-angle-up')
2051            $this.next().slideToggle('fast')
2052          })
2053
2054        // Click to show mobile menu
2055        $button.on('click', function (e) {
2056          e.preventDefault()
2057
2058          if ($body.hasClass(sidebarClass)) {
2059            $body.removeClass(sidebarClass)
2060            $button.removeClass('active')
2061
2062            return
2063          }
2064          e.stopPropagation() // Do not trigger click event on '.site' below
2065          $body.addClass(sidebarClass)
2066          $button.addClass('active')
2067
2068        })
2069      }
2070    }
2071    
2072    PENCI.ElementorHumburger = function () {
2073      var $menuhumburger = $('.penci-menu-hbg-ele')
2074      if ($menuhumburger.length) {
2075        var $body = $('body'),
2076          $button = $(
2077            '.penci-vernav-toggle,.penci-menuhbg-toggle,#penci-close-hbg,.penci-menu-hbg-overlay'),
2078          sidebarClass = 'penci-menuhbg-open'
2079
2080        // Add indicator
2081        $('.penci-menu-hbg-ele .menu li.menu-item-has-children > a').
2082          append('<u class="indicator"><i class="fa fa-angle-down"></i></u>')
2083
2084        // indicator click
2085        $('.penci-menu-hbg-ele .menu li a .indicator').on('click', function (e) {
2086          if ($('body').hasClass('penci-hbg-cparent') &&
2087            !$menuhumburger.hasClass('penci-builder-mobile-sidebar-nav')) {
2088            return
2089          }
2090          if ($menuhumburger.hasClass('penci-builder-mobile-sidebar-nav') &&
2091            $menuhumburger.find('.pchb-cparent').length) {
2092            return
2093          }
2094          var $this = $(this)
2095          e.preventDefault()
2096          $this.children().toggleClass('fa-angle-up')
2097          $this.parent().next().slideToggle('fast')
2098        })
2099
2100        $('.penci-hbg-cparent .penci-menu-hbg-ele .menu li.menu-item-has-children > a').
2101          on('click', function (e) {
2102            var $this = $(this)
2103            e.preventDefault()
2104            $this.children().children().toggleClass('fa-angle-up')
2105            $this.next().slideToggle('fast')
2106          })
2107
2108        // Click to show mobile menu
2109        $button.on('click', function (e) {
2110          e.preventDefault()
2111
2112          if ($body.hasClass(sidebarClass)) {
2113            $body.removeClass(sidebarClass)
2114            $button.removeClass('active')
2115
2116            return
2117          }
2118          e.stopPropagation() // Do not trigger click event on '.site' below
2119          $body.addClass(sidebarClass)
2120          $button.addClass('active')
2121
2122        })
2123      }
2124    }
2125
2126    /* Light box
2127 ----------------------------------------------------------------*/
2128    PENCI.lightbox = function () {
2129      if ($().magnificPopup) {
2130        $('a[data-rel^="penci-gallery-image-content"], .penci-enable-lightbox .gallery-item a').
2131          magnificPopup({
2132            type: 'image',
2133            closeOnContentClick: true,
2134            closeBtnInside: false,
2135            fixedContentPos: true,
2136            image: {
2137              verticalFit: true,
2138              titleSrc: 'data-cap',
2139            },
2140            gallery: {
2141              enabled: true,
2142            },
2143            zoom: {
2144              enabled: false,
2145              duration: 300,
2146            },
2147          })
2148
2149        $('a[data-rel^="penci-gallery-bground-content"]').magnificPopup({
2150          type: 'image',
2151          closeOnContentClick: true,
2152          closeBtnInside: false,
2153          fixedContentPos: true,
2154          image: {
2155            verticalFit: true,
2156          },
2157          gallery: {
2158            enabled: true,
2159          },
2160        })
2161
2162        // Enable lightbox videos
2163        $('.penci-other-layouts-lighbox').magnificPopup({
2164          type: 'iframe',
2165          mainClass: 'mfp-fade',
2166          fixedContentPos: true,
2167          closeBtnInside: false,
2168          closeOnContentClick: true,
2169        })
2170
2171        if ($('.penci-image-gallery').length) {
2172          $('.penci-image-gallery').each(function () {
2173            var $this = $(this),
2174              id = $this.attr('id')
2175
2176            $('#' + id + ' a.penci-gallery-ite').magnificPopup({
2177              type: 'image',
2178              closeOnContentClick: true,
2179              closeBtnInside: false,
2180              fixedContentPos: true,
2181              image: {
2182                verticalFit: true,
2183                titleSrc: 'data-cap',
2184              },
2185              gallery: {
2186                enabled: true,
2187              },
2188            })
2189          })
2190        }
2191
2192        if ($('.penci-post-gallery-container').length) {
2193          $('.penci-post-gallery-container').each(function () {
2194            var $this = $(this),
2195              id = $this.attr('id')
2196
2197            $('#' + id + ' a.penci-gallery-ite').magnificPopup({
2198              type: 'image',
2199              closeOnContentClick: true,
2200              closeBtnInside: false,
2201              fixedContentPos: true,
2202              image: {
2203                verticalFit: true,
2204                titleSrc: 'data-cap',
2205              },
2206              gallery: {
2207                enabled: true,
2208              },
2209            })
2210          })
2211        }
2212
2213      } // if magnificPopup exists
2214    }
2215
2216    /* Masonry layout
2217 ----------------------------------------------------------------*/
2218    PENCI.masonry = function () {
2219      var $masonry_container = $(
2220        '.penci-masonry, .penci-bgstyle-2 .penci-biggrid-data')
2221      if ($masonry_container.length) {
2222        $masonry_container.each(function () {
2223          var $this = $(this)
2224          $this.imagesLoaded(function () {
2225            // initialize isotope
2226            $this.isotope({
2227              itemSelector: '.item-masonry',
2228              transitionDuration: '.55s',
2229              layoutMode: 'masonry',
2230            })
2231          })
2232        })
2233      }
2234    }
2235
2236    /* Video Background
2237 ----------------------------------------------------------------*/
2238    PENCI.video_background = function () {
2239      var $penci_videobg = $('#penci-featured-video-bg')
2240      if ($penci_videobg.length) {
2241        $($penci_videobg).each(function () {
2242          var $this = $(this),
2243            $src = $this.data('videosrc'),
2244            $startime = $this.data('starttime'),
2245            $jarallaxArgs = {
2246              videoSrc: $src,
2247              videoStartTime: $startime,
2248              videoPlayOnlyVisible: false,
2249            }
2250
2251          jarallax($this, $jarallaxArgs)
2252          $('.featured-area').addClass('loaded-wait')
2253          setTimeout(function () {
2254            $('.featured-area').addClass('loaded-animation')
2255          }, 1500)
2256        })
2257      }
2258    }
2259
2260    /* Portfolio
2261 ----------------------------------------------------------------*/
2262    PENCI.AjaxPortfolio = function () {
2263      
2264      var $penci_portfolio_w = $('.wrapper-penci-portfolio.pcpt-ajax-ftl'),
2265          $penci_portfolio = $penci_portfolio_w.find('.penci-portfolio'),
2266          $penci_portfolio_i = $penci_portfolio_w.find('.inner-portfolio-posts'),
2267          $filter_a = $penci_portfolio_w.find('.penci-portfolio-filter a'),
2268          unique_id = $penci_portfolio.attr('id'),
2269          pagenavi = $penci_portfolio_w.find('.penci-pagenavi-shortcode'),
2270          DataFilter = null
2271
2272      if (typeof (
2273          portfolioDataJs
2274        ) != 'undefined' && portfolioDataJs !==
2275        null) {
2276        for (var e in portfolioDataJs) {
2277
2278          if (portfolioDataJs[e].instanceId == unique_id) {
2279            DataFilter = portfolioDataJs[e]
2280          }
2281        }
2282      }
2283
2284      if ($().isotope && $penci_portfolio_i.length) {
2285        $penci_portfolio_i.each(function () {
2286          var $this = $(this)
2287
2288          $this.imagesLoaded(function () {
2289            $this.isotope({
2290              itemSelector: '.portfolio-item',
2291              animationEngine: 'best-available',
2292              animationOptions: {
2293                duration: 250,
2294                queue: false,
2295              },
2296            }) // isotope
2297
2298            $this.addClass('loaded')
2299
2300            $('.portfolio-item .inner-item-portfolio').each(function () {
2301              var $this = $(this)
2302              $this.one('inview',
2303                function (event, isInView, visiblePartX, visiblePartY) {
2304                  $this.addClass('animated')
2305                }) // inview
2306            }) // each
2307          })
2308        })
2309      }
2310      
2311      $filter_a.on('click', function(e) {
2312        e.preventDefault();
2313        var filter_a = $(this),
2314            term = filter_a.attr('data-term'),
2315            paged = filter_a.attr('data-paged') ? parseInt( filter_a.attr('data-paged') ) : 1,
2316            term_wrapper = $penci_portfolio.find('.pcpt_data_' + term),
2317            df_wrapper =  $penci_portfolio.find('.inner-portfolio-posts:first-child'),
2318            loadmorebtm = $penci_portfolio_w.find('.penci-ajax-more-button'),
2319            mesNoMore = loadmorebtm.data('mes_no_more'),
2320            mes = loadmorebtm.data('mes')
2321
2322
2323          if ( filter_a.hasClass('loadmore-finish') ) {
2324            loadmorebtm.find('.ajax-more-text').html(mesNoMore)
2325            loadmorebtm.addClass('disable')
2326          } else {
2327            loadmorebtm.find('.ajax-more-text').html(mes)
2328            loadmorebtm.removeClass('disable')
2329          }
2330
2331          if ( filter_a.hasClass('loading-data') || filter_a.closest('li').hasClass('active') ){
2332            return;
2333          }
2334
2335          $penci_portfolio_w.find('.penci-portfolio-filter li').removeClass('active');
2336          filter_a.closest('li').addClass('active')
2337
2338          filter_a.addClass('loading-data')
2339          $penci_portfolio.addClass('pcftaj-ld')
2340
2341
2342          if ( term == '*' ) {
2343            $penci_portfolio.find('.inner-portfolio-posts').hide()
2344            $penci_portfolio.find('.inner-portfolio-posts').removeClass('loaded')
2345            df_wrapper.show()
2346            df_wrapper.isotope('layout')
2347            df_wrapper.addClass('loaded')
2348            filter_a.removeClass('loading-data');
2349            $penci_portfolio.removeClass('pcftaj-ld');
2350            return
2351          }
2352
2353          if( filter_a.hasClass('loaded_data')){
2354            $penci_portfolio.find('.inner-portfolio-posts').hide()
2355            $penci_portfolio.find('.inner-portfolio-posts').removeClass('loaded')
2356            $('.pcpt_data_' + term).show()
2357            $('.pcpt_data_' + term).isotope('layout')
2358            $('.pcpt_data_' + term).addClass('loaded')
2359            filter_a.removeClass('loading-data');
2360            $penci_portfolio.removeClass('pcftaj-ld');
2361            return;
2362          }
2363
2364          if( filter_a.hasClass('load_full')){
2365            pagenavi.hide();
2366          } else {
2367            pagenavi.show();
2368          }
2369
2370        DataFilter.currentTerm = term
2371        DataFilter.query.paged = paged
2372
2373        var data = {
2374          action: 'penci_pfl_more_post_ajax',
2375          datafilter: DataFilter,
2376          nonce: ajax_var_more.nonce,
2377        }
2378
2379        $.post(ajax_var_more.url, data, function (response) {
2380
2381          filter_a.attr('data-paged', paged + 1)
2382
2383          var $data = $(response.data.items)
2384
2385          if ( ! term_wrapper.length && term != '*' ) {
2386            $penci_portfolio.append('<div class="inner-portfolio-posts pcpt_data_'+ term +'"></div>')
2387          }
2388
2389          $penci_portfolio.find('.inner-portfolio-posts').hide()
2390          $penci_portfolio.find('.inner-portfolio-posts').removeClass('loaded')
2391          $('.pcpt_data_' + term).show()
2392          $('.pcpt_data_' + term).addClass('loaded')
2393
2394          if ( $data.length > 0 ) {
2395            $('.pcpt_data_' + term).isotope()
2396            .append( $data )
2397            .isotope( 'appended', $data )
2398            .isotope('layout');
2399            filter_a.addClass('loaded_data')
2400          } else {
2401            $('.pcpt_data_' + term).isotope().isotope('layout')
2402            filter_a.addClass('load_full')
2403          }
2404
2405          $('.container').fitVids({ ignore: '.penci-sticky-video' })
2406
2407          $('a[data-rel^="penci-gallery-image-content"]').magnificPopup({
2408            type: 'image',
2409            closeOnContentClick: true,
2410            closeBtnInside: false,
2411            fixedContentPos: true,
2412            image: {
2413              verticalFit: true,
2414            },
2415            gallery: {
2416              enabled: true,
2417            },
2418            zoom: {
2419              enabled: false,
2420              duration: 300,
2421            },
2422          })
2423
2424          $('.portfolio-item .inner-item-portfolio').each(function () {
2425            var $this = $(this)
2426            $this.one('inview',
2427              function (event, isInView, visiblePartX, visiblePartY) {
2428                $this.addClass('animated')
2429              }) // inview
2430          }) // each
2431
2432          filter_a.removeClass('loading-data')
2433          $penci_portfolio.removeClass('pcftaj-ld')
2434        })
2435      });
2436
2437      PENCI.Ajax_Portfolio_LoadMore.loadMore(DataFilter)
2438      PENCI.Ajax_Portfolio_LoadMore.infinityScroll(DataFilter)
2439      
2440    }
2441
2442    PENCI.Ajax_Portfolio_LoadMore = {
2443      btnLoadMore: $('.penci-plf-loadmore'),
2444      loadMore: function (DataFilter) {
2445        var self = this
2446        $('body').on('click', '.penci-plf-loadmore .penci-ajax-more-button', function (event) {
2447          self.actionLoadMore($(this), DataFilter)
2448        })
2449      },
2450      infinityScroll: function (DataFilter) {
2451        var self = this,
2452          $handle = $('.penci-plf-loadmore'),
2453          $button_load = $handle.find('.penci-ajax-more-button')
2454
2455        if ($handle.hasClass('penci-infinite-scroll')) {
2456          $(window).on('scroll', function () {
2457            var hT = $button_load.offset().top,
2458              hH = $button_load.outerHeight(),
2459              wH = $(window).height(),
2460              wS = $(this).scrollTop()
2461
2462            if ((
2463              wS > (
2464                hT + hH - wH
2465              )
2466            ) && $button_load.length) {
2467              self.actionLoadMore($button_load, DataFilter)
2468            }
2469          }).trigger('scroll')
2470        }
2471      },
2472      actionLoadMore: function ($button_load, DataFilter) {
2473        if ($button_load.hasClass('loading-portfolios')) {
2474          return false
2475        }
2476
2477        $button_load.addClass('loading-portfolios')
2478
2479        var mesNoMore = $button_load.data('mes_no_more'),
2480            mes = $button_load.data('mes'),
2481            currentItem = $button_load.closest('.wrapper-penci-portfolio').find('.penci-portfolio-filter li.active a'),
2482            $wrap_content = $button_load.closest('.wrapper-penci-portfolio').find('.inner-portfolio-posts.loaded'),
2483            term_name = currentItem.attr('data-term'),
2484            term_paged = currentItem.attr('data-paged')
2485
2486
2487            DataFilter.currentTerm = term_name
2488            DataFilter.query.paged = term_paged
2489
2490        var data = {
2491          action: 'penci_pfl_more_post_ajax',
2492          datafilter: DataFilter,
2493          nonce: ajax_var_more.nonce,
2494        }
2495        $.post(ajax_var_more.url, data, function (response) {
2496          if (!response.data.items) {
2497            $button_load.find('.ajax-more-text').html(mesNoMore)
2498            $button_load.removeClass('loading-portfolios')
2499
2500            currentItem.addClass('loadmore-finish')
2501            $wrap_content.addClass('nore-moreposts')
2502            $button_load.addClass('disable')
2503            return false
2504          }
2505
2506          currentItem.attr('data-paged', term_paged + 1)
2507
2508          var $data = $(response.data.items)
2509
2510          $wrap_content.append($data)
2511          $wrap_content.isotope('appended', $data).imagesLoaded(function () {
2512            $wrap_content.isotope('layout')
2513          })
2514
2515          $('.container').fitVids({ ignore: '.penci-sticky-video' })
2516
2517          $('a[data-rel^="penci-gallery-image-content"]').magnificPopup({
2518            type: 'image',
2519            closeOnContentClick: true,
2520            closeBtnInside: false,
2521            fixedContentPos: true,
2522            image: {
2523              verticalFit: true,
2524            },
2525            gallery: {
2526              enabled: true,
2527            },
2528            zoom: {
2529              enabled: false,
2530              duration: 300,
2531            },
2532          })
2533
2534          $('.portfolio-item .inner-item-portfolio').each(function () {
2535            var $this = $(this)
2536            $this.one('inview',
2537              function (event, isInView, visiblePartX, visiblePartY) {
2538                $this.addClass('animated')
2539              }) // inview
2540          }) // each
2541
2542          $button_load.removeClass('loading-portfolios')
2543        })
2544      },
2545    }
2546
2547    // end portfolio ajax
2548
2549    PENCI.portfolio = function () {
2550      var $penci_portfolio = $('.penci-portfolio')
2551
2552      if ( $penci_portfolio.hasClass( 'pcpt-ajax-ftl' ) ) {
2553        return;
2554      }
2555
2556      if ($().isotope && $penci_portfolio.length) {
2557        $('.penci-portfolio').each(function () {
2558          var $this = $(this),
2559            unique_id = $(this).attr('id'),
2560            DataFilter = null
2561
2562          if (typeof (
2563              portfolioDataJs
2564            ) != 'undefined' && portfolioDataJs !==
2565            null) {
2566            for (var e in portfolioDataJs) {
2567
2568              if (portfolioDataJs[e].instanceId == unique_id) {
2569                var DataFilter = portfolioDataJs[e]
2570              }
2571            }
2572          }
2573
2574          $this.imagesLoaded(function () {
2575            $this.isotope({
2576              itemSelector: '.portfolio-item',
2577              animationEngine: 'best-available',
2578              animationOptions: {
2579                duration: 250,
2580                queue: false,
2581              },
2582            }) // isotope
2583
2584            $this.addClass('loaded')
2585
2586            $('.portfolio-item .inner-item-portfolio').each(function () {
2587              var $this = $(this)
2588              $this.one('inview',
2589                function (event, isInView, visiblePartX, visiblePartY) {
2590                  $this.addClass('animated')
2591                }) // inview
2592            }) // each
2593
2594            var location = window.location.hash.toString()
2595            if (location.length) {
2596              location = location.replace('#', '')
2597              location.match(/:/)
2598              var Mlocation = location.match(/^([^:]+)/)[1]
2599              location = location.replace(Mlocation + ':', '')
2600
2601              if (location.length > 1) {
2602
2603                var $termActive = $afilter.filter(
2604                    '[data-term="' + location + '"]'),
2605                  portfolioItem = $this.find('.portfolio-item'),
2606                  $buttonLoadMore = $this.parent().
2607                    find('.penci-pagenavi-shortcode')
2608
2609                if ($termActive.length) {
2610
2611                  liFilter.removeClass('active')
2612                  $termActive.parent().addClass('active')
2613                  $this.isotope({ filter: '.penci-' + location })
2614
2615                  var dataTerm = $termActive.data('term'),
2616                    p = {}
2617
2618                  DataFilter.currentTerm = dataTerm
2619                  $.each(DataFilter.countByTerms, function (t, e) {
2620                    p[t] = 0
2621                  })
2622
2623                  portfolioItem.each(function (t, e) {
2624                    $.each((
2625                      $(e).data('terms') + ''
2626                    ).split(' '), function (t, e) {
2627                      p[e]++
2628                    })
2629                  })
2630
2631                  var show_button = 'number' == typeof p[dataTerm] &&
2632                    p[dataTerm] == DataFilter.countByTerms[dataTerm]
2633                  if ($buttonLoadMore.length) {
2634                    if (portfolioItem.length !== DataFilter.count &&
2635                      !show_button) {
2636                      $buttonLoadMore.show()
2637                    } else {
2638                      $buttonLoadMore.hide()
2639                    }
2640                  }
2641                }
2642              }
2643            }
2644          }) // imagesloaded
2645
2646          // Filter items when filter link is clicked
2647          var $filter = $this.parent().find('.penci-portfolio-filter'),
2648            $afilter = $filter.find('a'),
2649            liFilter = $filter.find('li')
2650
2651          liFilter.on('click', function () {
2652
2653            var self = $(this),
2654              term = self.find('a').data('term'),
2655              selector = self.find('a').attr('data-filter'),
2656              $e_dataTerm = $filter.find('a').
2657                filter('[data-term="' + term + '"]'),
2658              portfolioItem = $this.find('.portfolio-item'),
2659              $buttonLoadMore = $this.parent().
2660                find('.penci-pagenavi-shortcode'),
2661              scrollTop = $(window).scrollTop()
2662
2663            liFilter.removeClass('active')
2664            self.addClass('active')
2665
2666            $this.parent().
2667              find('.penci-ajax-more-button').
2668              attr('data-cat', term)
2669
2670            $this.isotope({ filter: selector })
2671
2672            if ($e_dataTerm.length) {
2673              window.location.hash = '*' == term ? '' : term
2674
2675              $(window).scrollTop(scrollTop)
2676            }
2677
2678            var p = {}
2679            DataFilter.currentTerm = term
2680            $.each(DataFilter.countByTerms, function (t, e) {
2681              p[t] = 0
2682            })
2683
2684            portfolioItem.each(function (t, e) {
2685              $.each((
2686                $(e).data('terms') + ''
2687              ).split(' '), function (t, e) {
2688                p[e]++
2689              })
2690            })
2691
2692            var show_button = 'number' == typeof p[term] && p[term] ==
2693              DataFilter.countByTerms[term]
2694            if ($buttonLoadMore.length) {
2695              if (portfolioItem.length !== DataFilter.count && !show_button) {
2696                $buttonLoadMore.show()
2697              } else {
2698                $buttonLoadMore.hide()
2699              }
2700            }
2701
2702            return false
2703          })
2704
2705          PENCI.portfolioLoadMore.loadMore($this, DataFilter)
2706          PENCI.portfolioLoadMore.infinityScroll(DataFilter)
2707
2708        }) // each .penci-portfolio
2709
2710      }	// end if isotope & portfolio
2711
2712      var $btnLoadMore = $('.penci-plf-loadmore')
2713      if (!$().isotope || !$btnLoadMore.length) {
2714        return false
2715      }
2716    }
2717
2718    PENCI.portfolioLoadMore = {
2719      btnLoadMore: $('.penci-plf-loadmore'),
2720      loadMore: function ($pfl_wapper, DataFilter) {
2721        var self = this
2722        $('body').on('click', '.penci-ajax-more-button', function (event) {
2723          self.actionLoadMore($(this), $pfl_wapper, DataFilter)
2724        })
2725      },
2726      infinityScroll: function (DataFilter) {
2727        var self = this,
2728          $handle = $('.penci-plf-loadmore'),
2729          $button_load = $handle.find('.penci-ajax-more-button')
2730
2731        if ($handle.hasClass('penci-infinite-scroll')) {
2732          $(window).on('scroll', function () {
2733            var hT = $button_load.offset().top,
2734              hH = $button_load.outerHeight(),
2735              wH = $(window).height(),
2736              wS = $(this).scrollTop()
2737
2738            if ((
2739              wS > (
2740                hT + hH - wH
2741              )
2742            ) && $button_load.length) {
2743              var $pfl_wapper = $button_load.closest('.penci-portfolio')
2744              self.actionLoadMore($button_load, $pfl_wapper, DataFilter)
2745            }
2746          }).trigger('scroll')
2747        }
2748      },
2749      actionLoadMore: function ($button_load, $pfl_wapper, DataFilter) {
2750        if ($button_load.hasClass('loading-portfolios')) {
2751          return false
2752        }
2753
2754        $button_load.addClass('loading-portfolios')
2755
2756        var mesNoMore = $button_load.data('mes_no_more'),
2757          mes = $button_load.data('mes')
2758
2759        DataFilter.pflShowIds = []
2760
2761        $button_load.closest('.wrapper-penci-portfolio').
2762          find('.portfolio-item').
2763          each(function (t, e) {
2764            DataFilter.pflShowIds.push($(e).data('pflid'))
2765          })
2766
2767        var data = {
2768          action: 'penci_pfl_more_post_ajax',
2769          datafilter: DataFilter,
2770          nonce: ajax_var_more.nonce,
2771        }
2772        $.post(ajax_var_more.url, data, function (response) {
2773          if (!response.data.items) {
2774            $button_load.find('.ajax-more-text').html(mesNoMore)
2775            $button_load.removeClass('loading-portfolios')
2776
2777            $button_load.closest('.wrapper-penci-portfolio').
2778              find('.penci-portfolio-filter li.active').
2779              addClass('loadmore-finish')
2780
2781            setTimeout(function () {
2782              $button_load.parent().parent().hide()
2783              $button_load.find('.ajax-more-text').html(mes)
2784            }, 1200)
2785
2786            return false
2787          }
2788
2789          var $wrap_content = $button_load.closest('.wrapper-penci-portfolio').
2790              find('.penci-portfolio'),
2791            $data = $(response.data.items)
2792
2793          $wrap_content.find('.inner-portfolio-posts').append($data)
2794          $wrap_content.isotope('appended', $data).imagesLoaded(function () {
2795            $wrap_content.isotope('layout')
2796          })
2797
2798          $('.container').fitVids({ ignore: '.penci-sticky-video' })
2799
2800          $('a[data-rel^="penci-gallery-image-content"]').magnificPopup({
2801            type: 'image',
2802            closeOnContentClick: true,
2803            closeBtnInside: false,
2804            fixedContentPos: true,
2805            image: {
2806              verticalFit: true,
2807            },
2808            gallery: {
2809              enabled: true,
2810            },
2811            zoom: {
2812              enabled: false,
2813              duration: 300,
2814            },
2815          })
2816
2817          $wrap_content.addClass('loaded')
2818
2819          $('.portfolio-item .inner-item-portfolio').each(function () {
2820            var $this = $(this)
2821            $this.one('inview',
2822              function (event, isInView, visiblePartX, visiblePartY) {
2823                $this.addClass('animated')
2824              }) // inview
2825          }) // each
2826
2827          $button_load.removeClass('loading-portfolios')
2828        })
2829      },
2830    }
2831
2832    /* Gallery
2833 ----------------------------------------------------------------*/
2834    PENCI.gallery = function () {
2835      var $justified_gallery = $('.penci-post-gallery-container.justified')
2836      var $masonry_gallery = $('.penci-post-gallery-container.masonry')
2837      if ($().justifiedGallery && $justified_gallery.length) {
2838        $('.penci-post-gallery-container.justified').each(function () {
2839          var $this = $(this)
2840          $this.justifiedGallery({
2841            rowHeight: $this.data('height'),
2842            lastRow: 'nojustify',
2843            margins: $this.data('margin'),
2844            randomize: false,
2845          })
2846        }) // each .penci-post-gallery-container
2847      }
2848
2849      if ($().isotope && $masonry_gallery.length) {
2850
2851        $('.penci-post-gallery-container.masonry .item-gallery-masonry').
2852          each(function () {
2853            var $this = $(this).children()
2854            if ($this.attr('data-cap') && !$this.hasClass('added-caption')) {
2855              var $title = $this.attr('data-cap')
2856              if ($title !== 'undefined') {
2857                $this.children().
2858                  append('<div class="caption">' + $title + '</div>')
2859                $this.addClass('added-caption')
2860              }
2861
2862            }
2863          })
2864      }
2865
2866      if ($masonry_gallery.length) {
2867        $masonry_gallery.each(function () {
2868          var $this = $(this)
2869          $this.imagesLoaded(function () {
2870            // initialize isotope
2871            $this.isotope({
2872              itemSelector: '.item-gallery-masonry',
2873              transitionDuration: '.55s',
2874              layoutMode: 'masonry',
2875            })
2876
2877            $this.addClass('loaded')
2878
2879            $('.penci-post-gallery-container.masonry .item-gallery-masonry').
2880              each(function () {
2881                var $this = $(this)
2882                $this.one('inview',
2883                  function (event, isInView, visiblePartX, visiblePartY) {
2884                    $this.children().addClass('animated')
2885                  }) // inview
2886              }) // each
2887          })
2888        })
2889      }
2890    },
2891
2892      /* Jarallax
2893 ----------------------------------------------------------------*/
2894      PENCI.Jarallax = function () {
2895        if (!$.fn.jarallax || !$('.penci-jarallax').length) {
2896          return false
2897        }
2898        $('.penci-jarallax').each(function () {
2899          var $this = $(this),
2900            $jarallaxArgs = {}
2901
2902          $this.imagesLoaded({ background: true }, function () {
2903            jarallax($this, $jarallaxArgs)
2904          })
2905        })
2906      },
2907
2908      /* Related Popup
2909 ----------------------------------------------------------------*/
2910      PENCI.RelatedPopup = function () {
2911        if ($('.penci-rlt-popup').length) {
2912          var rltpopup = $('.penci-rlt-popup'),
2913            rltclose = $('.penci-rlt-popup .penci-close-rltpopup'),
2914            rltlazy = rltpopup.find('.penci-lazy')
2915
2916          $('body').on('inview', '.penci-flag-rlt-popup',
2917            function (event, isInView, visiblePartX, visiblePartY) {
2918              if (!rltpopup.hasClass('rltpopup-notshow-again') &&
2919                isInView) {
2920                rltpopup.addClass('rltpopup-show-up')
2921                rltclose.on('click', function (e) {
2922                  e.preventDefault()
2923                  rltpopup.removeClass('rltpopup-show-up').
2924                    addClass('rltpopup-notshow-again')
2925                })
2926              }
2927            })
2928          rltclose.on('click', function (e) {
2929            e.preventDefault()
2930            rltpopup.removeClass('rltpopup-show-up').
2931              addClass('rltpopup-notshow-again')
2932          })
2933        }
2934      },
2935
2936      PENCI.extraFunction = {
2937        init: function () {
2938          this.counterUp()
2939          this.progressBar()
2940          this.loginPopup()
2941          this.recoverPassPopup()
2942          this.registerPopup()
2943          this.login()
2944          this.register()
2945          this.map()
2946          if ($('#penci_agreebox').is(':checked')) {
2947            $('.register-input-checkbox').addClass('checked');
2948          }
2949          $('body').on('change', '#penci_agreebox', function () {
2950              if ($(this).is(':checked')) {
2951                  $('.register-input-checkbox').addClass('checked');
2952              } else {
2953                  $('.register-input-checkbox').removeClass('checked');
2954              }
2955          });
2956        },
2957        progressBar: function () {
2958          if ($('.penci-review-process').length) {
2959            $('.penci-review-process').each(function () {
2960              var $this = $(this),
2961                $bar = $this.children(),
2962                $bar_w = $bar.data('width') * 10
2963              $this.one('inview',
2964                function (event, isInView, visiblePartX, visiblePartY) {
2965                  $bar.animate({ width: $bar_w + '%' }, 1000)
2966                }) // bind inview
2967            }) // each
2968          }
2969
2970          if ($.fn.easyPieChart && $('.penci-piechart').length) {
2971            $('.penci-piechart').each(function () {
2972              var $this = $(this)
2973              $this.one('inview',
2974                function (event, isInView, visiblePartX, visiblePartY) {
2975                  var chart_args = {
2976                    barColor: $this.data('color'),
2977                    trackColor: $this.data('trackcolor'),
2978                    scaleColor: false,
2979                    lineWidth: $this.data('thickness'),
2980                    size: $this.data('size'),
2981                    animate: 1000,
2982                  }
2983                  $this.easyPieChart(chart_args)
2984                }) // bind inview
2985            }) // each
2986          }
2987        },
2988        counterUp: function () {
2989          var $counterup = $('.penci-counterup-number')
2990
2991          if (!$.fn.counterUp || !$counterup.length) {
2992            return false
2993          }
2994
2995          $counterup.each(function () {
2996            var $this = $(this)
2997
2998            $this.one('inview',
2999              function (event, isInView, visiblePartX, visiblePartY) {
3000                setTimeout(function () {
3001                  $({ countNum: $this.text() }).animate(
3002                    {
3003                      countNum: $this.attr('data-count'),
3004                    },
3005
3006                    {
3007                      duration: 2000,
3008                      easing: 'linear',
3009                      step: function () {
3010                        $this.text(Math.floor(this.countNum))
3011                      },
3012                      complete: function () {
3013                        $this.text(this.countNum)
3014                      },
3015                    },
3016                  )
3017                }, $this.attr('data-delay'))
3018
3019              }) // bind inview
3020          })
3021        },
3022        loginPopup: function () {
3023          var $body = $('body'),
3024            $loginform = $('#penci-loginpopform'),
3025            $loginContainer = $loginform.closest('.penci-popup-wrapper')
3026
3027          if ($loginform.length) {
3028
3029            $('.penci-login-popup-btn a').magnificPopup({
3030              type: 'inline',
3031              midClick: true,
3032              removalDelay: 600,
3033              mainClass: 'penci-popup-animation',
3034            })
3035
3036            $body.on('click', '.penci-lostpassword-btn', function (e) {
3037              var $this = $(this),
3038                $parent = $this.closest('.penci-popup-wrapper')
3039
3040              $parent.children('.penci-popup-passreset').slideDown('normal')
3041              $parent.children('.penci-popup-login').slideUp('normal')
3042              e.preventDefault()
3043              return false
3044            })
3045
3046            $body.on('click', '.penci-register-popup-btn', function (e) {
3047              var $this = $(this),
3048                $parent = $this.closest('.penci-popup-wrapper')
3049
3050              $parent.children('.penci-popup-register').slideDown('normal')
3051              $parent.children('.penci-popup-login').slideUp('normal')
3052              e.preventDefault()
3053              return false
3054            })
3055
3056            $body.on('click', '.penci-login-popup-btn', function (e) {
3057              var $this = $(this),
3058                $parent = $this.closest('.penci-popup-wrapper')
3059
3060              $parent.children('.penci-popup-login').slideDown('normal')
3061              $parent.children('.penci-popup-register').slideUp('normal')
3062              $parent.children('.penci-popup-passreset').slideUp('normal')
3063
3064              e.preventDefault()
3065              return false
3066            })
3067
3068            $('#penci_user, #penci_pass').on('focus', function () {
3069              $(this).removeClass('invalid')
3070            })
3071
3072            $loginform.on('submit', function (e) {
3073              var $this = $(this),
3074                inputUsername = $this.find('#penci_user'),
3075                inputPass = $this.find('#penci_pass'),
3076                valUsername = inputUsername.val(),
3077                valPass = inputPass.val(),
3078                nonce = $this.find('.penci_form_nonce').val(),
3079                gcapcha = $this.find('.g-recaptcha-response')
3080              if (gcapcha.length) {
3081                var captcha = gcapcha.val()
3082              } else {
3083                var captcha = 'noexists'
3084              }
3085
3086              if (inputUsername.length > 0 && valUsername == '') {
3087                inputUsername.addClass('invalid')
3088                e.preventDefault()
3089              }
3090
3091              if (inputPass.length > 0 && valPass == '') {
3092                inputPass.addClass('invalid')
3093                e.preventDefault()
3094              }
3095
3096              if (valUsername == '' || valPass == '') {
3097                return false
3098              }
3099
3100              $loginContainer.addClass('ajax-loading')
3101              $loginContainer.find('.message').slideDown().remove()
3102
3103              var data = {
3104                action: 'penci_login_ajax',
3105                username: valUsername,
3106                password: valPass,
3107                captcha: captcha,
3108                security: nonce,
3109                remember: $loginContainer.find('#remembermepopup').val(),
3110              }
3111
3112              $.post(ajax_var_more.url, data, function (response) {
3113                $loginContainer.removeClass('ajax-loading')
3114                $loginContainer.children('.penci-popup-login').
3115                  append(response.data)
3116                if (!response.success) {
3117                  return
3118                }
3119
3120                var rdurl = window.location.href,
3121                  curl = ajax_var_more.redirect_url,
3122                  urlPattern = /^(https?:\/\/)?([\w-]+\.)*[\w-]+[\.][\w]+(\/.*)?$/
3123
3124                if (urlPattern.test(curl)) {
3125                  rdurl = curl
3126                }
3127
3128                window.location.href = rdurl + '?singin=true'
3129              })
3130
3131              e.preventDefault()
3132              return false
3133            })
3134          }
3135        },
3136        recoverPassPopup: function () {
3137          var $body = $('body'),
3138            $recoveryform = $('#penci-passreset-popup'),
3139            $recoveryContainer = $recoveryform.closest(
3140              '.penci-popup-wrapper')
3141
3142          if ($recoveryform.length) {
3143
3144            $('.penci_user_email').on('focus', function () {
3145              $(this).removeClass('invalid')
3146            })
3147
3148            $recoveryform.on('submit', function (e) {
3149              e.preventDefault()
3150
3151              var $this = $(this),
3152                inputUsername = $this.find('.penci_user_email'),
3153                valUsername = inputUsername.val(),
3154                nonce = $this.find('.penci_form_nonce').val(),
3155                gcapcha = $this.find('.g-recaptcha-response')
3156              if (gcapcha.length) {
3157                var captcha = gcapcha.val()
3158              } else {
3159                var captcha = 'noexists'
3160              }
3161
3162              if (inputUsername.length > 0 && valUsername == '') {
3163                inputUsername.addClass('invalid')
3164
3165                e.preventDefault()
3166                return false
3167              }
3168
3169              $recoveryContainer.addClass('ajax-loading')
3170              $recoveryContainer.find('.message').slideDown().remove()
3171
3172              var data = {
3173                action: 'penci_resetpass_ajax',
3174                security: nonce,
3175                username: valUsername,
3176                captcha: captcha,
3177              }
3178
3179              $.post(ajax_var_more.url, data, function (response) {
3180                $recoveryContainer.removeClass('ajax-loading')
3181                $recoveryContainer.children('.penci-popup-passreset').
3182                  append(response.data)
3183
3184                return
3185              })
3186
3187              event.preventDefault()
3188              return false
3189            })
3190          }
3191        },
3192        registerPopup: function () {
3193          var $body = $('body'),
3194            $registerform = $('#penci-register-popup'),
3195            $registerContainer = $registerform.closest(
3196              '.penci-popup-wrapper')
3197
3198          if ($registerform.length) {
3199
3200            var $allInput = $(
3201              '.penci_user_name,.penci_user_email,.penci_user_pass,.penci_user_pass_confirm')
3202            $allInput.on('focus', function () {
3203              $(this).removeClass('invalid')
3204            })
3205
3206            $registerform.on('submit', function (e) {
3207              e.preventDefault()
3208
3209              var $this = $(this),
3210                inputUsername = $this.find('.penci_user_name'),
3211                inputEmail = $this.find('.penci_user_email'),
3212                $inputPass = $this.find('.penci_user_pass'),
3213                inputPhone = $this.find('.penci_user_phone'),
3214                $inputPassConfirm = $this.find('.penci_user_pass_confirm'),
3215                valUsername = inputUsername.val(),
3216                valEmail = inputEmail.val(),
3217                valPass = $inputPass.val(),
3218                valPhone = inputPhone.val(),
3219                valPassConfirm = $inputPassConfirm.val(),
3220                nonce = $this.find('.penci_form_nonce').val(),
3221                gcapcha = $this.find('.g-recaptcha-response')
3222              if (gcapcha.length) {
3223                var captcha = gcapcha.val()
3224              } else {
3225                var captcha = 'noexists'
3226              }
3227
3228              $allInput.removeClass('invalid')
3229
3230              if (inputUsername.length > 0 && valUsername == '') {
3231                inputUsername.addClass('invalid')
3232                event.preventDefault()
3233              }
3234              
3235              if (inputPhone.length > 0 && valPhone == '') {
3236                inputPhone.addClass('invalid')
3237                event.preventDefault()
3238              }
3239
3240              if (inputEmail.length > 0 && valEmail == '') {
3241                inputEmail.addClass('invalid')
3242                event.preventDefault()
3243              }
3244
3245              if ($inputPass.length > 0 && valPass == '') {
3246                $inputPass.addClass('invalid')
3247                event.preventDefault()
3248              }
3249
3250              if ($inputPassConfirm.length > 0 && valPassConfirm == '') {
3251                $inputPassConfirm.addClass('invalid')
3252                event.preventDefault()
3253              }
3254              if (valUsername == '' || valEmail == '' || valPass == '' ||
3255                valPassConfirm == '') {
3256                return false
3257              }
3258
3259              $registerContainer.find('.message').slideDown().remove()
3260
3261              // Password does not match the confirm password
3262              if (valPassConfirm !== valPass) {
3263                $inputPass.addClass('invalid')
3264                $inputPassConfirm.addClass('invalid')
3265                $registerContainer.children('.penci-popup-register').
3266                  append(ajax_var_more.errorPass)
3267                event.preventDefault()
3268
3269                return false
3270              }
3271              $registerContainer.addClass('ajax-loading')
3272
3273              var data = {
3274                action: 'penci_register_ajax',
3275                fistName: $this.find('.penci_first_name').val(),
3276                lastName: $this.find('.penci_last_name').val(),
3277                username: valUsername,
3278                password: valPass,
3279                phone: valPhone,
3280                confirmPass: valPassConfirm,
3281                email: valEmail,
3282                security: nonce,
3283                captcha: captcha,
3284              }
3285
3286              $.post(ajax_var_more.url, data, function (response) {
3287                $registerContainer.removeClass('ajax-loading')
3288                $registerContainer.children('.penci-popup-register').
3289                  append(response.data)
3290                if (!response.success) {
3291                  return
3292                }
3293                window.location.href = window.location.href + '?singin=true'
3294              })
3295
3296              event.preventDefault()
3297              return false
3298            })
3299
3300          }
3301        },
3302        login: function () {
3303          var $body = $('body'),
3304            $loginform = $('.penci-loginform'),
3305            $loginContainer = $loginform.parent('.penci-login-wrap')
3306
3307          if ($loginform.length) {
3308            $body.on('click', '.penci-user-register', function (e) {
3309              e.preventDefault()
3310
3311              var $this = $(this),
3312                $parent = $this.closest('.penci-login-register')
3313
3314              $parent.find('.penci-login-wrap').addClass('hidden')
3315              $parent.find('.penci-register-wrap').removeClass('hidden')
3316            })
3317
3318            $('#penci-user-login,#penci-user-pass').on('focus', function () {
3319              $(this).removeClass('invalid')
3320            })
3321
3322            $('.penci-loginform').each(function () {
3323              $(this).on('submit', function (e) {
3324                var $this = $(this),
3325                  $loginContainer = $this.parent('.penci-login-wrap'),
3326                  inputUsername = $this.find('#penci-user-login'),
3327                  inputPass = $this.find('#penci-user-pass'),
3328                  valUsername = inputUsername.val(),
3329                  valPass = inputPass.val(),
3330                  nonce = $this.find('.penci_form_nonce').val(),
3331                  gcapcha = $this.find('.g-recaptcha-response')
3332                if (gcapcha.length) {
3333                  var captcha = gcapcha.val()
3334                } else {
3335                  var captcha = 'noexists'
3336                }
3337
3338                if (inputUsername.length > 0 && valUsername == '') {
3339                  inputUsername.addClass('invalid')
3340                  e.preventDefault()
3341                }
3342
3343                if (inputPass.length > 0 && valPass == '') {
3344                  inputPass.addClass('invalid')
3345                  e.preventDefault()
3346                }
3347
3348                if (valUsername == '' || valPass == '') {
3349                  return false
3350                }
3351
3352                $loginContainer.parent().addClass('ajax-loading')
3353                $loginContainer.find('.message').slideDown().remove()
3354
3355                var data = {
3356                  action: 'penci_login_ajax',
3357                  username: valUsername,
3358                  password: valPass,
3359                  captcha: captcha,
3360                  security: nonce,
3361                  remember: $loginContainer.find('#rememberme').val(),
3362                }
3363
3364                $.post(ajax_var_more.url, data, function (response) {
3365                  $loginContainer.parent().removeClass('ajax-loading')
3366                  $loginContainer.append(response.data)
3367                  if (!response.success) {
3368                    return
3369                  }
3370
3371                  window.location.href = window.location.href + '?singin=true'
3372                })
3373
3374                e.preventDefault()
3375                return false
3376              })
3377            })
3378          }
3379        },
3380        register: function () {
3381          var $body = $('body'),
3382            $registerform = $('#penci-registration-form'),
3383            $registerContainer = $registerform.closest(
3384              '.penci-register-wrap')
3385
3386          if (!$registerform.length) {
3387            return false
3388          }
3389
3390          $body.on('click', '.penci-user-login-here', function (e) {
3391            e.preventDefault()
3392
3393            var $this = $(this),
3394              $parent = $this.closest('.penci-login-register')
3395
3396            $parent.find('.penci-login-wrap').removeClass('hidden')
3397            $parent.find('.penci-register-wrap').addClass('hidden')
3398
3399            return false
3400          })
3401
3402          var $allInput = $(
3403            '.penci_user_name,.penci_user_email,.penci_user_pass,.penci_user_pass_confirm')
3404          $allInput.on('focus', function () {
3405            $(this).removeClass('invalid')
3406          })
3407
3408          $('.penci-registration-form').each(function () {
3409            $(this).on('submit', function (e) {
3410              e.preventDefault()
3411
3412              var $this = $(this),
3413                $registerContainer = $this.closest('.penci-register-wrap'),
3414                inputUsername = $this.find('.penci_user_name'),
3415                inputEmail = $this.find('.penci_user_email'),
3416                $inputPass = $this.find('.penci_user_pass'),
3417                $inputPassConfirm = $this.find('.penci_user_pass_confirm'),
3418                valUsername = inputUsername.val(),
3419                valEmail = inputEmail.val(),
3420                valPass = $inputPass.val(),
3421                valPassConfirm = $inputPassConfirm.val(),
3422                inputPhone = $this.find('.penci_user_phone'),
3423                valPhone = inputPhone.val(),
3424                nonce = $this.find('.penci_form_nonce').val(),
3425                gcapcha = $this.find('.g-recaptcha-response')
3426              if (gcapcha.length) {
3427                var captcha = gcapcha.val()
3428              } else {
3429                var captcha = 'noexists'
3430              }
3431
3432              $allInput.removeClass('invalid')
3433
3434              if (inputUsername.length > 0 && valUsername == '') {
3435                inputUsername.addClass('invalid')
3436                event.preventDefault()
3437              }
3438
3439              if (inputPhone.length > 0 && valPhone == '') {
3440                  inputPhone.addClass('invalid')
3441                  event.preventDefault()
3442              }
3443
3444              if (inputEmail.length > 0 && valEmail == '') {
3445                inputEmail.addClass('invalid')
3446                event.preventDefault()
3447              }
3448
3449              if ($inputPass.length > 0 && valPass == '') {
3450                $inputPass.addClass('invalid')
3451                event.preventDefault()
3452              }
3453
3454              if ($inputPassConfirm.length > 0 && valPassConfirm == '') {
3455                $inputPassConfirm.addClass('invalid')
3456                event.preventDefault()
3457              }
3458              if (valUsername == '' || valEmail == '' || valPass == '' ||
3459                valPassConfirm == '') {
3460                return false
3461              }
3462
3463              $registerContainer.find('.message').slideDown().remove()
3464
3465              // Password does not match the confirm password
3466              if (valPassConfirm !== valPass) {
3467                $inputPass.addClass('invalid')
3468                $inputPassConfirm.addClass('invalid')
3469                $registerContainer.append(ajax_var_more.errorPass)
3470                event.preventDefault()
3471
3472                return false
3473              }
3474              $registerContainer.parent().addClass('ajax-loading')
3475
3476              var data = {
3477                action: 'penci_register_ajax',
3478                fistName: $this.find('.penci_first_name').val(),
3479                lastName: $this.find('.penci_last_name').val(),
3480                username: valUsername,
3481                password: valPass,
3482                confirmPass: valPassConfirm,
3483                email: valEmail,
3484                phone: valPhone,
3485                security: nonce,
3486                captcha: captcha,
3487              }
3488
3489              $.post(ajax_var_more.url, data, function (response) {
3490                $registerContainer.parent().removeClass('ajax-loading')
3491                $registerContainer.append(response.data)
3492                if (!response.suc
3492cess) {
3493                  return
3494                }
3495                window.location.href = window.location.href + '?singin=true'
3496              })
3497
3498              event.preventDefault()
3499              return false
3500            })
3501          })
3502        },
3503        map: function () {
3504          if (!$('.penci-google-map').length) {
3505            return false
3506          }
3507          $('.penci-google-map').each(function () {
3508
3509            var map = $(this),
3510              Option = map.data('map_options'),
3511              mapID = map.attr('id')
3512
3513            var mapTypePre = google.maps.MapTypeId.ROADMAP
3514            switch (Option.map_type) {
3515              case'satellite':
3516                mapTypePre = google.maps.MapTypeId.SATELLITE
3517                break
3518              case'hybrid':
3519                mapTypePre = google.maps.MapTypeId.HYBRID
3520                break
3521              case'terrain':
3522                mapTypePre = google.maps.MapTypeId.TERRAIN
3523            }
3524            var latLng = new google.maps.LatLng(-34.397, 150.644)
3525            var map = new google.maps.Map(document.getElementById(mapID), {
3526              zoom: parseInt(Option.map_zoom),
3527              center: latLng,
3528              mapTypeId: mapTypePre,
3529              panControl: Option.map_pan,
3530              zoomControl: Option.map_is_zoom,
3531              mapTypeControl: true,
3532              scaleControl: Option.map_scale,
3533              streetViewControl: Option.map_street_view,
3534              rotateControl: Option.map_rotate,
3535              overviewMapControl: Option.map_overview,
3536              scrollwheel: Option.map_scrollwheel,
3537            })
3538            var marker = new google.maps.Marker({
3539              position: latLng,
3540              map: map,
3541              title: Option.marker_title,
3542              icon: Option.marker_img,
3543            })
3544
3545            if (Option.info_window) {
3546              var infoWindow = new google.maps.InfoWindow({
3547                content: Option.info_window,
3548              })
3549
3550              google.maps.event.addListener(marker, 'click', function () {
3551                infoWindow.open(map, marker)
3552              })
3553            }
3554
3555            if ('coordinates' == Option.map_using && Option.latitude &&
3556              Option.longtitude) {
3557              latLng = new google.maps.LatLng(Option.latitude,
3558                Option.longtitude)
3559              map.setCenter(latLng)
3560              marker.setPosition(latLng)
3561            } else {
3562              var geocoder = new google.maps.Geocoder()
3563              geocoder.geocode({
3564                address: Option.address,
3565              }, function (results) {
3566                var loc = results[0].geometry.location
3567                latLng = new google.maps.LatLng(loc.lat(), loc.lng())
3568                map.setCenter(latLng)
3569                marker.setPosition(latLng)
3570              })
3571            }
3572          })
3573        },
3574      },
3575
3576      PENCI.VideosList = {
3577        // Init the module
3578        init: function () {
3579          PENCI.VideosList.play()
3580        },
3581        play: function () {
3582          if (!$('.penci-video_playlist').length) {
3583            return false
3584          }
3585          $('.penci-video_playlist').each(function (idx, item) {
3586            var $blockVideo = $(this),
3587              $VideoF = $blockVideo.find('.penci-video-frame')
3588
3589            var $height = $blockVideo.find('.penci-video-nav').height(),
3590              $heightTitle = $blockVideo.find(
3591                '.penci-video-nav .penci-playlist-title').height()
3592
3593            $blockVideo.find('.penci-video-playlist-nav').
3594              css('height', $height - $heightTitle)
3595            // Init
3596            $VideoF.video()
3597            PENCI.VideosList.updateStatus($blockVideo)
3598
3599            // Show First video and remove the loader icon
3600            $VideoF.addVideoEvent('ready', function () {
3601              $VideoF.css('visibility', 'visible').fadeIn()
3602              $blockVideo.find('.loader-overlay').remove()
3603            })
3604            // Play videos
3605            $blockVideo.on('click', '.penci-video-playlist-item', function () {
3606              var $thisVideo = $(this),
3607                frameID = $thisVideo.data('name'),
3608                $thisFrame = $('#' + frameID),
3609                videoSrc = $thisVideo.data('src'),
3610                videoNum = $thisVideo.find('.penci-video-number').text()
3611
3612              if ($thisVideo.hasClass('is-playing')) {
3613                $thisFrame.pauseVideo()
3614                return
3615              }
3616
3617              // Update the number of the playing video in the title section
3618              $blockVideo.find('.penci-video-playing').text(videoNum)
3619
3620              // Pause all Videos
3621              $blockVideo.find('.penci-video-frame').each(function () {
3622                $(this).pauseVideo().hide()
3623              })
3624
3625              // If the iframe not loaded before, add it
3626              if (!$thisFrame.length) {
3627                // Add the loader icon
3628                $blockVideo.find('.fluid-width-video-wrapper').prepend('')
3629
3630                $blockVideo.find('.fluid-width-video-wrapper').
3631                  append('<iframe class="penci-video-frame" id="' + frameID +
3632                    '" src="' + videoSrc +
3633                    '" frameborder="0" width="100%"" height="434" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>')
3634                $thisFrame = $('#' + frameID)
3635
3636                $thisFrame.video() // reinit
3637
3638                $thisFrame.addVideoEvent('ready',
3639                  function (e, $thisFrame, video_type) {
3640                    $thisFrame.playVideo()
3641                    $blockVideo.find('.loader-overlay').remove()
3642                  })
3643              } else {
3644                $thisFrame.playVideo()
3645              }
3646
3647              $thisFrame.css('visibility', 'visible').fadeIn()
3648
3649              PENCI.VideosList.updateStatus($blockVideo)
3650
3651            })
3652          })
3653        },
3654        updateStatus: function ($blockVideo) {
3655          $blockVideo.find('.penci-video-frame').each(function () {
3656            var $this = $(this),
3657              $videoItem = $('[data-name=\'' + $this.attr('id') + '\']')
3658
3659            $this.addVideoEvent('play', function () {
3660              $videoItem.removeClass('is-paused').addClass('is-playing')
3661            })
3662
3663            $this.addVideoEvent('pause', function () {
3664              $videoItem.removeClass('is-playing').addClass('is-paused')
3665            })
3666
3667            $this.addVideoEvent('finish', function () {
3668              $videoItem.removeClass('is-paused is-playing')
3669            })
3670          })
3671        },
3672      },
3673
3674      PENCI.JumtoRecipe = function () {
3675
3676        $('.penci-jump-recipe').on('click', function (e) {
3677          e.preventDefault()
3678          var $closetMain = $(this).closest('.penci-single-block'),
3679            id = $(this).attr('href'),
3680            $firstRecipe = $closetMain.find(id).first()
3681          if ($firstRecipe.length) {
3682            var $scroll_top = $firstRecipe.offset().top,
3683              $nav_height = 30
3684            if ($('#navigation').length) {
3685              $nav_height = $('#navigation').height() + 30
3686            }
3686 else if ($('.pc-wrapbuilder-header').length) {
3687              if (window.matchMedia('(max-width: 960px)').matches) {
3688                var headermobile = $('.penci_navbar_mobile')
3689                if (!headermobile.hasClass('hide-scroll-down')) {
3690                  $nav_height = headermobile.height() + 30
3691                }
3692              } else {
3693                var headerdesktop = $('.penci_builder_sticky_header_desktop')
3694                if (headerdesktop.length &&
3695                  !headerdesktop.hasClass('hide-scroll-down')) {
3696                  $nav_height = headerdesktop.height() + 30
3697                }
3698              }
3699            }
3700            if ($('body').hasClass('admin-bar')) {
3701              $nav_height = $nav_height + 32
3702            }
3703            var $scroll_to = $scroll_top - $nav_height
3704            $('html,body').animate({
3705              scrollTop: $scroll_to,
3706            }, 'fast')
3707          }
3708        })
3709      },
3710
3711      PENCI.DelayedContent = function () {
3712        $(document).on('mousemove scroll click', function(event) {
3713          $('.pc-content-delayed').each( function(e) {
3714            var t = $(this),
3715                d = t.attr('data-type') ? t.attr('data-type') : '',
3716                u = t.attr('data-url') ? t.attr('data-url') : '',
3717                c = t.attr('data-class') ? t.attr('data-class') : '',
3718                id = t.attr('data-id') ? t.attr('data-id') : '',
3719                s = t.attr('data-settings') ? t.attr('data-settings') : '',
3720                save_name = ('pcdelayed_' + d + id + c).toLowerCase();
3721
3722            if ( ! t.hasClass('loaded') ) {
3723              t.addClass('loaded')
3724              if ( localStorage.getItem( save_name ) ) {
3725                t.after( localStorage.getItem( save_name ) )
3726                t.remove()
3727              } else {
3728
3729                if ( u ) {
3730                  $.ajax({
3731                    type: "GET",
3732                    url: u,
3733                    success: function (response) {
3734                      t.after( response )
3735                      t.remove()
3736                      localStorage.setItem( save_name, response );
3737                    }
3738                  })
3739                } else {
3740                  $.ajax({
3741                    type: "POST",
3742                    dataType: 'JSON',
3743                    url: ajax_var_more.url,
3744                    data: {
3745                      type: d,
3746                      class: c,
3747                      id: id,
3748                      settings: s,
3749                      action: 'penci_delayed_div_content',
3750                      nonce: ajax_var_more.nonce,
3751                    },
3752                    success: function (response) {
3753                      t.after( response.data.html )
3754                      t.remove()
3755                      localStorage.setItem( save_name, response.data.html );
3756                    }
3757                  })
3758                }
3759              }
3760              
3761            }
3762
3763            $(document).trigger('penci-mega-loaded')
3764            
3765          })
3766        })
3767      },
3768
3769      /* Smart Lists
3770    ---------------------------------------------------------------*/
3771      PENCI.SmartLists = function () {
3772        $('.pcsml-dropdown').each(function () {
3773          var select = $(this)
3774          select.on('change', function () {
3775            var url = this.value,
3776              curl = window.location.href
3777
3778            if (url != curl && url !== undefined) {
3779              window.location.href = url
3780            }
3781          })
3782        })
3783      },
3784
3785      PENCI.Single_Loadmore = function () {
3786        var $wrapper_loadmore = $('.penci-single-infiscroll')
3787        if ($wrapper_loadmore.length) {
3788          var adsHTML = $wrapper_loadmore.data('infiads')
3789          $(window).on('scroll', $.debounce(250, function () {
3790            var $lastArticle = $wrapper_loadmore.find('.penci-single-block').
3791                last(),
3792              $windowScroll = $(window).scrollTop(),
3793              $lastArticleTop = $lastArticle.offset().top,
3794              $dataURL = $lastArticle.data('prev-url')
3795
3796            if ($lastArticle.hasClass('penci-single-infiblock-end')) {
3797              $('.penci-ldsingle').remove()
3798            }
3799
3800            if ((
3801                $windowScroll > $lastArticleTop
3802              ) &&
3803              (
3804                typeof $dataURL !== 'undefined'
3805              ) && (
3806                typeof $dataURL !== ''
3807              ) &&
3808              !$lastArticle.hasClass('penci-single-infiblock-end')) {
3809              if (!$wrapper_loadmore.hasClass('penci-disable-sendajax')) {
3810                $wrapper_loadmore.addClass('penci-disable-sendajax')
3811                $.ajax({
3812                  url: $dataURL,
3813                  type: 'GET',
3814                  dataType: 'html',
3815                  success: function (result) {
3816                    var resultBlock = $(
3817                      $(result).find('.penci-single-wrapper').html()).
3818                      css('opacity', 0).
3819                      animate({ 'opacity': 1 }, 300)
3820                    if ((
3821                        typeof adsHTML !== 'undefined'
3822                      ) &&
3823                      (
3824                        typeof adsHTML !== ''
3825                      )) {
3826                      $wrapper_loadmore.append(adsHTML)
3827                    }
3828                    $wrapper_loadmore.append(resultBlock)
3829                    if (resultBlock.find('.penci_facebook_widget').length) {
3830                      try {
3831                        FB.XFBML.parse()
3832                      } catch (ex) {
3833                      }
3834                    }
3835                    $wrapper_loadmore.removeClass('penci-disable-sendajax')
3836
3837                    PENCI.featured_slider()
3838                    PENCI.owl_slider()
3839                    PENCI.fitvids()
3840                    PENCI.sticky_sidebar()
3841                    PENCI.lightbox()
3842                    PENCI.masonry()
3843                    PENCI.portfolio()
3844                    PENCI.AjaxPortfolio()
3845                    PENCI.gallery()
3846                    PENCI.Jarallax()
3847                    PENCI.extraFunction.init()
3848                    PENCI.VideosList.init()
3849                    PENCI.JumtoRecipe()
3850                    PENCI.shareexpand()
3851                    PENCI.videofloat()
3852
3853                    var $review_process = $('.penci-review-process'),
3854                      $review_piechart = $('.penci-piechart')
3855                    if ($review_process.length) {
3856                      $('.penci-review-process').each(function () {
3857                        var $this = $(this),
3858                          $bar = $this.children(),
3859                          $bar_w = $bar.data('width') * 10
3860                        $this.one('inview',
3861                          function (event, isInView, visiblePartX,
3862                            visiblePartY,
3863                          ) {
3864                            $bar.animate({ width: $bar_w + '%' }, 1000)
3865                          }) // bind inview
3866                      }) // each
3867                    }
3868
3869                    if ($review_piechart.length) {
3870                      $('.penci-piechart').each(function () {
3871                        var $this = $(this)
3872                        $this.one('inview',
3873                          function (event, isInView, visiblePartX,
3874                            visiblePartY,
3875                          ) {
3876                            var chart_args = {
3877                              barColor: $this.data('color'),
3878                              trackColor: $this.data('trackcolor'),
3879                              scaleColor: false,
3880                              lineWidth: $this.data('thickness'),
3881                              size: $this.data('size'),
3882                              animate: 1000,
3883                            }
3884                            $this.easyPieChart(chart_args)
3885                          }) // bind inview
3886                      }) // each
3887                    }
3888                    $('body').trigger('single_loaded_more')
3889                  },
3890                })
3891              }
3892            }
3893          }))
3894
3895          $(window).bind('scroll touchstart', function () {
3896            // UPdate permalink
3897            var scrollTop = $(this).scrollTop()
3898            var firstPost = $('.penci-single-block')
3899            window.setTimeout(function () {
3900              var preScrollTop = scrollTop + 60
3901              var postsContainer = $('.penci-single-block')
3902              var locationHref = window.location.href
3903
3904              var currentP = postsContainer.map(function () {
3905                if ($(this).offset().top < preScrollTop) {
3906                  return this
3907                }
3908              })
3909
3910              currentP = currentP[currentP.length - 1]
3911              var pid = $(currentP).data('postid'),
3912                plink = $(currentP).data('current-url'),
3913                ptitle = $(currentP).data('post-title'),
3914                pedit = $(currentP).data('edit-post')
3915
3916              if (typeof pid === 'undefined' || typeof pid === '') {
3917                pid = firstPost.data('postid')
3918                plink = firstPost.data('current-url')
3919                ptitle = firstPost.data('post-title')
3920                pedit = firstPost.data('edit-post')
3921              }
3922
3923              if (locationHref !== plink) {
3924                window.history.pushState({ 'pageTitle': ptitle }, '', plink)
3925                if ($('#wpadminbar').length) {
3926                  $('#wp-admin-bar-edit a').attr('href', pedit)
3927                }
3928                if ($('title').length) {
3929                  $('title').each(function () {
3930                    $(this).text(ptitle)
3931                  })
3932                }
3933
3934                if (typeof _gaq !== 'undefined' && _gaq !== null) {
3935                  _gaq.push(['_trackPageview', plink])
3936                }
3937
3938                if (typeof ga !== 'undefined' && ga !== null) {
3939                  ga('send', 'pageview', plink)
3940                }
3941              }
3942
3943            }, 100)
3944          })
3945        }
3946      }
3947
3948    /* Init functions
3949 ---------------------------------------------------------------*/
3950    $(document).ready(function () {
3951      PENCI.general()
3952      PENCI.rdatetime()
3953      PENCI.cookie()
3954      PENCI.main_sticky()
3955      PENCI.featured_slider()
3956      PENCI.slick_slider()
3957      PENCI.owl_slider()
3958      PENCI.fitvids()
3959      PENCI.sticky_sidebar()
3960      PENCI.mega_menu()
3961      PENCI.mobile_menu()
3962      PENCI.toggleMenuHumburger()
3963      PENCI.ElementorHumburger()
3964      PENCI.lightbox()
3965      PENCI.masonry()
3966      PENCI.video_background()
3967      PENCI.portfolio()
3968      PENCI.AjaxPortfolio()
3969      PENCI.gallery()
3970      PENCI.Jarallax()
3971      PENCI.RelatedPopup()
3972      PENCI.extraFunction.init()
3973      PENCI.VideosList.init()
3974      PENCI.JumtoRecipe()
3975      PENCI.Single_Loadmore()
3976      PENCI.fontsizeChanger()
3977      setTimeout(function () {
3978        PENCI.shareexpand()
3979        PENCI.fontsizeChanger()
3980      }, 100)
3981      PENCI.categories_lists()
3982      PENCI.blockheadinglist()
3983      PENCI.SmartLists()
3984      PENCI.videofloat()
3985      PENCI.DelayedContent()
3986      if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
3987        PENCI.mobile_ajax_menu()
3988      }
3989      $('body').on('penci-ajax-menu-loaded', function(){
3990        PENCI.mega_menu()
3991      })
3992      $('body').on('penci-block-heading', function () {
3993        PENCI.blockheadinglist()
3994      }).on('penci-image-gallery', function () {
3995        PENCI.slick_slider()
3996      })
3997      $('body').on('el_featured_slider', function () {
3998        PENCI.slick_slider()
3999        PENCI.featured_slider()
4000        PENCI.owl_slider()
4001      })
4002      $('body').on('slider-load', function () {
4003        PENCI.owl_slider()
4004      })
4005      $('body').on('penci_swiper_sliders', function () {
4006        PENCI.owl_slider()
4007        PENCI.slick_slider()
4008      })
4009      $(document).on('pajax-tab-loaded', function () {
4010        PENCI.owl_slider()
4011      })
4012      $(window).on('resize', function () {
4013        PENCI.sticky_sidebar()
4014        PENCI.blockheadinglist()
4015        PENCI.fontsizeChanger()
4016        PENCI.videofloat()
4017        PENCI.mobile_ajax_menu()
4018        setTimeout(function () {
4019          PENCI.shareexpand()
4020        }, 100)
4021      })
4022      $(window).on('scroll', function () {
4023        PENCI.fontsizeChanger()
4024      })
4025      $(document).on('penci-mega-loaded', function () {
4026        PENCI.featured_slider()
4027        PENCI.owl_slider()
4028        PENCI.fitvids()
4029        PENCI.lightbox()
4030        PENCI.masonry()
4031        PENCI.portfolio()
4032        PENCI.AjaxPortfolio()
4033        PENCI.gallery()
4034        PENCI.extraFunction.init()
4035        PENCI.VideosList.init()
4036      })
4037    })
4038  }
4039)(jQuery)	// EOF

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.