1
Surpriseplus
2022-09-16 8d1a91c23df335b090e38b2edd15203aa3b03da9
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
/* == jquery mousewheel plugin == Version: 3.1.13, License: MIT License (MIT) */
!
    function(a) {
        "function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof exports ? module.exports = a: a(jQuery)
    } (function(a) {
        function b(b) {
            var g = b || window.event,
                h = i.call(arguments, 1),
                j = 0,
                l = 0,
                m = 0,
                n = 0,
                o = 0,
                p = 0;
            if (b = a.event.fix(g), b.type = "mousewheel", "detail" in g && (m = -1 * g.detail), "wheelDelta" in g && (m = g.wheelDelta), "wheelDeltaY" in g && (m = g.wheelDeltaY), "wheelDeltaX" in g && (l = -1 * g.wheelDeltaX), "axis" in g && g.axis === g.HORIZONTAL_AXIS && (l = -1 * m, m = 0), j = 0 === m ? l: m, "deltaY" in g && (m = -1 * g.deltaY, j = m), "deltaX" in g && (l = g.deltaX, 0 === m && (j = -1 * l)), 0 !== m || 0 !== l) {
                if (1 === g.deltaMode) {
                    var q = a.data(this, "mousewheel-line-height");
                    j *= q,
                        m *= q,
                        l *= q
                } else if (2 === g.deltaMode) {
                    var r = a.data(this, "mousewheel-page-height");
                    j *= r,
                        m *= r,
                        l *= r
                }
                if (n = Math.max(Math.abs(m), Math.abs(l)), (!f || f > n) && (f = n, d(g, n) && (f /= 40)), d(g, n) && (j /= 40, l /= 40, m /= 40), j = Math[j >= 1 ? "floor": "ceil"](j / f), l = Math[l >= 1 ? "floor": "ceil"](l / f), m = Math[m >= 1 ? "floor": "ceil"](m / f), k.settings.normalizeOffset && this.getBoundingClientRect) {
                    var s = this.getBoundingClientRect();
                    o = b.clientX - s.left,
                        p = b.clientY - s.top
                }
                return b.deltaX = l,
                    b.deltaY = m,
                    b.deltaFactor = f,
                    b.offsetX = o,
                    b.offsetY = p,
                    b.deltaMode = 0,
                    h.unshift(b, j, l, m),
                e && clearTimeout(e),
                    e = setTimeout(c, 200),
                    (a.event.dispatch || a.event.handle).apply(this, h)
            }
        }
        function c() {
            f = null
        }
        function d(a, b) {
            return k.settings.adjustOldDeltas && "mousewheel" === a.type && b % 120 === 0
        }
        var e, f, g = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
            h = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"],
            i = Array.prototype.slice;
        if (a.event.fixHooks) for (var j = g.length; j;) a.event.fixHooks[g[--j]] = a.event.mouseHooks;
        var k = a.event.special.mousewheel = {
            version: "3.1.12",
            setup: function() {
                if (this.addEventListener) for (var c = h.length; c;) this.addEventListener(h[--c], b, !1);
                else this.onmousewheel = b;
                a.data(this, "mousewheel-line-height", k.getLineHeight(this)),
                    a.data(this, "mousewheel-page-height", k.getPageHeight(this))
            },
            teardown: function() {
                if (this.removeEventListener) for (var c = h.length; c;) this.removeEventListener(h[--c], b, !1);
                else this.onmousewheel = null;
                a.removeData(this, "mousewheel-line-height"),
                    a.removeData(this, "mousewheel-page-height")
            },
            getLineHeight: function(b) {
                var c = a(b),
                    d = c["offsetParent" in a.fn ? "offsetParent": "parent"]();
                return d.length || (d = a("body")),
                parseInt(d.css("fontSize"), 10) || parseInt(c.css("fontSize"), 10) || 16
            },
            getPageHeight: function(b) {
                return a(b).height()
            },
            settings: {
                adjustOldDeltas: !0,
                normalizeOffset: !0
            }
        };
        a.fn.extend({
            mousewheel: function(a) {
                return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
            },
            unmousewheel: function(a) {
                return this.unbind("mousewheel", a)
            }
        })
    }); !
    function(a) {
        "function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof exports ? module.exports = a: a(jQuery)
    } (function(a) {
        function b(b) {
            var g = b || window.event,
                h = i.call(arguments, 1),
                j = 0,
                l = 0,
                m = 0,
                n = 0,
                o = 0,
                p = 0;
            if (b = a.event.fix(g), b.type = "mousewheel", "detail" in g && (m = -1 * g.detail), "wheelDelta" in g && (m = g.wheelDelta), "wheelDeltaY" in g && (m = g.wheelDeltaY), "wheelDeltaX" in g && (l = -1 * g.wheelDeltaX), "axis" in g && g.axis === g.HORIZONTAL_AXIS && (l = -1 * m, m = 0), j = 0 === m ? l: m, "deltaY" in g && (m = -1 * g.deltaY, j = m), "deltaX" in g && (l = g.deltaX, 0 === m && (j = -1 * l)), 0 !== m || 0 !== l) {
                if (1 === g.deltaMode) {
                    var q = a.data(this, "mousewheel-line-height");
                    j *= q,
                        m *= q,
                        l *= q
                } else if (2 === g.deltaMode) {
                    var r = a.data(this, "mousewheel-page-height");
                    j *= r,
                        m *= r,
                        l *= r
                }
                if (n = Math.max(Math.abs(m), Math.abs(l)), (!f || f > n) && (f = n, d(g, n) && (f /= 40)), d(g, n) && (j /= 40, l /= 40, m /= 40), j = Math[j >= 1 ? "floor": "ceil"](j / f), l = Math[l >= 1 ? "floor": "ceil"](l / f), m = Math[m >= 1 ? "floor": "ceil"](m / f), k.settings.normalizeOffset && this.getBoundingClientRect) {
                    var s = this.getBoundingClientRect();
                    o = b.clientX - s.left,
                        p = b.clientY - s.top
                }
                return b.deltaX = l,
                    b.deltaY = m,
                    b.deltaFactor = f,
                    b.offsetX = o,
                    b.offsetY = p,
                    b.deltaMode = 0,
                    h.unshift(b, j, l, m),
                e && clearTimeout(e),
                    e = setTimeout(c, 200),
                    (a.event.dispatch || a.event.handle).apply(this, h)
            }
        }
        function c() {
            f = null
        }
        function d(a, b) {
            return k.settings.adjustOldDeltas && "mousewheel" === a.type && b % 120 === 0
        }
        var e, f, g = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
            h = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"],
            i = Array.prototype.slice;
        if (a.event.fixHooks) for (var j = g.length; j;) a.event.fixHooks[g[--j]] = a.event.mouseHooks;
        var k = a.event.special.mousewheel = {
            version: "3.1.12",
            setup: function() {
                if (this.addEventListener) for (var c = h.length; c;) this.addEventListener(h[--c], b, !1);
                else this.onmousewheel = b;
                a.data(this, "mousewheel-line-height", k.getLineHeight(this)),
                    a.data(this, "mousewheel-page-height", k.getPageHeight(this))
            },
            teardown: function() {
                if (this.removeEventListener) for (var c = h.length; c;) this.removeEventListener(h[--c], b, !1);
                else this.onmousewheel = null;
                a.removeData(this, "mousewheel-line-height"),
                    a.removeData(this, "mousewheel-page-height")
            },
            getLineHeight: function(b) {
                var c = a(b),
                    d = c["offsetParent" in a.fn ? "offsetParent": "parent"]();
                return d.length || (d = a("body")),
                parseInt(d.css("fontSize"), 10) || parseInt(c.css("fontSize"), 10) || 16
            },
            getPageHeight: function(b) {
                return a(b).height()
            },
            settings: {
                adjustOldDeltas: !0,
                normalizeOffset: !0
            }
        };
        a.fn.extend({
            mousewheel: function(a) {
                return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
            },
            unmousewheel: function(a) {
                return this.unbind("mousewheel", a)
            }
        })
    });
