-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.js
1783 lines (1747 loc) · 103 KB
/
common.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
$.expr[':'].isExternalLink = function(obj) {
return (obj.hostname != location.hostname) || !!(obj.href.match(/\.(pdf|zip)$/));
};
$(function() {
/* all external links in new windows */
$('a:isExternalLink').attr('target', '_blank');
// function adjustSizes() {
// $('.slider').css('height',$(window).height());
// }
// $(window).on('resize',adjustSizes); adjustSizes();
/* Nav toggle */
$('<li class="nav-toggle"><a><span class="nav-toggle-off">Close</span><span class="nav-toggle-on">Menu</span></span></li>')
.appendTo($('.nav--meta>ul'))
.on('click', function() {
if ($('body').hasClass('nav-open')) {
$('body').toggleClass('nav-open', false);
$('#nav-search').blur();
} else {
$('body').toggleClass('nav-open', true);
$('#nav-search').focus();
}
})
;
/* Prepare responsive lazyloading images */
$('.prepare-aspect').each(function() {
var
$img = $('img,iframe', this).eq(0),
imgwidth = $img.attr('width'),
imgheight = $img.attr('height')
;
$(this)
.addClass('aspect')
.removeClass('prepare-aspect')
.css({
'padding-bottom': (imgheight / imgwidth * 100) + '%'
})
;
});
/* Masonry on grid */
var $grid = $('.grid')
.append($('<div class="grid-sizer-column"/><div class="grid-sizer-gutter"/>'))
.masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-sizer-column',
gutter: '.grid-sizer-gutter',
verticalSpacing: '.grid-sizer-gutter',
transitionDuration: 250
})
;
/* Unveil */
$('img.lazy').unveil();
/* Lazyload workaround: Trigger reevaluation (i.e., scroll event) on window resize/Masonry re-init */
// $(window).on('resize',function(){
// $('html,body').trigger('scroll');
// });
/* Sliders/Progress bars */
function sliderMenuColorize(item) {
$('body').toggleClass('nav-inverted', slidesInvertMenu[item]);
}
;
// var $progressBar = $('<div class="progressbar"/>').appendTo($('body'));
if ($('.slider').length) {
$('.slider').each(function() {
var slider = new Flickity('.slider', {
adaptiveHeight: true,
setGallerySize: false,
cellSelector: '.slide',
pageDots: false,
wrapAround: true
});
// draggable: false
var t = 0,
b = 100,
i = 5000;
function slprg() {
if (t > i) {
t = 0;
slider.next();
}
$('.progressbar').css('width', (t / i) * 100 + '%');
t += b;
}
window.setInterval(slprg, b);
slider.on('change', function(item) {
sliderMenuColorize(item);
t = 0;
$progressBar.css('width', 0);
});
sliderMenuColorize(0);
});
} else {
var lastPos = $(window).scrollTop(),
lastDPos = lastPos,
hysteresis = 30,
dir = true,
vis = false;
$('.nav--pager').hide();
$(window).on('scroll', function() {
var scrollTop = $(window).scrollTop();
$('.progressbar').css('width', Math.round(scrollTop / ($('body').outerHeight() - $(window).height()) * 100) + '%');
var footerPos = $('body>footer').eq(0).offset().top,
windowHeight = $(window).height();
footerPos = (footerPos > 60 ? footerPos - 60 : footerPos); /* offset for IOS bottom toolbar */
if (vis == false) {
if (scrollTop + windowHeight < footerPos) {
vis = true;
$('.nav--pager').show();
}
} else {
if (scrollTop + windowHeight >= footerPos) {
vis = false;
$('.nav--pager').hide();
}
}
});
}
/* Filters */
$('.filter li').each(function() {
var $this = $(this),
filter = $this.data('filter'),
activeClass = 'active';
$this.on('click', function(e) {
e.preventDefault();
$('.grid-item').show();
$('.filter li').removeClass(activeClass);
$this.addClass(activeClass);
if (filter) {
$('.grid-item').not('.' + filter).hide();
}
$('.grid').masonry();
setTimeout(function() {
$('html,body').trigger('scroll');
}, 600);
$('body').removeClass('filter-open');
});
});
$('.filter-trigger').on('click', function() {
$('body').toggleClass('filter-open');
});
/* Popups */
if ($('.popup').length) {
$('<div class="popup-close popup-close-icon"></div>').appendTo($('.popup-content'));
$('.popup-trigger').on('click', function() {
var num = $(this).data('popup');
$('#popup-content-' + num).show();
});
$('.popup, .popup-close').on('click', function() {
$('.popup').hide();
});
}
});
/* Masonry */
// !function(e,i){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)}):"object"==typeof module&&module.exports?module.exports=i(e,require("jquery")):e.jQueryBridget=i(e,e.jQuery)}(window,function(t,e){"use strict";var l=Array.prototype.slice,i=t.console,c=void 0===i?function(){}:function(t){i.error(t)};function n(u,o,d){(d=d||e||t.jQuery)&&(o.prototype.option||(o.prototype.option=function(t){d.isPlainObject(t)&&(this.options=d.extend(!0,this.options,t))}),d.fn[u]=function(t){if("string"==typeof t){var e=l.call(arguments,1);return s=e,h="$()."+u+'("'+(r=t)+'")',(i=this).each(function(t,e){var i=d.data(e,u);if(i){var n=i[r];if(n&&"_"!=r.charAt(0)){var o=n.apply(i,s);a=void 0===a?o:a}else c(h+" is not a valid method")}else c(u+" not initialized. Cannot call methods, i.e. "+h)}),void 0!==a?a:i}var i,r,s,a,h,n;return n=t,this.each(function(t,e){var i=d.data(e,u);i?(i.option(n),i._init()):(i=new o(e,n),d.data(e,u,i))}),this},r(d))}function r(t){!t||t&&t.bridget||(t.bridget=n)}return r(e||t.jQuery),n}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o];n&&n[r]&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function y(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}var i="undefined"==typeof console?function(){}:function(t){console.error(t)},v=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],_=v.length;function z(t){var e=getComputedStyle(t);return e||i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}var E,b=!1;function x(t){if(function(){if(!b){b=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=z(t);E=200==Math.round(y(i.width)),x.isBoxSizeOuter=E,e.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var e=z(t);if("none"==e.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<_;e++)t[v[e]]=0;return t}();var i={};i.width=t.offsetWidth,i.height=t.offsetHeight;for(var n=i.isBorderBox="border-box"==e.boxSizing,o=0;o<_;o++){var r=v[o],s=e[r],a=parseFloat(s);i[r]=isNaN(a)?0:a}var h=i.paddingLeft+i.paddingRight,u=i.paddingTop+i.paddingBottom,d=i.marginLeft+i.marginRight,l=i.marginTop+i.marginBottom,c=i.borderLeftWidth+i.borderRightWidth,f=i.borderTopWidth+i.borderBottomWidth,m=n&&E,p=y(e.width);!1!==p&&(i.width=p+(m?0:h+c));var g=y(e.height);return!1!==g&&(i.height=g+(m?0:u+f)),i.innerWidth=i.width-(h+c),i.innerHeight=i.height-(u+f),i.outerWidth=i.width+d,i.outerHeight=i.height+l,i}}return x}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var i=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i]+"MatchesSelector";if(t[n])return n}}();return function(t,e){return t[i](e)}}),function(e,i){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)}):"object"==typeof module&&module.exports?module.exports=i(e,require("desandro-matches-selector")):e.fizzyUIUtils=i(e,e.matchesSelector)}(window,function(u,r){var d={extend:function(t,e){for(var i in e)t[i]=e[i];return t},modulo:function(t,e){return(t%e+e)%e}},e=Array.prototype.slice;d.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?e.call(t):[t]},d.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},d.getParent=function(t,e){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,r(t,e))return t},d.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.filterFindElements=function(t,n){t=d.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement)if(n){r(t,n)&&o.push(t);for(var e=t.querySelectorAll(n),i=0;i<e.length;i++)o.push(e[i])}else o.push(t)}),o},d.debounceMethod=function(t,e,n){n=n||100;var o=t.prototype[e],r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments,i=this;this[r]=setTimeout(function(){o.apply(i,e),delete i[r]},n)}},d.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},d.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var l=u.console;return d.htmlInit=function(a,h){d.docReady(function(){var t=d.toDashed(h),o="data-"+t,e=document.querySelectorAll("["+o+"]"),i=document.querySelectorAll(".js-"+t),n=d.makeArray(e).concat(d.makeArray(i)),r=o+"-options",s=u.jQuery;n.forEach(function(e){var t,i=e.getAttribute(o)||e.getAttribute(r);try{t=i&&JSON.parse(i)}catch(t){return void(l&&l.error("Error parsing "+o+" on "+e.className+": "+t))}var n=new a(e,t);s&&s.data(e,h,n)})})},d}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";var i=document.documentElement.style,n="string"==typeof i.transition?"transition":"WebkitTransition",o="string"==typeof i.transform?"transform":"WebkitTransform",r={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[n],s={transform:o,transition:n,transitionDuration:n+"Duration",transitionProperty:n+"Property",transitionDelay:n+"Delay"};function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var h=a.prototype=Object.create(t.prototype);h.constructor=a,h._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},h.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},h.getSize=function(){this.size=e(this.element)},h.css=function(t){var e=this.element.style;for(var i in t){e[s[i]||i]=t[i]}},h.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},h.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},h.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},h.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},h._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),!o||this.isTransitioning){var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},h.getTranslate=function(t,e){return"translate3d("+(t=this.layout._getOption("originLeft")?t:-t)+"px, "+(e=this.layout._getOption("originTop")?e:-e)+"px, 0)"},h.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},h.moveTo=h._transitionTo,h.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},h._nonTransition=function(t){for(var e in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[e].call(this)},h.transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);this.element.offsetHeight;null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var u="opacity,"+o.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()});h.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:u,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(r,this,!1)}},h.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},h.onotransitionend=function(t){this.ontransitionend(t)};var d={"-webkit-transform":"transform"};h.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,i=d[t.propertyName]||t.propertyName;if(delete e.ingProperties[i],function(t){for(var e in t)return!1;return!0}(e.ingProperties)&&this.disableTransition(),i in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[i]),i in e.onEnd)e.onEnd[i].call(this),delete e.onEnd[i];this.emitEvent("transitionEnd",[this])}},h.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(r,this,!1),this.isTransitioning=!1},h._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var l={transitionProperty:"",transitionDuration:"",transitionDelay:""};return h.removeTransitionStyles=function(){this.css(l)},h.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},h.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},h.remove=function(){n&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),this.hide()):this.removeElem()},h.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},h.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},h.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},h.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},h.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},h.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}),function(o,r){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(t,e,i,n){return r(o,t,e,i,n)}):"object"==typeof module&&module.exports?module.exports=r(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):o.Outlayer=r(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,o.Outlayer.Item)}(window,function(t,e,o,r,n){"use strict";var s=t.console,a=t.jQuery,i=function(){},h=0,u={};function d(t,e){var i=r.getQueryElement(t);if(i){this.element=i,a&&(this.$element=a(this.element)),this.options=r.extend({},this.constructor.defaults),this.option(e);var n=++h;this.element.outlayerGUID=n,(u[n]=this)._create(),this._getOption("initLayout")&&this.layout()}else s&&s.error("Bad element for "+this.constructor.namespace+": "+(i||t))}d.namespace="outlayer",d.Item=n,d.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var l=d.prototype;function c(t){function e(){t.apply(this,arguments)}return(e.prototype=Object.create(t.prototype)).constructor=e}r.extend(l,e.prototype),l.option=function(t){r.extend(this.options,t)},l._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},d.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},l._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},l.reloadItems=function(){this.items=this._itemize(this.element.children)},l._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=new i(e[o],this);n.push(r)}return n},l._filterFindItemElements=function(t){return r.filterFindElements(t,this.options.itemSelector)},l.getItemElements=function(){return this.items.map(function(t){return t.element})},l.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},l._init=l.layout,l._resetLayout=function(){this.getSize()},l.getSize=function(){this.size=o(this.element)},l._getMeasurement=function(t,e){var i,n=this.options[t];n?("string"==typeof n?i=this.element.querySelector(n):n instanceof HTMLElement&&(i=n),this[t]=i?o(i)[e]:n):this[t]=0},l.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},l._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},l._layoutItems=function(t,i){if(this._emitCompleteOnItems("layout",t),t&&t.length){var n=[];t.forEach(function(t){var e=this._getItemLayoutPosition(t);e.item=t,e.isInstant=i||t.isLayoutInstant,n.push(e)},this),this._processLayoutQueue(n)}},l._getItemLayoutPosition=function(){return{x:0,y:0}},l._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},l.updateStagger=function(){var t=this.options.stagger;if(null!=t)return this.stagger=function(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=f[n]||1;return i*o}(t),this.stagger;this.stagger=0},l._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},l._postLayout=function(){this.resizeContainer()},l.resizeContainer=function(){if(this._getOption("resizeContainer")){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},l._getContainerSize=i,l._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},l._emitCompleteOnItems=function(e,t){var i=this;function n(){i.dispatchEvent(e+"Complete",null,[t])}var o=t.length;if(t&&o){var r=0;t.forEach(function(t){t.once(e,s)})}else n();function s(){++r==o&&n()}},l.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),a)if(this.$element=this.$element||a(this.element),e){var o=a.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},l.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},l.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},l.stamp=function(t){(t=this._find(t))&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},l.unstamp=function(t){(t=this._find(t))&&t.forEach(function(t){r.removeFrom(this.stamps,t),this.unignore(t)},this)},l._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=r.makeArray(t)},l._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},l._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},l._manageStamp=i,l._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,n=o(t);return{left:e.left-i.left-n.marginLeft,top:e.top-i.top-n.marginTop,right:i.right-e.right-n.marginRight,bottom:i.bottom-e.bottom-n.marginBottom}},l.handleEvent=r.handleEvent,l.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},l.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},l.onresize=function(){this.resize()},r.debounceMethod(d,"onresize",100),l.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},l.needsResizeLayout=function(){var t=o(this.element);return this.size&&t&&t.innerWidth!==this.size.innerWidth},l.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},l.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},l.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},l.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var i=this.updateStagger();t.forEach(function(t,e){t.stagger(e*i),t.reveal()})}},l.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var i=this.updateStagger();t.forEach(function(t,e){t.stagger(e*i),t.hide()})}},l.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},l.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},l.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},l.getItems=function(t){t=r.makeArray(t);var i=[];return t.forEach(function(t){var e=this.getItem(t);e&&i.push(e)},this),i},l.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),r.removeFrom(this.items,t)},this)},l.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete u[e],delete this.element.outlayerGUID,a&&a.removeData(this.element,this.constructor.namespace)},d.data=function(t){var e=(t=r.getQueryElement(t))&&t.outlayerGUID;return e&&u[e]},d.create=function(t,e){var i=c(d);return i.defaults=r.extend({},d.defaults),r.extend(i.defaults,e),i.compatOptions=r.extend({},d.compatOptions),i.namespace=t,i.data=d.data,i.Item=c(n),r.htmlInit(i,t),a&&a.bridget&&a.bridget(t,i),i};var f={ms:1,s:1e3};return d.Item=n,d}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,u){var e=t.create("masonry");e.compatOptions.fitWidth="isFitWidth";var i=e.prototype;return i._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this._getMeasurement("verticalSpacing","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},i.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],e=t&&t.element;this.columnWidth=e&&u(e).outerWidth||this.containerWidth}var i=this.columnWidth+=this.gutter,n=this.containerWidth+this.gutter,o=n/i,r=i-n%i;o=Math[r&&r<1?"round":"floor"](o),this.cols=Math.max(o,1)},i.getContainerWidth=function(){var t=this._getOption("fitWidth")?this.element.parentNode:this.element,e=u(t);this.containerWidth=e&&e.innerWidth},i._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=Math[e&&e<1?"round":"ceil"](t.size.outerWidth/this.columnWidth);i=Math.min(i,this.cols);var n=this[this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition"](i,t);n.y+=0!=n.y?this.verticalSpacing:0;for(var o={x:this.columnWidth*n.col,y:n.y},r=n.y+t.size.outerHeight,s=i+n.col,a=n.col;a<s;a++)this.colYs[a]=r;return o},i._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},i._getTopColGroup=function(t){if(t<2)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;n<i;n++)e[n]=this._getColGroupY(n,t);return e},i._getColGroupY=function(t,e){if(e<2)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},i._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols;i=1<t&&i+t>this.cols?0:i;var n=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=n?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},i._manageStamp=function(t){var e=u(t),i=this._getElementOffset(t),n=this._getOption("originLeft")?i.left:i.right,o=n+e.outerWidth,r=Math.floor(n/this.columnWidth);r=Math.max(0,r);var s=Math.floor(o/this.columnWidth);s-=o%this.columnWidth?0:1,s=Math.min(this.cols-1,s);for(var a=(this._getOption("originTop")?i.top:i.bottom)+e.outerHeight,h=r;h<=s;h++)this.colYs[h]=Math.max(a,this.colYs[h])},i._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},i._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},i.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},e});
/* Unveil */
!function(t) {
t.fn.unveil = function(i, e) {
var n,
r = t(window),
o = i || 0,
u = window.devicePixelRatio > 1 ? "data-src-retina" : "data-src",
s = this;
function l() {
var i = s.filter(function() {
var i = t(this);
if (!i.is(":hidden")) {
var e = r.scrollTop(),
n = e + r.height(),
u = i.offset().top;
return u + i.height() >= e - o && u <= n + o
}
});
n = i.trigger("unveil"), s = s.not(n)
}
return this.one("unveil", function() {
var t = this.getAttribute(u);
(t = t || this.getAttribute("data-src")) && (this.setAttribute("src", t), "function" == typeof e && e.call(this))
}), r.on("scroll.unveil resize.unveil lookup.unveil", l), l(), this
}
}(window.jQuery || window.Zepto);
/* Flickity v2.1.2 */
!function(t, e) {
"function" == typeof define && define.amd ? define("jquery-bridget/jquery-bridget", ["jquery"], function(i) {
return e(t, i)
}) : "object" == typeof module && module.exports ? module.exports = e(t, require("jquery")) : t.jQueryBridget = e(t, t.jQuery)
}(window, function(t, e) {
"use strict";
function i(i, o, a) {
function l(t, e, n) {
var s,
o = "$()." + i + '("' + e + '")';
return t.each(function(t, l) {
var h = a.data(l, i);
if (!h)
return void r(i + " not initialized. Cannot call methods, i.e. " + o);
var c = h[e];
if (!c || "_" == e.charAt(0))
return void r(o + " is not a valid method");
var d = c.apply(h, n);
s = void 0 === s ? d : s
}), void 0 !== s ? s : t
}
function h(t, e) {
t.each(function(t, n) {
var s = a.data(n, i);
s ? (s.option(e), s._init()) : (s = new o(n, e), a.data(n, i, s))
})
}
a = a || e || t.jQuery, a && (o.prototype.option || (o.prototype.option = function(t) {
a.isPlainObject(t) && (this.options = a.extend(!0, this.options, t))
}), a.fn[i] = function(t) {
if ("string" == typeof t) {
var e = s.call(arguments, 1);
return l(this, t, e)
}
return h(this, t), this
}, n(a))
}
function n(t) {
!t || t && t.bridget || (t.bridget = i)
}
var s = Array.prototype.slice,
o = t.console,
r = "undefined" == typeof o ? function() {} : function(t) {
o.error(t)
};
return n(e || t.jQuery), i
}), function(t, e) {
"function" == typeof define && define.amd ? define("ev-emitter/ev-emitter", e) : "object" == typeof module && module.exports ? module.exports = e() : t.EvEmitter = e()
}("undefined" != typeof window ? window : this, function() {
function t() {}
var e = t.prototype;
return e.on = function(t, e) {
if (t && e) {
var i = this._events = this._events || {},
n = i[t] = i[t] || [];
return n.indexOf(e) == -1 && n.push(e), this
}
}, e.once = function(t, e) {
if (t && e) {
this.on(t, e);
var i = this._onceEvents = this._onceEvents || {},
n = i[t] = i[t] || {};
return n[e] = !0, this
}
}, e.off = function(t, e) {
var i = this._events && this._events[t];
if (i && i.length) {
var n = i.indexOf(e);
return n != -1 && i.splice(n, 1), this
}
}, e.emitEvent = function(t, e) {
var i = this._events && this._events[t];
if (i && i.length) {
i = i.slice(0), e = e || [];
for (var n = this._onceEvents && this._onceEvents[t], s = 0; s < i.length; s++) {
var o = i[s],
r = n && n[o];
r && (this.off(t, o), delete n[o]), o.apply(this, e)
}
return this
}
}, e.allOff = function() {
delete this._events, delete this._onceEvents
}, t
}), function(t, e) {
"function" == typeof define && define.amd ? define("get-size/get-size", e) : "object" == typeof module && module.exports ? module.exports = e() : t.getSize = e()
}(window, function() {
"use strict";
function t(t) {
var e = parseFloat(t),
i = t.indexOf("%") == -1 && !isNaN(e);
return i && e
}
function e() {}
function i() {
for (var t = {
width: 0,
height: 0,
innerWidth: 0,
innerHeight: 0,
outerWidth: 0,
outerHeight: 0
}, e = 0; e < h; e++) {
var i = l[e];
t[i] = 0
}
return t
}
function n(t) {
var e = getComputedStyle(t);
return e || a("Style returned " + e + ". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"), e
}
function s() {
if (!c) {
c = !0;
var e = document.createElement("div");
e.style.width = "200px", e.style.padding = "1px 2px 3px 4px", e.style.borderStyle = "solid", e.style.borderWidth = "1px 2px 3px 4px", e.style.boxSizing = "border-box";
var i = document.body || document.documentElement;
i.appendChild(e);
var s = n(e);
r = 200 == Math.round(t(s.width)), o.isBoxSizeOuter = r, i.removeChild(e)
}
}
function o(e) {
if (s(), "string" == typeof e && (e = document.querySelector(e)), e && "object" == typeof e && e.nodeType) {
var o = n(e);
if ("none" == o.display)
return i();
var a = {};
a.width = e.offsetWidth, a.height = e.offsetHeight;
for (var c = a.isBorderBox = "border-box" == o.boxSizing, d = 0; d < h; d++) {
var u = l[d],
f = o[u],
p = parseFloat(f);
a[u] = isNaN(p) ? 0 : p
}
var g = a.paddingLeft + a.paddingRight,
v = a.paddingTop + a.paddingBottom,
m = a.marginLeft + a.marginRight,
y = a.marginTop + a.marginBottom,
b = a.borderLeftWidth + a.borderRightWidth,
E = a.borderTopWidth + a.borderBottomWidth,
S = c && r,
C = t(o.width);
C !== !1 && (a.width = C + (S ? 0 : g + b));
var x = t(o.height);
return x !== !1 && (a.height = x + (S ? 0 : v + E)), a.innerWidth = a.width - (g + b), a.innerHeight = a.height - (v + E), a.outerWidth = a.width + m, a.outerHeight = a.height + y, a
}
}
var r,
a = "undefined" == typeof console ? e : function(t) {
console.error(t)
},
l = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"],
h = l.length,
c = !1;
return o
}), function(t, e) {
"use strict";
"function" == typeof define && define.amd ? define("desandro-matches-selector/matches-selector", e) : "object" == typeof module && module.exports ? module.exports = e() : t.matchesSelector = e()
}(window, function() {
"use strict";
var t = function() {
var t = window.Element.prototype;
if (t.matches)
return "matches";
if (t.matchesSelector)
return "matchesSelector";
for (var e = ["webkit", "moz", "ms", "o"], i = 0; i < e.length; i++) {
var n = e[i],
s = n + "MatchesSelector";
if (t[s])
return s
}
}();
return function(e, i) {
return e[t](i)
}
}), function(t, e) {
"function" == typeof define && define.amd ? define("fizzy-ui-utils/utils", ["desandro-matches-selector/matches-selector"], function(i) {
return e(t, i)
}) : "object" == typeof module && module.exports ? module.exports = e(t, require("desandro-matches-selector")) : t.fizzyUIUtils = e(t, t.matchesSelector)
}(window, function(t, e) {
var i = {};
i.extend = function(t, e) {
for (var i in e)
t[i] = e[i];
return t
}, i.modulo = function(t, e) {
return (t % e + e) % e
};
var n = Array.prototype.slice;
i.makeArray = function(t) {
if (Array.isArray(t))
return t;
if (null === t || void 0 === t)
return [];
var e = "object" == typeof t && "number" == typeof t.length;
return e ? n.call(t) : [t]
}, i.removeFrom = function(t, e) {
var i = t.indexOf(e);
i != -1 && t.splice(i, 1)
}, i.getParent = function(t, i) {
for (; t.parentNode && t != document.body;)
if (t = t.parentNode, e(t, i))
return t
}, i.getQueryElement = function(t) {
return "string" == typeof t ? document.querySelector(t) : t
}, i.handleEvent = function(t) {
var e = "on" + t.type;
this[e] && this[e](t)
}, i.filterFindElements = function(t, n) {
t = i.makeArray(t);
var s = [];
return t.forEach(function(t) {
if (t instanceof HTMLElement) {
if (!n)
return void s.push(t);
e(t, n) && s.push(t);
for (var i = t.querySelectorAll(n), o = 0; o < i.length; o++)
s.push(i[o])
}
}), s
}, i.debounceMethod = function(t, e, i) {
i = i || 100;
var n = t.prototype[e],
s = e + "Timeout";
t.prototype[e] = function() {
var t = this[s];
clearTimeout(t);
var e = arguments,
o = this;
this[s] = setTimeout(function() {
n.apply(o, e), delete o[s]
}, i)
}
}, i.docReady = function(t) {
var e = document.readyState;
"complete" == e || "interactive" == e ? setTimeout(t) : document.addEventListener("DOMContentLoaded", t)
}, i.toDashed = function(t) {
return t.replace(/(.)([A-Z])/g, function(t, e, i) {
return e + "-" + i
}).toLowerCase()
};
var s = t.console;
return i.htmlInit = function(e, n) {
i.docReady(function() {
var o = i.toDashed(n),
r = "data-" + o,
a = document.querySelectorAll("[" + r + "]"),
l = document.querySelectorAll(".js-" + o),
h = i.makeArray(a).concat(i.makeArray(l)),
c = r + "-options",
d = t.jQuery;
h.forEach(function(t) {
var i,
o = t.getAttribute(r) || t.getAttribute(c);
try {
i = o && JSON.parse(o)
} catch (a) {
return void (s && s.error("Error parsing " + r + " on " + t.className + ": " + a))
}
var l = new e(t, i);
d && d.data(t, n, l)
})
})
}, i
}), function(t, e) {
"function" == typeof define && define.amd ? define("flickity/js/cell", ["get-size/get-size"], function(i) {
return e(t, i)
}) : "object" == typeof module && module.exports ? module.exports = e(t, require("get-size")) : (t.Flickity = t.Flickity || {}, t.Flickity.Cell = e(t, t.getSize))
}(window, function(t, e) {
function i(t, e) {
this.element = t, this.parent = e, this.create()
}
var n = i.prototype;
return n.create = function() {
this.element.style.position = "absolute", this.element.setAttribute("aria-selected", "false"), this.x = 0, this.shift = 0
}, n.destroy = function() {
this.element.style.position = "";
var t = this.parent.originSide;
this.element.removeAttribute("aria-selected"), this.element.style[t] = ""
}, n.getSize = function() {
this.size = e(this.element)
}, n.setPosition = function(t) {
this.x = t, this.updateTarget(), this.renderPosition(t)
}, n.updateTarget = n.setDefaultTarget = function() {
var t = "left" == this.parent.originSide ? "marginLeft" : "marginRight";
this.target = this.x + this.size[t] + this.size.width * this.parent.cellAlign
}, n.renderPosition = function(t) {
var e = this.parent.originSide;
this.element.style[e] = this.parent.getPositionValue(t)
}, n.wrapShift = function(t) {
this.shift = t, this.renderPosition(this.x + this.parent.slideableWidth * t)
}, n.remove = function() {
this.element.parentNode.removeChild(this.element)
}, i
}), function(t, e) {
"function" == typeof define && define.amd ? define("flickity/js/slide", e) : "object" == typeof module && module.exports ? module.exports = e() : (t.Flickity = t.Flickity || {}, t.Flickity.Slide = e())
}(window, function() {
"use strict";
function t(t) {
this.parent = t, this.isOriginLeft = "left" == t.originSide, this.cells = [], this.outerWidth = 0, this.height = 0
}
var e = t.prototype;
return e.addCell = function(t) {
if (this.cells.push(t), this.outerWidth += t.size.outerWidth, this.height = Math.max(t.size.outerHeight, this.height), 1 == this.cells.length) {
this.x = t.x;
var e = this.isOriginLeft ? "marginLeft" : "marginRight";
this.firstMargin = t.size[e]
}
}, e.updateTarget = function() {
var t = this.isOriginLeft ? "marginRight" : "marginLeft",
e = this.getLastCell(),
i = e ? e.size[t] : 0,
n = this.outerWidth - (this.firstMargin + i);
this.target = this.x + this.firstMargin + n * this.parent.cellAlign
}, e.getLastCell = function() {
return this.cells[this.cells.length - 1]
}, e.select = function() {
this.changeSelected(!0)
}, e.unselect = function() {
this.changeSelected(!1)
}, e.changeSelected = function(t) {
var e = t ? "add" : "remove";
this.cells.forEach(function(i) {
i.element.classList[e]("is-selected"), i.element.setAttribute("aria-selected", t.toString())
})
}, e.getCellElements = function() {
return this.cells.map(function(t) {
return t.element
})
}, t
}), function(t, e) {
"function" == typeof define && define.amd ? define("flickity/js/animate", ["fizzy-ui-utils/utils"], function(i) {
return e(t, i)
}) : "object" == typeof module && module.exports ? module.exports = e(t, require("fizzy-ui-utils")) : (t.Flickity = t.Flickity || {}, t.Flickity.animatePrototype = e(t, t.fizzyUIUtils))
}(window, function(t, e) {
var i = {};
return i.startAnimation = function() {
this.isAnimating || (this.isAnimating = !0, this.restingFrames = 0, this.animate())
}, i.animate = function() {
this.applyDragForce(), this.applySelectedAttraction();
var t = this.x;
if (this.integratePhysics(), this.positionSlider(), this.settle(t), this.isAnimating) {
var e = this;
requestAnimationFrame(function() {
e.animate()
})
}
}, i.positionSlider = function() {
var t = this.x;
this.options.wrapAround && this.cells.length > 1 && (t = e.modulo(t, this.slideableWidth), t -= this.slideableWidth, this.shiftWrapCells(t)), t += this.cursorPosition, t = this.options.rightToLeft ? -t : t;
var i = this.getPositionValue(t);
this.slider.style.transform = this.isAnimating ? "translate3d(" + i + ",0,0)" : "translateX(" + i + ")";
var n = this.slides[0];
if (n) {
var s = -this.x - n.target,
o = s / this.slidesWidth;
this.dispatchEvent("scroll", null, [o, s])
}
}, i.positionSliderAtSelected = function() {
this.cells.length && (this.x = -this.selectedSlide.target, this.velocity = 0, this.positionSlider())
}, i.getPositionValue = function(t) {
return this.options.percentPosition ? .01 * Math.round(t / this.size.innerWidth * 1e4) + "%" : Math.round(t) + "px"
}, i.settle = function(t) {
this.isPointerDown || Math.round(100 * this.x) != Math.round(100 * t) || this.restingFrames++, this.restingFrames > 2 && (this.isAnimating = !1, delete this.isFreeScrolling, this.positionSlider(), this.dispatchEvent("settle", null, [this.selectedIndex]))
}, i.shiftWrapCells = function(t) {
var e = this.cursorPosition + t;
this._shiftCells(this.beforeShiftCells, e, -1);
var i = this.size.innerWidth - (t + this.slideableWidth + this.cursorPosition);
this._shiftCells(this.afterShiftCells, i, 1)
}, i._shiftCells = function(t, e, i) {
for (var n = 0; n < t.length; n++) {
var s = t[n],
o = e > 0 ? i : 0;
s.wrapShift(o), e -= s.size.outerWidth
}
}, i._unshiftCells = function(t) {
if (t && t.length)
for (var e = 0; e < t.length; e++)
t[e].wrapShift(0)
}, i.integratePhysics = function() {
this.x += this.velocity, this.velocity *= this.getFrictionFactor()
}, i.applyForce = function(t) {
this.velocity += t
}, i.getFrictionFactor = function() {
return 1 - this.options[this.isFreeScrolling ? "freeScrollFriction" : "friction"]
}, i.getRestingPosition = function() {
return this.x + this.velocity / (1 - this.getFrictionFactor())
}, i.applyDragForce = function() {
if (this.isDraggable && this.isPointerDown) {
var t = this.dragX - this.x,
e = t - this.velocity;
this.applyForce(e)
}
}, i.applySelectedAttraction = function() {
var t = this.isDraggable && this.isPointerDown;
if (!t && !this.isFreeScrolling && this.slides.length) {
var e = this.selectedSlide.target * -1 - this.x,
i = e * this.options.selectedAttraction;
this.applyForce(i)
}
}, i
}), function(t, e) {
if ("function" == typeof define && define.amd)
define("flickity/js/flickity", ["ev-emitter/ev-emitter", "get-size/get-size", "fizzy-ui-utils/utils", "./cell", "./slide", "./animate"], function(i, n, s, o, r, a) {
return e(t, i, n, s, o, r, a)
});
else if ("object" == typeof module && module.exports)
module.exports = e(t, require("ev-emitter"), require("get-size"), require("fizzy-ui-utils"), require("./cell"), require("./slide"), require("./animate"));
else {
var i = t.Flickity;
t.Flickity = e(t, t.EvEmitter, t.getSize, t.fizzyUIUtils, i.Cell, i.Slide, i.animatePrototype)
}
}(window, function(t, e, i, n, s, o, r) {
function a(t, e) {
for (t = n.makeArray(t); t.length;)
e.appendChild(t.shift())
}
function l(t, e) {
var i = n.getQueryElement(t);
if (!i)
return void (d && d.error("Bad element for Flickity: " + (i || t)));
if (this.element = i, this.element.flickityGUID) {
var s = f[this.element.flickityGUID];
return s.option(e), s
}
h && (this.$element = h(this.element)), this.options = n.extend({}, this.constructor.defaults), this.option(e), this._create()
}
var h = t.jQuery,
c = t.getComputedStyle,
d = t.console,
u = 0,
f = {};
l.defaults = {
accessibility: !0,
cellAlign: "center",
freeScrollFriction: .075,
friction: .28,
namespaceJQueryEvents: !0,
percentPosition: !0,
resize: !0,
selectedAttraction: .025,
setGallerySize: !0
}, l.createMethods = [];
var p = l.prototype;
n.extend(p, e.prototype), p._create = function() {
var e = this.guid = ++u;
this.element.flickityGUID = e, f[e] = this, this.selectedIndex = 0, this.restingFrames = 0, this.x = 0, this.velocity = 0, this.originSide = this.options.rightToLeft ? "right" : "left", this.viewport = document.createElement("div"), this.viewport.className = "flickity-viewport", this._createSlider(), (this.options.resize || this.options.watchCSS) && t.addEventListener("resize", this);
for (var i in this.options.on) {
var n = this.options.on[i];
this.on(i, n)
}
l.createMethods.forEach(function(t) {
this[t]()
}, this), this.options.watchCSS ? this.watchCSS() : this.activate()
}, p.option = function(t) {
n.extend(this.options, t)
}, p.activate = function() {
if (!this.isActive) {
this.isActive = !0, this.element.classList.add("flickity-enabled"), this.options.rightToLeft && this.element.classList.add("flickity-rtl"), this.getSize();
var t = this._filterFindCellElements(this.element.children);
a(t, this.slider), this.viewport.appendChild(this.slider), this.element.appendChild(this.viewport), this.reloadCells(), this.options.accessibility && (this.element.tabIndex = 0, this.element.addEventListener("keydown", this)), this.emitEvent("activate");
var e,
i = this.options.initialIndex;
e = this.isInitActivated ? this.selectedIndex : void 0 !== i && this.cells[i] ? i : 0, this.select(e, !1, !0), this.isInitActivated = !0, this.dispatchEvent("ready")
}
}, p._createSlider = function() {
var t = document.createElement("div");
t.className = "flickity-slider", t.style[this.originSide] = 0, this.slider = t
}, p._filterFindCellElements = function(t) {
return n.filterFindElements(t, this.options.cellSelector)
}, p.reloadCells = function() {
this.cells = this._makeCells(this.slider.children), this.positionCells(), this._getWrapShiftCells(), this.setGallerySize()
}, p._makeCells = function(t) {
var e = this._filterFindCellElements(t),
i = e.map(function(t) {
return new s(t, this)
}, this);
return i
}, p.getLastCell = function() {
return this.cells[this.cells.length - 1]
}, p.getLastSlide = function() {
return this.slides[this.slides.length - 1]
}, p.positionCells = function() {
this._sizeCells(this.cells), this._positionCells(0)
}, p._positionCells = function(t) {
t = t || 0, this.maxCellHeight = t ? this.maxCellHeight || 0 : 0;
var e = 0;
if (t > 0) {
var i = this.cells[t - 1];
e = i.x + i.size.outerWidth
}
for (var n = this.cells.length, s = t; s < n; s++) {
var o = this.cells[s];
o.setPosition(e), e += o.size.outerWidth, this.maxCellHeight = Math.max(o.size.outerHeight, this.maxCellHeight)
}
this.slideableWidth = e, this.updateSlides(), this._containSlides(), this.slidesWidth = n ? this.getLastSlide().target - this.slides[0].target : 0
}, p._sizeCells = function(t) {
t.forEach(function(t) {
t.getSize()
})
}, p.updateSlides = function() {
if (this.slides = [], this.cells.length) {
var t = new o(this);
this.slides.push(t);
var e = "left" == this.originSide,
i = e ? "marginRight" : "marginLeft",
n = this._getCanCellFit();
this.cells.forEach(function(e, s) {
if (!t.cells.length)
return void t.addCell(e);
var r = t.outerWidth - t.firstMargin + (e.size.outerWidth - e.size[i]);
n.call(this, s, r) ? t.addCell(e) : (t.updateTarget(), t = new o(this), this.slides.push(t), t.addCell(e))
}, this), t.updateTarget(), this.updateSelectedSlide()
}
}, p._getCanCellFit = function() {
var t = this.options.groupCells;
if (!t)
return function() {
return !1
};
if ("number" == typeof t) {
var e = parseInt(t, 10);
return function(t) {
return t % e !== 0
}
}
var i = "string" == typeof t && t.match(/^(\d+)%$/),
n = i ? parseInt(i[1], 10) / 100 : 1;
return function(t, e) {
return e <= (this.size.innerWidth + 1) * n
}
}, p._init = p.reposition = function() {
this.positionCells(), this.positionSliderAtSelected()
}, p.getSize = function() {
this.size = i(this.element), this.setCellAlign(), this.cursorPosition = this.size.innerWidth * this.cellAlign
};
var g = {
center: {
left: .5,
right: .5
},
left: {
left: 0,
right: 1
},
right: {
right: 0,
left: 1
}
};
return p.setCellAlign = function() {
var t = g[this.options.cellAlign];
this.cellAlign = t ? t[this.originSide] : this.options.cellAlign
}, p.setGallerySize = function() {
if (this.options.setGallerySize) {
var t = this.options.adaptiveHeight && this.selectedSlide ? this.selectedSlide.height : this.maxCellHeight;
this.viewport.style.height = t + "px"
}
}, p._getWrapShiftCells = function() {
if (this.options.wrapAround) {
this._unshiftCells(this.beforeShiftCells), this._unshiftCells(this.afterShiftCells);
var t = this.cursorPosition,
e = this.cells.length - 1;
this.beforeShiftCells = this._getGapCells(t, e, -1), t = this.size.innerWidth - this.cursorPosition, this.afterShiftCells = this._getGapCells(t, 0, 1)
}
}, p._getGapCells = function(t, e, i) {
for (var n = []; t > 0;) {
var s = this.cells[e];
if (!s)
break;
n.push(s), e += i, t -= s.size.outerWidth
}
return n
}, p._containSlides = function() {
if (this.options.contain && !this.options.wrapAround && this.cells.length) {
var t = this.options.rightToLeft,
e = t ? "marginRight" : "marginLeft",
i = t ? "marginLeft" : "marginRight",
n = this.slideableWidth - this.getLastCell().size[i],
s = n < this.size.innerWidth,
o = this.cursorPosition + this.cells[0].size[e],
r = n - this.size.innerWidth * (1 - this.cellAlign);
this.slides.forEach(function(t) {
s ? t.target = n * this.cellAlign : (t.target = Math.max(t.target, o), t.target = Math.min(t.target, r))
}, this)
}
}, p.dispatchEvent = function(t, e, i) {
var n = e ? [e].concat(i) : i;
if (this.emitEvent(t, n), h && this.$element) {
t += this.options.namespaceJQueryEvents ? ".flickity" : "";
var s = t;
if (e) {
var o = h.Event(e);
o.type = t, s = o
}
this.$element.trigger(s, i)
}
}, p.select = function(t, e, i) {
if (this.isActive && (t = parseInt(t, 10), this._wrapSelect(t), (this.options.wrapAround || e) && (t = n.modulo(t, this.slides.length)), this.slides[t])) {
var s = this.selectedIndex;
this.selectedIndex = t, this.updateSelectedSlide(), i ? this.positionSliderAtSelected() : this.startAnimation(), this.options.adaptiveHeight && this.setGallerySize(), this.dispatchEvent("select", null, [t]), t != s && this.dispatchEvent("change", null, [t]), this.dispatchEvent("cellSelect")
}
}, p._wrapSelect = function(t) {
var e = this.slides.length,
i = this.options.wrapAround && e > 1;
if (!i)
return t;
var s = n.modulo(t, e),
o = Math.abs(s - this.selectedIndex),
r = Math.abs(s + e - this.selectedIndex),
a = Math.abs(s - e - this.selectedIndex);
!this.isDragSelect && r < o ? t += e : !this.isDragSelect && a < o && (t -= e), t < 0 ? this.x -= this.slideableWidth : t >= e && (this.x += this.slideableWidth)
}, p.previous = function(t, e) {
this.select(this.selectedIndex - 1, t, e)
}, p.next = function(t, e) {
this.select(this.selectedIndex + 1, t, e)
}, p.updateSelectedSlide = function() {
var t = this.slides[this.selectedIndex];
t && (this.unselectSelectedSlide(), this.selectedSlide = t, t.select(), this.selectedCells = t.cells, this.selectedElements = t.getCellElements(), this.selectedCell = t.cells[0], this.selectedElement = this.selectedElements[0])
}, p.unselectSelectedSlide = function() {
this.selectedSlide && this.selectedSlide.unselect()
}, p.selectCell = function(t, e, i) {
var n = this.queryCell(t);
if (n) {
var s = this.getCellSlideIndex(n);
this.select(s, e, i)
}
}, p.getCellSlideIndex = function(t) {
for (var e = 0; e < this.slides.length; e++) {
var i = this.slides[e],
n = i.cells.indexOf(t);
if (n != -1)
return e
}
}, p.getCell = function(t) {
for (var e = 0; e < this.cells.length; e++) {
var i = this.cells[e];
if (i.element == t)
return i
}
}, p.getCells = function(t) {
t = n.makeArray(t);
var e = [];
return t.forEach(function(t) {
var i = this.getCell(t);
i && e.push(i)
}, this), e
}, p.getCellElements = function() {
return this.cells.map(function(t) {
return t.element
})
}, p.getParentCell = function(t) {
var e = this.getCell(t);
return e ? e : (t = n.getParent(t, ".flickity-slider > *"), this.getCell(t))
}, p.getAdjacentCellElements = function(t, e) {
if (!t)
return this.selectedSlide.getCellElements();
e = void 0 === e ? this.selectedIndex : e;
var i = this.slides.length;
if (1 + 2 * t >= i)
return this.getCellElements();
for (var s = [], o = e - t; o <= e + t; o++) {
var r = this.options.wrapAround ? n.modulo(o, i) : o,
a = this.slides[r];
a && (s = s.concat(a.getCellElements()))
}
return s
}, p.queryCell = function(t) {
return "number" == typeof t ? this.cells[t] : ("string" == typeof t && (t = this.element.querySelector(t)), this.getCell(t))
}, p.uiChange = function() {
this.emitEvent("uiChange")
}, p.childUIPointerDown = function(t) {
this.emitEvent("childUIPointerDown", [t])
}, p.onresize = function() {
this.watchCSS(), this.resize()
}, n.debounceMethod(l, "onresize", 150), p.resize = function() {
if (this.isActive) {
this.getSize(), this.options.wrapAround && (this.x = n.modulo(this.x, this.slideableWidth)), this.positionCells(), this._getWrapShiftCells(), this.setGallerySize(), this.emitEvent("resize");
var t = this.selectedElements && this.selectedElements[0];
this.selectCell(t, !1, !0)
}
}, p.watchCSS = function() {
var t = this.options.watchCSS;
if (t) {
var e = c(this.element, ":after").content;
e.indexOf("flickity") != -1 ? this.activate() : this.deactivate()
}
}, p.onkeydown = function(t) {
var e = document.activeElement && document.activeElement != this.element;
if (this.options.accessibility && !e) {
var i = l.keyboardHandlers[t.keyCode];
i && i.call(this)
}
}, l.keyboardHandlers = {
37: function() {
var t = this.options.rightToLeft ? "next" : "previous";
this.uiChange(), this[t]()
},
39: function() {
var t = this.options.rightToLeft ? "previous" : "next";
this.uiChange(), this[t]()
}
}, p.focus = function() {
var e = t.pageYOffset;
this.element.focus({
preventScroll: !0
}), t.pageYOffset != e && t.scrollTo(t.pageXOffset, e)
}, p.deactivate = function() {
this.isActive && (this.element.classList.remove("flickity-enabled"), this.element.classList.remove("flickity-rtl"), this.unselectSelectedSlide(), this.cells.forEach(function(t) {
t.destroy()
}), this.element.removeChild(this.viewport), a(this.slider.children, this.element), this.options.accessibility && (this.element.removeAttribute("tabIndex"), this.element.removeEventListener("keydown", this)), this.isActive = !1, this.emitEvent("deactivate"))
}, p.destroy = function() {
this.deactivate(), t.removeEventListener("resize", this), this.emitEvent("destroy"), h && this.$element && h.removeData(this.element, "flickity"), delete this.element.flickityGUID, delete f[this.guid]
}, n.extend(p, r), l.data = function(t) {
t = n.getQueryElement(t);
var e = t && t.flickityGUID;
return e && f[e]
}, n.htmlInit(l, "flickity"), h && h.bridget && h.bridget("flickity", l), l.setJQuery = function(t) {
h = t
}, l.Cell = s, l
}), function(t, e) {
"function" == typeof define && define.amd ? define("unipointer/unipointer", ["ev-emitter/ev-emitter"], function(i) {
return e(t, i)
}) : "object" == typeof module && module.exports ? module.exports = e(t, require("ev-emitter")) : t.Unipointer = e(t, t.EvEmitter)
}(window, function(t, e) {
function i() {}
function n() {}
var s = n.prototype = Object.create(e.prototype);
s.bindStartEvent = function(t) {
this._bindStartEvent(t, !0)
}, s.unbindStartEvent = function(t) {
this._bindStartEvent(t, !1)
}, s._bindStartEvent = function(e, i) {
i = void 0 === i || i;
var n = i ? "addEventListener" : "removeEventListener",
s = "mousedown";
t.PointerEvent ? s = "pointerdown" : "ontouchstart" in t && (s = "touchstart"), e[n](s, this)
}, s.handleEvent = function(t) {
var e = "on" + t.type;
this[e] && this[e](t)
}, s.getTouch = function(t) {
for (var e = 0; e < t.length; e++) {
var i = t[e];
if (i.identifier == this.pointerIdentifier)
return i
}
}, s.onmousedown = function(t) {
var e = t.button;
e && 0 !== e && 1 !== e || this._pointerDown(t, t)
}, s.ontouchstart = function(t) {
this._pointerDown(t, t.changedTouches[0])
}, s.onpointerdown = function(t) {
this._pointerDown(t, t)
}, s._pointerDown = function(t, e) {
t.button || this.isPointerDown || (this.isPointerDown = !0, this.pointerIdentifier = void 0 !== e.pointerId ? e.pointerId : e.identifier, this.pointerDown(t, e))
}, s.pointerDown = function(t, e) {
this._bindPostStartEvents(t), this.emitEvent("pointerDown", [t, e])
};
var o = {
mousedown: ["mousemove", "mouseup"],
touchstart: ["touchmove", "touchend", "touchcancel"],
pointerdown: ["pointermove", "pointerup", "pointercancel"]
};
return s._bindPostStartEvents = function(e) {
if (e) {
var i = o[e.type];
i.forEach(function(e) {
t.addEventListener(e, this)
}, this), this._boundPointerEvents = i
}
}, s._unbindPostStartEvents = function() {
this._boundPointerEvents && (this._boundPointerEvents.forEach(function(e) {
t.removeEventListener(e, this)
}, this), delete this._boundPointerEvents)
}, s.onmousemove = function(t) {
this._pointerMove(t, t)
}, s.onpointermove = function(t) {
t.pointerId == this.pointerIdentifier && this._pointerMove(t, t)
}, s.ontouchmove = function(t) {
var e = this.getTouch(t.changedTouches);
e && this._pointerMove(t, e)
}, s._pointerMove = function(t, e) {