/* == malihu jquery custom scrollbar plugin == Version: 3.1.5, License: MIT License (MIT) */
!
    function(e) {
        "function" == typeof define && define.amd ? define(["jquery"], e) : "undefined" != typeof module && module.exports ? module.exports = e: e(jQuery, window, document)
    } (function(e) { !
        function(t) {
            var o = "function" == typeof define && define.amd,
                a = "undefined" != typeof module && module.exports,
                n = "https:" == document.location.protocol ? "https:": "http:",
                i = "cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";
            o || (a ? require("jquery-mousewheel")(e) : e.event.special.mousewheel || e("head").append(decodeURI("%3Cscript src=" + n + "//" + i + "%3E%3C/script%3E"))),
                t()
        } (function() {
            var t, o = "mCustomScrollbar",
                a = "mCS",
                n = ".mCustomScrollbar",
                i = {
                    setTop: 0,
                    setLeft: 0,
                    axis: "y",
                    scrollbarPosition: "inside",
                    scrollInertia: 950,
                    autoDraggerLength: !0,
                    alwaysShowScrollbar: 0,
                    snapOffset: 0,
                    mouseWheel: {
                        enable: !0,
                        scrollAmount: "auto",
                        axis: "y",
                        deltaFactor: "auto",
                        disableOver: ["select", "option", "keygen", "datalist", "textarea"]
                    },
                    scrollButtons: {
                        scrollType: "stepless",
                        scrollAmount: "auto"
                    },
                    keyboard: {
                        enable: !0,
                        scrollType: "stepless",
                        scrollAmount: "auto"
                    },
                    contentTouchScroll: 25,
                    documentTouchScroll: !0,
                    advanced: {
                        autoScrollOnFocus: "input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",
                        updateOnContentResize: !0,
                        updateOnImageLoad: "auto",
                        autoUpdateTimeout: 60
                    },
                    theme: "light",
                    callbacks: {
                        onTotalScrollOffset: 0,
                        onTotalScrollBackOffset: 0,
                        alwaysTriggerOffsets: !0
                    }
                },
                r = 0,
                l = {},
                s = window.attachEvent && !window.addEventListener ? 1 : 0,
                c = !1,
                d = ["mCSB_dragger_onDrag", "mCSB_scrollTools_onDrag", "mCS_img_loaded", "mCS_disabled", "mCS_destroyed", "mCS_no_scrollbar", "mCS-autoHide", "mCS-dir-rtl", "mCS_no_scrollbar_y", "mCS_no_scrollbar_x", "mCS_y_hidden", "mCS_x_hidden", "mCSB_draggerContainer", "mCSB_buttonUp", "mCSB_buttonDown", "mCSB_buttonLeft", "mCSB_buttonRight"],
                u = {
                    init: function(t) {
                        var t = e.extend(!0, {},
                            i, t),
                            o = f.call(this);
                        if (t.live) {
                            var s = t.liveSelector || this.selector || n,
                                c = e(s);
                            if ("off" === t.live) return void m(s);
                            l[s] = setTimeout(function() {
                                    c.mCustomScrollbar(t),
                                    "once" === t.live && c.length && m(s)
                                },
                                500)
                        } else m(s);
                        return t.setWidth = t.set_width ? t.set_width: t.setWidth,
                            t.setHeight = t.set_height ? t.set_height: t.setHeight,
                            t.axis = t.horizontalScroll ? "x": p(t.axis),
                            t.scrollInertia = t.scrollInertia > 0 && t.scrollInertia < 17 ? 17 : t.scrollInertia,
                        "object" != typeof t.mouseWheel && 1 == t.mouseWheel && (t.mouseWheel = {
                            enable: !0,
                            scrollAmount: "auto",
                            axis: "y",
                            preventDefault: !1,
                            deltaFactor: "auto",
                            normalizeDelta: !1,
                            invert: !1
                        }),
                            t.mouseWheel.scrollAmount = t.mouseWheelPixels ? t.mouseWheelPixels: t.mouseWheel.scrollAmount,
                            t.mouseWheel.normalizeDelta = t.advanced.normalizeMouseWheelDelta ? t.advanced.normalizeMouseWheelDelta: t.mouseWheel.normalizeDelta,
                            t.scrollButtons.scrollType = g(t.scrollButtons.scrollType),
                            h(t),
                            e(o).each(function() {
                                var o = e(this);
                                if (!o.data(a)) {
                                    o.data(a, {
                                        idx: ++r,
                                        opt: t,
                                        scrollRatio: {
                                            y: null,
                                            x: null
                                        },
                                        overflowed: null,
                                        contentReset: {
                                            y: null,
                                            x: null
                                        },
                                        bindEvents: !1,
                                        tweenRunning: !1,
                                        sequential: {},
                                        langDir: o.css("direction"),
                                        cbOffsets: null,
                                        trigger: null,
                                        poll: {
                                            size: {
                                                o: 0,
                                                n: 0
                                            },
                                            img: {
                                                o: 0,
                                                n: 0
                                            },
                                            change: {
                                                o: 0,
                                                n: 0
                                            }
                                        }
                                    });
                                    var n = o.data(a),
                                        i = n.opt,
                                        l = o.data("mcs-axis"),
                                        s = o.data("mcs-scrollbar-position"),
                                        c = o.data("mcs-theme");
                                    l && (i.axis = l),
                                    s && (i.scrollbarPosition = s),
                                    c && (i.theme = c, h(i)),
                                        v.call(this),
                                    n && i.callbacks.onCreate && "function" == typeof i.callbacks.onCreate && i.callbacks.onCreate.call(this),
                                        e("#mCSB_" + n.idx + "_container img:not(." + d[2] + ")").addClass(d[2]),
                                        u.update.call(null, o)
                                }
                            })
                    },
                    update: function(t, o) {
                        var n = t || f.call(this);
                        return e(n).each(function() {
                            var t = e(this);
                            if (t.data(a)) {
                                var n = t.data(a),
                                    i = n.opt,
                                    r = e("#mCSB_" + n.idx + "_container"),
                                    l = e("#mCSB_" + n.idx),
                                    s = [e("#mCSB_" + n.idx + "_dragger_vertical"), e("#mCSB_" + n.idx + "_dragger_horizontal")];
                                if (!r.length) return;
                                n.tweenRunning && Q(t),
                                o && n && i.callbacks.onBeforeUpdate && "function" == typeof i.callbacks.onBeforeUpdate && i.callbacks.onBeforeUpdate.call(this),
                                t.hasClass(d[3]) && t.removeClass(d[3]),
                                t.hasClass(d[4]) && t.removeClass(d[4]),
                                    l.css("max-height", "none"),
                                l.height() !== t.height() && l.css("max-height", t.height()),
                                    _.call(this),
                                "y" === i.axis || i.advanced.autoExpandHorizontalScroll || r.css("width", x(r)),
                                    n.overflowed = y.call(this),
                                    M.call(this),
                                i.autoDraggerLength && S.call(this),
                                    b.call(this),
                                    T.call(this);
                                var c = [Math.abs(r[0].offsetTop), Math.abs(r[0].offsetLeft)];
                                "x" !== i.axis && (n.overflowed[0] ? s[0].height() > s[0].parent().height() ? B.call(this) : (G(t, c[0].toString(), {
                                    dir: "y",
                                    dur: 0,
                                    overwrite: "none"
                                }), n.contentReset.y = null) : (B.call(this), "y" === i.axis ? k.call(this) : "yx" === i.axis && n.overflowed[1] && G(t, c[1].toString(), {
                                    dir: "x",
                                    dur: 0,
                                    overwrite: "none"
                                }))),
                                "y" !== i.axis && (n.overflowed[1] ? s[1].width() > s[1].parent().width() ? B.call(this) : (G(t, c[1].toString(), {
                                    dir: "x",
                                    dur: 0,
                                    overwrite: "none"
                                }), n.contentReset.x = null) : (B.call(this), "x" === i.axis ? k.call(this) : "yx" === i.axis && n.overflowed[0] && G(t, c[0].toString(), {
                                    dir: "y",
                                    dur: 0,
                                    overwrite: "none"
                                }))),
                                o && n && (2 === o && i.callbacks.onImageLoad && "function" == typeof i.callbacks.onImageLoad ? i.callbacks.onImageLoad.call(this) : 3 === o && i.callbacks.onSelectorChange && "function" == typeof i.callbacks.onSelectorChange ? i.callbacks.onSelectorChange.call(this) : i.callbacks.onUpdate && "function" == typeof i.callbacks.onUpdate && i.callbacks.onUpdate.call(this)),
                                    N.call(this)
                            }
                        })
                    },
                    scrollTo: function(t, o) {
                        if ("undefined" != typeof t && null != t) {
                            var n = f.call(this);
                            return e(n).each(function() {
                                var n = e(this);
                                if (n.data(a)) {
                                    var i = n.data(a),
                                        r = i.opt,
                                        l = {
                                            trigger: "external",
                                            scrollInertia: r.scrollInertia,
                                            scrollEasing: "mcsEaseInOut",
                                            moveDragger: !1,
                                            timeout: 60,
                                            callbacks: !0,
                                            onStart: !0,
                                            onUpdate: !0,
                                            onComplete: !0
                                        },
                                        s = e.extend(!0, {},
                                            l, o),
                                        c = Y.call(this, t),
                                        d = s.scrollInertia > 0 && s.scrollInertia < 17 ? 17 : s.scrollInertia;
                                    c[0] = X.call(this, c[0], "y"),
                                        c[1] = X.call(this, c[1], "x"),
                                    s.moveDragger && (c[0] *= i.scrollRatio.y, c[1] *= i.scrollRatio.x),
                                        s.dur = ne() ? 0 : d,
                                        setTimeout(function() {
                                                null !== c[0] && "undefined" != typeof c[0] && "x" !== r.axis && i.overflowed[0] && (s.dir = "y", s.overwrite = "all", G(n, c[0].toString(), s)),
                                                null !== c[1] && "undefined" != typeof c[1] && "y" !== r.axis && i.overflowed[1] && (s.dir = "x", s.overwrite = "none", G(n, c[1].toString(), s))
                                            },
                                            s.timeout)
                                }
                            })
                        }
                    },
                    stop: function() {
                        var t = f.call(this);
                        return e(t).each(function() {
                            var t = e(this);
                            t.data(a) && Q(t)
                        })
                    },
                    disable: function(t) {
                        var o = f.call(this);
                        return e(o).each(function() {
                            var o = e(this);
                            if (o.data(a)) {
                                o.data(a);
                                N.call(this, "remove"),
                                    k.call(this),
                                t && B.call(this),
                                    M.call(this, !0),
                                    o.addClass(d[3])
                            }
                        })
                    },
                    destroy: function() {
                        var t = f.call(this);
                        return e(t).each(function() {
                            var n = e(this);
                            if (n.data(a)) {
                                var i = n.data(a),
                                    r = i.opt,
                                    l = e("#mCSB_" + i.idx),
                                    s = e("#mCSB_" + i.idx + "_container"),
                                    c = e(".mCSB_" + i.idx + "_scrollbar");
                                r.live && m(r.liveSelector || e(t).selector),
                                    N.call(this, "remove"),
                                    k.call(this),
                                    B.call(this),
                                    n.removeData(a),
                                    $(this, "mcs"),
                                    c.remove(),
                                    s.find("img." + d[2]).removeClass(d[2]),
                                    l.replaceWith(s.contents()),
                                    n.removeClass(o + " _" + a + "_" + i.idx + " " + d[6] + " " + d[7] + " " + d[5] + " " + d[3]).addClass(d[4])
                            }
                        })
                    }
                },
                f = function() {
                    return "object" != typeof e(this) || e(this).length < 1 ? n: this
                },
                h = function(t) {
                    var o = ["rounded", "rounded-dark", "rounded-dots", "rounded-dots-dark"],
                        a = ["rounded-dots", "rounded-dots-dark", "3d", "3d-dark", "3d-thick", "3d-thick-dark", "inset", "inset-dark", "inset-2", "inset-2-dark", "inset-3", "inset-3-dark"],
                        n = ["minimal", "minimal-dark"],
                        i = ["minimal", "minimal-dark"],
                        r = ["minimal", "minimal-dark"];
                    t.autoDraggerLength = e.inArray(t.theme, o) > -1 ? !1 : t.autoDraggerLength,
                        t.autoExpandScrollbar = e.inArray(t.theme, a) > -1 ? !1 : t.autoExpandScrollbar,
                        t.scrollButtons.enable = e.inArray(t.theme, n) > -1 ? !1 : t.scrollButtons.enable,
                        t.autoHideScrollbar = e.inArray(t.theme, i) > -1 ? !0 : t.autoHideScrollbar,
                        t.scrollbarPosition = e.inArray(t.theme, r) > -1 ? "outside": t.scrollbarPosition
                },
                m = function(e) {
                    l[e] && (clearTimeout(l[e]), $(l, e))
                },
                p = function(e) {
                    return "yx" === e || "xy" === e || "auto" === e ? "yx": "x" === e || "horizontal" === e ? "x": "y"
                },
                g = function(e) {
                    return "stepped" === e || "pixels" === e || "step" === e || "click" === e ? "stepped": "stepless"
                },
                v = function() {
                    var t = e(this),
                        n = t.data(a),
                        i = n.opt,
                        r = i.autoExpandScrollbar ? " " + d[1] + "_expand": "",
                        l = ["<div id='mCSB_" + n.idx + "_scrollbar_vertical' class='mCSB_scrollTools mCSB_" + n.idx + "_scrollbar mCS-" + i.theme + " mCSB_scrollTools_vertical" + r + "'><div class='" + d[12] + "'><div id='mCSB_" + n.idx + "_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>", "<div id='mCSB_" + n.idx + "_scrollbar_horizontal' class='mCSB_scrollTools mCSB_" + n.idx + "_scrollbar mCS-" + i.theme + " mCSB_scrollTools_horizontal" + r + "'><div class='" + d[12] + "'><div id='mCSB_" + n.idx + "_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],
                        s = "yx" === i.axis ? "mCSB_vertical_horizontal": "x" === i.axis ? "mCSB_horizontal": "mCSB_vertical",
                        c = "yx" === i.axis ? l[0] + l[1] : "x" === i.axis ? l[1] : l[0],
                        u = "yx" === i.axis ? "<div id='mCSB_" + n.idx + "_container_wrapper' class='mCSB_container_wrapper' />": "",
                        f = i.autoHideScrollbar ? " " + d[6] : "",
                        h = "x" !== i.axis && "rtl" === n.langDir ? " " + d[7] : "";
                    i.setWidth && t.css("width", i.setWidth),
                    i.setHeight && t.css("height", i.setHeight),
                        i.setLeft = "y" !== i.axis && "rtl" === n.langDir ? "989999px": i.setLeft,
                        t.addClass(o + " _" + a + "_" + n.idx + f + h).wrapInner("<div id='mCSB_" + n.idx + "' class='mCustomScrollBox mCS-" + i.theme + " " + s + "'><div id='mCSB_" + n.idx + "_container' class='mCSB_container' style='position:relative; top:" + i.setTop + "; left:" + i.setLeft + ";' dir='" + n.langDir + "' /></div>");
                    var m = e("#mCSB_" + n.idx),
                        p = e("#mCSB_" + n.idx + "_container");
                    "y" === i.axis || i.advanced.autoExpandHorizontalScroll || p.css("width", x(p)),
                        "outside" === i.scrollbarPosition ? ("static" === t.css("position") && t.css("position", "relative"), t.css("overflow", "visible"), m.addClass("mCSB_outside").after(c)) : (m.addClass("mCSB_inside").append(c), p.wrap(u)),
                        w.call(this);
                    var g = [e("#mCSB_" + n.idx + "_dragger_vertical"), e("#mCSB_" + n.idx + "_dragger_horizontal")];
                    g[0].css("min-height", g[0].height()),
                        g[1].css("min-width", g[1].width())
                },
                x = function(t) {
                    var o = [t[0].scrollWidth, Math.max.apply(Math, t.children().map(function() {
                            return e(this).outerWidth(!0)
                        }).get())],
                        a = t.parent().width();
                    return o[0] > a ? o[0] : o[1] > a ? o[1] : "100%"
                },
                _ = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = o.opt,
                        i = e("#mCSB_" + o.idx + "_container");
                    if (n.advanced.autoExpandHorizontalScroll && "y" !== n.axis) {
                        i.css({
                            width: "auto",
                            "min-width": 0,
                            "overflow-x": "scroll"
                        });
                        var r = Math.ceil(i[0].scrollWidth);
                        3 === n.advanced.autoExpandHorizontalScroll || 2 !== n.advanced.autoExpandHorizontalScroll && r > i.parent().width() ? i.css({
                            width: r,
                            "min-width": "100%",
                            "overflow-x": "inherit"
                        }) : i.css({
                            "overflow-x": "inherit",
                            position: "absolute"
                        }).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({
                            width: Math.ceil(i[0].getBoundingClientRect().right + .4) - Math.floor(i[0].getBoundingClientRect().left),
                            "min-width": "100%",
                            position: "relative"
                        }).unwrap()
                    }
                },
                w = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = o.opt,
                        i = e(".mCSB_" + o.idx + "_scrollbar:first"),
                        r = oe(n.scrollButtons.tabindex) ? "tabindex='" + n.scrollButtons.tabindex + "'": "",
                        l = ["<a href='#' class='" + d[13] + "' " + r + " />", "<a href='#' class='" + d[14] + "' " + r + " />", "<a href='#' class='" + d[15] + "' " + r + " />", "<a href='#' class='" + d[16] + "' " + r + " />"],
                        s = ["x" === n.axis ? l[2] : l[0], "x" === n.axis ? l[3] : l[1], l[2], l[3]];
                    n.scrollButtons.enable && i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])
                },
                S = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = e("#mCSB_" + o.idx),
                        i = e("#mCSB_" + o.idx + "_container"),
                        r = [e("#mCSB_" + o.idx + "_dragger_vertical"), e("#mCSB_" + o.idx + "_dragger_horizontal")],
                        l = [n.height() / i.outerHeight(!1), n.width() / i.outerWidth(!1)],
                        c = [parseInt(r[0].css("min-height")), Math.round(l[0] * r[0].parent().height()), parseInt(r[1].css("min-width")), Math.round(l[1] * r[1].parent().width())],
                        d = s && c[1] < c[0] ? c[0] : c[1],
                        u = s && c[3] < c[2] ? c[2] : c[3];
                    r[0].css({
                        height: d,
                        "max-height": r[0].parent().height() - 10
                    }).find(".mCSB_dragger_bar").css({
                        "line-height": c[0] + "px"
                    }),
                        r[1].css({
                            width: u,
                            "max-width": r[1].parent().width() - 10
                        })
                },
                b = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = e("#mCSB_" + o.idx),
                        i = e("#mCSB_" + o.idx + "_container"),
                        r = [e("#mCSB_" + o.idx + "_dragger_vertical"), e("#mCSB_" + o.idx + "_dragger_horizontal")],
                        l = [i.outerHeight(!1) - n.height(), i.outerWidth(!1) - n.width()],
                        s = [l[0] / (r[0].parent().height() - r[0].height()), l[1] / (r[1].parent().width() - r[1].width())];
                    o.scrollRatio = {
                        y: s[0],
                        x: s[1]
                    }
                },
                C = function(e, t, o) {
                    var a = o ? d[0] + "_expanded": "",
                        n = e.closest(".mCSB_scrollTools");
                    "active" === t ? (e.toggleClass(d[0] + " " + a), n.toggleClass(d[1]), e[0]._draggable = e[0]._draggable ? 0 : 1) : e[0]._draggable || ("hide" === t ? (e.removeClass(d[0]), n.removeClass(d[1])) : (e.addClass(d[0]), n.addClass(d[1])))
                },
                y = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = e("#mCSB_" + o.idx),
                        i = e("#mCSB_" + o.idx + "_container"),
                        r = null == o.overflowed ? i.height() : i.outerHeight(!1),
                        l = null == o.overflowed ? i.width() : i.outerWidth(!1),
                        s = i[0].scrollHeight,
                        c = i[0].scrollWidth;
                    return s > r && (r = s),
                    c > l && (l = c),
                        [r > n.height(), l > n.width()]
                },
                B = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = o.opt,
                        i = e("#mCSB_" + o.idx),
                        r = e("#mCSB_" + o.idx + "_container"),
                        l = [e("#mCSB_" + o.idx + "_dragger_vertical"), e("#mCSB_" + o.idx + "_dragger_horizontal")];
                    if (Q(t), ("x" !== n.axis && !o.overflowed[0] || "y" === n.axis && o.overflowed[0]) && (l[0].add(r).css("top", 0), G(t, "_resetY")), "y" !== n.axis && !o.overflowed[1] || "x" === n.axis && o.overflowed[1]) {
                        var s = dx = 0;
                        "rtl" === o.langDir && (s = i.width() - r.outerWidth(!1), dx = Math.abs(s / o.scrollRatio.x)),
                            r.css("left", s),
                            l[1].css("left", dx),
                            G(t, "_resetX")
                    }
                },
                T = function() {
                    function t() {
                        r = setTimeout(function() {
                                e.event.special.mousewheel ? (clearTimeout(r), W.call(o[0])) : t()
                            },
                            100)
                    }
                    var o = e(this),
                        n = o.data(a),
                        i = n.opt;
                    if (!n.bindEvents) {
                        if (I.call(this), i.contentTouchScroll && D.call(this), E.call(this), i.mouseWheel.enable) {
                            var r;
                            t()
                        }
                        P.call(this),
                            U.call(this),
                        i.advanced.autoScrollOnFocus && H.call(this),
                        i.scrollButtons.enable && F.call(this),
                        i.keyboard.enable && q.call(this),
                            n.bindEvents = !0
                    }
                },
                k = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = o.opt,
                        i = a + "_" + o.idx,
                        r = ".mCSB_" + o.idx + "_scrollbar",
                        l = e("#mCSB_" + o.idx + ",#mCSB_" + o.idx + "_container,#mCSB_" + o.idx + "_container_wrapper," + r + " ." + d[12] + ",#mCSB_" + o.idx + "_dragger_vertical,#mCSB_" + o.idx + "_dragger_horizontal," + r + ">a"),
                        s = e("#mCSB_" + o.idx + "_container");
                    n.advanced.releaseDraggableSelectors && l.add(e(n.advanced.releaseDraggableSelectors)),
                    n.advanced.extraDraggableSelectors && l.add(e(n.advanced.extraDraggableSelectors)),
                    o.bindEvents && (e(document).add(e(!A() || top.document)).unbind("." + i), l.each(function() {
                        e(this).unbind("." + i)
                    }), clearTimeout(t[0]._focusTimeout), $(t[0], "_focusTimeout"), clearTimeout(o.sequential.step), $(o.sequential, "step"), clearTimeout(s[0].onCompleteTimeout), $(s[0], "onCompleteTimeout"), o.bindEvents = !1)
                },
                M = function(t) {
                    var o = e(this),
                        n = o.data(a),
                        i = n.opt,
                        r = e("#mCSB_" + n.idx + "_container_wrapper"),
                        l = r.length ? r: e("#mCSB_" + n.idx + "_container"),
                        s = [e("#mCSB_" + n.idx + "_scrollbar_vertical"), e("#mCSB_" + n.idx + "_scrollbar_horizontal")],
                        c = [s[0].find(".mCSB_dragger"), s[1].find(".mCSB_dragger")];
                    "x" !== i.axis && (n.overflowed[0] && !t ? (s[0].add(c[0]).add(s[0].children("a")).css("display", "block"), l.removeClass(d[8] + " " + d[10])) : (i.alwaysShowScrollbar ? (2 !== i.alwaysShowScrollbar && c[0].css("display", "none"), l.removeClass(d[10])) : (s[0].css("display", "none"), l.addClass(d[10])), l.addClass(d[8]))),
                    "y" !== i.axis && (n.overflowed[1] && !t ? (s[1].add(c[1]).add(s[1].children("a")).css("display", "block"), l.removeClass(d[9] + " " + d[11])) : (i.alwaysShowScrollbar ? (2 !== i.alwaysShowScrollbar && c[1].css("display", "none"), l.removeClass(d[11])) : (s[1].css("display", "none"), l.addClass(d[11])), l.addClass(d[9]))),
                        n.overflowed[0] || n.overflowed[1] ? o.removeClass(d[5]) : o.addClass(d[5])
                },
                O = function(t) {
                    var o = t.type,
                        a = t.target.ownerDocument !== document && null !== frameElement ? [e(frameElement).offset().top, e(frameElement).offset().left] : null,
                        n = A() && t.target.ownerDocument !== top.document && null !== frameElement ? [e(t.view.frameElement).offset().top, e(t.view.frameElement).offset().left] : [0, 0];
                    switch (o) {
                        case "pointerdown":
                        case "MSPointerDown":
                        case "pointermove":
                        case "MSPointerMove":
                        case "pointerup":
                        case "MSPointerUp":
                            return a ? [t.originalEvent.pageY - a[0] + n[0], t.originalEvent.pageX - a[1] + n[1], !1] : [t.originalEvent.pageY, t.originalEvent.pageX, !1];
                        case "touchstart":
                        case "touchmove":
                        case "touchend":
                            var i = t.originalEvent.touches[0] || t.originalEvent.changedTouches[0],
                                r = t.originalEvent.touches.length || t.originalEvent.changedTouches.length;
                            return t.target.ownerDocument !== document ? [i.screenY, i.screenX, r > 1] : [i.pageY, i.pageX, r > 1];
                        default:
                            return a ? [t.pageY - a[0] + n[0], t.pageX - a[1] + n[1], !1] : [t.pageY, t.pageX, !1]
                    }
                },
                I = function() {
                    function t(e, t, a, n) {
                        if (h[0].idleTimer = d.scrollInertia < 233 ? 250 : 0, o.attr("id") === f[1]) var i = "x",
                            s = (o[0].offsetLeft - t + n) * l.scrollRatio.x;
                        else var i = "y",
                            s = (o[0].offsetTop - e + a) * l.scrollRatio.y;
                        G(r, s.toString(), {
                            dir: i,
                            drag: !0
                        })
                    }
                    var o, n, i, r = e(this),
                        l = r.data(a),
                        d = l.opt,
                        u = a + "_" + l.idx,
                        f = ["mCSB_" + l.idx + "_dragger_vertical", "mCSB_" + l.idx + "_dragger_horizontal"],
                        h = e("#mCSB_" + l.idx + "_container"),
                        m = e("#" + f[0] + ",#" + f[1]),
                        p = d.advanced.releaseDraggableSelectors ? m.add(e(d.advanced.releaseDraggableSelectors)) : m,
                        g = d.advanced.extraDraggableSelectors ? e(!A() || top.document).add(e(d.advanced.extraDraggableSelectors)) : e(!A() || top.document);
                    m.bind("contextmenu." + u,
                        function(e) {
                            e.preventDefault()
                        }).bind("mousedown." + u + " touchstart." + u + " pointerdown." + u + " MSPointerDown." + u,
                        function(t) {
                            if (t.stopImmediatePropagation(), t.preventDefault(), ee(t)) {
                                c = !0,
                                s && (document.onselectstart = function() {
                                    return ! 1
                                }),
                                    L.call(h, !1),
                                    Q(r),
                                    o = e(this);
                                var a = o.offset(),
                                    l = O(t)[0] - a.top,
                                    u = O(t)[1] - a.left,
                                    f = o.height() + a.top,
                                    m = o.width() + a.left;
                                f > l && l > 0 && m > u && u > 0 && (n = l, i = u),
                                    C(o, "active", d.autoExpandScrollbar)
                            }
                        }).bind("touchmove." + u,
                        function(e) {
                            e.stopImmediatePropagation(),
                                e.preventDefault();
                            var a = o.offset(),
                                r = O(e)[0] - a.top,
                                l = O(e)[1] - a.left;
                            t(n, i, r, l)
                        }),
                        e(document).add(g).bind("mousemove." + u + " pointermove." + u + " MSPointerMove." + u,
                            function(e) {
                                if (o) {
                                    var a = o.offset(),
                                        r = O(e)[0] - a.top,
                                        l = O(e)[1] - a.left;
                                    if (n === r && i === l) return;
                                    t(n, i, r, l)
                                }
                            }).add(p).bind("mouseup." + u + " touchend." + u + " pointerup." + u + " MSPointerUp." + u,
                            function() {
                                o && (C(o, "active", d.autoExpandScrollbar), o = null),
                                    c = !1,
                                s && (document.onselectstart = null),
                                    L.call(h, !0)
                            })
                },
                D = function() {
                    function o(e) {
                        if (!te(e) || c || O(e)[2]) return void(t = 0);
                        t = 1,
                            b = 0,
                            C = 0,
                            d = 1,
                            y.removeClass("mCS_touch_action");
                        var o = I.offset();
                        u = O(e)[0] - o.top,
                            f = O(e)[1] - o.left,
                            z = [O(e)[0], O(e)[1]]
                    }
                    function n(e) {
                        if (te(e) && !c && !O(e)[2] && (T.documentTouchScroll || e.preventDefault(), e.stopImmediatePropagation(), (!C || b) && d)) {
                            g = K();
                            var t = M.offset(),
                                o = O(e)[0] - t.top,
                                a = O(e)[1] - t.left,
                                n = "mcsLinearOut";
                            if (E.push(o), W.push(a), z[2] = Math.abs(O(e)[0] - z[0]), z[3] = Math.abs(O(e)[1] - z[1]), B.overflowed[0]) var i = D[0].parent().height() - D[0].height(),
                                r = u - o > 0 && o - u > -(i * B.scrollRatio.y) && (2 * z[3] < z[2] || "yx" === T.axis);
                            if (B.overflowed[1]) var l = D[1].parent().width() - D[1].width(),
                                h = f - a > 0 && a - f > -(l * B.scrollRatio.x) && (2 * z[2] < z[3] || "yx" === T.axis);
                            r || h ? (U || e.preventDefault(), b = 1) : (C = 1, y.addClass("mCS_touch_action")),
                            U && e.preventDefault(),
                                w = "yx" === T.axis ? [u - o, f - a] : "x" === T.axis ? [null, f - a] : [u - o, null],
                                I[0].idleTimer = 250,
                            B.overflowed[0] && s(w[0], R, n, "y", "all", !0),
                            B.overflowed[1] && s(w[1], R, n, "x", L, !0)
                        }
                    }
                    function i(e) {
                        if (!te(e) || c || O(e)[2]) return void(t = 0);
                        t = 1,
                            e.stopImmediatePropagation(),
                            Q(y),
                            p = K();
                        var o = M.offset();
                        h = O(e)[0] - o.top,
                            m = O(e)[1] - o.left,
                            E = [],
                            W = []
                    }
                    function r(e) {
                        if (te(e) && !c && !O(e)[2]) {
                            d = 0,
                                e.stopImmediatePropagation(),
                                b = 0,
                                C = 0,
                                v = K();
                            var t = M.offset(),
                                o = O(e)[0] - t.top,
                                a = O(e)[1] - t.left;
                            if (! (v - g > 30)) {
                                _ = 1e3 / (v - p);
                                var n = "mcsEaseOut",
                                    i = 2.5 > _,
                                    r = i ? [E[E.length - 2], W[W.length - 2]] : [0, 0];
                                x = i ? [o - r[0], a - r[1]] : [o - h, a - m];
                                var u = [Math.abs(x[0]), Math.abs(x[1])];
                                _ = i ? [Math.abs(x[0] / 4), Math.abs(x[1] / 4)] : [_, _];
                                var f = [Math.abs(I[0].offsetTop) - x[0] * l(u[0] / _[0], _[0]), Math.abs(I[0].offsetLeft) - x[1] * l(u[1] / _[1], _[1])];
                                w = "yx" === T.axis ? [f[0], f[1]] : "x" === T.axis ? [null, f[1]] : [f[0], null],
                                    S = [4 * u[0] + T.scrollInertia, 4 * u[1] + T.scrollInertia];
                                var y = parseInt(T.contentTouchScroll) || 0;
                                w[0] = u[0] > y ? w[0] : 0,
                                    w[1] = u[1] > y ? w[1] : 0,
                                B.overflowed[0] && s(w[0], S[0], n, "y", L, !1),
                                B.overflowed[1] && s(w[1], S[1], n, "x", L, !1)
                            }
                        }
                    }
                    function l(e, t) {
                        var o = [1.5 * t, 2 * t, t / 1.5, t / 2];
                        return e > 90 ? t > 4 ? o[0] : o[3] : e > 60 ? t > 3 ? o[3] : o[2] : e > 30 ? t > 8 ? o[1] : t > 6 ? o[0] : t > 4 ? t: o[2] : t > 8 ? t: o[3]
                    }
                    function s(e, t, o, a, n, i) {
                        e && G(y, e.toString(), {
                            dur: t,
                            scrollEasing: o,
                            dir: a,
                            overwrite: n,
                            drag: i
                        })
                    }
                    var d, u, f, h, m, p, g, v, x, _, w, S, b, C, y = e(this),
                        B = y.data(a),
                        T = B.opt,
                        k = a + "_" + B.idx,
                        M = e("#mCSB_" + B.idx),
                        I = e("#mCSB_" + B.idx + "_container"),
                        D = [e("#mCSB_" + B.idx + "_dragger_vertical"), e("#mCSB_" + B.idx + "_dragger_horizontal")],
                        E = [],
                        W = [],
                        R = 0,
                        L = "yx" === T.axis ? "none": "all",
                        z = [],
                        P = I.find("iframe"),
                        H = ["touchstart." + k + " pointerdown." + k + " MSPointerDown." + k, "touchmove." + k + " pointermove." + k + " MSPointerMove." + k, "touchend." + k + " pointerup." + k + " MSPointerUp." + k],
                        U = void 0 !== document.body.style.touchAction && "" !== document.body.style.touchAction;
                    I.bind(H[0],
                        function(e) {
                            o(e)
                        }).bind(H[1],
                        function(e) {
                            n(e)
                        }),
                        M.bind(H[0],
                            function(e) {
                                i(e)
                            }).bind(H[2],
                            function(e) {
                                r(e)
                            }),
                    P.length && P.each(function() {
                        e(this).bind("load",
                            function() {
                                A(this) && e(this.contentDocument || this.contentWindow.document).bind(H[0],
                                    function(e) {
                                        o(e),
                                            i(e)
                                    }).bind(H[1],
                                    function(e) {
                                        n(e)
                                    }).bind(H[2],
                                    function(e) {
                                        r(e)
                                    })
                            })
                    })
                },
                E = function() {
                    function o() {
                        return window.getSelection ? window.getSelection().toString() : document.selection && "Control" != document.selection.type ? document.selection.createRange().text: 0
                    }
                    function n(e, t, o) {
                        d.type = o && i ? "stepped": "stepless",
                            d.scrollAmount = 10,
                            j(r, e, t, "mcsLinearOut", o ? 60 : null)
                    }
                    var i, r = e(this),
                        l = r.data(a),
                        s = l.opt,
                        d = l.sequential,
                        u = a + "_" + l.idx,
                        f = e("#mCSB_" + l.idx + "_container"),
                        h = f.parent();
                    f.bind("mousedown." + u,
                        function() {
                            t || i || (i = 1, c = !0)
                        }).add(document).bind("mousemove." + u,
                        function(e) {
                            if (!t && i && o()) {
                                var a = f.offset(),
                                    r = O(e)[0] - a.top + f[0].offsetTop,
                                    c = O(e)[1] - a.left + f[0].offsetLeft;
                                r > 0 && r < h.height() && c > 0 && c < h.width() ? d.step && n("off", null, "stepped") : ("x" !== s.axis && l.overflowed[0] && (0 > r ? n("on", 38) : r > h.height() && n("on", 40)), "y" !== s.axis && l.overflowed[1] && (0 > c ? n("on", 37) : c > h.width() && n("on", 39)))
                            }
                        }).bind("mouseup." + u + " dragend." + u,
                        function() {
                            t || (i && (i = 0, n("off", null)), c = !1)
                        })
                },
                W = function() {
                    function t(t, a) {
                        if (Q(o), !z(o, t.target)) {
                            var r = "auto" !== i.mouseWheel.deltaFactor ? parseInt(i.mouseWheel.deltaFactor) : s && t.deltaFactor < 100 ? 100 : t.deltaFactor || 100,
                                d = i.scrollInertia;
                            if ("x" === i.axis || "x" === i.mouseWheel.axis) var u = "x",
                                f = [Math.round(r * n.scrollRatio.x), parseInt(i.mouseWheel.scrollAmount)],
                                h = "auto" !== i.mouseWheel.scrollAmount ? f[1] : f[0] >= l.width() ? .9 * l.width() : f[0],
                                m = Math.abs(e("#mCSB_" + n.idx + "_container")[0].offsetLeft),
                                p = c[1][0].offsetLeft,
                                g = c[1].parent().width() - c[1].width(),
                                v = "y" === i.mouseWheel.axis ? t.deltaY || a: t.deltaX;
                            else var u = "y",
                                f = [Math.round(r * n.scrollRatio.y), parseInt(i.mouseWheel.scrollAmount)],
                                h = "auto" !== i.mouseWheel.scrollAmount ? f[1] : f[0] >= l.height() ? .9 * l.height() : f[0],
                                m = Math.abs(e("#mCSB_" + n.idx + "_container")[0].offsetTop),
                                p = c[0][0].offsetTop,
                                g = c[0].parent().height() - c[0].height(),
                                v = t.deltaY || a;
                            "y" === u && !n.overflowed[0] || "x" === u && !n.overflowed[1] || ((i.mouseWheel.invert || t.webkitDirectionInvertedFromDevice) && (v = -v), i.mouseWheel.normalizeDelta && (v = 0 > v ? -1 : 1), (v > 0 && 0 !== p || 0 > v && p !== g || i.mouseWheel.preventDefault) && (t.stopImmediatePropagation(), t.preventDefault()), t.deltaFactor < 5 && !i.mouseWheel.normalizeDelta && (h = t.deltaFactor, d = 17), G(o, (m - v * h).toString(), {
                                dir: u,
                                dur: d
                            }))
                        }
                    }
                    if (e(this).data(a)) {
                        var o = e(this),
                            n = o.data(a),
                            i = n.opt,
                            r = a + "_" + n.idx,
                            l = e("#mCSB_" + n.idx),
                            c = [e("#mCSB_" + n.idx + "_dragger_vertical"), e("#mCSB_" + n.idx + "_dragger_horizontal")],
                            d = e("#mCSB_" + n.idx + "_container").find("iframe");
                        d.length && d.each(function() {
                            e(this).bind("load",
                                function() {
                                    A(this) && e(this.contentDocument || this.contentWindow.document).bind("mousewheel." + r,
                                        function(e, o) {
                                            t(e, o)
                                        })
                                })
                        }),
                            l.bind("mousewheel." + r,
                                function(e, o) {
                                    t(e, o)
                                })
                    }
                },
                R = new Object,
                A = function(t) {
                    var o = !1,
                        a = !1,
                        n = null;
                    if (void 0 === t ? a = "#empty": void 0 !== e(t).attr("id") && (a = e(t).attr("id")), a !== !1 && void 0 !== R[a]) return R[a];
                    if (t) {
                        try {
                            var i = t.contentDocument || t.contentWindow.document;
                            n = i.body.innerHTML
                        } catch(r) {}
                        o = null !== n
                    } else {
                        try {
                            var i = top.document;
                            n = i.body.innerHTML
                        } catch(r) {}
                        o = null !== n
                    }
                    return a !== !1 && (R[a] = o),
                        o
                },
                L = function(e) {
                    var t = this.find("iframe");
                    if (t.length) {
                        var o = e ? "auto": "none";
                        t.css("pointer-events", o)
                    }
                },
                z = function(t, o) {
                    var n = o.nodeName.toLowerCase(),
                        i = t.data(a).opt.mouseWheel.disableOver,
                        r = ["select", "textarea"];
                    return e.inArray(n, i) > -1 && !(e.inArray(n, r) > -1 && !e(o).is(":focus"))
                },
                P = function() {
                    var t, o = e(this),
                        n = o.data(a),
                        i = a + "_" + n.idx,
                        r = e("#mCSB_" + n.idx + "_container"),
                        l = r.parent(),
                        s = e(".mCSB_" + n.idx + "_scrollbar ." + d[12]);
                    s.bind("mousedown." + i + " touchstart." + i + " pointerdown." + i + " MSPointerDown." + i,
                        function(o) {
                            c = !0,
                            e(o.target).hasClass("mCSB_dragger") || (t = 1)
                        }).bind("touchend." + i + " pointerup." + i + " MSPointerUp." + i,
                        function() {
                            c = !1
                        }).bind("click." + i,
                        function(a) {
                            if (t && (t = 0, e(a.target).hasClass(d[12]) || e(a.target).hasClass("mCSB_draggerRail"))) {
                                Q(o);
                                var i = e(this),
                                    s = i.find(".mCSB_dragger");
                                if (i.parent(".mCSB_scrollTools_horizontal").length > 0) {
                                    if (!n.overflowed[1]) return;
                                    var c = "x",
                                        u = a.pageX > s.offset().left ? -1 : 1,
                                        f = Math.abs(r[0].offsetLeft) - u * (.9 * l.width())
                                } else {
                                    if (!n.overflowed[0]) return;
                                    var c = "y",
                                        u = a.pageY > s.offset().top ? -1 : 1,
                                        f = Math.abs(r[0].offsetTop) - u * (.9 * l.height())
                                }
                                G(o, f.toString(), {
                                    dir: c,
                                    scrollEasing: "mcsEaseInOut"
                                })
                            }
                        })
                },
                H = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = o.opt,
                        i = a + "_" + o.idx,
                        r = e("#mCSB_" + o.idx + "_container"),
                        l = r.parent();
                    r.bind("focusin." + i,
                        function() {
                            var o = e(document.activeElement),
                                a = r.find(".mCustomScrollBox").length,
                                i = 0;
                            o.is(n.advanced.autoScrollOnFocus) && (Q(t), clearTimeout(t[0]._focusTimeout), t[0]._focusTimer = a ? (i + 17) * a: 0, t[0]._focusTimeout = setTimeout(function() {
                                    var e = [ae(o)[0], ae(o)[1]],
                                        a = [r[0].offsetTop, r[0].offsetLeft],
                                        s = [a[0] + e[0] >= 0 && a[0] + e[0] < l.height() - o.outerHeight(!1), a[1] + e[1] >= 0 && a[0] + e[1] < l.width() - o.outerWidth(!1)],
                                        c = "yx" !== n.axis || s[0] || s[1] ? "all": "none";
                                    "x" === n.axis || s[0] || G(t, e[0].toString(), {
                                        dir: "y",
                                        scrollEasing: "mcsEaseInOut",
                                        overwrite: c,
                                        dur: i
                                    }),
                                    "y" === n.axis || s[1] || G(t, e[1].toString(), {
                                        dir: "x",
                                        scrollEasing: "mcsEaseInOut",
                                        overwrite: c,
                                        dur: i
                                    })
                                },
                                t[0]._focusTimer))
                        })
                },
                U = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = a + "_" + o.idx,
                        i = e("#mCSB_" + o.idx + "_container").parent();
                    i.bind("scroll." + n,
                        function() {
                            0 === i.scrollTop() && 0 === i.scrollLeft() || e(".mCSB_" + o.idx + "_scrollbar").css("visibility", "hidden")
                        })
                },
                F = function() {
                    var t = e(this),
                        o = t.data(a),
                        n = o.opt,
                        i = o.sequential,
                        r = a + "_" + o.idx,
                        l = ".mCSB_" + o.idx + "_scrollbar",
                        s = e(l + ">a");
                    s.bind("contextmenu." + r,
                        function(e) {
                            e.preventDefault()
                        }).bind("mousedown." + r + " touchstart." + r + " pointerdown." + r + " MSPointerDown." + r + " mouseup." + r + " touchend." + r + " pointerup." + r + " MSPointerUp." + r + " mouseout." + r + " pointerout." + r + " MSPointerOut." + r + " click." + r,
                        function(a) {
                            function r(e, o) {
                                i.scrollAmount = n.scrollButtons.scrollAmount,
                                    j(t, e, o)
                            }
                            if (a.preventDefault(), ee(a)) {
                                var l = e(this).attr("class");
                                switch (i.type = n.scrollButtons.scrollType, a.type) {
                                    case "mousedown":
                                    case "touchstart":
                                    case "pointerdown":
                                    case "MSPointerDown":
                                        if ("stepped" === i.type) return;
                                        c = !0,
                                            o.tweenRunning = !1,
                                            r("on", l);
                                        break;
                                    case "mouseup":
                                    case "touchend":
                                    case "pointerup":
                                    case "MSPointerUp":
                                    case "mouseout":
                                    case "pointerout":
                                    case "MSPointerOut":
                                        if ("stepped" === i.type) return;
                                        c = !1,
                                        i.dir && r("off", l);
                                        break;
                                    case "click":
                                        if ("stepped" !== i.type || o.tweenRunning) return;
                                        r("on", l)
                                }
                            }
                        })
                },
                q = function() {
                    function t(t) {
                        function a(e, t) {
                            r.type = i.keyboard.scrollType,
                                r.scrollAmount = i.keyboard.scrollAmount,
                            "stepped" === r.type && n.tweenRunning || j(o, e, t)
                        }
                        switch (t.type) {
                            case "blur":
                                n.tweenRunning && r.dir && a("off", null);
                                break;
                            case "keydown":
                            case "keyup":
                                var l = t.keyCode ? t.keyCode: t.which,
                                    s = "on";
                                if ("x" !== i.axis && (38 === l || 40 === l) || "y" !== i.axis && (37 === l || 39 === l)) {
                                    if ((38 === l || 40 === l) && !n.overflowed[0] || (37 === l || 39 === l) && !n.overflowed[1]) return;
                                    "keyup" === t.type && (s = "off"),
                                    e(document.activeElement).is(u) || (t.preventDefault(), t.stopImmediatePropagation(), a(s, l))
                                } else if (33 === l || 34 === l) {
                                    if ((n.overflowed[0] || n.overflowed[1]) && (t.preventDefault(), t.stopImmediatePropagation()), "keyup" === t.type) {
                                        Q(o);
                                        var f = 34 === l ? -1 : 1;
                                        if ("x" === i.axis || "yx" === i.axis && n.overflowed[1] && !n.overflowed[0]) var h = "x",
                                            m = Math.abs(c[0].offsetLeft) - f * (.9 * d.width());
                                        else var h = "y",
                                            m = Math.abs(c[0].offsetTop) - f * (.9 * d.height());
                                        G(o, m.toString(), {
                                            dir: h,
                                            scrollEasing: "mcsEaseInOut"
                                        })
                                    }
                                } else if ((35 === l || 36 === l) && !e(document.activeElement).is(u) && ((n.overflowed[0] || n.overflowed[1]) && (t.preventDefault(), t.stopImmediatePropagation()), "keyup" === t.type)) {
                                    if ("x" === i.axis || "yx" === i.axis && n.overflowed[1] && !n.overflowed[0]) var h = "x",
                                        m = 35 === l ? Math.abs(d.width() - c.outerWidth(!1)) : 0;
                                    else var h = "y",
                                        m = 35 === l ? Math.abs(d.height() - c.outerHeight(!1)) : 0;
                                    G(o, m.toString(), {
                                        dir: h,
                                        scrollEasing: "mcsEaseInOut"
                                    })
                                }
                        }
                    }
                    var o = e(this),
                        n = o.data(a),
                        i = n.opt,
                        r = n.sequential,
                        l = a + "_" + n.idx,
                        s = e("#mCSB_" + n.idx),
                        c = e("#mCSB_" + n.idx + "_container"),
                        d = c.parent(),
                        u = "input,textarea,select,datalist,keygen,[contenteditable='true']",
                        f = c.find("iframe"),
                        h = ["blur." + l + " keydown." + l + " keyup." + l];
                    f.length && f.each(function() {
                        e(this).bind("load",
                            function() {
                                A(this) && e(this.contentDocument || this.contentWindow.document).bind(h[0],
                                    function(e) {
                                        t(e)
                                    })
                            })
                    }),
                        s.attr("tabindex", "0").bind(h[0],
                            function(e) {
                                t(e)
                            })
                },
                j = function(t, o, n, i, r) {
                    function l(e) {
                        u.snapAmount && (f.scrollAmount = u.snapAmount instanceof Array ? "x" === f.dir[0] ? u.snapAmount[1] : u.snapAmount[0] : u.snapAmount);
                        var o = "stepped" !== f.type,
                            a = r ? r: e ? o ? p / 1.5 : g: 1e3 / 60,
                            n = e ? o ? 7.5 : 40 : 2.5,
                            s = [Math.abs(h[0].offsetTop), Math.abs(h[0].offsetLeft)],
                            d = [c.scrollRatio.y > 10 ? 10 : c.scrollRatio.y, c.scrollRatio.x > 10 ? 10 : c.scrollRatio.x],
                            m = "x" === f.dir[0] ? s[1] + f.dir[1] * (d[1] * n) : s[0] + f.dir[1] * (d[0] * n),
                            v = "x" === f.dir[0] ? s[1] + f.dir[1] * parseInt(f.scrollAmount) : s[0] + f.dir[1] * parseInt(f.scrollAmount),
                            x = "auto" !== f.scrollAmount ? v: m,
                            _ = i ? i: e ? o ? "mcsLinearOut": "mcsEaseInOut": "mcsLinear",
                            w = !!e;
                        return e && 17 > a && (x = "x" === f.dir[0] ? s[1] : s[0]),
                            G(t, x.toString(), {
                                dir: f.dir[0],
                                scrollEasing: _,
                                dur: a,
                                onComplete: w
                            }),
                            e ? void(f.dir = !1) : (clearTimeout(f.step), void(f.step = setTimeout(function() {
                                    l()
                                },
                                a)))
                    }
                    function s() {
                        clearTimeout(f.step),
                            $(f, "step"),
                            Q(t)
                    }
                    var c = t.data(a),
                        u = c.opt,
                        f = c.sequential,
                        h = e("#mCSB_" + c.idx + "_container"),
                        m = "stepped" === f.type,
                        p = u.scrollInertia < 26 ? 26 : u.scrollInertia,
                        g = u.scrollInertia < 1 ? 17 : u.scrollInertia;
                    switch (o) {
                        case "on":
                            if (f.dir = [n === d[16] || n === d[15] || 39 === n || 37 === n ? "x": "y", n === d[13] || n === d[15] || 38 === n || 37 === n ? -1 : 1], Q(t), oe(n) && "stepped" === f.type) return;
                            l(m);
                            break;
                        case "off":
                            s(),
                            (m || c.tweenRunning && f.dir) && l(!0)
                    }
                },
                Y = function(t) {
                    var o = e(this).data(a).opt,
                        n = [];
                    return "function" == typeof t && (t = t()),
                        t instanceof Array ? n = t.length > 1 ? [t[0], t[1]] : "x" === o.axis ? [null, t[0]] : [t[0], null] : (n[0] = t.y ? t.y: t.x || "x" === o.axis ? null: t, n[1] = t.x ? t.x: t.y || "y" === o.axis ? null: t),
                    "function" == typeof n[0] && (n[0] = n[0]()),
                    "function" == typeof n[1] && (n[1] = n[1]()),
                        n
                },
                X = function(t, o) {
                    if (null != t && "undefined" != typeof t) {
                        var n = e(this),
                            i = n.data(a),
                            r = i.opt,
                            l = e("#mCSB_" + i.idx + "_container"),
                            s = l.parent(),
                            c = typeof t;
                        o || (o = "x" === r.axis ? "x": "y");
                        var d = "x" === o ? l.outerWidth(!1) - s.width() : l.outerHeight(!1) - s.height(),
                            f = "x" === o ? l[0].offsetLeft: l[0].offsetTop,
                            h = "x" === o ? "left": "top";
                        switch (c) {
                            case "function":
                                return t();
                            case "object":
                                var m = t.jquery ? t: e(t);
                                if (!m.length) return;
                                return "x" === o ? ae(m)[1] : ae(m)[0];
                            case "string":
                            case "number":
                                if (oe(t)) return Math.abs(t);
                                if ( - 1 !== t.indexOf("%")) return Math.abs(d * parseInt(t) / 100);
                                if ( - 1 !== t.indexOf("-=")) return Math.abs(f - parseInt(t.split("-=")[1]));
                                if ( - 1 !== t.indexOf("+=")) {
                                    var p = f + parseInt(t.split("+=")[1]);
                                    return p >= 0 ? 0 : Math.abs(p)
                                }
                                if ( - 1 !== t.indexOf("px") && oe(t.split("px")[0])) return Math.abs(t.split("px")[0]);
                                if ("top" === t || "left" === t) return 0;
                                if ("bottom" === t) return Math.abs(s.height() - l.outerHeight(!1));
                                if ("right" === t) return Math.abs(s.width() - l.outerWidth(!1));
                                if ("first" === t || "last" === t) {
                                    var m = l.find(":" + t);
                                    return "x" === o ? ae(m)[1] : ae(m)[0]
                                }
                                return e(t).length ? "x" === o ? ae(e(t))[1] : ae(e(t))[0] : (l.css(h, t), void u.update.call(null, n[0]))
                        }
                    }
                },
                N = function(t) {
                    function o() {
                        return clearTimeout(f[0].autoUpdate),
                            0 === l.parents("html").length ? void(l = null) : void(f[0].autoUpdate = setTimeout(function() {
                                    return c.advanced.updateOnSelectorChange && (s.poll.change.n = i(), s.poll.change.n !== s.poll.change.o) ? (s.poll.change.o = s.poll.change.n, void r(3)) : c.advanced.updateOnContentResize && (s.poll.size.n = l[0].scrollHeight + l[0].scrollWidth + f[0].offsetHeight + l[0].offsetHeight + l[0].offsetWidth, s.poll.size.n !== s.poll.size.o) ? (s.poll.size.o = s.poll.size.n, void r(1)) : !c.advanced.updateOnImageLoad || "auto" === c.advanced.updateOnImageLoad && "y" === c.axis || (s.poll.img.n = f.find("img").length, s.poll.img.n === s.poll.img.o) ? void((c.advanced.updateOnSelectorChange || c.advanced.updateOnContentResize || c.advanced.updateOnImageLoad) && o()) : (s.poll.img.o = s.poll.img.n, void f.find("img").each(function() {
                                        n(this)
                                    }))
                                },
                                c.advanced.autoUpdateTimeout))
                    }
                    function n(t) {
                        function o(e, t) {
                            return function() {
                                return t.apply(e, arguments)
                            }
                        }
                        function a() {
                            this.onload = null,
                                e(t).addClass(d[2]),
                                r(2)
                        }
                        if (e(t).hasClass(d[2])) return void r();
                        var n = new Image;
                        n.onload = o(n, a),
                            n.src = t.src
                    }
                    function i() {
                        c.advanced.updateOnSelectorChange === !0 && (c.advanced.updateOnSelectorChange = "*");
                        var e = 0,
                            t = f.find(c.advanced.updateOnSelectorChange);
                        return c.advanced.updateOnSelectorChange && t.length > 0 && t.each(function() {
                            e += this.offsetHeight + this.offsetWidth
                        }),
                            e
                    }
                    function r(e) {
                        clearTimeout(f[0].autoUpdate),
                            u.update.call(null, l[0], e)
                    }
                    var l = e(this),
                        s = l.data(a),
                        c = s.opt,
                        f = e("#mCSB_" + s.idx + "_container");
                    return t ? (clearTimeout(f[0].autoUpdate), void $(f[0], "autoUpdate")) : void o()
                },
                V = function(e, t, o) {
                    return Math.round(e / t) * t - o
                },
                Q = function(t) {
                    var o = t.data(a),
                        n = e("#mCSB_" + o.idx + "_container,#mCSB_" + o.idx + "_container_wrapper,#mCSB_" + o.idx + "_dragger_vertical,#mCSB_" + o.idx + "_dragger_horizontal");
                    n.each(function() {
                        Z.call(this)
                    })
                },
                G = function(t, o, n) {
                    function i(e) {
                        return s && c.callbacks[e] && "function" == typeof c.callbacks[e]
                    }
                    function r() {
                        return [c.callbacks.alwaysTriggerOffsets || w >= S[0] + y, c.callbacks.alwaysTriggerOffsets || -B >= w]
                    }
                    function l() {
                        var e = [h[0].offsetTop, h[0].offsetLeft],
                            o = [x[0].offsetTop, x[0].offsetLeft],
                            a = [h.outerHeight(!1), h.outerWidth(!1)],
                            i = [f.height(), f.width()];
                        t[0].mcs = {
                            content: h,
                            top: e[0],
                            left: e[1],
                            draggerTop: o[0],
                            draggerLeft: o[1],
                            topPct: Math.round(100 * Math.abs(e[0]) / (Math.abs(a[0]) - i[0])),
                            leftPct: Math.round(100 * Math.abs(e[1]) / (Math.abs(a[1]) - i[1])),
                            direction: n.dir
                        }
                    }
                    var s = t.data(a),
                        c = s.opt,
                        d = {
                            trigger: "internal",
                            dir: "y",
                            scrollEasing: "mcsEaseOut",
                            drag: !1,
                            dur: c.scrollInertia,
                            overwrite: "all",
                            callbacks: !0,
                            onStart: !0,
                            onUpdate: !0,
                            onComplete: !0
                        },
                        n = e.extend(d, n),
                        u = [n.dur, n.drag ? 0 : n.dur],
                        f = e("#mCSB_" + s.idx),
                        h = e("#mCSB_" + s.idx + "_container"),
                        m = h.parent(),
                        p = c.callbacks.onTotalScrollOffset ? Y.call(t, c.callbacks.onTotalScrollOffset) : [0, 0],
                        g = c.callbacks.onTotalScrollBackOffset ? Y.call(t, c.callbacks.onTotalScrollBackOffset) : [0, 0];
                    if (s.trigger = n.trigger, 0 === m.scrollTop() && 0 === m.scrollLeft() || (e(".mCSB_" + s.idx + "_scrollbar").css("visibility", "visible"), m.scrollTop(0).scrollLeft(0)), "_resetY" !== o || s.contentReset.y || (i("onOverflowYNone") && c.callbacks.onOverflowYNone.call(t[0]), s.contentReset.y = 1), "_resetX" !== o || s.contentReset.x || (i("onOverflowXNone") && c.callbacks.onOverflowXNone.call(t[0]), s.contentReset.x = 1), "_resetY" !== o && "_resetX" !== o) {
                        if (!s.contentReset.y && t[0].mcs || !s.overflowed[0] || (i("onOverflowY") && c.callbacks.onOverflowY.call(t[0]), s.contentReset.x = null), !s.contentReset.x && t[0].mcs || !s.overflowed[1] || (i("onOverflowX") && c.callbacks.onOverflowX.call(t[0]), s.contentReset.x = null), c.snapAmount) {
                            var v = c.snapAmount instanceof Array ? "x" === n.dir ? c.snapAmount[1] : c.snapAmount[0] : c.snapAmount;
                            o = V(o, v, c.snapOffset)
                        }
                        switch (n.dir) {
                            case "x":
                                var x = e("#mCSB_" + s.idx + "_dragger_horizontal"),
                                    _ = "left",
                                    w = h[0].offsetLeft,
                                    S = [f.width() - h.outerWidth(!1), x.parent().width() - x.width()],
                                    b = [o, 0 === o ? 0 : o / s.scrollRatio.x],
                                    y = p[1],
                                    B = g[1],
                                    T = y > 0 ? y / s.scrollRatio.x: 0,
                                    k = B > 0 ? B / s.scrollRatio.x: 0;
                                break;
                            case "y":
                                var x = e("#mCSB_" + s.idx + "_dragger_vertical"),
                                    _ = "top",
                                    w = h[0].offsetTop,
                                    S = [f.height() - h.outerHeight(!1), x.parent().height() - x.height()],
                                    b = [o, 0 === o ? 0 : o / s.scrollRatio.y],
                                    y = p[0],
                                    B = g[0],
                                    T = y > 0 ? y / s.scrollRatio.y: 0,
                                    k = B > 0 ? B / s.scrollRatio.y: 0
                        }
                        b[1] < 0 || 0 === b[0] && 0 === b[1] ? b = [0, 0] : b[1] >= S[1] ? b = [S[0], S[1]] : b[0] = -b[0],
                        t[0].mcs || (l(), i("onInit") && c.callbacks.onInit.call(t[0])),
                            clearTimeout(h[0].onCompleteTimeout),
                            J(x[0], _, Math.round(b[1]), u[1], n.scrollEasing),
                        !s.tweenRunning && (0 === w && b[0] >= 0 || w === S[0] && b[0] <= S[0]) || J(h[0], _, Math.round(b[0]), u[0], n.scrollEasing, n.overwrite, {
                            onStart: function() {
                                n.callbacks && n.onStart && !s.tweenRunning && (i("onScrollStart") && (l(), c.callbacks.onScrollStart.call(t[0])), s.tweenRunning = !0, C(x), s.cbOffsets = r())
                            },
                            onUpdate: function() {
                                n.callbacks && n.onUpdate && i("whileScrolling") && (l(), c.callbacks.whileScrolling.call(t[0]))
                            },
                            onComplete: function() {
                                if (n.callbacks && n.onComplete) {
                                    "yx" === c.axis && clearTimeout(h[0].onCompleteTimeout);
                                    var e = h[0].idleTimer || 0;
                                    h[0].onCompleteTimeout = setTimeout(function() {
                                            i("onScroll") && (l(), c.callbacks.onScroll.call(t[0])),
                                            i("onTotalScroll") && b[1] >= S[1] - T && s.cbOffsets[0] && (l(), c.callbacks.onTotalScroll.call(t[0])),
                                            i("onTotalScrollBack") && b[1] <= k && s.cbOffsets[1] && (l(), c.callbacks.onTotalScrollBack.call(t[0])),
                                                s.tweenRunning = !1,
                                                h[0].idleTimer = 0,
                                                C(x, "hide")
                                        },
                                        e)
                                }
                            }
                        })
                    }
                },
                J = function(e, t, o, a, n, i, r) {
                    function l() {
                        S.stop || (x || m.call(), x = K() - v, s(), x >= S.time && (S.time = x > S.time ? x + f - (x - S.time) : x + f - 1, S.time < x + 1 && (S.time = x + 1)), S.time < a ? S.id = h(l) : g.call())
                    }
                    function s() {
                        a > 0 ? (S.currVal = u(S.time, _, b, a, n), w[t] = Math.round(S.currVal) + "px") : w[t] = o + "px",
                            p.call()
                    }
                    function c() {
                        f = 1e3 / 60,
                            S.time = x + f,
                            h = window.requestAnimationFrame ? window.requestAnimationFrame: function(e) {
                                return s(),
                                    setTimeout(e, .01)
                            },
                            S.id = h(l)
                    }
                    function d() {
                        null != S.id && (window.requestAnimationFrame ? window.cancelAnimationFrame(S.id) : clearTimeout(S.id), S.id = null)
                    }
                    function u(e, t, o, a, n) {
                        switch (n) {
                            case "linear":
                            case "mcsLinear":
                                return o * e / a + t;
                            case "mcsLinearOut":
                                return e /= a,
                                    e--,
                                o * Math.sqrt(1 - e * e) + t;
                            case "easeInOutSmooth":
                                return e /= a / 2,
                                    1 > e ? o / 2 * e * e + t: (e--, -o / 2 * (e * (e - 2) - 1) + t);
                            case "easeInOutStrong":
                                return e /= a / 2,
                                    1 > e ? o / 2 * Math.pow(2, 10 * (e - 1)) + t: (e--, o / 2 * ( - Math.pow(2, -10 * e) + 2) + t);
                            case "easeInOut":
                            case "mcsEaseInOut":
                                return e /= a / 2,
                                    1 > e ? o / 2 * e * e * e + t: (e -= 2, o / 2 * (e * e * e + 2) + t);
                            case "easeOutSmooth":
                                return e /= a,
                                    e--,
                                -o * (e * e * e * e - 1) + t;
                            case "easeOutStrong":
                                return o * ( - Math.pow(2, -10 * e / a) + 1) + t;
                            case "easeOut":
                            case "mcsEaseOut":
                            default:
                                var i = (e /= a) * e,
                                    r = i * e;
                                return t + o * (.499999999999997 * r * i + -2.5 * i * i + 5.5 * r + -6.5 * i + 4 * e)
                        }
                    }
                    e._mTween || (e._mTween = {
                        top: {},
                        left: {}
                    });
                    var f, h, r = r || {},
                        m = r.onStart ||
                            function() {},
                        p = r.onUpdate ||
                            function() {},
                        g = r.onComplete ||
                            function() {},
                        v = K(),
                        x = 0,
                        _ = e.offsetTop,
                        w = e.style,
                        S = e._mTween[t];
                    "left" === t && (_ = e.offsetLeft);
                    var b = o - _;
                    S.stop = 0,
                    "none" !== i && d(),
                        c()
                },
                K = function() {
                    return window.performance && window.performance.now ? window.performance.now() : window.performance && window.performance.webkitNow ? window.performance.webkitNow() : Date.now ? Date.now() : (new Date).getTime()
                },
                Z = function() {
                    var e = this;
                    e._mTween || (e._mTween = {
                        top: {},
                        left: {}
                    });
                    for (var t = ["top", "left"], o = 0; o < t.length; o++) {
                        var a = t[o];
                        e._mTween[a].id && (window.requestAnimationFrame ? window.cancelAnimationFrame(e._mTween[a].id) : clearTimeout(e._mTween[a].id), e._mTween[a].id = null, e._mTween[a].stop = 1)
                    }
                },
                $ = function(e, t) {
                    try {
                        delete e[t]
                    } catch(o) {
                        e[t] = null
                    }
                },
                ee = function(e) {
                    return ! (e.which && 1 !== e.which)
                },
                te = function(e) {
                    var t = e.originalEvent.pointerType;
                    return ! (t && "touch" !== t && 2 !== t)
                },
                oe = function(e) {
                    return ! isNaN(parseFloat(e)) && isFinite(e)
                },
                ae = function(e) {
                    var t = e.parents(".mCSB_container");
                    return [e.offset().top - t.offset().top, e.offset().left - t.offset().left]
                },
                ne = function() {
                    function e() {
                        var e = ["webkit", "moz", "ms", "o"];
                        if ("hidden" in document) return "hidden";
                        for (var t = 0; t < e.length; t++) if (e[t] + "Hidden" in document) return e[t] + "Hidden";
                        return null
                    }
                    var t = e();
                    return t ? document[t] : !1
                };
            e.fn[o] = function(t) {
                return u[t] ? u[t].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof t && t ? void e.error("Method " + t + " does not exist") : u.init.apply(this, arguments)
            },
                e[o] = function(t) {
                    return u[t] ? u[t].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof t && t ? void e.error("Method " + t + " does not exist") : u.init.apply(this, arguments)
                },
                e[o].defaults = i,
                window[o] = !0,
                e(window).bind("load",
                    function() {
                        e(n)[o](),
                            e.extend(e.expr[":"], {
                                mcsInView: e.expr[":"].mcsInView ||
                                    function(t) {
                                        var o, a, n = e(t),
                                            i = n.parents(".mCSB_container");
                                        if (i.length) return o = i.parent(),
                                            a = [i[0].offsetTop, i[0].offsetLeft],
                                        a[0] + ae(n)[0] >= 0 && a[0] + ae(n)[0] < o.height() - n.outerHeight(!1) && a[1] + ae(n)[1] >= 0 && a[1] + ae(n)[1] < o.width() - n.outerWidth(!1)
                                    },
                                mcsInSight: e.expr[":"].mcsInSight ||
                                    function(t, o, a) {
                                        var n, i, r, l, s = e(t),
                                            c = s.parents(".mCSB_container"),
                                            d = "exact" === a[3] ? [[1, 0], [1, 0]] : [[.9, .1], [.6, .4]];
                                        if (c.length) return n = [s.outerHeight(!1), s.outerWidth(!1)],
                                            r = [c[0].offsetTop + ae(s)[0], c[0].offsetLeft + ae(s)[1]],
                                            i = [c.parent()[0].offsetHeight, c.parent()[0].offsetWidth],
                                            l = [n[0] < i[0] ? d[0] : d[1], n[1] < i[1] ? d[0] : d[1]],
                                        r[0] - i[0] * l[0][0] < 0 && r[0] + n[0] - i[0] * l[0][1] >= 0 && r[1] - i[1] * l[1][0] < 0 && r[1] + n[1] - i[1] * l[1][1] >= 0
                                    },
                                mcsOverflow: e.expr[":"].mcsOverflow ||
                                    function(t) {
                                        var o = e(t).data(a);
                                        if (o) return o.overflowed[0] || o.overflowed[1]
                                    }
                            })
                    })
        })
    });