User Role Editor - Version 4.57.1

Version Description

Download this release

Release Info

Developer shinephp
Plugin Icon 128x128 User Role Editor
Version 4.57.1
Comparing to
See all releases

Code changes from version 4.57 to 4.57.1

changelog.txt CHANGED
@@ -1,5 +1,16 @@
1
  CHANGES LOG (full version).
2
  ===========================
 
 
 
 
 
 
 
 
 
 
 
3
  = [4.56.1] 05.09.2020 =
4
  * New: WordPress multisite: Main site: Users->User Role Editor->Apply to All->Update: 'ure_after_network_roles_update' action hook was added. It is executed after all roles were replicated from the main site to the all other subsites of the network.
5
  * Fix: "Granted Only" filter did not work.
1
  CHANGES LOG (full version).
2
  ===========================
3
+ = [4.57.1] 10.12.2020 =
4
+ * Fix: Nextgen Gallery's user capabilities were not shown as granted after current role change via roles selection dropdown list.
5
+ * Fix: PHP Warning: The magic method __wakeup() must have public visibility. __wakeup() method was defined as private as a part of the Singleton design partern. Method was redefined as public but with exception inside to prevent its usage.
6
+ * Update: jQuery [MultiSelect](http://multiple-select.wenzhixin.net.cn/) plugin was updated to version 1.5.2
7
+
8
+ = [4.57] 09.11.2020 =
9
+ * Update: Marked as compatible with WordPress 5.6.
10
+ * Update: " jQuery( document ).ready( handler ) " was replaced globally with " jQuery( handler ) " for compatibility with [jQuery 3.0](https://api.jquery.com/ready/) and WordPress 5.6.
11
+ * Update: jQuery UI CSS was updated to version 1.12.1
12
+ * Fix: "Grant Roles" button produced JavaScript error, if single user without any role granted (None) was selected.
13
+
14
  = [4.56.1] 05.09.2020 =
15
  * New: WordPress multisite: Main site: Users->User Role Editor->Apply to All->Update: 'ure_after_network_roles_update' action hook was added. It is executed after all roles were replicated from the main site to the all other subsites of the network.
16
  * Fix: "Granted Only" filter did not work.
css/multiple-select.css CHANGED
@@ -1,40 +1,46 @@
 
1
  /**
2
  * @author zhixin wen <wenzhixin2010@gmail.com>
3
  */
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  .ms-parent {
6
- display: inline-block;
7
- position: relative;
8
- vertical-align: middle;
9
- }
10
 
11
  .ms-choice {
12
- display: block;
13
- width: 100%;
14
- height: 26px;
15
- padding: 0;
16
- overflow: hidden;
17
- cursor: pointer;
18
- border: 1px solid #aaa;
19
- text-align: left;
20
- white-space: nowrap;
21
- line-height: 26px;
22
- color: #444;
23
- text-decoration: none;
24
- -webkit-border-radius: 4px;
25
- -moz-border-radius: 4px;
26
- border-radius: 4px;
27
- background-color: #fff;
28
- }
29
-
30
- .ms-choice.disabled {
31
  background-color: #f4f4f4;
32
  background-image: none;
33
  border: 1px solid #ddd;
34
- cursor: default;
35
- }
36
-
37
- .ms-choice > span {
38
  position: absolute;
39
  top: 0;
40
  left: 0;
@@ -43,149 +49,135 @@
43
  overflow: hidden;
44
  text-overflow: ellipsis;
45
  display: block;
46
- padding-left: 8px;
47
- }
48
-
49
- .ms-choice > span.placeholder {
50
- color: #999;
51
- }
52
-
53
- .ms-choice > div {
54
  position: absolute;
55
- top: 0;
56
- right: 0;
57
- width: 20px;
58
- height: 25px;
59
- background: url('multiple-select.png') left top no-repeat;
60
- }
61
-
62
- .ms-choice > div.open {
63
- background: url('multiple-select.png') right top no-repeat;
64
- }
65
-
66
- .ms-drop {
67
- width: 100%;
68
- overflow: hidden;
69
- display: none;
70
- margin-top: -1px;
71
- padding: 0;
72
  position: absolute;
73
- z-index: 1000;
74
- background: #fff;
75
- color: #000;
76
- border: 1px solid #aaa;
77
- -webkit-border-radius: 4px;
78
- -moz-border-radius: 4px;
79
- border-radius: 4px;
80
- }
 
 
 
81
 
82
- .ms-drop.bottom {
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  top: 100%;
84
- -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
85
- -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
86
- box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
87
- }
88
-
89
- .ms-drop.top {
90
  bottom: 100%;
91
- -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
92
- -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
93
- box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
94
- }
95
 
96
  .ms-search {
97
- display: inline-block;
98
- margin: 0;
99
- min-height: 26px;
100
- padding: 4px;
101
- position: relative;
102
- white-space: nowrap;
103
- width: 100%;
104
- z-index: 10000;
105
- }
106
-
107
- .ms-search input {
108
  width: 100%;
109
  height: auto !important;
110
  min-height: 24px;
111
- padding: 0 20px 0 5px;
112
  margin: 0;
113
  outline: 0;
114
  font-family: sans-serif;
115
- font-size: 1em;
116
  border: 1px solid #aaa;
117
- -webkit-border-radius: 0;
118
- -moz-border-radius: 0;
119
- border-radius: 0;
120
- -webkit-box-shadow: none;
121
- -moz-box-shadow: none;
122
- box-shadow: none;
123
- background: #fff url('multiple-select.png') no-repeat 100% -22px;
124
- background: url('multiple-select.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
125
- background: url('multiple-select.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
126
- background: url('multiple-select.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
127
- background: url('multiple-select.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
128
- background: url('multiple-select.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
129
- background: url('multiple-select.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
130
- }
131
-
132
- .ms-search, .ms-search input {
133
- -webkit-box-sizing: border-box;
134
- -khtml-box-sizing: border-box;
135
- -moz-box-sizing: border-box;
136
- -ms-box-sizing: border-box;
137
- box-sizing: border-box;
138
- }
139
 
140
  .ms-drop ul {
141
- overflow: auto;
142
- margin: 0;
143
- padding: 5px 8px;
144
- }
145
-
146
- .ms-drop ul > li {
147
  list-style: none;
148
  display: list-item;
149
  background-image: none;
150
  position: static;
151
- }
152
-
153
- .ms-drop ul > li .disabled {
154
- opacity: .35;
155
- filter: Alpha(Opacity=35);
156
- }
157
-
158
- .ms-drop ul > li.multiple {
159
- display: block;
160
- float: left;
161
- }
162
-
163
- .ms-drop ul > li.group {
164
- clear: both;
165
- }
166
-
167
- .ms-drop ul > li.multiple label {
168
- width: 100%;
169
- display: block;
170
- white-space: nowrap;
171
- overflow: hidden;
172
- text-overflow: ellipsis;
173
- }
174
-
175
- .ms-drop ul > li label {
176
- font-weight: normal;
177
- display: block;
178
- white-space: nowrap;
179
- }
180
-
181
- .ms-drop ul > li label.optgroup {
182
- font-weight: bold;
183
- }
184
-
185
- .ms-drop input[type="checkbox"] {
186
- vertical-align: middle;
187
- }
 
 
 
 
 
 
 
 
 
188
 
189
  .ms-drop .ms-no-results {
190
- display: none;
191
- }
1
+ @charset "UTF-8";
2
  /**
3
  * @author zhixin wen <wenzhixin2010@gmail.com>
4
  */
5
+ .ms-offscreen {
6
+ clip: rect(0 0 0 0) !important;
7
+ width: 1px !important;
8
+ height: 1px !important;
9
+ border: 0 !important;
10
+ margin: 0 !important;
11
+ padding: 0 !important;
12
+ overflow: hidden !important;
13
+ position: absolute !important;
14
+ outline: 0 !important;
15
+ left: auto !important;
16
+ top: auto !important; }
17
 
18
  .ms-parent {
19
+ display: inline-block;
20
+ position: relative;
21
+ vertical-align: middle; }
 
22
 
23
  .ms-choice {
24
+ display: block;
25
+ width: 100%;
26
+ height: 26px;
27
+ padding: 0;
28
+ overflow: hidden;
29
+ cursor: pointer;
30
+ border: 1px solid #aaa;
31
+ text-align: left;
32
+ white-space: nowrap;
33
+ line-height: 26px;
34
+ color: #444;
35
+ text-decoration: none;
36
+ border-radius: 4px;
37
+ background-color: #fff; }
38
+ .ms-choice.disabled {
 
 
 
 
39
  background-color: #f4f4f4;
40
  background-image: none;
41
  border: 1px solid #ddd;
42
+ cursor: default; }
43
+ .ms-choice > span {
 
 
44
  position: absolute;
45
  top: 0;
46
  left: 0;
49
  overflow: hidden;
50
  text-overflow: ellipsis;
51
  display: block;
52
+ padding-left: 8px; }
53
+ .ms-choice > span.placeholder {
54
+ color: #999; }
55
+ .ms-choice > div.icon-close {
 
 
 
 
56
  position: absolute;
57
+ top: 0px;
58
+ right: 16px;
59
+ height: 100%;
60
+ width: 16px; }
61
+ .ms-choice > div.icon-close:before {
62
+ content: '×';
63
+ color: #888;
64
+ font-weight: bold;
65
+ position: absolute;
66
+ top: 50%;
67
+ margin-top: -14px; }
68
+ .ms-choice > div.icon-close:hover:before {
69
+ color: #333; }
70
+ .ms-choice > div.icon-caret {
 
 
 
71
  position: absolute;
72
+ width: 0;
73
+ height: 0;
74
+ top: 50%;
75
+ right: 8px;
76
+ margin-top: -2px;
77
+ border-color: #888 transparent transparent transparent;
78
+ border-style: solid;
79
+ border-width: 5px 4px 0 4px; }
80
+ .ms-choice > div.icon-caret.open {
81
+ border-color: transparent transparent #888 transparent;
82
+ border-width: 0 4px 5px 4px; }
83
 
84
+ .ms-drop {
85
+ width: auto;
86
+ min-width: 100%;
87
+ overflow: hidden;
88
+ display: none;
89
+ margin-top: -1px;
90
+ padding: 0;
91
+ position: absolute;
92
+ z-index: 1000;
93
+ background: #fff;
94
+ color: #000;
95
+ border: 1px solid #aaa;
96
+ border-radius: 4px; }
97
+ .ms-drop.bottom {
98
  top: 100%;
99
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15); }
100
+ .ms-drop.top {
 
 
 
 
101
  bottom: 100%;
102
+ box-shadow: 0 -4px 5px rgba(0, 0, 0, 0.15); }
 
 
 
103
 
104
  .ms-search {
105
+ display: inline-block;
106
+ margin: 0;
107
+ min-height: 26px;
108
+ padding: 2px;
109
+ position: relative;
110
+ white-space: nowrap;
111
+ width: 100%;
112
+ z-index: 10000;
113
+ box-sizing: border-box; }
114
+ .ms-search input {
 
115
  width: 100%;
116
  height: auto !important;
117
  min-height: 24px;
118
+ padding: 0 5px;
119
  margin: 0;
120
  outline: 0;
121
  font-family: sans-serif;
 
122
  border: 1px solid #aaa;
123
+ border-radius: 5px;
124
+ box-shadow: none; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  .ms-drop ul {
127
+ overflow: auto;
128
+ margin: 0;
129
+ padding: 0; }
130
+ .ms-drop ul > li {
 
 
131
  list-style: none;
132
  display: list-item;
133
  background-image: none;
134
  position: static;
135
+ padding: .25rem 8px; }
136
+ .ms-drop ul > li .disabled {
137
+ font-weight: normal !important;
138
+ opacity: .35;
139
+ filter: Alpha(Opacity=35);
140
+ cursor: default; }
141
+ .ms-drop ul > li.multiple {
142
+ display: block;
143
+ float: left; }
144
+ .ms-drop ul > li.group {
145
+ clear: both; }
146
+ .ms-drop ul > li.multiple label {
147
+ width: 100%;
148
+ display: block;
149
+ white-space: nowrap;
150
+ overflow: hidden;
151
+ text-overflow: ellipsis; }
152
+ .ms-drop ul > li label {
153
+ position: relative;
154
+ padding-left: 1.25rem;
155
+ margin-bottom: 0;
156
+ font-weight: normal;
157
+ display: block;
158
+ white-space: nowrap;
159
+ cursor: pointer; }
160
+ .ms-drop ul > li label.optgroup {
161
+ font-weight: bold; }
162
+ .ms-drop ul > li.hide-radio {
163
+ padding: 0; }
164
+ .ms-drop ul > li.hide-radio:focus, .ms-drop ul > li.hide-radio:hover {
165
+ background-color: #f8f9fa; }
166
+ .ms-drop ul > li.hide-radio.selected {
167
+ color: #fff;
168
+ background-color: #007bff; }
169
+ .ms-drop ul > li.hide-radio label {
170
+ margin-bottom: 0;
171
+ padding: 5px 8px; }
172
+ .ms-drop ul > li.hide-radio input {
173
+ display: none; }
174
+ .ms-drop ul > li.option-level-1 label {
175
+ padding-left: 28px; }
176
+
177
+ .ms-drop input[type="radio"], .ms-drop input[type="checkbox"] {
178
+ position: absolute;
179
+ margin-top: .3rem;
180
+ margin-left: -1.25rem; }
181
 
182
  .ms-drop .ms-no-results {
183
+ display: none; }
 
css/multiple-select.min.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * multiple-select - Multiple select is a jQuery plugin to select multiple elements with checkboxes :).
3
+ *
4
+ * @version v1.5.2
5
+ * @homepage http://multiple-select.wenzhixin.net.cn
6
+ * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7
+ * @license MIT
8
+ */
9
+
10
+ @charset "UTF-8";.ms-offscreen{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:auto!important;top:auto!important}.ms-parent{display:inline-block;position:relative;vertical-align:middle}.ms-choice{display:block;width:100%;height:26px;padding:0;overflow:hidden;cursor:pointer;border:1px solid #aaa;text-align:left;white-space:nowrap;line-height:26px;color:#444;text-decoration:none;border-radius:4px;background-color:#fff}.ms-choice.disabled{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.ms-choice>span{position:absolute;top:0;left:0;right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;padding-left:8px}.ms-choice>span.placeholder{color:#999}.ms-choice>div.icon-close{position:absolute;top:0;right:16px;height:100%;width:16px}.ms-choice>div.icon-close:before{content:'×';color:#888;font-weight:bold;position:absolute;top:50%;margin-top:-14px}.ms-choice>div.icon-close:hover:before{color:#333}.ms-choice>div.icon-caret{position:absolute;width:0;height:0;top:50%;right:8px;margin-top:-2px;border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px}.ms-choice>div.icon-caret.open{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.ms-drop{width:auto;min-width:100%;overflow:hidden;display:none;margin-top:-1px;padding:0;position:absolute;z-index:1000;background:#fff;color:#000;border:1px solid #aaa;border-radius:4px}.ms-drop.bottom{top:100%;box-shadow:0 4px 5px rgba(0,0,0,0.15)}.ms-drop.top{bottom:100%;box-shadow:0 -4px 5px rgba(0,0,0,0.15)}.ms-search{display:inline-block;margin:0;min-height:26px;padding:2px;position:relative;white-space:nowrap;width:100%;z-index:10000;box-sizing:border-box}.ms-search input{width:100%;height:auto!important;min-height:24px;padding:0 5px;margin:0;outline:0;font-family:sans-serif;border:1px solid #aaa;border-radius:5px;box-shadow:none}.ms-drop ul{overflow:auto;margin:0;padding:0}.ms-drop ul>li{list-style:none;display:list-item;background-image:none;position:static;padding:.25rem 8px}.ms-drop ul>li .disabled{font-weight:normal!important;opacity:.35;filter:Alpha(Opacity=35);cursor:default}.ms-drop ul>li.multiple{display:block;float:left}.ms-drop ul>li.group{clear:both}.ms-drop ul>li.multiple label{width:100%;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-drop ul>li label{position:relative;padding-left:1.25rem;margin-bottom:0;font-weight:normal;display:block;white-space:nowrap;cursor:pointer}.ms-drop ul>li label.optgroup{font-weight:bold}.ms-drop ul>li.hide-radio{padding:0}.ms-drop ul>li.hide-radio:focus,.ms-drop ul>li.hide-radio:hover{background-color:#f8f9fa}.ms-drop ul>li.hide-radio.selected{color:#fff;background-color:#007bff}.ms-drop ul>li.hide-radio label{margin-bottom:0;padding:5px 8px}.ms-drop ul>li.hide-radio input{display:none}.ms-drop ul>li.option-level-1 label{padding-left:28px}.ms-drop input[type="radio"],.ms-drop input[type="checkbox"]{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.ms-drop .ms-no-results{display:none}
includes/classes/ajax-processor.php CHANGED
@@ -243,12 +243,18 @@ class URE_Ajax_Processor {
243
  $role_options = array();
244
  }
245
 
 
 
 
 
 
 
246
  $answer = array(
247
  'result'=>'success',
248
  'message'=>'Role capabilities retrieved successfully',
249
  'role_id'=>$role,
250
  'role_name'=>$wp_roles->roles[$role]['name'],
251
- 'caps'=>$wp_roles->roles[$role]['capabilities'],
252
  'options'=>$role_options
253
  );
254
 
243
  $role_options = array();
244
  }
245
 
246
+ $caps = array();
247
+ foreach( $wp_roles->roles[$role]['capabilities'] as $cap_id=>$allowed ) {
248
+ $cap = URE_Capability::escape( $cap_id );
249
+ $caps[$cap] = $allowed;
250
+ }
251
+
252
  $answer = array(
253
  'result'=>'success',
254
  'message'=>'Role capabilities retrieved successfully',
255
  'role_id'=>$role,
256
  'role_name'=>$wp_roles->roles[$role]['name'],
257
+ 'caps'=>$caps,
258
  'options'=>$role_options
259
  );
260
 
includes/classes/base-lib.php CHANGED
@@ -338,24 +338,22 @@ class URE_Base_Lib {
338
 
339
 
340
  /**
341
- * Private clone method to prevent cloning of the instance of the
342
- * *Singleton* instance.
343
  *
344
  * @return void
345
  */
346
- private function __clone() {
347
-
348
  }
349
  // end of __clone()
350
 
351
  /**
352
- * Private unserialize method to prevent unserializing of the *Singleton*
353
- * instance.
354
  *
355
  * @return void
356
  */
357
- private function __wakeup() {
358
-
359
  }
360
  // end of __wakeup()
361
 
338
 
339
 
340
  /**
341
+ * Prevent cloning of the instance of the *Singleton* instance.
 
342
  *
343
  * @return void
344
  */
345
+ public function __clone() {
346
+ throw new \Exception('Do not clone a singleton instance.');
347
  }
348
  // end of __clone()
349
 
350
  /**
351
+ * Prevent unserializing of the *Singleton* instance.
 
352
  *
353
  * @return void
354
  */
355
+ public function __wakeup() {
356
+ throw new \Exception('Do not unserialize a singleton instance.');
357
  }
358
  // end of __wakeup()
359
 
includes/classes/capabilities-groups-manager.php CHANGED
@@ -402,27 +402,24 @@ class URE_Capabilities_Groups_Manager {
402
 
403
 
404
  /**
405
- * Private clone method to prevent cloning of the instance of the
406
- * *Singleton* instance.
407
  *
408
  * @return void
409
  */
410
- private function __clone() {
411
-
412
  }
413
  // end of __clone()
414
 
415
  /**
416
- * Private unserialize method to prevent unserializing of the *Singleton*
417
- * instance.
418
  *
419
  * @return void
420
  */
421
- private function __wakeup() {
422
-
423
  }
424
- // end of __wakeup()
425
-
426
 
427
  }
428
  // end of class URE_Capabilities_Groups_Manager
402
 
403
 
404
  /**
405
+ * Prevent cloning of the instance of the *Singleton* instance.
 
406
  *
407
  * @return void
408
  */
409
+ public function __clone() {
410
+ throw new \Exception('Do not clone a singleton instance.');
411
  }
412
  // end of __clone()
413
 
414
  /**
415
+ * Prevent unserializing of the *Singleton* instance.
 
416
  *
417
  * @return void
418
  */
419
+ public function __wakeup() {
420
+ throw new \Exception('Do not unserialize a singleton instance.');
421
  }
422
+ // end of __wakeup()
 
423
 
424
  }
425
  // end of class URE_Capabilities_Groups_Manager
includes/classes/capabilities.php CHANGED
@@ -412,21 +412,24 @@ class URE_Capabilities {
412
 
413
 
414
  /**
415
- * Private clone method to prevent cloning of the instance of the
416
- * *Singleton* instance.
417
  *
418
  * @return void
419
  */
420
- private function __clone() { }
 
 
 
421
 
422
  /**
423
- * Private unserialize method to prevent unserializing of the *Singleton*
424
- * instance.
425
  *
426
  * @return void
427
  */
428
- private function __wakeup() { }
429
-
 
 
430
 
431
  }
432
  // end of URE_Capabilities class
412
 
413
 
414
  /**
415
+ * Prevent cloning of the instance of the *Singleton* instance.
 
416
  *
417
  * @return void
418
  */
419
+ public function __clone() {
420
+ throw new \Exception('Do not clone a singleton instance.');
421
+ }
422
+ // end of __clone()
423
 
424
  /**
425
+ * Prevent unserializing of the *Singleton* instance.
 
426
  *
427
  * @return void
428
  */
429
+ public function __wakeup() {
430
+ throw new \Exception('Do not unserialize a singleton instance.');
431
+ }
432
+ // end of __wakeup()
433
 
434
  }
435
  // end of URE_Capabilities class
includes/classes/editor.php CHANGED
@@ -1366,22 +1366,26 @@ class URE_Editor {
1366
  // end of translation_data()
1367
 
1368
 
 
1369
  /**
1370
- * Private clone method to prevent cloning of the instance of the
1371
- * *Singleton* instance.
1372
  *
1373
  * @return void
1374
  */
1375
- private function __clone() { }
 
 
 
1376
 
1377
  /**
1378
- * Private unserialize method to prevent unserializing of the *Singleton*
1379
- * instance.
1380
  *
1381
  * @return void
1382
  */
1383
- private function __wakeup() { }
1384
-
 
 
1385
 
1386
  }
1387
  // end of URE_Editor class
1366
  // end of translation_data()
1367
 
1368
 
1369
+
1370
  /**
1371
+ * Prevent cloning of the instance of the *Singleton* instance.
 
1372
  *
1373
  * @return void
1374
  */
1375
+ public function __clone() {
1376
+ throw new \Exception('Do not clone a singleton instance.');
1377
+ }
1378
+ // end of __clone()
1379
 
1380
  /**
1381
+ * Prevent unserializing of the *Singleton* instance.
 
1382
  *
1383
  * @return void
1384
  */
1385
+ public function __wakeup() {
1386
+ throw new \Exception('Do not unserialize a singleton instance.');
1387
+ }
1388
+ // end of __wakeup()
1389
 
1390
  }
1391
  // end of URE_Editor class
includes/classes/task-queue.php CHANGED
@@ -125,24 +125,22 @@ class URE_Task_Queue {
125
  // end of process();
126
 
127
  /**
128
- * Private clone method to prevent cloning of the instance of the
129
- * *Singleton* instance.
130
  *
131
  * @return void
132
  */
133
- private function __clone() {
134
-
135
  }
136
  // end of __clone()
137
 
138
  /**
139
- * Private unserialize method to prevent unserializing of the *Singleton*
140
- * instance.
141
  *
142
  * @return void
143
  */
144
- private function __wakeup() {
145
-
146
  }
147
  // end of __wakeup()
148
 
125
  // end of process();
126
 
127
  /**
128
+ * Prevent cloning of the instance of the *Singleton* instance.
 
129
  *
130
  * @return void
131
  */
132
+ public function __clone() {
133
+ throw new \Exception('Do not clone a singleton instance.');
134
  }
135
  // end of __clone()
136
 
137
  /**
138
+ * Prevent unserializing of the *Singleton* instance.
 
139
  *
140
  * @return void
141
  */
142
+ public function __wakeup() {
143
+ throw new \Exception('Do not unserialize a singleton instance.');
144
  }
145
  // end of __wakeup()
146
 
includes/classes/user-other-roles.php CHANGED
@@ -59,8 +59,14 @@ class URE_User_Other_Roles {
59
  */
60
  public function load_css() {
61
 
 
 
 
 
 
 
62
  wp_enqueue_style('wp-jquery-ui-dialog');
63
- wp_enqueue_style('ure-jquery-multiple-select', plugins_url('/css/multiple-select.css', URE_PLUGIN_FULL_PATH), array(), false, 'screen');
64
 
65
  }
66
  // end of load_css()
@@ -72,11 +78,16 @@ class URE_User_Other_Roles {
72
  return;
73
  }
74
 
 
 
 
 
 
75
 
76
  $select_primary_role = apply_filters('ure_users_select_primary_role', true);
77
 
78
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
79
- wp_register_script('ure-jquery-multiple-select', plugins_url('/js/multiple-select.js', URE_PLUGIN_FULL_PATH));
80
  wp_enqueue_script('ure-jquery-multiple-select');
81
  wp_register_script('ure-user-profile-other-roles', plugins_url('/js/user-profile-other-roles.js', URE_PLUGIN_FULL_PATH));
82
  wp_enqueue_script('ure-user-profile-other-roles');
59
  */
60
  public function load_css() {
61
 
62
+ if ( defined('WP_DEBUG') && !empty( WP_DEBUG ) ) {
63
+ $file_name = 'multiple-select.css';
64
+ } else {
65
+ $file_name = 'multiple-select.min.css';
66
+ }
67
+
68
  wp_enqueue_style('wp-jquery-ui-dialog');
69
+ wp_enqueue_style('ure-jquery-multiple-select', plugins_url('/css/'. $file_name, URE_PLUGIN_FULL_PATH ), array(), false, 'screen');
70
 
71
  }
72
  // end of load_css()
78
  return;
79
  }
80
 
81
+ if ( defined('WP_DEBUG') && !empty( WP_DEBUG ) ) {
82
+ $ms_file_name = 'multiple-select.js';
83
+ } else {
84
+ $ms_file_name = 'multiple-select.min.js';
85
+ }
86
 
87
  $select_primary_role = apply_filters('ure_users_select_primary_role', true);
88
 
89
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
90
+ wp_register_script('ure-jquery-multiple-select', plugins_url('/js/'. $ms_file_name, URE_PLUGIN_FULL_PATH));
91
  wp_enqueue_script('ure-jquery-multiple-select');
92
  wp_register_script('ure-user-profile-other-roles', plugins_url('/js/user-profile-other-roles.js', URE_PLUGIN_FULL_PATH));
93
  wp_enqueue_script('ure-user-profile-other-roles');
includes/classes/user-role-editor.php CHANGED
@@ -40,23 +40,22 @@ class User_Role_Editor {
40
 
41
 
42
  /**
43
- * Private clone method to prevent cloning of the instance of the *Singleton*
44
  *
45
  * @return void
46
  */
47
- private function __clone() {
48
-
49
  }
50
  // end of __clone()
51
 
52
  /**
53
- * Private unserialize method to prevent unserializing of the *Singleton*
54
- * instance.
55
  *
56
  * @return void
57
  */
58
- private function __wakeup() {
59
-
60
  }
61
  // end of __wakeup()
62
 
40
 
41
 
42
  /**
43
+ * Prevent cloning of a *Singleton* instance
44
  *
45
  * @return void
46
  */
47
+ public function __clone() {
48
+ throw new \Exception('Do not clone a singleton instance.');
49
  }
50
  // end of __clone()
51
 
52
  /**
53
+ * Prevent unserializing of a *Singleton* instance.
 
54
  *
55
  * @return void
56
  */
57
+ public function __wakeup() {
58
+ throw new \Exception('Do not unserialize a singleton instance.');
59
  }
60
  // end of __wakeup()
61
 
js/multiple-select.js CHANGED
@@ -1,782 +1,4289 @@
1
- /**
2
- * @author zhixin wen <wenzhixin2010@gmail.com>
3
- * @version 1.2.1
4
- *
5
- * http://wenzhixin.net.cn/p/multiple-select/
6
- */
7
 
8
- (function ($) {
9
 
10
- 'use strict';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- // it only does '%s', and return '' when arguments are undefined
13
- var sprintf = function (str) {
14
- var args = arguments,
15
- flag = true,
16
- i = 1;
17
 
18
- str = str.replace(/%s/g, function () {
19
- var arg = args[i++];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
- if (typeof arg === 'undefined') {
22
- flag = false;
23
- return '';
 
24
  }
25
- return arg;
26
- });
27
- return flag ? str : '';
28
- };
29
 
30
- var removeDiacritics = function (str) {
31
- var defaultDiacriticsRemovalMap = [
32
- {'base':'A', 'letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},
33
- {'base':'AA','letters':/[\uA732]/g},
34
- {'base':'AE','letters':/[\u00C6\u01FC\u01E2]/g},
35
- {'base':'AO','letters':/[\uA734]/g},
36
- {'base':'AU','letters':/[\uA736]/g},
37
- {'base':'AV','letters':/[\uA738\uA73A]/g},
38
- {'base':'AY','letters':/[\uA73C]/g},
39
- {'base':'B', 'letters':/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},
40
- {'base':'C', 'letters':/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},
41
- {'base':'D', 'letters':/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},
42
- {'base':'DZ','letters':/[\u01F1\u01C4]/g},
43
- {'base':'Dz','letters':/[\u01F2\u01C5]/g},
44
- {'base':'E', 'letters':/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},
45
- {'base':'F', 'letters':/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},
46
- {'base':'G', 'letters':/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},
47
- {'base':'H', 'letters':/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},
48
- {'base':'I', 'letters':/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},
49
- {'base':'J', 'letters':/[\u004A\u24BF\uFF2A\u0134\u0248]/g},
50
- {'base':'K', 'letters':/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},
51
- {'base':'L', 'letters':/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},
52
- {'base':'LJ','letters':/[\u01C7]/g},
53
- {'base':'Lj','letters':/[\u01C8]/g},
54
- {'base':'M', 'letters':/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},
55
- {'base':'N', 'letters':/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},
56
- {'base':'NJ','letters':/[\u01CA]/g},
57
- {'base':'Nj','letters':/[\u01CB]/g},
58
- {'base':'O', 'letters':/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},
59
- {'base':'OI','letters':/[\u01A2]/g},
60
- {'base':'OO','letters':/[\uA74E]/g},
61
- {'base':'OU','letters':/[\u0222]/g},
62
- {'base':'P', 'letters':/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},
63
- {'base':'Q', 'letters':/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},
64
- {'base':'R', 'letters':/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},
65
- {'base':'S', 'letters':/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},
66
- {'base':'T', 'letters':/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},
67
- {'base':'TZ','letters':/[\uA728]/g},
68
- {'base':'U', 'letters':/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},
69
- {'base':'V', 'letters':/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},
70
- {'base':'VY','letters':/[\uA760]/g},
71
- {'base':'W', 'letters':/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},
72
- {'base':'X', 'letters':/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},
73
- {'base':'Y', 'letters':/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},
74
- {'base':'Z', 'letters':/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},
75
- {'base':'a', 'letters':/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},
76
- {'base':'aa','letters':/[\uA733]/g},
77
- {'base':'ae','letters':/[\u00E6\u01FD\u01E3]/g},
78
- {'base':'ao','letters':/[\uA735]/g},
79
- {'base':'au','letters':/[\uA737]/g},
80
- {'base':'av','letters':/[\uA739\uA73B]/g},
81
- {'base':'ay','letters':/[\uA73D]/g},
82
- {'base':'b', 'letters':/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},
83
- {'base':'c', 'letters':/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},
84
- {'base':'d', 'letters':/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},
85
- {'base':'dz','letters':/[\u01F3\u01C6]/g},
86
- {'base':'e', 'letters':/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},
87
- {'base':'f', 'letters':/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},
88
- {'base':'g', 'letters':/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},
89
- {'base':'h', 'letters':/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},
90
- {'base':'hv','letters':/[\u0195]/g},
91
- {'base':'i', 'letters':/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},
92
- {'base':'j', 'letters':/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},
93
- {'base':'k', 'letters':/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},
94
- {'base':'l', 'letters':/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},
95
- {'base':'lj','letters':/[\u01C9]/g},
96
- {'base':'m', 'letters':/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},
97
- {'base':'n', 'letters':/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},
98
- {'base':'nj','letters':/[\u01CC]/g},
99
- {'base':'o', 'letters':/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},
100
- {'base':'oi','letters':/[\u01A3]/g},
101
- {'base':'ou','letters':/[\u0223]/g},
102
- {'base':'oo','letters':/[\uA74F]/g},
103
- {'base':'p','letters':/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},
104
- {'base':'q','letters':/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},
105
- {'base':'r','letters':/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},
106
- {'base':'s','letters':/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},
107
- {'base':'t','letters':/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},
108
- {'base':'tz','letters':/[\uA729]/g},
109
- {'base':'u','letters':/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},
110
- {'base':'v','letters':/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},
111
- {'base':'vy','letters':/[\uA761]/g},
112
- {'base':'w','letters':/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},
113
- {'base':'x','letters':/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},
114
- {'base':'y','letters':/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},
115
- {'base':'z','letters':/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}
116
- ];
117
-
118
- for (var i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
119
- str = str.replace(defaultDiacriticsRemovalMap[i].letters, defaultDiacriticsRemovalMap[i].base);
120
- }
121
-
122
- return str;
123
-
124
- };
125
 
126
- function MultipleSelect($el, options) {
127
- var that = this,
128
- name = $el.attr('name') || options.name || '';
 
 
 
 
 
129
 
130
- this.options = options;
 
 
 
 
 
131
 
132
- // hide select element
133
- this.$el = $el.hide();
134
 
135
- // label element
136
- this.$label = this.$el.closest('label');
137
- if (this.$label.length === 0 && this.$el.attr('id')) {
138
- this.$label = $(sprintf('label[for="%s"]', this.$el.attr('id').replace(/:/g, '\\:')));
139
- }
140
-
141
- // restore class and title from select element
142
- this.$parent = $(sprintf(
143
- '<div class="ms-parent %s" %s/>',
144
- $el.attr('class') || '',
145
- sprintf('title="%s"', $el.attr('title'))));
146
-
147
- // add placeholder to choice button
148
- this.$choice = $(sprintf([
149
- '<button type="button" class="ms-choice">',
150
- '<span class="placeholder">%s</span>',
151
- '<div></div>',
152
- '</button>'
153
- ].join(''),
154
- this.options.placeholder));
155
-
156
- // default position is bottom
157
- this.$drop = $(sprintf('<div class="ms-drop %s"%s></div>',
158
- this.options.position,
159
- sprintf(' style="width: %s"', this.options.dropWidth)));
160
 
161
- this.$el.after(this.$parent);
162
- this.$parent.append(this.$choice);
163
- this.$parent.append(this.$drop);
164
 
165
- if (this.$el.prop('disabled')) {
166
- this.$choice.addClass('disabled');
 
 
 
167
  }
168
- this.$parent.css('width',
169
- this.options.width ||
170
- this.$el.css('width') ||
171
- this.$el.outerWidth() + 20);
172
 
173
- this.selectAllName = 'data-name="selectAll' + name + '"';
174
- this.selectGroupName = 'data-name="selectGroup' + name + '"';
175
- this.selectItemName = 'data-name="selectItem' + name + '"';
 
 
 
 
176
 
177
- if (!this.options.keepOpen) {
178
- $(document).click(function (e) {
179
- if ($(e.target)[0] === that.$choice[0] ||
180
- $(e.target).parents('.ms-choice')[0] === that.$choice[0]) {
181
- return;
182
- }
183
- if (($(e.target)[0] === that.$drop[0] ||
184
- $(e.target).parents('.ms-drop')[0] !== that.$drop[0] && e.target !== $el[0]) &&
185
- that.options.isOpen) {
186
- that.close();
187
- }
188
- });
189
  }
190
- }
191
 
192
- MultipleSelect.prototype = {
193
- constructor: MultipleSelect,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
 
195
- init: function () {
196
- var that = this,
197
- $ul = $('<ul></ul>');
198
 
199
- this.$drop.html('');
 
 
200
 
201
- if (this.options.filter) {
202
- this.$drop.append([
203
- '<div class="ms-search">',
204
- '<input type="text" autocomplete="off" autocorrect="off" autocapitilize="off" spellcheck="false">',
205
- '</div>'].join('')
206
- );
207
  }
208
 
209
- if (this.options.selectAll && !this.options.single) {
210
- $ul.append([
211
- '<li class="ms-select-all">',
212
- '<label>',
213
- sprintf('<input type="checkbox" %s /> ', this.selectAllName),
214
- this.options.selectAllDelimiter[0],
215
- this.options.selectAllText,
216
- this.options.selectAllDelimiter[1],
217
- '</label>',
218
- '</li>'
219
- ].join(''));
220
  }
 
221
 
222
- $.each(this.$el.children(), function (i, elm) {
223
- $ul.append(that.optionToHtml(i, elm));
224
- });
225
- $ul.append(sprintf('<li class="ms-no-results">%s</li>', this.options.noMatchesFound));
226
- this.$drop.append($ul);
227
-
228
- this.$drop.find('ul').css('max-height', this.options.maxHeight + 'px');
229
- this.$drop.find('.multiple').css('width', this.options.multipleWidth + 'px');
230
-
231
- this.$searchInput = this.$drop.find('.ms-search input');
232
- this.$selectAll = this.$drop.find('input[' + this.selectAllName + ']');
233
- this.$selectGroups = this.$drop.find('input[' + this.selectGroupName + ']');
234
- this.$selectItems = this.$drop.find('input[' + this.selectItemName + ']:enabled');
235
- this.$disableItems = this.$drop.find('input[' + this.selectItemName + ']:disabled');
236
- this.$noResults = this.$drop.find('.ms-no-results');
237
-
238
- this.events();
239
- this.updateSelectAll(true);
240
- this.update(true);
241
-
242
- if (this.options.isOpen) {
243
- this.open();
244
- }
245
- },
246
-
247
- optionToHtml: function (i, elm, group, groupDisabled) {
248
- var that = this,
249
- $elm = $(elm),
250
- classes = $elm.attr('class') || '',
251
- title = sprintf('title="%s"', $elm.attr('title')),
252
- multiple = this.options.multiple ? 'multiple' : '',
253
- disabled,
254
- type = this.options.single ? 'radio' : 'checkbox';
255
-
256
- if ($elm.is('option')) {
257
- var value = $elm.val(),
258
- text = that.options.textTemplate($elm),
259
- selected = $elm.prop('selected'),
260
- style = sprintf('style="%s"', this.options.styler(value)),
261
- $el;
262
-
263
- disabled = groupDisabled || $elm.prop('disabled');
264
-
265
- $el = $([
266
- sprintf('<li class="%s %s" %s %s>', multiple, classes, title, style),
267
- sprintf('<label class="%s">', disabled ? 'disabled' : ''),
268
- sprintf('<input type="%s" %s%s%s%s>',
269
- type, this.selectItemName,
270
- selected ? ' checked="checked"' : '',
271
- disabled ? ' disabled="disabled"' : '',
272
- sprintf(' data-group="%s"', group)),
273
- sprintf('<span>%s</span>', text),
274
- '</label>',
275
- '</li>'
276
- ].join(''));
277
- $el.find('input').val(value);
278
- return $el;
279
- }
280
- if ($elm.is('optgroup')) {
281
- var label = that.options.labelTemplate($elm),
282
- $group = $('<div/>');
283
-
284
- group = 'group_' + i;
285
- disabled = $elm.prop('disabled');
286
-
287
- $group.append([
288
- '<li class="group">',
289
- sprintf('<label class="optgroup %s" data-group="%s">', disabled ? 'disabled' : '', group),
290
- this.options.hideOptgroupCheckboxes || this.options.single ? '' :
291
- sprintf('<input type="checkbox" %s %s>',
292
- this.selectGroupName, disabled ? 'disabled="disabled"' : ''),
293
- label,
294
- '</label>',
295
- '</li>'
296
- ].join(''));
297
-
298
- $.each($elm.children(), function (i, elm) {
299
- $group.append(that.optionToHtml(i, elm, group, disabled));
300
- });
301
- return $group.html();
302
- }
303
- },
304
-
305
- events: function () {
306
- var that = this,
307
- toggleOpen = function (e) {
308
- e.preventDefault();
309
- that[that.options.isOpen ? 'close' : 'open']();
310
- };
311
 
312
- if (this.$label) {
313
- this.$label.off('click').on('click', function (e) {
314
- if (e.target.nodeName.toLowerCase() !== 'label' || e.target !== this) {
315
- return;
316
- }
317
- toggleOpen(e);
318
- if (!that.options.filter || !that.options.isOpen) {
319
- that.focus();
320
- }
321
- e.stopPropagation(); // Causes lost focus otherwise
322
- });
323
  }
 
 
324
 
325
- this.$choice.off('click').on('click', toggleOpen)
326
- .off('focus').on('focus', this.options.onFocus)
327
- .off('blur').on('blur', this.options.onBlur);
 
 
 
 
 
 
328
 
329
- this.$parent.off('keydown').on('keydown', function (e) {
330
- switch (e.which) {
331
- case 27: // esc key
332
- that.close();
333
- that.$choice.focus();
334
- break;
335
- }
336
- });
337
 
338
- this.$searchInput.off('keydown').on('keydown',function (e) {
339
- // Ensure shift-tab causes lost focus from filter as with clicking away
340
- if (e.keyCode === 9 && e.shiftKey) {
341
- that.close();
342
- }
343
- }).off('keyup').on('keyup', function (e) {
344
- // enter or space
345
- // Avoid selecting/deselecting if no choices made
346
- if (that.options.filterAcceptOnEnter && (e.which === 13 || e.which == 32) && that.$searchInput.val()) {
347
- that.$selectAll.click();
348
- that.close();
349
- that.focus();
350
- return;
351
- }
352
- that.filter();
353
- });
354
 
355
- this.$selectAll.off('click').on('click', function () {
356
- var checked = $(this).prop('checked'),
357
- $items = that.$selectItems.filter(':visible');
358
-
359
- if ($items.length === that.$selectItems.length) {
360
- that[checked ? 'checkAll' : 'uncheckAll']();
361
- } else { // when the filter option is true
362
- that.$selectGroups.prop('checked', checked);
363
- $items.prop('checked', checked);
364
- that.options[checked ? 'onCheckAll' : 'onUncheckAll']();
365
- that.update();
366
- }
367
- });
368
- this.$selectGroups.off('click').on('click', function () {
369
- var group = $(this).parent().attr('data-group'),
370
- $items = that.$selectItems.filter(':visible'),
371
- $children = $items.filter(sprintf('[data-group="%s"]', group)),
372
- checked = $children.length !== $children.filter(':checked').length;
373
-
374
- $children.prop('checked', checked);
375
- that.updateSelectAll();
376
- that.update();
377
- that.options.onOptgroupClick({
378
- label: $(this).parent().text(),
379
- checked: checked,
380
- children: $children.get(),
381
- instance: that
382
- });
383
- });
384
- this.$selectItems.off('click').on('click', function () {
385
- that.updateSelectAll();
386
- that.update();
387
- that.updateOptGroupSelect();
388
- that.options.onClick({
389
- label: $(this).parent().text(),
390
- value: $(this).val(),
391
- checked: $(this).prop('checked'),
392
- instance: that
393
- });
394
-
395
- if (that.options.single && that.options.isOpen && !that.options.keepOpen) {
396
- that.close();
397
- }
398
 
399
- if (that.options.single) {
400
- var clickedVal = $(this).val();
401
- that.$selectItems.filter(function() {
402
- return $(this).val() !== clickedVal;
403
- }).each(function() {
404
- $(this).prop('checked', false);
405
- });
406
- that.update();
407
- }
408
- });
409
- },
410
-
411
- open: function () {
412
- if (this.$choice.hasClass('disabled')) {
413
- return;
414
- }
415
- this.options.isOpen = true;
416
- this.$choice.find('>div').addClass('open');
417
- this.$drop[this.animateMethod('show')]();
418
-
419
- // fix filter bug: no results show
420
- this.$selectAll.parent().show();
421
- this.$noResults.hide();
422
-
423
- // Fix #77: 'All selected' when no options
424
- if (!this.$el.children().length) {
425
- this.$selectAll.parent().hide();
426
- this.$noResults.show();
427
- }
428
-
429
- if (this.options.container) {
430
- var offset = this.$drop.offset();
431
- this.$drop.appendTo($(this.options.container));
432
- this.$drop.offset({
433
- top: offset.top,
434
- left: offset.left
435
- });
436
- }
437
-
438
- if (this.options.filter) {
439
- this.$searchInput.val('');
440
- this.$searchInput.focus();
441
- this.filter();
442
- }
443
- this.options.onOpen();
444
- },
445
-
446
- close: function () {
447
- this.options.isOpen = false;
448
- this.$choice.find('>div').removeClass('open');
449
- this.$drop[this.animateMethod('hide')]();
450
- if (this.options.container) {
451
- this.$parent.append(this.$drop);
452
- this.$drop.css({
453
- 'top': 'auto',
454
- 'left': 'auto'
455
- });
456
- }
457
- this.options.onClose();
458
- },
459
-
460
- animateMethod: function (method) {
461
- var methods = {
462
- show: {
463
- fade: 'fadeIn',
464
- slide: 'slideDown'
465
- },
466
- hide: {
467
- fade: 'fadeOut',
468
- slide: 'slideUp'
469
- }
470
- };
471
-
472
- return methods[method][this.options.animate] || method;
473
- },
474
-
475
- update: function (isInit) {
476
- var selects = this.options.displayValues ? this.getSelects() : this.getSelects('text'),
477
- $span = this.$choice.find('>span'),
478
- sl = selects.length;
479
-
480
- if (sl === 0) {
481
- $span.addClass('placeholder').html(this.options.placeholder);
482
- } else if (this.options.allSelected && sl === this.$selectItems.length + this.$disableItems.length) {
483
- $span.removeClass('placeholder').html(this.options.allSelected);
484
- } else if (this.options.ellipsis && sl > this.options.minimumCountSelected) {
485
- $span.removeClass('placeholder').text(selects.slice(0, this.options.minimumCountSelected)
486
- .join(this.options.delimiter) + '...');
487
- } else if (this.options.countSelected && sl > this.options.minimumCountSelected) {
488
- $span.removeClass('placeholder').html(this.options.countSelected
489
- .replace('#', selects.length)
490
- .replace('%', this.$selectItems.length + this.$disableItems.length));
491
- } else {
492
- $span.removeClass('placeholder').text(selects.join(this.options.delimiter));
493
  }
494
 
495
- if (this.options.addTitle) {
496
- $span.prop('title', this.getSelects('text'));
 
 
497
  }
498
 
499
- // set selects to select
500
- this.$el.val(this.getSelects()).trigger('change');
 
 
 
 
 
 
 
501
 
502
- // add selected class to selected li
503
- this.$drop.find('li').removeClass('selected');
504
- this.$drop.find('input:checked').each(function () {
505
- $(this).parents('li').first().addClass('selected');
506
- });
 
 
507
 
508
- // trigger <select> change event
509
- if (!isInit) {
510
- this.$el.trigger('change');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  }
512
- },
513
 
514
- updateSelectAll: function (isInit) {
515
- var $items = this.$selectItems;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
 
517
- if (!isInit) {
518
- $items = $items.filter(':visible');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
  }
520
- this.$selectAll.prop('checked', $items.length &&
521
- $items.length === $items.filter(':checked').length);
522
- if (!isInit && this.$selectAll.prop('checked')) {
523
- this.options.onCheckAll();
 
 
 
 
524
  }
525
- },
 
 
 
 
 
526
 
527
- updateOptGroupSelect: function () {
528
- var $items = this.$selectItems.filter(':visible');
529
- $.each(this.$selectGroups, function (i, val) {
530
- var group = $(val).parent().attr('data-group'),
531
- $children = $items.filter(sprintf('[data-group="%s"]', group));
532
- $(val).prop('checked', $children.length &&
533
- $children.length === $children.filter(':checked').length);
534
- });
535
- },
536
-
537
- //value or text, default: 'value'
538
- getSelects: function (type) {
539
- var that = this,
540
- texts = [],
541
- values = [];
542
- this.$drop.find(sprintf('input[%s]:checked', this.selectItemName)).each(function () {
543
- texts.push($(this).parents('li').first().text());
544
- values.push($(this).val());
545
- });
546
 
547
- if (type === 'text' && this.$selectGroups.length) {
548
- texts = [];
549
- this.$selectGroups.each(function () {
550
- var html = [],
551
- text = $.trim($(this).parent().text()),
552
- group = $(this).parent().data('group'),
553
- $children = that.$drop.find(sprintf('[%s][data-group="%s"]', that.selectItemName, group)),
554
- $selected = $children.filter(':checked');
555
-
556
- if (!$selected.length) {
557
- return;
558
- }
559
 
560
- html.push('[');
561
- html.push(text);
562
- if ($children.length > $selected.length) {
563
- var list = [];
564
- $selected.each(function () {
565
- list.push($(this).parent().text());
566
- });
567
- html.push(': ' + list.join(', '));
568
- }
569
- html.push(']');
570
- texts.push(html.join(''));
571
- });
572
- }
573
- return type === 'text' ? texts : values;
574
- },
575
-
576
- setSelects: function (values) {
577
- var that = this;
578
- this.$selectItems.prop('checked', false);
579
- this.$disableItems.prop('checked', false);
580
- $.each(values, function (i, value) {
581
- that.$selectItems.filter(sprintf('[value="%s"]', value)).prop('checked', true);
582
- that.$disableItems.filter(sprintf('[value="%s"]', value)).prop('checked', true);
583
- });
584
- this.$selectAll.prop('checked', this.$selectItems.length ===
585
- this.$selectItems.filter(':checked').length + this.$disableItems.filter(':checked').length);
586
-
587
- $.each(that.$selectGroups, function (i, val) {
588
- var group = $(val).parent().attr('data-group'),
589
- $children = that.$selectItems.filter('[data-group="' + group + '"]');
590
- $(val).prop('checked', $children.length &&
591
- $children.length === $children.filter(':checked').length);
592
- });
593
 
594
- this.update();
595
- },
 
596
 
597
- enable: function () {
598
- this.$choice.removeClass('disabled');
599
- },
600
 
601
- disable: function () {
602
- this.$choice.addClass('disabled');
603
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
 
605
- checkAll: function () {
606
- this.$selectItems.prop('checked', true);
607
- this.$selectGroups.prop('checked', true);
608
- this.$selectAll.prop('checked', true);
609
- this.update();
610
- this.options.onCheckAll();
611
- },
612
 
613
- uncheckAll: function () {
614
- this.$selectItems.prop('checked', false);
615
- this.$selectGroups.prop('checked', false);
616
- this.$selectAll.prop('checked', false);
617
- this.update();
618
- this.options.onUncheckAll();
619
- },
620
-
621
- focus: function () {
622
- this.$choice.focus();
623
- this.options.onFocus();
624
- },
625
-
626
- blur: function () {
627
- this.$choice.blur();
628
- this.options.onBlur();
629
- },
630
-
631
- refresh: function () {
632
- this.init();
633
- },
634
-
635
- filter: function () {
636
- var that = this,
637
- text = $.trim(this.$searchInput.val()).toLowerCase();
638
-
639
- if (text.length === 0) {
640
- this.$selectAll.parent().show();
641
- this.$selectItems.parent().show();
642
- this.$disableItems.parent().show();
643
- this.$selectGroups.parent().show();
644
- this.$noResults.hide();
645
  } else {
646
- this.$selectItems.each(function () {
647
- var $parent = $(this).parent();
648
- $parent[removeDiacritics($parent.text().toLowerCase()).indexOf(removeDiacritics(text)) < 0 ? 'hide' : 'show']();
649
- });
650
- this.$disableItems.parent().hide();
651
- this.$selectGroups.each(function () {
652
- var $parent = $(this).parent();
653
- var group = $parent.attr('data-group'),
654
- $items = that.$selectItems.filter(':visible');
655
- $parent[$items.filter(sprintf('[data-group="%s"]', group)).length ? 'show' : 'hide']();
656
- });
657
-
658
- //Check if no matches found
659
- if (this.$selectItems.parent().filter(':visible').length) {
660
- this.$selectAll.parent().show();
661
- this.$noResults.hide();
662
- } else {
663
- this.$selectAll.parent().hide();
664
- this.$noResults.show();
665
- }
666
  }
667
- this.updateOptGroupSelect();
668
- this.updateSelectAll();
669
- this.options.onFilter(text);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
670
  }
671
- };
672
 
673
- $.fn.multipleSelect = function () {
674
- var option = arguments[0],
675
- args = arguments,
676
-
677
- value,
678
- allowedMethods = [
679
- 'getSelects', 'setSelects',
680
- 'enable', 'disable',
681
- 'open', 'close',
682
- 'checkAll', 'uncheckAll',
683
- 'focus', 'blur',
684
- 'refresh', 'close'
685
- ];
686
-
687
- this.each(function () {
688
- var $this = $(this),
689
- data = $this.data('multipleSelect'),
690
- options = $.extend({}, $.fn.multipleSelect.defaults,
691
- $this.data(), typeof option === 'object' && option);
692
-
693
- if (!data) {
694
- data = new MultipleSelect($this, options);
695
- $this.data('multipleSelect', data);
696
- }
697
-
698
- if (typeof option === 'string') {
699
- if ($.inArray(option, allowedMethods) < 0) {
700
- throw 'Unknown method: ' + option;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
  }
702
- value = data[option](args[1]);
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  } else {
704
- data.init();
705
- if (args[1]) {
706
- value = data[args[1]].apply(data, [].slice.call(args, 2));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
  }
709
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
 
711
- return typeof value !== 'undefined' ? value : this;
712
- };
 
713
 
714
- $.fn.multipleSelect.defaults = {
715
- name: '',
716
- isOpen: false,
717
- placeholder: '',
718
- selectAll: true,
719
- selectAllDelimiter: ['[', ']'],
720
- minimumCountSelected: 3,
721
- ellipsis: false,
722
- multiple: false,
723
- multipleWidth: 80,
724
- single: false,
725
- filter: false,
726
- width: undefined,
727
- dropWidth: undefined,
728
- maxHeight: 250,
729
- container: null,
730
- position: 'bottom',
731
- keepOpen: false,
732
- animate: 'none', // 'none', 'fade', 'slide'
733
- displayValues: false,
734
- delimiter: ', ',
735
- addTitle: false,
736
- filterAcceptOnEnter: false,
737
- hideOptgroupCheckboxes: false,
738
-
739
- selectAllText: 'Select all',
740
- allSelected: 'All selected',
741
- countSelected: '# of % selected',
742
- noMatchesFound: 'No matches found',
743
-
744
- styler: function () {
745
- return false;
746
- },
747
- textTemplate: function ($elm) {
748
- return $elm.html();
749
- },
750
- labelTemplate: function ($elm) {
751
- return $elm.attr('label');
752
- },
753
-
754
- onOpen: function () {
755
- return false;
756
- },
757
- onClose: function () {
758
- return false;
759
- },
760
- onCheckAll: function () {
761
- return false;
762
- },
763
- onUncheckAll: function () {
764
- return false;
765
- },
766
- onFocus: function () {
767
- return false;
768
- },
769
- onBlur: function () {
770
- return false;
771
- },
772
- onOptgroupClick: function () {
773
- return false;
774
- },
775
- onClick: function () {
776
- return false;
777
- },
778
- onFilter: function () {
779
- return false;
780
  }
781
- };
782
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
3
+ typeof define === 'function' && define.amd ? define(['jquery'], factory) :
4
+ (global = global || self, factory(global.jQuery));
5
+ }(this, function ($) { 'use strict';
 
6
 
7
+ $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
8
 
9
+ function _typeof(obj) {
10
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
11
+ _typeof = function (obj) {
12
+ return typeof obj;
13
+ };
14
+ } else {
15
+ _typeof = function (obj) {
16
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
17
+ };
18
+ }
19
+
20
+ return _typeof(obj);
21
+ }
22
+
23
+ function _classCallCheck(instance, Constructor) {
24
+ if (!(instance instanceof Constructor)) {
25
+ throw new TypeError("Cannot call a class as a function");
26
+ }
27
+ }
28
+
29
+ function _defineProperties(target, props) {
30
+ for (var i = 0; i < props.length; i++) {
31
+ var descriptor = props[i];
32
+ descriptor.enumerable = descriptor.enumerable || false;
33
+ descriptor.configurable = true;
34
+ if ("value" in descriptor) descriptor.writable = true;
35
+ Object.defineProperty(target, descriptor.key, descriptor);
36
+ }
37
+ }
38
+
39
+ function _createClass(Constructor, protoProps, staticProps) {
40
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
41
+ if (staticProps) _defineProperties(Constructor, staticProps);
42
+ return Constructor;
43
+ }
44
+
45
+ function _slicedToArray(arr, i) {
46
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
47
+ }
48
+
49
+ function _toConsumableArray(arr) {
50
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
51
+ }
52
+
53
+ function _arrayWithoutHoles(arr) {
54
+ if (Array.isArray(arr)) {
55
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
56
+
57
+ return arr2;
58
+ }
59
+ }
60
+
61
+ function _arrayWithHoles(arr) {
62
+ if (Array.isArray(arr)) return arr;
63
+ }
64
+
65
+ function _iterableToArray(iter) {
66
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
67
+ }
68
+
69
+ function _iterableToArrayLimit(arr, i) {
70
+ if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
71
+ return;
72
+ }
73
+
74
+ var _arr = [];
75
+ var _n = true;
76
+ var _d = false;
77
+ var _e = undefined;
78
+
79
+ try {
80
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
81
+ _arr.push(_s.value);
82
+
83
+ if (i && _arr.length === i) break;
84
+ }
85
+ } catch (err) {
86
+ _d = true;
87
+ _e = err;
88
+ } finally {
89
+ try {
90
+ if (!_n && _i["return"] != null) _i["return"]();
91
+ } finally {
92
+ if (_d) throw _e;
93
+ }
94
+ }
95
+
96
+ return _arr;
97
+ }
98
+
99
+ function _nonIterableSpread() {
100
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
101
+ }
102
+
103
+ function _nonIterableRest() {
104
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
105
+ }
106
+
107
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
108
+
109
+ function createCommonjsModule(fn, module) {
110
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
111
+ }
112
+
113
+ var O = 'object';
114
+ var check = function (it) {
115
+ return it && it.Math == Math && it;
116
+ };
117
+
118
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
119
+ var global_1 =
120
+ // eslint-disable-next-line no-undef
121
+ check(typeof globalThis == O && globalThis) ||
122
+ check(typeof window == O && window) ||
123
+ check(typeof self == O && self) ||
124
+ check(typeof commonjsGlobal == O && commonjsGlobal) ||
125
+ // eslint-disable-next-line no-new-func
126
+ Function('return this')();
127
+
128
+ var fails = function (exec) {
129
+ try {
130
+ return !!exec();
131
+ } catch (error) {
132
+ return true;
133
+ }
134
+ };
135
+
136
+ // Thank's IE8 for his funny defineProperty
137
+ var descriptors = !fails(function () {
138
+ return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
139
+ });
140
+
141
+ var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
142
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
143
+
144
+ // Nashorn ~ JDK8 bug
145
+ var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
146
+
147
+ // `Object.prototype.propertyIsEnumerable` method implementation
148
+ // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
149
+ var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
150
+ var descriptor = getOwnPropertyDescriptor(this, V);
151
+ return !!descriptor && descriptor.enumerable;
152
+ } : nativePropertyIsEnumerable;
153
+
154
+ var objectPropertyIsEnumerable = {
155
+ f: f
156
+ };
157
+
158
+ var createPropertyDescriptor = function (bitmap, value) {
159
+ return {
160
+ enumerable: !(bitmap & 1),
161
+ configurable: !(bitmap & 2),
162
+ writable: !(bitmap & 4),
163
+ value: value
164
+ };
165
+ };
166
+
167
+ var toString = {}.toString;
168
+
169
+ var classofRaw = function (it) {
170
+ return toString.call(it).slice(8, -1);
171
+ };
172
+
173
+ var split = ''.split;
174
+
175
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
176
+ var indexedObject = fails(function () {
177
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
178
+ // eslint-disable-next-line no-prototype-builtins
179
+ return !Object('z').propertyIsEnumerable(0);
180
+ }) ? function (it) {
181
+ return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
182
+ } : Object;
183
+
184
+ // `RequireObjectCoercible` abstract operation
185
+ // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
186
+ var requireObjectCoercible = function (it) {
187
+ if (it == undefined) throw TypeError("Can't call method on " + it);
188
+ return it;
189
+ };
190
+
191
+ // toObject with fallback for non-array-like ES3 strings
192
+
193
+
194
+
195
+ var toIndexedObject = function (it) {
196
+ return indexedObject(requireObjectCoercible(it));
197
+ };
198
+
199
+ var isObject = function (it) {
200
+ return typeof it === 'object' ? it !== null : typeof it === 'function';
201
+ };
202
+
203
+ // `ToPrimitive` abstract operation
204
+ // https://tc39.github.io/ecma262/#sec-toprimitive
205
+ // instead of the ES6 spec version, we didn't implement @@toPrimitive case
206
+ // and the second argument - flag - preferred type is a string
207
+ var toPrimitive = function (input, PREFERRED_STRING) {
208
+ if (!isObject(input)) return input;
209
+ var fn, val;
210
+ if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
211
+ if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
212
+ if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
213
+ throw TypeError("Can't convert object to primitive value");
214
+ };
215
+
216
+ var hasOwnProperty = {}.hasOwnProperty;
217
+
218
+ var has = function (it, key) {
219
+ return hasOwnProperty.call(it, key);
220
+ };
221
+
222
+ var document$1 = global_1.document;
223
+ // typeof document.createElement is 'object' in old IE
224
+ var EXISTS = isObject(document$1) && isObject(document$1.createElement);
225
+
226
+ var documentCreateElement = function (it) {
227
+ return EXISTS ? document$1.createElement(it) : {};
228
+ };
229
+
230
+ // Thank's IE8 for his funny defineProperty
231
+ var ie8DomDefine = !descriptors && !fails(function () {
232
+ return Object.defineProperty(documentCreateElement('div'), 'a', {
233
+ get: function () { return 7; }
234
+ }).a != 7;
235
+ });
236
+
237
+ var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
238
+
239
+ // `Object.getOwnPropertyDescriptor` method
240
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
241
+ var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
242
+ O = toIndexedObject(O);
243
+ P = toPrimitive(P, true);
244
+ if (ie8DomDefine) try {
245
+ return nativeGetOwnPropertyDescriptor(O, P);
246
+ } catch (error) { /* empty */ }
247
+ if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
248
+ };
249
+
250
+ var objectGetOwnPropertyDescriptor = {
251
+ f: f$1
252
+ };
253
+
254
+ var anObject = function (it) {
255
+ if (!isObject(it)) {
256
+ throw TypeError(String(it) + ' is not an object');
257
+ } return it;
258
+ };
259
+
260
+ var nativeDefineProperty = Object.defineProperty;
261
+
262
+ // `Object.defineProperty` method
263
+ // https://tc39.github.io/ecma262/#sec-object.defineproperty
264
+ var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
265
+ anObject(O);
266
+ P = toPrimitive(P, true);
267
+ anObject(Attributes);
268
+ if (ie8DomDefine) try {
269
+ return nativeDefineProperty(O, P, Attributes);
270
+ } catch (error) { /* empty */ }
271
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
272
+ if ('value' in Attributes) O[P] = Attributes.value;
273
+ return O;
274
+ };
275
+
276
+ var objectDefineProperty = {
277
+ f: f$2
278
+ };
279
+
280
+ var hide = descriptors ? function (object, key, value) {
281
+ return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
282
+ } : function (object, key, value) {
283
+ object[key] = value;
284
+ return object;
285
+ };
286
+
287
+ var setGlobal = function (key, value) {
288
+ try {
289
+ hide(global_1, key, value);
290
+ } catch (error) {
291
+ global_1[key] = value;
292
+ } return value;
293
+ };
294
+
295
+ var shared = createCommonjsModule(function (module) {
296
+ var SHARED = '__core-js_shared__';
297
+ var store = global_1[SHARED] || setGlobal(SHARED, {});
298
+
299
+ (module.exports = function (key, value) {
300
+ return store[key] || (store[key] = value !== undefined ? value : {});
301
+ })('versions', []).push({
302
+ version: '3.2.1',
303
+ mode: 'global',
304
+ copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
305
+ });
306
+ });
307
+
308
+ var functionToString = shared('native-function-to-string', Function.toString);
309
+
310
+ var WeakMap = global_1.WeakMap;
311
+
312
+ var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
313
+
314
+ var id = 0;
315
+ var postfix = Math.random();
316
+
317
+ var uid = function (key) {
318
+ return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
319
+ };
320
+
321
+ var keys = shared('keys');
322
+
323
+ var sharedKey = function (key) {
324
+ return keys[key] || (keys[key] = uid(key));
325
+ };
326
+
327
+ var hiddenKeys = {};
328
+
329
+ var WeakMap$1 = global_1.WeakMap;
330
+ var set, get, has$1;
331
+
332
+ var enforce = function (it) {
333
+ return has$1(it) ? get(it) : set(it, {});
334
+ };
335
+
336
+ var getterFor = function (TYPE) {
337
+ return function (it) {
338
+ var state;
339
+ if (!isObject(it) || (state = get(it)).type !== TYPE) {
340
+ throw TypeError('Incompatible receiver, ' + TYPE + ' required');
341
+ } return state;
342
+ };
343
+ };
344
+
345
+ if (nativeWeakMap) {
346
+ var store = new WeakMap$1();
347
+ var wmget = store.get;
348
+ var wmhas = store.has;
349
+ var wmset = store.set;
350
+ set = function (it, metadata) {
351
+ wmset.call(store, it, metadata);
352
+ return metadata;
353
+ };
354
+ get = function (it) {
355
+ return wmget.call(store, it) || {};
356
+ };
357
+ has$1 = function (it) {
358
+ return wmhas.call(store, it);
359
+ };
360
+ } else {
361
+ var STATE = sharedKey('state');
362
+ hiddenKeys[STATE] = true;
363
+ set = function (it, metadata) {
364
+ hide(it, STATE, metadata);
365
+ return metadata;
366
+ };
367
+ get = function (it) {
368
+ return has(it, STATE) ? it[STATE] : {};
369
+ };
370
+ has$1 = function (it) {
371
+ return has(it, STATE);
372
+ };
373
+ }
374
+
375
+ var internalState = {
376
+ set: set,
377
+ get: get,
378
+ has: has$1,
379
+ enforce: enforce,
380
+ getterFor: getterFor
381
+ };
382
+
383
+ var redefine = createCommonjsModule(function (module) {
384
+ var getInternalState = internalState.get;
385
+ var enforceInternalState = internalState.enforce;
386
+ var TEMPLATE = String(functionToString).split('toString');
387
+
388
+ shared('inspectSource', function (it) {
389
+ return functionToString.call(it);
390
+ });
391
+
392
+ (module.exports = function (O, key, value, options) {
393
+ var unsafe = options ? !!options.unsafe : false;
394
+ var simple = options ? !!options.enumerable : false;
395
+ var noTargetGet = options ? !!options.noTargetGet : false;
396
+ if (typeof value == 'function') {
397
+ if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
398
+ enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
399
+ }
400
+ if (O === global_1) {
401
+ if (simple) O[key] = value;
402
+ else setGlobal(key, value);
403
+ return;
404
+ } else if (!unsafe) {
405
+ delete O[key];
406
+ } else if (!noTargetGet && O[key]) {
407
+ simple = true;
408
+ }
409
+ if (simple) O[key] = value;
410
+ else hide(O, key, value);
411
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
412
+ })(Function.prototype, 'toString', function toString() {
413
+ return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
414
+ });
415
+ });
416
+
417
+ var path = global_1;
418
+
419
+ var aFunction = function (variable) {
420
+ return typeof variable == 'function' ? variable : undefined;
421
+ };
422
+
423
+ var getBuiltIn = function (namespace, method) {
424
+ return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
425
+ : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
426
+ };
427
+
428
+ var ceil = Math.ceil;
429
+ var floor = Math.floor;
430
+
431
+ // `ToInteger` abstract operation
432
+ // https://tc39.github.io/ecma262/#sec-tointeger
433
+ var toInteger = function (argument) {
434
+ return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
435
+ };
436
+
437
+ var min = Math.min;
438
+
439
+ // `ToLength` abstract operation
440
+ // https://tc39.github.io/ecma262/#sec-tolength
441
+ var toLength = function (argument) {
442
+ return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
443
+ };
444
+
445
+ var max = Math.max;
446
+ var min$1 = Math.min;
447
+
448
+ // Helper for a popular repeating case of the spec:
449
+ // Let integer be ? ToInteger(index).
450
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
451
+ var toAbsoluteIndex = function (index, length) {
452
+ var integer = toInteger(index);
453
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
454
+ };
455
+
456
+ // `Array.prototype.{ indexOf, includes }` methods implementation
457
+ var createMethod = function (IS_INCLUDES) {
458
+ return function ($this, el, fromIndex) {
459
+ var O = toIndexedObject($this);
460
+ var length = toLength(O.length);
461
+ var index = toAbsoluteIndex(fromIndex, length);
462
+ var value;
463
+ // Array#includes uses SameValueZero equality algorithm
464
+ // eslint-disable-next-line no-self-compare
465
+ if (IS_INCLUDES && el != el) while (length > index) {
466
+ value = O[index++];
467
+ // eslint-disable-next-line no-self-compare
468
+ if (value != value) return true;
469
+ // Array#indexOf ignores holes, Array#includes - not
470
+ } else for (;length > index; index++) {
471
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
472
+ } return !IS_INCLUDES && -1;
473
+ };
474
+ };
475
+
476
+ var arrayIncludes = {
477
+ // `Array.prototype.includes` method
478
+ // https://tc39.github.io/ecma262/#sec-array.prototype.includes
479
+ includes: createMethod(true),
480
+ // `Array.prototype.indexOf` method
481
+ // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
482
+ indexOf: createMethod(false)
483
+ };
484
+
485
+ var indexOf = arrayIncludes.indexOf;
486
+
487
+
488
+ var objectKeysInternal = function (object, names) {
489
+ var O = toIndexedObject(object);
490
+ var i = 0;
491
+ var result = [];
492
+ var key;
493
+ for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
494
+ // Don't enum bug & hidden keys
495
+ while (names.length > i) if (has(O, key = names[i++])) {
496
+ ~indexOf(result, key) || result.push(key);
497
+ }
498
+ return result;
499
+ };
500
+
501
+ // IE8- don't enum bug keys
502
+ var enumBugKeys = [
503
+ 'constructor',
504
+ 'hasOwnProperty',
505
+ 'isPrototypeOf',
506
+ 'propertyIsEnumerable',
507
+ 'toLocaleString',
508
+ 'toString',
509
+ 'valueOf'
510
+ ];
511
+
512
+ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
513
+
514
+ // `Object.getOwnPropertyNames` method
515
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
516
+ var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
517
+ return objectKeysInternal(O, hiddenKeys$1);
518
+ };
519
+
520
+ var objectGetOwnPropertyNames = {
521
+ f: f$3
522
+ };
523
+
524
+ var f$4 = Object.getOwnPropertySymbols;
525
+
526
+ var objectGetOwnPropertySymbols = {
527
+ f: f$4
528
+ };
529
+
530
+ // all object keys, includes non-enumerable and symbols
531
+ var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
532
+ var keys = objectGetOwnPropertyNames.f(anObject(it));
533
+ var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
534
+ return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
535
+ };
536
+
537
+ var copyConstructorProperties = function (target, source) {
538
+ var keys = ownKeys(source);
539
+ var defineProperty = objectDefineProperty.f;
540
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
541
+ for (var i = 0; i < keys.length; i++) {
542
+ var key = keys[i];
543
+ if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
544
+ }
545
+ };
546
+
547
+ var replacement = /#|\.prototype\./;
548
+
549
+ var isForced = function (feature, detection) {
550
+ var value = data[normalize(feature)];
551
+ return value == POLYFILL ? true
552
+ : value == NATIVE ? false
553
+ : typeof detection == 'function' ? fails(detection)
554
+ : !!detection;
555
+ };
556
+
557
+ var normalize = isForced.normalize = function (string) {
558
+ return String(string).replace(replacement, '.').toLowerCase();
559
+ };
560
+
561
+ var data = isForced.data = {};
562
+ var NATIVE = isForced.NATIVE = 'N';
563
+ var POLYFILL = isForced.POLYFILL = 'P';
564
+
565
+ var isForced_1 = isForced;
566
+
567
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
568
+
569
+
570
+
571
+
572
+
573
+
574
+ /*
575
+ options.target - name of the target object
576
+ options.global - target is the global object
577
+ options.stat - export as static methods of target
578
+ options.proto - export as prototype methods of target
579
+ options.real - real prototype method for the `pure` version
580
+ options.forced - export even if the native feature is available
581
+ options.bind - bind methods to the target, required for the `pure` version
582
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
583
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
584
+ options.sham - add a flag to not completely full polyfills
585
+ options.enumerable - export as enumerable property
586
+ options.noTargetGet - prevent calling a getter on target
587
+ */
588
+ var _export = function (options, source) {
589
+ var TARGET = options.target;
590
+ var GLOBAL = options.global;
591
+ var STATIC = options.stat;
592
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
593
+ if (GLOBAL) {
594
+ target = global_1;
595
+ } else if (STATIC) {
596
+ target = global_1[TARGET] || setGlobal(TARGET, {});
597
+ } else {
598
+ target = (global_1[TARGET] || {}).prototype;
599
+ }
600
+ if (target) for (key in source) {
601
+ sourceProperty = source[key];
602
+ if (options.noTargetGet) {
603
+ descriptor = getOwnPropertyDescriptor$1(target, key);
604
+ targetProperty = descriptor && descriptor.value;
605
+ } else targetProperty = target[key];
606
+ FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
607
+ // contained in target
608
+ if (!FORCED && targetProperty !== undefined) {
609
+ if (typeof sourceProperty === typeof targetProperty) continue;
610
+ copyConstructorProperties(sourceProperty, targetProperty);
611
+ }
612
+ // add a flag to not completely full polyfills
613
+ if (options.sham || (targetProperty && targetProperty.sham)) {
614
+ hide(sourceProperty, 'sham', true);
615
+ }
616
+ // extend global
617
+ redefine(target, key, sourceProperty, options);
618
+ }
619
+ };
620
+
621
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
622
+ // Chrome 38 Symbol has incorrect toString conversion
623
+ // eslint-disable-next-line no-undef
624
+ return !String(Symbol());
625
+ });
626
+
627
+ var Symbol$1 = global_1.Symbol;
628
+ var store$1 = shared('wks');
629
+
630
+ var wellKnownSymbol = function (name) {
631
+ return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
632
+ || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
633
+ };
634
+
635
+ // `Object.keys` method
636
+ // https://tc39.github.io/ecma262/#sec-object.keys
637
+ var objectKeys = Object.keys || function keys(O) {
638
+ return objectKeysInternal(O, enumBugKeys);
639
+ };
640
+
641
+ // `Object.defineProperties` method
642
+ // https://tc39.github.io/ecma262/#sec-object.defineproperties
643
+ var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
644
+ anObject(O);
645
+ var keys = objectKeys(Properties);
646
+ var length = keys.length;
647
+ var index = 0;
648
+ var key;
649
+ while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
650
+ return O;
651
+ };
652
+
653
+ var html = getBuiltIn('document', 'documentElement');
654
+
655
+ var IE_PROTO = sharedKey('IE_PROTO');
656
+
657
+ var PROTOTYPE = 'prototype';
658
+ var Empty = function () { /* empty */ };
659
+
660
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
661
+ var createDict = function () {
662
+ // Thrash, waste and sodomy: IE GC bug
663
+ var iframe = documentCreateElement('iframe');
664
+ var length = enumBugKeys.length;
665
+ var lt = '<';
666
+ var script = 'script';
667
+ var gt = '>';
668
+ var js = 'java' + script + ':';
669
+ var iframeDocument;
670
+ iframe.style.display = 'none';
671
+ html.appendChild(iframe);
672
+ iframe.src = String(js);
673
+ iframeDocument = iframe.contentWindow.document;
674
+ iframeDocument.open();
675
+ iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
676
+ iframeDocument.close();
677
+ createDict = iframeDocument.F;
678
+ while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
679
+ return createDict();
680
+ };
681
+
682
+ // `Object.create` method
683
+ // https://tc39.github.io/ecma262/#sec-object.create
684
+ var objectCreate = Object.create || function create(O, Properties) {
685
+ var result;
686
+ if (O !== null) {
687
+ Empty[PROTOTYPE] = anObject(O);
688
+ result = new Empty();
689
+ Empty[PROTOTYPE] = null;
690
+ // add "__proto__" for Object.getPrototypeOf polyfill
691
+ result[IE_PROTO] = O;
692
+ } else result = createDict();
693
+ return Properties === undefined ? result : objectDefineProperties(result, Properties);
694
+ };
695
+
696
+ hiddenKeys[IE_PROTO] = true;
697
+
698
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
699
+ var ArrayPrototype = Array.prototype;
700
+
701
+ // Array.prototype[@@unscopables]
702
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
703
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
704
+ hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
705
+ }
706
+
707
+ // add a key to Array.prototype[@@unscopables]
708
+ var addToUnscopables = function (key) {
709
+ ArrayPrototype[UNSCOPABLES][key] = true;
710
+ };
711
+
712
+ var $includes = arrayIncludes.includes;
713
+
714
+
715
+ // `Array.prototype.includes` method
716
+ // https://tc39.github.io/ecma262/#sec-array.prototype.includes
717
+ _export({ target: 'Array', proto: true }, {
718
+ includes: function includes(el /* , fromIndex = 0 */) {
719
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
720
+ }
721
+ });
722
+
723
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
724
+ addToUnscopables('includes');
725
+
726
+ // `ToObject` abstract operation
727
+ // https://tc39.github.io/ecma262/#sec-toobject
728
+ var toObject = function (argument) {
729
+ return Object(requireObjectCoercible(argument));
730
+ };
731
+
732
+ var nativeAssign = Object.assign;
733
+
734
+ // `Object.assign` method
735
+ // https://tc39.github.io/ecma262/#sec-object.assign
736
+ // should work with symbols and should have deterministic property order (V8 bug)
737
+ var objectAssign = !nativeAssign || fails(function () {
738
+ var A = {};
739
+ var B = {};
740
+ // eslint-disable-next-line no-undef
741
+ var symbol = Symbol();
742
+ var alphabet = 'abcdefghijklmnopqrst';
743
+ A[symbol] = 7;
744
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
745
+ return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
746
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
747
+ var T = toObject(target);
748
+ var argumentsLength = arguments.length;
749
+ var index = 1;
750
+ var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
751
+ var propertyIsEnumerable = objectPropertyIsEnumerable.f;
752
+ while (argumentsLength > index) {
753
+ var S = indexedObject(arguments[index++]);
754
+ var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
755
+ var length = keys.length;
756
+ var j = 0;
757
+ var key;
758
+ while (length > j) {
759
+ key = keys[j++];
760
+ if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
761
+ }
762
+ } return T;
763
+ } : nativeAssign;
764
+
765
+ // `Object.assign` method
766
+ // https://tc39.github.io/ecma262/#sec-object.assign
767
+ _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
768
+ assign: objectAssign
769
+ });
770
+
771
+ var MATCH = wellKnownSymbol('match');
772
+
773
+ // `IsRegExp` abstract operation
774
+ // https://tc39.github.io/ecma262/#sec-isregexp
775
+ var isRegexp = function (it) {
776
+ var isRegExp;
777
+ return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
778
+ };
779
+
780
+ var notARegexp = function (it) {
781
+ if (isRegexp(it)) {
782
+ throw TypeError("The method doesn't accept regular expressions");
783
+ } return it;
784
+ };
785
+
786
+ var MATCH$1 = wellKnownSymbol('match');
787
+
788
+ var correctIsRegexpLogic = function (METHOD_NAME) {
789
+ var regexp = /./;
790
+ try {
791
+ '/./'[METHOD_NAME](regexp);
792
+ } catch (e) {
793
+ try {
794
+ regexp[MATCH$1] = false;
795
+ return '/./'[METHOD_NAME](regexp);
796
+ } catch (f) { /* empty */ }
797
+ } return false;
798
+ };
799
+
800
+ // `String.prototype.includes` method
801
+ // https://tc39.github.io/ecma262/#sec-string.prototype.includes
802
+ _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
803
+ includes: function includes(searchString /* , position = 0 */) {
804
+ return !!~String(requireObjectCoercible(this))
805
+ .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined);
806
+ }
807
+ });
808
+
809
+ // a string of all valid unicode whitespaces
810
+ // eslint-disable-next-line max-len
811
+ var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
812
+
813
+ var whitespace = '[' + whitespaces + ']';
814
+ var ltrim = RegExp('^' + whitespace + whitespace + '*');
815
+ var rtrim = RegExp(whitespace + whitespace + '*$');
816
+
817
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
818
+ var createMethod$1 = function (TYPE) {
819
+ return function ($this) {
820
+ var string = String(requireObjectCoercible($this));
821
+ if (TYPE & 1) string = string.replace(ltrim, '');
822
+ if (TYPE & 2) string = string.replace(rtrim, '');
823
+ return string;
824
+ };
825
+ };
826
+
827
+ var stringTrim = {
828
+ // `String.prototype.{ trimLeft, trimStart }` methods
829
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
830
+ start: createMethod$1(1),
831
+ // `String.prototype.{ trimRight, trimEnd }` methods
832
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
833
+ end: createMethod$1(2),
834
+ // `String.prototype.trim` method
835
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trim
836
+ trim: createMethod$1(3)
837
+ };
838
+
839
+ var non = '\u200B\u0085\u180E';
840
+
841
+ // check that a method works with the correct list
842
+ // of whitespaces and has a correct name
843
+ var forcedStringTrimMethod = function (METHOD_NAME) {
844
+ return fails(function () {
845
+ return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
846
+ });
847
+ };
848
+
849
+ var $trim = stringTrim.trim;
850
+
851
+
852
+ // `String.prototype.trim` method
853
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trim
854
+ _export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
855
+ trim: function trim() {
856
+ return $trim(this);
857
+ }
858
+ });
859
+
860
+ var VERSION = '1.5.2';
861
+ var BLOCK_ROWS = 50;
862
+ var CLUSTER_BLOCKS = 4;
863
+ var DEFAULTS = {
864
+ name: '',
865
+ placeholder: '',
866
+ data: undefined,
867
+ locale: undefined,
868
+ selectAll: true,
869
+ single: undefined,
870
+ singleRadio: false,
871
+ multiple: false,
872
+ hideOptgroupCheckboxes: false,
873
+ multipleWidth: 80,
874
+ width: undefined,
875
+ dropWidth: undefined,
876
+ maxHeight: 250,
877
+ maxHeightUnit: 'px',
878
+ position: 'bottom',
879
+ displayValues: false,
880
+ displayTitle: false,
881
+ displayDelimiter: ', ',
882
+ minimumCountSelected: 3,
883
+ ellipsis: false,
884
+ isOpen: false,
885
+ keepOpen: false,
886
+ openOnHover: false,
887
+ container: null,
888
+ filter: false,
889
+ filterGroup: false,
890
+ filterPlaceholder: '',
891
+ filterAcceptOnEnter: false,
892
+ filterByDataLength: undefined,
893
+ customFilter: function customFilter(label, text) {
894
+ // originalLabel, originalText
895
+ return label.includes(text);
896
+ },
897
+ showClear: false,
898
+ animate: undefined,
899
+ styler: function styler() {
900
+ return false;
901
+ },
902
+ textTemplate: function textTemplate($elm) {
903
+ return $elm[0].innerHTML.trim();
904
+ },
905
+ labelTemplate: function labelTemplate($elm) {
906
+ return $elm[0].getAttribute('label');
907
+ },
908
+ onOpen: function onOpen() {
909
+ return false;
910
+ },
911
+ onClose: function onClose() {
912
+ return false;
913
+ },
914
+ onCheckAll: function onCheckAll() {
915
+ return false;
916
+ },
917
+ onUncheckAll: function onUncheckAll() {
918
+ return false;
919
+ },
920
+ onFocus: function onFocus() {
921
+ return false;
922
+ },
923
+ onBlur: function onBlur() {
924
+ return false;
925
+ },
926
+ onOptgroupClick: function onOptgroupClick() {
927
+ return false;
928
+ },
929
+ onClick: function onClick() {
930
+ return false;
931
+ },
932
+ onFilter: function onFilter() {
933
+ return false;
934
+ },
935
+ onClear: function onClear() {
936
+ return false;
937
+ },
938
+ onAfterCreate: function onAfterCreate() {
939
+ return false;
940
+ }
941
+ };
942
+ var EN = {
943
+ formatSelectAll: function formatSelectAll() {
944
+ return '[Select all]';
945
+ },
946
+ formatAllSelected: function formatAllSelected() {
947
+ return 'All selected';
948
+ },
949
+ formatCountSelected: function formatCountSelected(count, total) {
950
+ return count + ' of ' + total + ' selected';
951
+ },
952
+ formatNoMatchesFound: function formatNoMatchesFound() {
953
+ return 'No matches found';
954
+ }
955
+ };
956
+ var METHODS = ['getOptions', 'refreshOptions', 'getSelects', 'setSelects', 'enable', 'disable', 'open', 'close', 'check', 'uncheck', 'checkAll', 'uncheckAll', 'checkInvert', 'focus', 'blur', 'refresh', 'destroy'];
957
+ Object.assign(DEFAULTS, EN);
958
+ var Constants = {
959
+ VERSION: VERSION,
960
+ BLOCK_ROWS: BLOCK_ROWS,
961
+ CLUSTER_BLOCKS: CLUSTER_BLOCKS,
962
+ DEFAULTS: DEFAULTS,
963
+ METHODS: METHODS,
964
+ LOCALES: {
965
+ en: EN,
966
+ 'en-US': EN
967
+ }
968
+ };
969
+
970
+ // `IsArray` abstract operation
971
+ // https://tc39.github.io/ecma262/#sec-isarray
972
+ var isArray = Array.isArray || function isArray(arg) {
973
+ return classofRaw(arg) == 'Array';
974
+ };
975
+
976
+ var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
977
+
978
+ var toString$1 = {}.toString;
979
+
980
+ var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
981
+ ? Object.getOwnPropertyNames(window) : [];
982
+
983
+ var getWindowNames = function (it) {
984
+ try {
985
+ return nativeGetOwnPropertyNames(it);
986
+ } catch (error) {
987
+ return windowNames.slice();
988
+ }
989
+ };
990
+
991
+ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
992
+ var f$5 = function getOwnPropertyNames(it) {
993
+ return windowNames && toString$1.call(it) == '[object Window]'
994
+ ? getWindowNames(it)
995
+ : nativeGetOwnPropertyNames(toIndexedObject(it));
996
+ };
997
+
998
+ var objectGetOwnPropertyNamesExternal = {
999
+ f: f$5
1000
+ };
1001
+
1002
+ var f$6 = wellKnownSymbol;
1003
+
1004
+ var wrappedWellKnownSymbol = {
1005
+ f: f$6
1006
+ };
1007
+
1008
+ var defineProperty = objectDefineProperty.f;
1009
+
1010
+ var defineWellKnownSymbol = function (NAME) {
1011
+ var Symbol = path.Symbol || (path.Symbol = {});
1012
+ if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
1013
+ value: wrappedWellKnownSymbol.f(NAME)
1014
+ });
1015
+ };
1016
+
1017
+ var defineProperty$1 = objectDefineProperty.f;
1018
+
1019
+
1020
+
1021
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1022
+
1023
+ var setToStringTag = function (it, TAG, STATIC) {
1024
+ if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
1025
+ defineProperty$1(it, TO_STRING_TAG, { configurable: true, value: TAG });
1026
+ }
1027
+ };
1028
+
1029
+ var aFunction$1 = function (it) {
1030
+ if (typeof it != 'function') {
1031
+ throw TypeError(String(it) + ' is not a function');
1032
+ } return it;
1033
+ };
1034
+
1035
+ // optional / simple context binding
1036
+ var bindContext = function (fn, that, length) {
1037
+ aFunction$1(fn);
1038
+ if (that === undefined) return fn;
1039
+ switch (length) {
1040
+ case 0: return function () {
1041
+ return fn.call(that);
1042
+ };
1043
+ case 1: return function (a) {
1044
+ return fn.call(that, a);
1045
+ };
1046
+ case 2: return function (a, b) {
1047
+ return fn.call(that, a, b);
1048
+ };
1049
+ case 3: return function (a, b, c) {
1050
+ return fn.call(that, a, b, c);
1051
+ };
1052
+ }
1053
+ return function (/* ...args */) {
1054
+ return fn.apply(that, arguments);
1055
+ };
1056
+ };
1057
+
1058
+ var SPECIES = wellKnownSymbol('species');
1059
+
1060
+ // `ArraySpeciesCreate` abstract operation
1061
+ // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
1062
+ var arraySpeciesCreate = function (originalArray, length) {
1063
+ var C;
1064
+ if (isArray(originalArray)) {
1065
+ C = originalArray.constructor;
1066
+ // cross-realm fallback
1067
+ if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
1068
+ else if (isObject(C)) {
1069
+ C = C[SPECIES];
1070
+ if (C === null) C = undefined;
1071
+ }
1072
+ } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
1073
+ };
1074
+
1075
+ var push = [].push;
1076
+
1077
+ // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
1078
+ var createMethod$2 = function (TYPE) {
1079
+ var IS_MAP = TYPE == 1;
1080
+ var IS_FILTER = TYPE == 2;
1081
+ var IS_SOME = TYPE == 3;
1082
+ var IS_EVERY = TYPE == 4;
1083
+ var IS_FIND_INDEX = TYPE == 6;
1084
+ var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1085
+ return function ($this, callbackfn, that, specificCreate) {
1086
+ var O = toObject($this);
1087
+ var self = indexedObject(O);
1088
+ var boundFunction = bindContext(callbackfn, that, 3);
1089
+ var length = toLength(self.length);
1090
+ var index = 0;
1091
+ var create = specificCreate || arraySpeciesCreate;
1092
+ var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
1093
+ var value, result;
1094
+ for (;length > index; index++) if (NO_HOLES || index in self) {
1095
+ value = self[index];
1096
+ result = boundFunction(value, index, O);
1097
+ if (TYPE) {
1098
+ if (IS_MAP) target[index] = result; // map
1099
+ else if (result) switch (TYPE) {
1100
+ case 3: return true; // some
1101
+ case 5: return value; // find
1102
+ case 6: return index; // findIndex
1103
+ case 2: push.call(target, value); // filter
1104
+ } else if (IS_EVERY) return false; // every
1105
+ }
1106
+ }
1107
+ return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
1108
+ };
1109
+ };
1110
+
1111
+ var arrayIteration = {
1112
+ // `Array.prototype.forEach` method
1113
+ // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
1114
+ forEach: createMethod$2(0),
1115
+ // `Array.prototype.map` method
1116
+ // https://tc39.github.io/ecma262/#sec-array.prototype.map
1117
+ map: createMethod$2(1),
1118
+ // `Array.prototype.filter` method
1119
+ // https://tc39.github.io/ecma262/#sec-array.prototype.filter
1120
+ filter: createMethod$2(2),
1121
+ // `Array.prototype.some` method
1122
+ // https://tc39.github.io/ecma262/#sec-array.prototype.some
1123
+ some: createMethod$2(3),
1124
+ // `Array.prototype.every` method
1125
+ // https://tc39.github.io/ecma262/#sec-array.prototype.every
1126
+ every: createMethod$2(4),
1127
+ // `Array.prototype.find` method
1128
+ // https://tc39.github.io/ecma262/#sec-array.prototype.find
1129
+ find: createMethod$2(5),
1130
+ // `Array.prototype.findIndex` method
1131
+ // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
1132
+ findIndex: createMethod$2(6)
1133
+ };
1134
+
1135
+ var $forEach = arrayIteration.forEach;
1136
+
1137
+ var HIDDEN = sharedKey('hidden');
1138
+ var SYMBOL = 'Symbol';
1139
+ var PROTOTYPE$1 = 'prototype';
1140
+ var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
1141
+ var setInternalState = internalState.set;
1142
+ var getInternalState = internalState.getterFor(SYMBOL);
1143
+ var ObjectPrototype = Object[PROTOTYPE$1];
1144
+ var $Symbol = global_1.Symbol;
1145
+ var JSON = global_1.JSON;
1146
+ var nativeJSONStringify = JSON && JSON.stringify;
1147
+ var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
1148
+ var nativeDefineProperty$1 = objectDefineProperty.f;
1149
+ var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
1150
+ var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f;
1151
+ var AllSymbols = shared('symbols');
1152
+ var ObjectPrototypeSymbols = shared('op-symbols');
1153
+ var StringToSymbolRegistry = shared('string-to-symbol-registry');
1154
+ var SymbolToStringRegistry = shared('symbol-to-string-registry');
1155
+ var WellKnownSymbolsStore = shared('wks');
1156
+ var QObject = global_1.QObject;
1157
+ // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
1158
+ var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
1159
+
1160
+ // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
1161
+ var setSymbolDescriptor = descriptors && fails(function () {
1162
+ return objectCreate(nativeDefineProperty$1({}, 'a', {
1163
+ get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; }
1164
+ })).a != 7;
1165
+ }) ? function (O, P, Attributes) {
1166
+ var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype, P);
1167
+ if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
1168
+ nativeDefineProperty$1(O, P, Attributes);
1169
+ if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
1170
+ nativeDefineProperty$1(ObjectPrototype, P, ObjectPrototypeDescriptor);
1171
+ }
1172
+ } : nativeDefineProperty$1;
1173
+
1174
+ var wrap = function (tag, description) {
1175
+ var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]);
1176
+ setInternalState(symbol, {
1177
+ type: SYMBOL,
1178
+ tag: tag,
1179
+ description: description
1180
+ });
1181
+ if (!descriptors) symbol.description = description;
1182
+ return symbol;
1183
+ };
1184
+
1185
+ var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) {
1186
+ return typeof it == 'symbol';
1187
+ } : function (it) {
1188
+ return Object(it) instanceof $Symbol;
1189
+ };
1190
+
1191
+ var $defineProperty = function defineProperty(O, P, Attributes) {
1192
+ if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
1193
+ anObject(O);
1194
+ var key = toPrimitive(P, true);
1195
+ anObject(Attributes);
1196
+ if (has(AllSymbols, key)) {
1197
+ if (!Attributes.enumerable) {
1198
+ if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {}));
1199
+ O[HIDDEN][key] = true;
1200
+ } else {
1201
+ if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
1202
+ Attributes = objectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
1203
+ } return setSymbolDescriptor(O, key, Attributes);
1204
+ } return nativeDefineProperty$1(O, key, Attributes);
1205
+ };
1206
+
1207
+ var $defineProperties = function defineProperties(O, Properties) {
1208
+ anObject(O);
1209
+ var properties = toIndexedObject(Properties);
1210
+ var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
1211
+ $forEach(keys, function (key) {
1212
+ if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
1213
+ });
1214
+ return O;
1215
+ };
1216
+
1217
+ var $create = function create(O, Properties) {
1218
+ return Properties === undefined ? objectCreate(O) : $defineProperties(objectCreate(O), Properties);
1219
+ };
1220
+
1221
+ var $propertyIsEnumerable = function propertyIsEnumerable(V) {
1222
+ var P = toPrimitive(V, true);
1223
+ var enumerable = nativePropertyIsEnumerable$1.call(this, P);
1224
+ if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
1225
+ return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
1226
+ };
1227
+
1228
+ var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
1229
+ var it = toIndexedObject(O);
1230
+ var key = toPrimitive(P, true);
1231
+ if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
1232
+ var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
1233
+ if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
1234
+ descriptor.enumerable = true;
1235
+ }
1236
+ return descriptor;
1237
+ };
1238
+
1239
+ var $getOwnPropertyNames = function getOwnPropertyNames(O) {
1240
+ var names = nativeGetOwnPropertyNames$1(toIndexedObject(O));
1241
+ var result = [];
1242
+ $forEach(names, function (key) {
1243
+ if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
1244
+ });
1245
+ return result;
1246
+ };
1247
+
1248
+ var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
1249
+ var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
1250
+ var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
1251
+ var result = [];
1252
+ $forEach(names, function (key) {
1253
+ if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
1254
+ result.push(AllSymbols[key]);
1255
+ }
1256
+ });
1257
+ return result;
1258
+ };
1259
+
1260
+ // `Symbol` constructor
1261
+ // https://tc39.github.io/ecma262/#sec-symbol-constructor
1262
+ if (!nativeSymbol) {
1263
+ $Symbol = function Symbol() {
1264
+ if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
1265
+ var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
1266
+ var tag = uid(description);
1267
+ var setter = function (value) {
1268
+ if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
1269
+ if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
1270
+ setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
1271
+ };
1272
+ if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
1273
+ return wrap(tag, description);
1274
+ };
1275
+
1276
+ redefine($Symbol[PROTOTYPE$1], 'toString', function toString() {
1277
+ return getInternalState(this).tag;
1278
+ });
1279
+
1280
+ objectPropertyIsEnumerable.f = $propertyIsEnumerable;
1281
+ objectDefineProperty.f = $defineProperty;
1282
+ objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor;
1283
+ objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames;
1284
+ objectGetOwnPropertySymbols.f = $getOwnPropertySymbols;
1285
+
1286
+ if (descriptors) {
1287
+ // https://github.com/tc39/proposal-Symbol-description
1288
+ nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', {
1289
+ configurable: true,
1290
+ get: function description() {
1291
+ return getInternalState(this).description;
1292
+ }
1293
+ });
1294
+ {
1295
+ redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
1296
+ }
1297
+ }
1298
+
1299
+ wrappedWellKnownSymbol.f = function (name) {
1300
+ return wrap(wellKnownSymbol(name), name);
1301
+ };
1302
+ }
1303
+
1304
+ _export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, {
1305
+ Symbol: $Symbol
1306
+ });
1307
+
1308
+ $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
1309
+ defineWellKnownSymbol(name);
1310
+ });
1311
+
1312
+ _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
1313
+ // `Symbol.for` method
1314
+ // https://tc39.github.io/ecma262/#sec-symbol.for
1315
+ 'for': function (key) {
1316
+ var string = String(key);
1317
+ if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
1318
+ var symbol = $Symbol(string);
1319
+ StringToSymbolRegistry[string] = symbol;
1320
+ SymbolToStringRegistry[symbol] = string;
1321
+ return symbol;
1322
+ },
1323
+ // `Symbol.keyFor` method
1324
+ // https://tc39.github.io/ecma262/#sec-symbol.keyfor
1325
+ keyFor: function keyFor(sym) {
1326
+ if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
1327
+ if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
1328
+ },
1329
+ useSetter: function () { USE_SETTER = true; },
1330
+ useSimple: function () { USE_SETTER = false; }
1331
+ });
1332
+
1333
+ _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
1334
+ // `Object.create` method
1335
+ // https://tc39.github.io/ecma262/#sec-object.create
1336
+ create: $create,
1337
+ // `Object.defineProperty` method
1338
+ // https://tc39.github.io/ecma262/#sec-object.defineproperty
1339
+ defineProperty: $defineProperty,
1340
+ // `Object.defineProperties` method
1341
+ // https://tc39.github.io/ecma262/#sec-object.defineproperties
1342
+ defineProperties: $defineProperties,
1343
+ // `Object.getOwnPropertyDescriptor` method
1344
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
1345
+ getOwnPropertyDescriptor: $getOwnPropertyDescriptor
1346
+ });
1347
+
1348
+ _export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
1349
+ // `Object.getOwnPropertyNames` method
1350
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
1351
+ getOwnPropertyNames: $getOwnPropertyNames,
1352
+ // `Object.getOwnPropertySymbols` method
1353
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
1354
+ getOwnPropertySymbols: $getOwnPropertySymbols
1355
+ });
1356
+
1357
+ // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
1358
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3443
1359
+ _export({ target: 'Object', stat: true, forced: fails(function () { objectGetOwnPropertySymbols.f(1); }) }, {
1360
+ getOwnPropertySymbols: function getOwnPropertySymbols(it) {
1361
+ return objectGetOwnPropertySymbols.f(toObject(it));
1362
+ }
1363
+ });
1364
+
1365
+ // `JSON.stringify` method behavior with symbols
1366
+ // https://tc39.github.io/ecma262/#sec-json.stringify
1367
+ JSON && _export({ target: 'JSON', stat: true, forced: !nativeSymbol || fails(function () {
1368
+ var symbol = $Symbol();
1369
+ // MS Edge converts symbol values to JSON as {}
1370
+ return nativeJSONStringify([symbol]) != '[null]'
1371
+ // WebKit converts symbol values to JSON as null
1372
+ || nativeJSONStringify({ a: symbol }) != '{}'
1373
+ // V8 throws on boxed symbols
1374
+ || nativeJSONStringify(Object(symbol)) != '{}';
1375
+ }) }, {
1376
+ stringify: function stringify(it) {
1377
+ var args = [it];
1378
+ var index = 1;
1379
+ var replacer, $replacer;
1380
+ while (arguments.length > index) args.push(arguments[index++]);
1381
+ $replacer = replacer = args[1];
1382
+ if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1383
+ if (!isArray(replacer)) replacer = function (key, value) {
1384
+ if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
1385
+ if (!isSymbol(value)) return value;
1386
+ };
1387
+ args[1] = replacer;
1388
+ return nativeJSONStringify.apply(JSON, args);
1389
+ }
1390
+ });
1391
+
1392
+ // `Symbol.prototype[@@toPrimitive]` method
1393
+ // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
1394
+ if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
1395
+ // `Symbol.prototype[@@toStringTag]` property
1396
+ // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
1397
+ setToStringTag($Symbol, SYMBOL);
1398
+
1399
+ hiddenKeys[HIDDEN] = true;
1400
+
1401
+ var defineProperty$2 = objectDefineProperty.f;
1402
+
1403
+
1404
+ var NativeSymbol = global_1.Symbol;
1405
+
1406
+ if (descriptors && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
1407
+ // Safari 12 bug
1408
+ NativeSymbol().description !== undefined
1409
+ )) {
1410
+ var EmptyStringDescriptionStore = {};
1411
+ // wrap Symbol constructor for correct work with undefined description
1412
+ var SymbolWrapper = function Symbol() {
1413
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
1414
+ var result = this instanceof SymbolWrapper
1415
+ ? new NativeSymbol(description)
1416
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
1417
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
1418
+ if (description === '') EmptyStringDescriptionStore[result] = true;
1419
+ return result;
1420
+ };
1421
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
1422
+ var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
1423
+ symbolPrototype.constructor = SymbolWrapper;
1424
+
1425
+ var symbolToString = symbolPrototype.toString;
1426
+ var native = String(NativeSymbol('test')) == 'Symbol(test)';
1427
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
1428
+ defineProperty$2(symbolPrototype, 'description', {
1429
+ configurable: true,
1430
+ get: function description() {
1431
+ var symbol = isObject(this) ? this.valueOf() : this;
1432
+ var string = symbolToString.call(symbol);
1433
+ if (has(EmptyStringDescriptionStore, symbol)) return '';
1434
+ var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
1435
+ return desc === '' ? undefined : desc;
1436
+ }
1437
+ });
1438
+
1439
+ _export({ global: true, forced: true }, {
1440
+ Symbol: SymbolWrapper
1441
+ });
1442
+ }
1443
+
1444
+ // `Symbol.iterator` well-known symbol
1445
+ // https://tc39.github.io/ecma262/#sec-symbol.iterator
1446
+ defineWellKnownSymbol('iterator');
1447
+
1448
+ var createProperty = function (object, key, value) {
1449
+ var propertyKey = toPrimitive(key);
1450
+ if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
1451
+ else object[propertyKey] = value;
1452
+ };
1453
+
1454
+ var SPECIES$1 = wellKnownSymbol('species');
1455
+
1456
+ var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
1457
+ return !fails(function () {
1458
+ var array = [];
1459
+ var constructor = array.constructor = {};
1460
+ constructor[SPECIES$1] = function () {
1461
+ return { foo: 1 };
1462
+ };
1463
+ return array[METHOD_NAME](Boolean).foo !== 1;
1464
+ });
1465
+ };
1466
+
1467
+ var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
1468
+ var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
1469
+ var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
1470
+
1471
+ var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
1472
+ var array = [];
1473
+ array[IS_CONCAT_SPREADABLE] = false;
1474
+ return array.concat()[0] !== array;
1475
+ });
1476
+
1477
+ var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
1478
+
1479
+ var isConcatSpreadable = function (O) {
1480
+ if (!isObject(O)) return false;
1481
+ var spreadable = O[IS_CONCAT_SPREADABLE];
1482
+ return spreadable !== undefined ? !!spreadable : isArray(O);
1483
+ };
1484
+
1485
+ var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
1486
+
1487
+ // `Array.prototype.concat` method
1488
+ // https://tc39.github.io/ecma262/#sec-array.prototype.concat
1489
+ // with adding support of @@isConcatSpreadable and @@species
1490
+ _export({ target: 'Array', proto: true, forced: FORCED }, {
1491
+ concat: function concat(arg) { // eslint-disable-line no-unused-vars
1492
+ var O = toObject(this);
1493
+ var A = arraySpeciesCreate(O, 0);
1494
+ var n = 0;
1495
+ var i, k, length, len, E;
1496
+ for (i = -1, length = arguments.length; i < length; i++) {
1497
+ E = i === -1 ? O : arguments[i];
1498
+ if (isConcatSpreadable(E)) {
1499
+ len = toLength(E.length);
1500
+ if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1501
+ for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
1502
+ } else {
1503
+ if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1504
+ createProperty(A, n++, E);
1505
+ }
1506
+ }
1507
+ A.length = n;
1508
+ return A;
1509
+ }
1510
+ });
1511
+
1512
+ var $filter = arrayIteration.filter;
1513
+
1514
+
1515
+ // `Array.prototype.filter` method
1516
+ // https://tc39.github.io/ecma262/#sec-array.prototype.filter
1517
+ // with adding support of @@species
1518
+ _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
1519
+ filter: function filter(callbackfn /* , thisArg */) {
1520
+ return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1521
+ }
1522
+ });
1523
+
1524
+ var $find = arrayIteration.find;
1525
+
1526
+
1527
+ var FIND = 'find';
1528
+ var SKIPS_HOLES = true;
1529
+
1530
+ // Shouldn't skip holes
1531
+ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
1532
+
1533
+ // `Array.prototype.find` method
1534
+ // https://tc39.github.io/ecma262/#sec-array.prototype.find
1535
+ _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1536
+ find: function find(callbackfn /* , that = undefined */) {
1537
+ return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1538
+ }
1539
+ });
1540
+
1541
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1542
+ addToUnscopables(FIND);
1543
+
1544
+ var correctPrototypeGetter = !fails(function () {
1545
+ function F() { /* empty */ }
1546
+ F.prototype.constructor = null;
1547
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1548
+ });
1549
+
1550
+ var IE_PROTO$1 = sharedKey('IE_PROTO');
1551
+ var ObjectPrototype$1 = Object.prototype;
1552
+
1553
+ // `Object.getPrototypeOf` method
1554
+ // https://tc39.github.io/ecma262/#sec-object.getprototypeof
1555
+ var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
1556
+ O = toObject(O);
1557
+ if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
1558
+ if (typeof O.constructor == 'function' && O instanceof O.constructor) {
1559
+ return O.constructor.prototype;
1560
+ } return O instanceof Object ? ObjectPrototype$1 : null;
1561
+ };
1562
+
1563
+ var ITERATOR = wellKnownSymbol('iterator');
1564
+ var BUGGY_SAFARI_ITERATORS = false;
1565
+
1566
+ var returnThis = function () { return this; };
1567
+
1568
+ // `%IteratorPrototype%` object
1569
+ // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
1570
+ var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
1571
+
1572
+ if ([].keys) {
1573
+ arrayIterator = [].keys();
1574
+ // Safari 8 has buggy iterators w/o `next`
1575
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
1576
+ else {
1577
+ PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
1578
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
1579
+ }
1580
+ }
1581
+
1582
+ if (IteratorPrototype == undefined) IteratorPrototype = {};
1583
+
1584
+ // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
1585
+ if ( !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
1586
+
1587
+ var iteratorsCore = {
1588
+ IteratorPrototype: IteratorPrototype,
1589
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
1590
+ };
1591
+
1592
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1593
+
1594
+ var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
1595
+ var TO_STRING_TAG = NAME + ' Iterator';
1596
+ IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
1597
+ setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
1598
+ return IteratorConstructor;
1599
+ };
1600
+
1601
+ var aPossiblePrototype = function (it) {
1602
+ if (!isObject(it) && it !== null) {
1603
+ throw TypeError("Can't set " + String(it) + ' as a prototype');
1604
+ } return it;
1605
+ };
1606
+
1607
+ // `Object.setPrototypeOf` method
1608
+ // https://tc39.github.io/ecma262/#sec-object.setprototypeof
1609
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1610
+ /* eslint-disable no-proto */
1611
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1612
+ var CORRECT_SETTER = false;
1613
+ var test = {};
1614
+ var setter;
1615
+ try {
1616
+ setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
1617
+ setter.call(test, []);
1618
+ CORRECT_SETTER = test instanceof Array;
1619
+ } catch (error) { /* empty */ }
1620
+ return function setPrototypeOf(O, proto) {
1621
+ anObject(O);
1622
+ aPossiblePrototype(proto);
1623
+ if (CORRECT_SETTER) setter.call(O, proto);
1624
+ else O.__proto__ = proto;
1625
+ return O;
1626
+ };
1627
+ }() : undefined);
1628
+
1629
+ var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
1630
+ var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
1631
+ var ITERATOR$1 = wellKnownSymbol('iterator');
1632
+ var KEYS = 'keys';
1633
+ var VALUES = 'values';
1634
+ var ENTRIES = 'entries';
1635
+
1636
+ var returnThis$1 = function () { return this; };
1637
+
1638
+ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1639
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1640
+
1641
+ var getIterationMethod = function (KIND) {
1642
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1643
+ if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
1644
+ switch (KIND) {
1645
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1646
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1647
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1648
+ } return function () { return new IteratorConstructor(this); };
1649
+ };
1650
+
1651
+ var TO_STRING_TAG = NAME + ' Iterator';
1652
+ var INCORRECT_VALUES_NAME = false;
1653
+ var IterablePrototype = Iterable.prototype;
1654
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1655
+ || IterablePrototype['@@iterator']
1656
+ || DEFAULT && IterablePrototype[DEFAULT];
1657
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
1658
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1659
+ var CurrentIteratorPrototype, methods, KEY;
1660
+
1661
+ // fix native
1662
+ if (anyNativeIterator) {
1663
+ CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
1664
+ if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
1665
+ if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
1666
+ if (objectSetPrototypeOf) {
1667
+ objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
1668
+ } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
1669
+ hide(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
1670
+ }
1671
+ }
1672
+ // Set @@toStringTag to native iterators
1673
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1674
+ }
1675
+ }
1676
+
1677
+ // fix Array#{values, @@iterator}.name in V8 / FF
1678
+ if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1679
+ INCORRECT_VALUES_NAME = true;
1680
+ defaultIterator = function values() { return nativeIterator.call(this); };
1681
+ }
1682
+
1683
+ // define iterator
1684
+ if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
1685
+ hide(IterablePrototype, ITERATOR$1, defaultIterator);
1686
+ }
1687
+
1688
+ // export additional methods
1689
+ if (DEFAULT) {
1690
+ methods = {
1691
+ values: getIterationMethod(VALUES),
1692
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1693
+ entries: getIterationMethod(ENTRIES)
1694
+ };
1695
+ if (FORCED) for (KEY in methods) {
1696
+ if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1697
+ redefine(IterablePrototype, KEY, methods[KEY]);
1698
+ }
1699
+ } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
1700
+ }
1701
+
1702
+ return methods;
1703
+ };
1704
+
1705
+ var ARRAY_ITERATOR = 'Array Iterator';
1706
+ var setInternalState$1 = internalState.set;
1707
+ var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
1708
+
1709
+ // `Array.prototype.entries` method
1710
+ // https://tc39.github.io/ecma262/#sec-array.prototype.entries
1711
+ // `Array.prototype.keys` method
1712
+ // https://tc39.github.io/ecma262/#sec-array.prototype.keys
1713
+ // `Array.prototype.values` method
1714
+ // https://tc39.github.io/ecma262/#sec-array.prototype.values
1715
+ // `Array.prototype[@@iterator]` method
1716
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
1717
+ // `CreateArrayIterator` internal method
1718
+ // https://tc39.github.io/ecma262/#sec-createarrayiterator
1719
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1720
+ setInternalState$1(this, {
1721
+ type: ARRAY_ITERATOR,
1722
+ target: toIndexedObject(iterated), // target
1723
+ index: 0, // next index
1724
+ kind: kind // kind
1725
+ });
1726
+ // `%ArrayIteratorPrototype%.next` method
1727
+ // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
1728
+ }, function () {
1729
+ var state = getInternalState$1(this);
1730
+ var target = state.target;
1731
+ var kind = state.kind;
1732
+ var index = state.index++;
1733
+ if (!target || index >= target.length) {
1734
+ state.target = undefined;
1735
+ return { value: undefined, done: true };
1736
+ }
1737
+ if (kind == 'keys') return { value: index, done: false };
1738
+ if (kind == 'values') return { value: target[index], done: false };
1739
+ return { value: [index, target[index]], done: false };
1740
+ }, 'values');
1741
+
1742
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1743
+ addToUnscopables('keys');
1744
+ addToUnscopables('values');
1745
+ addToUnscopables('entries');
1746
+
1747
+ var sloppyArrayMethod = function (METHOD_NAME, argument) {
1748
+ var method = [][METHOD_NAME];
1749
+ return !method || !fails(function () {
1750
+ // eslint-disable-next-line no-useless-call,no-throw-literal
1751
+ method.call(null, argument || function () { throw 1; }, 1);
1752
+ });
1753
+ };
1754
+
1755
+ var nativeJoin = [].join;
1756
+
1757
+ var ES3_STRINGS = indexedObject != Object;
1758
+ var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
1759
+
1760
+ // `Array.prototype.join` method
1761
+ // https://tc39.github.io/ecma262/#sec-array.prototype.join
1762
+ _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
1763
+ join: function join(separator) {
1764
+ return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
1765
+ }
1766
+ });
1767
+
1768
+ var $map = arrayIteration.map;
1769
+
1770
+
1771
+ // `Array.prototype.map` method
1772
+ // https://tc39.github.io/ecma262/#sec-array.prototype.map
1773
+ // with adding support of @@species
1774
+ _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, {
1775
+ map: function map(callbackfn /* , thisArg */) {
1776
+ return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1777
+ }
1778
+ });
1779
+
1780
+ var SPECIES$2 = wellKnownSymbol('species');
1781
+ var nativeSlice = [].slice;
1782
+ var max$1 = Math.max;
1783
+
1784
+ // `Array.prototype.slice` method
1785
+ // https://tc39.github.io/ecma262/#sec-array.prototype.slice
1786
+ // fallback for not array-like ES3 strings and DOM objects
1787
+ _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
1788
+ slice: function slice(start, end) {
1789
+ var O = toIndexedObject(this);
1790
+ var length = toLength(O.length);
1791
+ var k = toAbsoluteIndex(start, length);
1792
+ var fin = toAbsoluteIndex(end === undefined ? length : end, length);
1793
+ // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
1794
+ var Constructor, result, n;
1795
+ if (isArray(O)) {
1796
+ Constructor = O.constructor;
1797
+ // cross-realm fallback
1798
+ if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
1799
+ Constructor = undefined;
1800
+ } else if (isObject(Constructor)) {
1801
+ Constructor = Constructor[SPECIES$2];
1802
+ if (Constructor === null) Constructor = undefined;
1803
+ }
1804
+ if (Constructor === Array || Constructor === undefined) {
1805
+ return nativeSlice.call(O, k, fin);
1806
+ }
1807
+ }
1808
+ result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
1809
+ for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
1810
+ result.length = n;
1811
+ return result;
1812
+ }
1813
+ });
1814
+
1815
+ var defineProperty$3 = objectDefineProperty.f;
1816
+
1817
+ var FunctionPrototype = Function.prototype;
1818
+ var FunctionPrototypeToString = FunctionPrototype.toString;
1819
+ var nameRE = /^\s*function ([^ (]*)/;
1820
+ var NAME = 'name';
1821
+
1822
+ // Function instances `.name` property
1823
+ // https://tc39.github.io/ecma262/#sec-function-instances-name
1824
+ if (descriptors && !(NAME in FunctionPrototype)) {
1825
+ defineProperty$3(FunctionPrototype, NAME, {
1826
+ configurable: true,
1827
+ get: function () {
1828
+ try {
1829
+ return FunctionPrototypeToString.call(this).match(nameRE)[1];
1830
+ } catch (error) {
1831
+ return '';
1832
+ }
1833
+ }
1834
+ });
1835
+ }
1836
+
1837
+ var propertyIsEnumerable = objectPropertyIsEnumerable.f;
1838
+
1839
+ // `Object.{ entries, values }` methods implementation
1840
+ var createMethod$3 = function (TO_ENTRIES) {
1841
+ return function (it) {
1842
+ var O = toIndexedObject(it);
1843
+ var keys = objectKeys(O);
1844
+ var length = keys.length;
1845
+ var i = 0;
1846
+ var result = [];
1847
+ var key;
1848
+ while (length > i) {
1849
+ key = keys[i++];
1850
+ if (!descriptors || propertyIsEnumerable.call(O, key)) {
1851
+ result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
1852
+ }
1853
+ }
1854
+ return result;
1855
+ };
1856
+ };
1857
+
1858
+ var objectToArray = {
1859
+ // `Object.entries` method
1860
+ // https://tc39.github.io/ecma262/#sec-object.entries
1861
+ entries: createMethod$3(true),
1862
+ // `Object.values` method
1863
+ // https://tc39.github.io/ecma262/#sec-object.values
1864
+ values: createMethod$3(false)
1865
+ };
1866
+
1867
+ var $entries = objectToArray.entries;
1868
+
1869
+ // `Object.entries` method
1870
+ // https://tc39.github.io/ecma262/#sec-object.entries
1871
+ _export({ target: 'Object', stat: true }, {
1872
+ entries: function entries(O) {
1873
+ return $entries(O);
1874
+ }
1875
+ });
1876
+
1877
+ var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
1878
+
1879
+ // `Object.keys` method
1880
+ // https://tc39.github.io/ecma262/#sec-object.keys
1881
+ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
1882
+ keys: function keys(it) {
1883
+ return objectKeys(toObject(it));
1884
+ }
1885
+ });
1886
+
1887
+ var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1888
+ // ES3 wrong here
1889
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1890
+
1891
+ // fallback for IE11 Script Access Denied error
1892
+ var tryGet = function (it, key) {
1893
+ try {
1894
+ return it[key];
1895
+ } catch (error) { /* empty */ }
1896
+ };
1897
+
1898
+ // getting tag from ES6+ `Object.prototype.toString`
1899
+ var classof = function (it) {
1900
+ var O, tag, result;
1901
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1902
+ // @@toStringTag case
1903
+ : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
1904
+ // builtinTag case
1905
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1906
+ // ES3 arguments fallback
1907
+ : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1908
+ };
1909
+
1910
+ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
1911
+ var test = {};
1912
+
1913
+ test[TO_STRING_TAG$2] = 'z';
1914
+
1915
+ // `Object.prototype.toString` method implementation
1916
+ // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1917
+ var objectToString = String(test) !== '[object z]' ? function toString() {
1918
+ return '[object ' + classof(this) + ']';
1919
+ } : test.toString;
1920
+
1921
+ var ObjectPrototype$2 = Object.prototype;
1922
+
1923
+ // `Object.prototype.toString` method
1924
+ // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1925
+ if (objectToString !== ObjectPrototype$2.toString) {
1926
+ redefine(ObjectPrototype$2, 'toString', objectToString, { unsafe: true });
1927
+ }
1928
+
1929
+ // `String.prototype.{ codePointAt, at }` methods implementation
1930
+ var createMethod$4 = function (CONVERT_TO_STRING) {
1931
+ return function ($this, pos) {
1932
+ var S = String(requireObjectCoercible($this));
1933
+ var position = toInteger(pos);
1934
+ var size = S.length;
1935
+ var first, second;
1936
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1937
+ first = S.charCodeAt(position);
1938
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size
1939
+ || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
1940
+ ? CONVERT_TO_STRING ? S.charAt(position) : first
1941
+ : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1942
+ };
1943
+ };
1944
+
1945
+ var stringMultibyte = {
1946
+ // `String.prototype.codePointAt` method
1947
+ // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
1948
+ codeAt: createMethod$4(false),
1949
+ // `String.prototype.at` method
1950
+ // https://github.com/mathiasbynens/String.prototype.at
1951
+ charAt: createMethod$4(true)
1952
+ };
1953
+
1954
+ var charAt = stringMultibyte.charAt;
1955
+
1956
+
1957
+
1958
+ var STRING_ITERATOR = 'String Iterator';
1959
+ var setInternalState$2 = internalState.set;
1960
+ var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
1961
+
1962
+ // `String.prototype[@@iterator]` method
1963
+ // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
1964
+ defineIterator(String, 'String', function (iterated) {
1965
+ setInternalState$2(this, {
1966
+ type: STRING_ITERATOR,
1967
+ string: String(iterated),
1968
+ index: 0
1969
+ });
1970
+ // `%StringIteratorPrototype%.next` method
1971
+ // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
1972
+ }, function next() {
1973
+ var state = getInternalState$2(this);
1974
+ var string = state.string;
1975
+ var index = state.index;
1976
+ var point;
1977
+ if (index >= string.length) return { value: undefined, done: true };
1978
+ point = charAt(string, index);
1979
+ state.index += point.length;
1980
+ return { value: point, done: false };
1981
+ });
1982
+
1983
+ // `RegExp.prototype.flags` getter implementation
1984
+ // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
1985
+ var regexpFlags = function () {
1986
+ var that = anObject(this);
1987
+ var result = '';
1988
+ if (that.global) result += 'g';
1989
+ if (that.ignoreCase) result += 'i';
1990
+ if (that.multiline) result += 'm';
1991
+ if (that.dotAll) result += 's';
1992
+ if (that.unicode) result += 'u';
1993
+ if (that.sticky) result += 'y';
1994
+ return result;
1995
+ };
1996
+
1997
+ var nativeExec = RegExp.prototype.exec;
1998
+ // This always refers to the native implementation, because the
1999
+ // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
2000
+ // which loads this file before patching the method.
2001
+ var nativeReplace = String.prototype.replace;
2002
+
2003
+ var patchedExec = nativeExec;
2004
+
2005
+ var UPDATES_LAST_INDEX_WRONG = (function () {
2006
+ var re1 = /a/;
2007
+ var re2 = /b*/g;
2008
+ nativeExec.call(re1, 'a');
2009
+ nativeExec.call(re2, 'a');
2010
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2011
+ })();
2012
+
2013
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
2014
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2015
+
2016
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
2017
+
2018
+ if (PATCH) {
2019
+ patchedExec = function exec(str) {
2020
+ var re = this;
2021
+ var lastIndex, reCopy, match, i;
2022
+
2023
+ if (NPCG_INCLUDED) {
2024
+ reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
2025
+ }
2026
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2027
+
2028
+ match = nativeExec.call(re, str);
2029
+
2030
+ if (UPDATES_LAST_INDEX_WRONG && match) {
2031
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
2032
+ }
2033
+ if (NPCG_INCLUDED && match && match.length > 1) {
2034
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
2035
+ // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
2036
+ nativeReplace.call(match[0], reCopy, function () {
2037
+ for (i = 1; i < arguments.length - 2; i++) {
2038
+ if (arguments[i] === undefined) match[i] = undefined;
2039
+ }
2040
+ });
2041
+ }
2042
+
2043
+ return match;
2044
+ };
2045
+ }
2046
+
2047
+ var regexpExec = patchedExec;
2048
+
2049
+ var SPECIES$3 = wellKnownSymbol('species');
2050
+
2051
+ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
2052
+ // #replace needs built-in support for named groups.
2053
+ // #match works fine because it just return the exec results, even if it has
2054
+ // a "grops" property.
2055
+ var re = /./;
2056
+ re.exec = function () {
2057
+ var result = [];
2058
+ result.groups = { a: '7' };
2059
+ return result;
2060
+ };
2061
+ return ''.replace(re, '$<a>') !== '7';
2062
+ });
2063
+
2064
+ // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
2065
+ // Weex JS has frozen built-in prototypes, so use try / catch wrapper
2066
+ var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
2067
+ var re = /(?:)/;
2068
+ var originalExec = re.exec;
2069
+ re.exec = function () { return originalExec.apply(this, arguments); };
2070
+ var result = 'ab'.split(re);
2071
+ return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
2072
+ });
2073
+
2074
+ var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
2075
+ var SYMBOL = wellKnownSymbol(KEY);
2076
+
2077
+ var DELEGATES_TO_SYMBOL = !fails(function () {
2078
+ // String methods call symbol-named RegEp methods
2079
+ var O = {};
2080
+ O[SYMBOL] = function () { return 7; };
2081
+ return ''[KEY](O) != 7;
2082
+ });
2083
+
2084
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
2085
+ // Symbol-named RegExp methods call .exec
2086
+ var execCalled = false;
2087
+ var re = /a/;
2088
+ re.exec = function () { execCalled = true; return null; };
2089
+
2090
+ if (KEY === 'split') {
2091
+ // RegExp[@@split] doesn't call the regex's exec method, but first creates
2092
+ // a new one. We need to return the patched regex when creating the new one.
2093
+ re.constructor = {};
2094
+ re.constructor[SPECIES$3] = function () { return re; };
2095
+ }
2096
+
2097
+ re[SYMBOL]('');
2098
+ return !execCalled;
2099
+ });
2100
+
2101
+ if (
2102
+ !DELEGATES_TO_SYMBOL ||
2103
+ !DELEGATES_TO_EXEC ||
2104
+ (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
2105
+ (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
2106
+ ) {
2107
+ var nativeRegExpMethod = /./[SYMBOL];
2108
+ var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2109
+ if (regexp.exec === regexpExec) {
2110
+ if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
2111
+ // The native String method already delegates to @@method (this
2112
+ // polyfilled function), leasing to infinite recursion.
2113
+ // We avoid it by directly calling the native @@method method.
2114
+ return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
2115
+ }
2116
+ return { done: true, value: nativeMethod.call(str, regexp, arg2) };
2117
+ }
2118
+ return { done: false };
2119
+ });
2120
+ var stringMethod = methods[0];
2121
+ var regexMethod = methods[1];
2122
+
2123
+ redefine(String.prototype, KEY, stringMethod);
2124
+ redefine(RegExp.prototype, SYMBOL, length == 2
2125
+ // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
2126
+ // 21.2.5.11 RegExp.prototype[@@split](string, limit)
2127
+ ? function (string, arg) { return regexMethod.call(string, this, arg); }
2128
+ // 21.2.5.6 RegExp.prototype[@@match](string)
2129
+ // 21.2.5.9 RegExp.prototype[@@search](string)
2130
+ : function (string) { return regexMethod.call(string, this); }
2131
+ );
2132
+ if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
2133
+ }
2134
+ };
2135
+
2136
+ var SPECIES$4 = wellKnownSymbol('species');
2137
+
2138
+ // `SpeciesConstructor` abstract operation
2139
+ // https://tc39.github.io/ecma262/#sec-speciesconstructor
2140
+ var speciesConstructor = function (O, defaultConstructor) {
2141
+ var C = anObject(O).constructor;
2142
+ var S;
2143
+ return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
2144
+ };
2145
+
2146
+ var charAt$1 = stringMultibyte.charAt;
2147
+
2148
+ // `AdvanceStringIndex` abstract operation
2149
+ // https://tc39.github.io/ecma262/#sec-advancestringindex
2150
+ var advanceStringIndex = function (S, index, unicode) {
2151
+ return index + (unicode ? charAt$1(S, index).length : 1);
2152
+ };
2153
+
2154
+ // `RegExpExec` abstract operation
2155
+ // https://tc39.github.io/ecma262/#sec-regexpexec
2156
+ var regexpExecAbstract = function (R, S) {
2157
+ var exec = R.exec;
2158
+ if (typeof exec === 'function') {
2159
+ var result = exec.call(R, S);
2160
+ if (typeof result !== 'object') {
2161
+ throw TypeError('RegExp exec method returned something other than an Object or null');
2162
+ }
2163
+ return result;
2164
+ }
2165
+
2166
+ if (classofRaw(R) !== 'RegExp') {
2167
+ throw TypeError('RegExp#exec called on incompatible receiver');
2168
+ }
2169
+
2170
+ return regexpExec.call(R, S);
2171
+ };
2172
+
2173
+ var arrayPush = [].push;
2174
+ var min$2 = Math.min;
2175
+ var MAX_UINT32 = 0xFFFFFFFF;
2176
+
2177
+ // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
2178
+ var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
2179
+
2180
+ // @@split logic
2181
+ fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
2182
+ var internalSplit;
2183
+ if (
2184
+ 'abbc'.split(/(b)*/)[1] == 'c' ||
2185
+ 'test'.split(/(?:)/, -1).length != 4 ||
2186
+ 'ab'.split(/(?:ab)*/).length != 2 ||
2187
+ '.'.split(/(.?)(.?)/).length != 4 ||
2188
+ '.'.split(/()()/).length > 1 ||
2189
+ ''.split(/.?/).length
2190
+ ) {
2191
+ // based on es5-shim implementation, need to rework it
2192
+ internalSplit = function (separator, limit) {
2193
+ var string = String(requireObjectCoercible(this));
2194
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2195
+ if (lim === 0) return [];
2196
+ if (separator === undefined) return [string];
2197
+ // If `separator` is not a regex, use native split
2198
+ if (!isRegexp(separator)) {
2199
+ return nativeSplit.call(string, separator, lim);
2200
+ }
2201
+ var output = [];
2202
+ var flags = (separator.ignoreCase ? 'i' : '') +
2203
+ (separator.multiline ? 'm' : '') +
2204
+ (separator.unicode ? 'u' : '') +
2205
+ (separator.sticky ? 'y' : '');
2206
+ var lastLastIndex = 0;
2207
+ // Make `global` and avoid `lastIndex` issues by working with a copy
2208
+ var separatorCopy = new RegExp(separator.source, flags + 'g');
2209
+ var match, lastIndex, lastLength;
2210
+ while (match = regexpExec.call(separatorCopy, string)) {
2211
+ lastIndex = separatorCopy.lastIndex;
2212
+ if (lastIndex > lastLastIndex) {
2213
+ output.push(string.slice(lastLastIndex, match.index));
2214
+ if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
2215
+ lastLength = match[0].length;
2216
+ lastLastIndex = lastIndex;
2217
+ if (output.length >= lim) break;
2218
+ }
2219
+ if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
2220
+ }
2221
+ if (lastLastIndex === string.length) {
2222
+ if (lastLength || !separatorCopy.test('')) output.push('');
2223
+ } else output.push(string.slice(lastLastIndex));
2224
+ return output.length > lim ? output.slice(0, lim) : output;
2225
+ };
2226
+ // Chakra, V8
2227
+ } else if ('0'.split(undefined, 0).length) {
2228
+ internalSplit = function (separator, limit) {
2229
+ return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
2230
+ };
2231
+ } else internalSplit = nativeSplit;
2232
+
2233
+ return [
2234
+ // `String.prototype.split` method
2235
+ // https://tc39.github.io/ecma262/#sec-string.prototype.split
2236
+ function split(separator, limit) {
2237
+ var O = requireObjectCoercible(this);
2238
+ var splitter = separator == undefined ? undefined : separator[SPLIT];
2239
+ return splitter !== undefined
2240
+ ? splitter.call(separator, O, limit)
2241
+ : internalSplit.call(String(O), separator, limit);
2242
+ },
2243
+ // `RegExp.prototype[@@split]` method
2244
+ // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
2245
+ //
2246
+ // NOTE: This cannot be properly polyfilled in engines that don't support
2247
+ // the 'y' flag.
2248
+ function (regexp, limit) {
2249
+ var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
2250
+ if (res.done) return res.value;
2251
+
2252
+ var rx = anObject(regexp);
2253
+ var S = String(this);
2254
+ var C = speciesConstructor(rx, RegExp);
2255
+
2256
+ var unicodeMatching = rx.unicode;
2257
+ var flags = (rx.ignoreCase ? 'i' : '') +
2258
+ (rx.multiline ? 'm' : '') +
2259
+ (rx.unicode ? 'u' : '') +
2260
+ (SUPPORTS_Y ? 'y' : 'g');
2261
+
2262
+ // ^(? + rx + ) is needed, in combination with some S slicing, to
2263
+ // simulate the 'y' flag.
2264
+ var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
2265
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2266
+ if (lim === 0) return [];
2267
+ if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
2268
+ var p = 0;
2269
+ var q = 0;
2270
+ var A = [];
2271
+ while (q < S.length) {
2272
+ splitter.lastIndex = SUPPORTS_Y ? q : 0;
2273
+ var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
2274
+ var e;
2275
+ if (
2276
+ z === null ||
2277
+ (e = min$2(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
2278
+ ) {
2279
+ q = advanceStringIndex(S, q, unicodeMatching);
2280
+ } else {
2281
+ A.push(S.slice(p, q));
2282
+ if (A.length === lim) return A;
2283
+ for (var i = 1; i <= z.length - 1; i++) {
2284
+ A.push(z[i]);
2285
+ if (A.length === lim) return A;
2286
+ }
2287
+ q = p = e;
2288
+ }
2289
+ }
2290
+ A.push(S.slice(p));
2291
+ return A;
2292
+ }
2293
+ ];
2294
+ }, !SUPPORTS_Y);
2295
+
2296
+ // iterable DOM collections
2297
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2298
+ var domIterables = {
2299
+ CSSRuleList: 0,
2300
+ CSSStyleDeclaration: 0,
2301
+ CSSValueList: 0,
2302
+ ClientRectList: 0,
2303
+ DOMRectList: 0,
2304
+ DOMStringList: 0,
2305
+ DOMTokenList: 1,
2306
+ DataTransferItemList: 0,
2307
+ FileList: 0,
2308
+ HTMLAllCollection: 0,
2309
+ HTMLCollection: 0,
2310
+ HTMLFormElement: 0,
2311
+ HTMLSelectElement: 0,
2312
+ MediaList: 0,
2313
+ MimeTypeArray: 0,
2314
+ NamedNodeMap: 0,
2315
+ NodeList: 1,
2316
+ PaintRequestList: 0,
2317
+ Plugin: 0,
2318
+ PluginArray: 0,
2319
+ SVGLengthList: 0,
2320
+ SVGNumberList: 0,
2321
+ SVGPathSegList: 0,
2322
+ SVGPointList: 0,
2323
+ SVGStringList: 0,
2324
+ SVGTransformList: 0,
2325
+ SourceBufferList: 0,
2326
+ StyleSheetList: 0,
2327
+ TextTrackCueList: 0,
2328
+ TextTrackList: 0,
2329
+ TouchList: 0
2330
+ };
2331
+
2332
+ var $forEach$1 = arrayIteration.forEach;
2333
+
2334
+
2335
+ // `Array.prototype.forEach` method implementation
2336
+ // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
2337
+ var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
2338
+ return $forEach$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2339
+ } : [].forEach;
2340
+
2341
+ for (var COLLECTION_NAME in domIterables) {
2342
+ var Collection = global_1[COLLECTION_NAME];
2343
+ var CollectionPrototype = Collection && Collection.prototype;
2344
+ // some Chrome versions have non-configurable methods on DOMTokenList
2345
+ if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
2346
+ hide(CollectionPrototype, 'forEach', arrayForEach);
2347
+ } catch (error) {
2348
+ CollectionPrototype.forEach = arrayForEach;
2349
+ }
2350
+ }
2351
+
2352
+ var ITERATOR$2 = wellKnownSymbol('iterator');
2353
+ var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
2354
+ var ArrayValues = es_array_iterator.values;
2355
+
2356
+ for (var COLLECTION_NAME$1 in domIterables) {
2357
+ var Collection$1 = global_1[COLLECTION_NAME$1];
2358
+ var CollectionPrototype$1 = Collection$1 && Collection$1.prototype;
2359
+ if (CollectionPrototype$1) {
2360
+ // some Chrome versions have non-configurable methods on DOMTokenList
2361
+ if (CollectionPrototype$1[ITERATOR$2] !== ArrayValues) try {
2362
+ hide(CollectionPrototype$1, ITERATOR$2, ArrayValues);
2363
+ } catch (error) {
2364
+ CollectionPrototype$1[ITERATOR$2] = ArrayValues;
2365
+ }
2366
+ if (!CollectionPrototype$1[TO_STRING_TAG$3]) hide(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1);
2367
+ if (domIterables[COLLECTION_NAME$1]) for (var METHOD_NAME in es_array_iterator) {
2368
+ // some Chrome versions have non-configurable methods on DOMTokenList
2369
+ if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
2370
+ hide(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
2371
+ } catch (error) {
2372
+ CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME];
2373
+ }
2374
+ }
2375
+ }
2376
+ }
2377
+
2378
+ var VirtualScroll =
2379
+ /*#__PURE__*/
2380
+ function () {
2381
+ function VirtualScroll(options) {
2382
+ var _this = this;
2383
+
2384
+ _classCallCheck(this, VirtualScroll);
2385
+
2386
+ this.rows = options.rows;
2387
+ this.scrollEl = options.scrollEl;
2388
+ this.contentEl = options.contentEl;
2389
+ this.callback = options.callback;
2390
+ this.cache = {};
2391
+ this.scrollTop = this.scrollEl.scrollTop;
2392
+ this.initDOM(this.rows);
2393
+ this.scrollEl.scrollTop = this.scrollTop;
2394
+ this.lastCluster = 0;
2395
+
2396
+ var onScroll = function onScroll() {
2397
+ if (_this.lastCluster !== (_this.lastCluster = _this.getNum())) {
2398
+ _this.initDOM(_this.rows);
2399
+
2400
+ _this.callback();
2401
+ }
2402
+ };
2403
+
2404
+ this.scrollEl.addEventListener('scroll', onScroll, false);
2405
+
2406
+ this.destroy = function () {
2407
+ _this.contentEl.innerHtml = '';
2408
+
2409
+ _this.scrollEl.removeEventListener('scroll', onScroll, false);
2410
+ };
2411
+ }
2412
+
2413
+ _createClass(VirtualScroll, [{
2414
+ key: "initDOM",
2415
+ value: function initDOM(rows) {
2416
+ if (typeof this.clusterHeight === 'undefined') {
2417
+ this.cache.scrollTop = this.scrollEl.scrollTop;
2418
+ this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
2419
+ this.getRowsHeight(rows);
2420
+ }
2421
+
2422
+ var data = this.initData(rows, this.getNum());
2423
+ var thisRows = data.rows.join('');
2424
+ var dataChanged = this.checkChanges('data', thisRows);
2425
+ var topOffsetChanged = this.checkChanges('top', data.topOffset);
2426
+ var bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);
2427
+ var html = [];
2428
+
2429
+ if (dataChanged && topOffsetChanged) {
2430
+ if (data.topOffset) {
2431
+ html.push(this.getExtra('top', data.topOffset));
2432
+ }
2433
+
2434
+ html.push(thisRows);
2435
+
2436
+ if (data.bottomOffset) {
2437
+ html.push(this.getExtra('bottom', data.bottomOffset));
2438
+ }
2439
+
2440
+ this.contentEl.innerHTML = html.join('');
2441
+ } else if (bottomOffsetChanged) {
2442
+ this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
2443
+ }
2444
+ }
2445
+ }, {
2446
+ key: "getRowsHeight",
2447
+ value: function getRowsHeight() {
2448
+ if (typeof this.itemHeight === 'undefined') {
2449
+ var nodes = this.contentEl.children;
2450
+ var node = nodes[Math.floor(nodes.length / 2)];
2451
+ this.itemHeight = node.offsetHeight;
2452
+ }
2453
+
2454
+ this.blockHeight = this.itemHeight * Constants.BLOCK_ROWS;
2455
+ this.clusterRows = Constants.BLOCK_ROWS * Constants.CLUSTER_BLOCKS;
2456
+ this.clusterHeight = this.blockHeight * Constants.CLUSTER_BLOCKS;
2457
+ }
2458
+ }, {
2459
+ key: "getNum",
2460
+ value: function getNum() {
2461
+ this.scrollTop = this.scrollEl.scrollTop;
2462
+ return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
2463
+ }
2464
+ }, {
2465
+ key: "initData",
2466
+ value: function initData(rows, num) {
2467
+ if (rows.length < Constants.BLOCK_ROWS) {
2468
+ return {
2469
+ topOffset: 0,
2470
+ bottomOffset: 0,
2471
+ rowsAbove: 0,
2472
+ rows: rows
2473
+ };
2474
+ }
2475
+
2476
+ var start = Math.max((this.clusterRows - Constants.BLOCK_ROWS) * num, 0);
2477
+ var end = start + this.clusterRows;
2478
+ var topOffset = Math.max(start * this.itemHeight, 0);
2479
+ var bottomOffset = Math.max((rows.length - end) * this.itemHeight, 0);
2480
+ var thisRows = [];
2481
+ var rowsAbove = start;
2482
+
2483
+ if (topOffset < 1) {
2484
+ rowsAbove++;
2485
+ }
2486
+
2487
+ for (var i = start; i < end; i++) {
2488
+ rows[i] && thisRows.push(rows[i]);
2489
+ }
2490
+
2491
+ this.dataStart = start;
2492
+ this.dataEnd = end;
2493
+ return {
2494
+ topOffset: topOffset,
2495
+ bottomOffset: bottomOffset,
2496
+ rowsAbove: rowsAbove,
2497
+ rows: thisRows
2498
+ };
2499
+ }
2500
+ }, {
2501
+ key: "checkChanges",
2502
+ value: function checkChanges(type, value) {
2503
+ var changed = value !== this.cache[type];
2504
+ this.cache[type] = value;
2505
+ return changed;
2506
+ }
2507
+ }, {
2508
+ key: "getExtra",
2509
+ value: function getExtra(className, height) {
2510
+ var tag = document.createElement('li');
2511
+ tag.className = "virtual-scroll-".concat(className);
2512
+
2513
+ if (height) {
2514
+ tag.style.height = "".concat(height, "px");
2515
+ }
2516
+
2517
+ return tag.outerHTML;
2518
+ }
2519
+ }]);
2520
+
2521
+ return VirtualScroll;
2522
+ }();
2523
+
2524
+ var max$2 = Math.max;
2525
+ var min$3 = Math.min;
2526
+ var floor$1 = Math.floor;
2527
+ var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
2528
+ var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
2529
+
2530
+ var maybeToString = function (it) {
2531
+ return it === undefined ? it : String(it);
2532
+ };
2533
+
2534
+ // @@replace logic
2535
+ fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
2536
+ return [
2537
+ // `String.prototype.replace` method
2538
+ // https://tc39.github.io/ecma262/#sec-string.prototype.replace
2539
+ function replace(searchValue, replaceValue) {
2540
+ var O = requireObjectCoercible(this);
2541
+ var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
2542
+ return replacer !== undefined
2543
+ ? replacer.call(searchValue, O, replaceValue)
2544
+ : nativeReplace.call(String(O), searchValue, replaceValue);
2545
+ },
2546
+ // `RegExp.prototype[@@replace]` method
2547
+ // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
2548
+ function (regexp, replaceValue) {
2549
+ var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
2550
+ if (res.done) return res.value;
2551
+
2552
+ var rx = anObject(regexp);
2553
+ var S = String(this);
2554
+
2555
+ var functionalReplace = typeof replaceValue === 'function';
2556
+ if (!functionalReplace) replaceValue = String(replaceValue);
2557
+
2558
+ var global = rx.global;
2559
+ if (global) {
2560
+ var fullUnicode = rx.unicode;
2561
+ rx.lastIndex = 0;
2562
+ }
2563
+ var results = [];
2564
+ while (true) {
2565
+ var result = regexpExecAbstract(rx, S);
2566
+ if (result === null) break;
2567
+
2568
+ results.push(result);
2569
+ if (!global) break;
2570
+
2571
+ var matchStr = String(result[0]);
2572
+ if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2573
+ }
2574
+
2575
+ var accumulatedResult = '';
2576
+ var nextSourcePosition = 0;
2577
+ for (var i = 0; i < results.length; i++) {
2578
+ result = results[i];
2579
+
2580
+ var matched = String(result[0]);
2581
+ var position = max$2(min$3(toInteger(result.index), S.length), 0);
2582
+ var captures = [];
2583
+ // NOTE: This is equivalent to
2584
+ // captures = result.slice(1).map(maybeToString)
2585
+ // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2586
+ // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2587
+ // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2588
+ for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
2589
+ var namedCaptures = result.groups;
2590
+ if (functionalReplace) {
2591
+ var replacerArgs = [matched].concat(captures, position, S);
2592
+ if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
2593
+ var replacement = String(replaceValue.apply(undefined, replacerArgs));
2594
+ } else {
2595
+ replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2596
+ }
2597
+ if (position >= nextSourcePosition) {
2598
+ accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
2599
+ nextSourcePosition = position + matched.length;
2600
+ }
2601
+ }
2602
+ return accumulatedResult + S.slice(nextSourcePosition);
2603
+ }
2604
+ ];
2605
+
2606
+ // https://tc39.github.io/ecma262/#sec-getsubstitution
2607
+ function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
2608
+ var tailPos = position + matched.length;
2609
+ var m = captures.length;
2610
+ var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2611
+ if (namedCaptures !== undefined) {
2612
+ namedCaptures = toObject(namedCaptures);
2613
+ symbols = SUBSTITUTION_SYMBOLS;
2614
+ }
2615
+ return nativeReplace.call(replacement, symbols, function (match, ch) {
2616
+ var capture;
2617
+ switch (ch.charAt(0)) {
2618
+ case '$': return '$';
2619
+ case '&': return matched;
2620
+ case '`': return str.slice(0, position);
2621
+ case "'": return str.slice(tailPos);
2622
+ case '<':
2623
+ capture = namedCaptures[ch.slice(1, -1)];
2624
+ break;
2625
+ default: // \d\d?
2626
+ var n = +ch;
2627
+ if (n === 0) return match;
2628
+ if (n > m) {
2629
+ var f = floor$1(n / 10);
2630
+ if (f === 0) return match;
2631
+ if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
2632
+ return match;
2633
+ }
2634
+ capture = captures[n - 1];
2635
+ }
2636
+ return capture === undefined ? '' : capture;
2637
+ });
2638
+ }
2639
+ });
2640
+
2641
+ var compareObjects = function compareObjects(objectA, objectB, compareLength) {
2642
+ var aKeys = Object.keys(objectA);
2643
+ var bKeys = Object.keys(objectB);
2644
+
2645
+ if (compareLength && aKeys.length !== bKeys.length) {
2646
+ return false;
2647
+ }
2648
+
2649
+ for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
2650
+ var key = _aKeys[_i];
2651
+
2652
+ if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
2653
+ return false;
2654
+ }
2655
+ }
2656
+
2657
+ return true;
2658
+ };
2659
+
2660
+ var removeDiacritics = function removeDiacritics(str) {
2661
+ if (str.normalize) {
2662
+ return str.normalize('NFD').replace(/[\u0300-\u036F]/g, '');
2663
+ }
2664
+
2665
+ var defaultDiacriticsRemovalMap = [{
2666
+ 'base': 'A',
2667
+ 'letters': /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g
2668
+ }, {
2669
+ 'base': 'AA',
2670
+ 'letters': /[\uA732]/g
2671
+ }, {
2672
+ 'base': 'AE',
2673
+ 'letters': /[\u00C6\u01FC\u01E2]/g
2674
+ }, {
2675
+ 'base': 'AO',
2676
+ 'letters': /[\uA734]/g
2677
+ }, {
2678
+ 'base': 'AU',
2679
+ 'letters': /[\uA736]/g
2680
+ }, {
2681
+ 'base': 'AV',
2682
+ 'letters': /[\uA738\uA73A]/g
2683
+ }, {
2684
+ 'base': 'AY',
2685
+ 'letters': /[\uA73C]/g
2686
+ }, {
2687
+ 'base': 'B',
2688
+ 'letters': /[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g
2689
+ }, {
2690
+ 'base': 'C',
2691
+ 'letters': /[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g
2692
+ }, {
2693
+ 'base': 'D',
2694
+ 'letters': /[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g
2695
+ }, {
2696
+ 'base': 'DZ',
2697
+ 'letters': /[\u01F1\u01C4]/g
2698
+ }, {
2699
+ 'base': 'Dz',
2700
+ 'letters': /[\u01F2\u01C5]/g
2701
+ }, {
2702
+ 'base': 'E',
2703
+ 'letters': /[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g
2704
+ }, {
2705
+ 'base': 'F',
2706
+ 'letters': /[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g
2707
+ }, {
2708
+ 'base': 'G',
2709
+ 'letters': /[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g
2710
+ }, {
2711
+ 'base': 'H',
2712
+ 'letters': /[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g
2713
+ }, {
2714
+ 'base': 'I',
2715
+ 'letters': /[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g
2716
+ }, {
2717
+ 'base': 'J',
2718
+ 'letters': /[\u004A\u24BF\uFF2A\u0134\u0248]/g
2719
+ }, {
2720
+ 'base': 'K',
2721
+ 'letters': /[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g
2722
+ }, {
2723
+ 'base': 'L',
2724
+ 'letters': /[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g
2725
+ }, {
2726
+ 'base': 'LJ',
2727
+ 'letters': /[\u01C7]/g
2728
+ }, {
2729
+ 'base': 'Lj',
2730
+ 'letters': /[\u01C8]/g
2731
+ }, {
2732
+ 'base': 'M',
2733
+ 'letters': /[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g
2734
+ }, {
2735
+ 'base': 'N',
2736
+ 'letters': /[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g
2737
+ }, {
2738
+ 'base': 'NJ',
2739
+ 'letters': /[\u01CA]/g
2740
+ }, {
2741
+ 'base': 'Nj',
2742
+ 'letters': /[\u01CB]/g
2743
+ }, {
2744
+ 'base': 'O',
2745
+ 'letters': /[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g
2746
+ }, {
2747
+ 'base': 'OI',
2748
+ 'letters': /[\u01A2]/g
2749
+ }, {
2750
+ 'base': 'OO',
2751
+ 'letters': /[\uA74E]/g
2752
+ }, {
2753
+ 'base': 'OU',
2754
+ 'letters': /[\u0222]/g
2755
+ }, {
2756
+ 'base': 'P',
2757
+ 'letters': /[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g
2758
+ }, {
2759
+ 'base': 'Q',
2760
+ 'letters': /[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g
2761
+ }, {
2762
+ 'base': 'R',
2763
+ 'letters': /[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g
2764
+ }, {
2765
+ 'base': 'S',
2766
+ 'letters': /[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g
2767
+ }, {
2768
+ 'base': 'T',
2769
+ 'letters': /[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g
2770
+ }, {
2771
+ 'base': 'TZ',
2772
+ 'letters': /[\uA728]/g
2773
+ }, {
2774
+ 'base': 'U',
2775
+ 'letters': /[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g
2776
+ }, {
2777
+ 'base': 'V',
2778
+ 'letters': /[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g
2779
+ }, {
2780
+ 'base': 'VY',
2781
+ 'letters': /[\uA760]/g
2782
+ }, {
2783
+ 'base': 'W',
2784
+ 'letters': /[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g
2785
+ }, {
2786
+ 'base': 'X',
2787
+ 'letters': /[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g
2788
+ }, {
2789
+ 'base': 'Y',
2790
+ 'letters': /[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g
2791
+ }, {
2792
+ 'base': 'Z',
2793
+ 'letters': /[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g
2794
+ }, {
2795
+ 'base': 'a',
2796
+ 'letters': /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g
2797
+ }, {
2798
+ 'base': 'aa',
2799
+ 'letters': /[\uA733]/g
2800
+ }, {
2801
+ 'base': 'ae',
2802
+ 'letters': /[\u00E6\u01FD\u01E3]/g
2803
+ }, {
2804
+ 'base': 'ao',
2805
+ 'letters': /[\uA735]/g
2806
+ }, {
2807
+ 'base': 'au',
2808
+ 'letters': /[\uA737]/g
2809
+ }, {
2810
+ 'base': 'av',
2811
+ 'letters': /[\uA739\uA73B]/g
2812
+ }, {
2813
+ 'base': 'ay',
2814
+ 'letters': /[\uA73D]/g
2815
+ }, {
2816
+ 'base': 'b',
2817
+ 'letters': /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g
2818
+ }, {
2819
+ 'base': 'c',
2820
+ 'letters': /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g
2821
+ }, {
2822
+ 'base': 'd',
2823
+ 'letters': /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g
2824
+ }, {
2825
+ 'base': 'dz',
2826
+ 'letters': /[\u01F3\u01C6]/g
2827
+ }, {
2828
+ 'base': 'e',
2829
+ 'letters': /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g
2830
+ }, {
2831
+ 'base': 'f',
2832
+ 'letters': /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g
2833
+ }, {
2834
+ 'base': 'g',
2835
+ 'letters': /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g
2836
+ }, {
2837
+ 'base': 'h',
2838
+ 'letters': /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g
2839
+ }, {
2840
+ 'base': 'hv',
2841
+ 'letters': /[\u0195]/g
2842
+ }, {
2843
+ 'base': 'i',
2844
+ 'letters': /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g
2845
+ }, {
2846
+ 'base': 'j',
2847
+ 'letters': /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g
2848
+ }, {
2849
+ 'base': 'k',
2850
+ 'letters': /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g
2851
+ }, {
2852
+ 'base': 'l',
2853
+ 'letters': /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g
2854
+ }, {
2855
+ 'base': 'lj',
2856
+ 'letters': /[\u01C9]/g
2857
+ }, {
2858
+ 'base': 'm',
2859
+ 'letters': /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g
2860
+ }, {
2861
+ 'base': 'n',
2862
+ 'letters': /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g
2863
+ }, {
2864
+ 'base': 'nj',
2865
+ 'letters': /[\u01CC]/g
2866
+ }, {
2867
+ 'base': 'o',
2868
+ 'letters': /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g
2869
+ }, {
2870
+ 'base': 'oi',
2871
+ 'letters': /[\u01A3]/g
2872
+ }, {
2873
+ 'base': 'ou',
2874
+ 'letters': /[\u0223]/g
2875
+ }, {
2876
+ 'base': 'oo',
2877
+ 'letters': /[\uA74F]/g
2878
+ }, {
2879
+ 'base': 'p',
2880
+ 'letters': /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g
2881
+ }, {
2882
+ 'base': 'q',
2883
+ 'letters': /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g
2884
+ }, {
2885
+ 'base': 'r',
2886
+ 'letters': /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g
2887
+ }, {
2888
+ 'base': 's',
2889
+ 'letters': /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g
2890
+ }, {
2891
+ 'base': 't',
2892
+ 'letters': /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g
2893
+ }, {
2894
+ 'base': 'tz',
2895
+ 'letters': /[\uA729]/g
2896
+ }, {
2897
+ 'base': 'u',
2898
+ 'letters': /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g
2899
+ }, {
2900
+ 'base': 'v',
2901
+ 'letters': /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g
2902
+ }, {
2903
+ 'base': 'vy',
2904
+ 'letters': /[\uA761]/g
2905
+ }, {
2906
+ 'base': 'w',
2907
+ 'letters': /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g
2908
+ }, {
2909
+ 'base': 'x',
2910
+ 'letters': /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g
2911
+ }, {
2912
+ 'base': 'y',
2913
+ 'letters': /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g
2914
+ }, {
2915
+ 'base': 'z',
2916
+ 'letters': /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g
2917
+ }];
2918
+ return defaultDiacriticsRemovalMap.reduce(function (string, _ref) {
2919
+ var letters = _ref.letters,
2920
+ base = _ref.base;
2921
+ return string.replace(letters, base);
2922
+ }, str);
2923
+ };
2924
+
2925
+ var setDataKeys = function setDataKeys(data) {
2926
+ var total = 0;
2927
+ data.forEach(function (row, i) {
2928
+ if (row.type === 'optgroup') {
2929
+ row._key = "group_".concat(i);
2930
+ row.visible = typeof row.visible === 'undefined' ? true : row.visible;
2931
+ row.children.forEach(function (child, j) {
2932
+ child._key = "option_".concat(i, "_").concat(j);
2933
+ child.visible = typeof child.visible === 'undefined' ? true : child.visible;
2934
+ });
2935
+ total += row.children.length;
2936
+ } else {
2937
+ row._key = "option_".concat(i);
2938
+ row.visible = typeof row.visible === 'undefined' ? true : row.visible;
2939
+ total += 1;
2940
+ }
2941
+ });
2942
+ return total;
2943
+ };
2944
+
2945
+ var findByParam = function findByParam(data, param, value) {
2946
+ var _iteratorNormalCompletion = true;
2947
+ var _didIteratorError = false;
2948
+ var _iteratorError = undefined;
2949
+
2950
+ try {
2951
+ for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2952
+ var row = _step.value;
2953
+
2954
+ if (row[param] === value || row[param] === +row[param] + '' && +row[param] === value) {
2955
+ return row;
2956
+ }
2957
+
2958
+ if (row.type === 'optgroup') {
2959
+ var _iteratorNormalCompletion2 = true;
2960
+ var _didIteratorError2 = false;
2961
+ var _iteratorError2 = undefined;
2962
+
2963
+ try {
2964
+ for (var _iterator2 = row.children[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
2965
+ var child = _step2.value;
2966
+
2967
+ if (child[param] === value || child[param] === +child[param] + '' && +child[param] === value) {
2968
+ return child;
2969
+ }
2970
+ }
2971
+ } catch (err) {
2972
+ _didIteratorError2 = true;
2973
+ _iteratorError2 = err;
2974
+ } finally {
2975
+ try {
2976
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
2977
+ _iterator2.return();
2978
+ }
2979
+ } finally {
2980
+ if (_didIteratorError2) {
2981
+ throw _iteratorError2;
2982
+ }
2983
+ }
2984
+ }
2985
+ }
2986
+ }
2987
+ } catch (err) {
2988
+ _didIteratorError = true;
2989
+ _iteratorError = err;
2990
+ } finally {
2991
+ try {
2992
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2993
+ _iterator.return();
2994
+ }
2995
+ } finally {
2996
+ if (_didIteratorError) {
2997
+ throw _iteratorError;
2998
+ }
2999
+ }
3000
+ }
3001
+ };
3002
+
3003
+ var removeUndefined = function removeUndefined(obj) {
3004
+ Object.keys(obj).forEach(function (key) {
3005
+ return obj[key] === undefined ? delete obj[key] : '';
3006
+ });
3007
+ return obj;
3008
+ };
3009
+
3010
+ var getDocumentClickEvent = function getDocumentClickEvent() {
3011
+ var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3012
+ id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
3013
+ return "click.multiple-select-".concat(id);
3014
+ };
3015
+
3016
+ var MultipleSelect =
3017
+ /*#__PURE__*/
3018
+ function () {
3019
+ function MultipleSelect($el, options) {
3020
+ _classCallCheck(this, MultipleSelect);
3021
+
3022
+ this.$el = $el;
3023
+ this.options = $.extend({}, Constants.DEFAULTS, options);
3024
+ }
3025
+
3026
+ _createClass(MultipleSelect, [{
3027
+ key: "init",
3028
+ value: function init() {
3029
+ this.initLocale();
3030
+ this.initContainer();
3031
+ this.initData();
3032
+ this.initSelected(true);
3033
+ this.initFilter();
3034
+ this.initDrop();
3035
+ this.initView();
3036
+ this.options.onAfterCreate();
3037
+ }
3038
+ }, {
3039
+ key: "initLocale",
3040
+ value: function initLocale() {
3041
+ if (this.options.locale) {
3042
+ var locales = $.fn.multipleSelect.locales;
3043
+ var parts = this.options.locale.split(/-|_/);
3044
+ parts[0] = parts[0].toLowerCase();
3045
+
3046
+ if (parts[1]) {
3047
+ parts[1] = parts[1].toUpperCase();
3048
+ }
3049
+
3050
+ if (locales[this.options.locale]) {
3051
+ $.extend(this.options, locales[this.options.locale]);
3052
+ } else if (locales[parts.join('-')]) {
3053
+ $.extend(this.options, locales[parts.join('-')]);
3054
+ } else if (locales[parts[0]]) {
3055
+ $.extend(this.options, locales[parts[0]]);
3056
+ }
3057
+ }
3058
+ }
3059
+ }, {
3060
+ key: "initContainer",
3061
+ value: function initContainer() {
3062
+ var _this = this;
3063
+
3064
+ var el = this.$el[0];
3065
+ var name = el.getAttribute('name') || this.options.name || ''; // hide select element
3066
+
3067
+ this.$el.hide(); // label element
3068
+
3069
+ this.$label = this.$el.closest('label');
3070
+
3071
+ if (!this.$label.length && this.$el.attr('id')) {
3072
+ this.$label = $("label[for=\"".concat(this.$el.attr('id'), "\"]"));
3073
+ }
3074
+
3075
+ if (this.$label.find('>input').length) {
3076
+ this.$label = null;
3077
+ } // single or multiple
3078
+
3079
+
3080
+ if (typeof this.options.single === 'undefined') {
3081
+ this.options.single = el.getAttribute('multiple') === null;
3082
+ } // restore class and title from select element
3083
+
3084
+
3085
+ this.$parent = $("\n <div class=\"ms-parent ".concat(el.getAttribute('class') || '', "\"\n title=\"").concat(el.getAttribute('title') || '', "\" />\n ")); // add placeholder to choice button
3086
+
3087
+ this.options.placeholder = this.options.placeholder || el.getAttribute('placeholder') || '';
3088
+ this.tabIndex = el.getAttribute('tabindex');
3089
+ var tabIndex = '';
3090
+
3091
+ if (this.tabIndex !== null) {
3092
+ this.$el.attr('tabindex', -1);
3093
+ tabIndex = this.tabIndex && "tabindex=\"".concat(this.tabIndex, "\"");
3094
+ }
3095
+
3096
+ this.$choice = $("\n <button type=\"button\" class=\"ms-choice\"".concat(tabIndex, ">\n <span class=\"placeholder\">").concat(this.options.placeholder, "</span>\n ").concat(this.options.showClear ? '<div class="icon-close"></div>' : '', "\n <div class=\"icon-caret\"></div>\n </button>\n ")); // default position is bottom
3097
+
3098
+ this.$drop = $("<div class=\"ms-drop ".concat(this.options.position, "\" />"));
3099
+ this.$close = this.$choice.find('.icon-close');
3100
+
3101
+ if (this.options.dropWidth) {
3102
+ this.$drop.css('width', this.options.dropWidth);
3103
+ }
3104
+
3105
+ this.$el.after(this.$parent);
3106
+ this.$parent.append(this.$choice);
3107
+ this.$parent.append(this.$drop);
3108
+
3109
+ if (el.disabled) {
3110
+ this.$choice.addClass('disabled');
3111
+ }
3112
+
3113
+ this.selectAllName = "data-name=\"selectAll".concat(name, "\"");
3114
+ this.selectGroupName = "data-name=\"selectGroup".concat(name, "\"");
3115
+ this.selectItemName = "data-name=\"selectItem".concat(name, "\"");
3116
+
3117
+ if (!this.options.keepOpen) {
3118
+ var clickEvent = getDocumentClickEvent(this.$el.attr('id'));
3119
+ $(document).off(clickEvent).on(clickEvent, function (e) {
3120
+ if ($(e.target)[0] === _this.$choice[0] || $(e.target).parents('.ms-choice')[0] === _this.$choice[0]) {
3121
+ return;
3122
+ }
3123
+
3124
+ if (($(e.target)[0] === _this.$drop[0] || $(e.target).parents('.ms-drop')[0] !== _this.$drop[0] && e.target !== el) && _this.options.isOpen) {
3125
+ _this.close();
3126
+ }
3127
+ });
3128
+ }
3129
+ }
3130
+ }, {
3131
+ key: "initData",
3132
+ value: function initData() {
3133
+ var _this2 = this;
3134
 
3135
+ var data = [];
 
 
 
 
3136
 
3137
+ if (this.options.data) {
3138
+ if (Array.isArray(this.options.data)) {
3139
+ this.data = this.options.data.map(function (it) {
3140
+ if (typeof it === 'string' || typeof it === 'number') {
3141
+ return {
3142
+ text: it,
3143
+ value: it
3144
+ };
3145
+ }
3146
+
3147
+ return it;
3148
+ });
3149
+ } else if (_typeof(this.options.data) === 'object') {
3150
+ for (var _i = 0, _Object$entries = Object.entries(this.options.data); _i < _Object$entries.length; _i++) {
3151
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
3152
+ value = _Object$entries$_i[0],
3153
+ text = _Object$entries$_i[1];
3154
 
3155
+ data.push({
3156
+ value: value,
3157
+ text: text
3158
+ });
3159
  }
 
 
 
 
3160
 
3161
+ this.data = data;
3162
+ }
3163
+ } else {
3164
+ $.each(this.$el.children(), function (i, elm) {
3165
+ var row = _this2.initRow(i, elm);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3166
 
3167
+ if (row) {
3168
+ data.push(_this2.initRow(i, elm));
3169
+ }
3170
+ });
3171
+ this.options.data = data;
3172
+ this.data = data;
3173
+ this.fromHtml = true;
3174
+ }
3175
 
3176
+ this.dataTotal = setDataKeys(this.data);
3177
+ }
3178
+ }, {
3179
+ key: "initRow",
3180
+ value: function initRow(i, elm, groupDisabled) {
3181
+ var _this3 = this;
3182
 
3183
+ var row = {};
3184
+ var $elm = $(elm);
3185
 
3186
+ if ($elm.is('option')) {
3187
+ row.type = 'option';
3188
+ row.text = this.options.textTemplate($elm);
3189
+ row.value = elm.value;
3190
+ row.visible = true;
3191
+ row.selected = !!elm.selected;
3192
+ row.disabled = groupDisabled || elm.disabled;
3193
+ row.classes = elm.getAttribute('class') || '';
3194
+ row.title = elm.getAttribute('title') || '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3195
 
3196
+ if ($elm.data('value')) {
3197
+ row._value = $elm.data('value'); // value for object
3198
+ }
3199
 
3200
+ if (Object.keys($elm.data()).length) {
3201
+ row._data = $elm.data();
3202
+ }
3203
+
3204
+ return row;
3205
  }
 
 
 
 
3206
 
3207
+ if ($elm.is('optgroup')) {
3208
+ row.type = 'optgroup';
3209
+ row.label = this.options.labelTemplate($elm);
3210
+ row.visible = true;
3211
+ row.selected = !!elm.selected;
3212
+ row.disabled = elm.disabled;
3213
+ row.children = [];
3214
 
3215
+ if (Object.keys($elm.data()).length) {
3216
+ row._data = $elm.data();
3217
+ }
3218
+
3219
+ $.each($elm.children(), function (j, elem) {
3220
+ row.children.push(_this3.initRow(j, elem, row.disabled));
3221
+ });
3222
+ return row;
 
 
 
 
3223
  }
 
3224
 
3225
+ return null;
3226
+ }
3227
+ }, {
3228
+ key: "initSelected",
3229
+ value: function initSelected(ignoreTrigger) {
3230
+ var selectedTotal = 0;
3231
+ var _iteratorNormalCompletion = true;
3232
+ var _didIteratorError = false;
3233
+ var _iteratorError = undefined;
3234
+
3235
+ try {
3236
+ for (var _iterator = this.data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3237
+ var row = _step.value;
3238
+
3239
+ if (row.type === 'optgroup') {
3240
+ var selectedCount = row.children.filter(function (child) {
3241
+ return child.selected && !child.disabled && child.visible;
3242
+ }).length;
3243
+ row.selected = selectedCount && selectedCount === row.children.filter(function (child) {
3244
+ return !child.disabled && child.visible;
3245
+ }).length;
3246
+ selectedTotal += selectedCount;
3247
+ } else {
3248
+ selectedTotal += row.selected && !row.disabled && row.visible ? 1 : 0;
3249
+ }
3250
+ }
3251
+ } catch (err) {
3252
+ _didIteratorError = true;
3253
+ _iteratorError = err;
3254
+ } finally {
3255
+ try {
3256
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
3257
+ _iterator.return();
3258
+ }
3259
+ } finally {
3260
+ if (_didIteratorError) {
3261
+ throw _iteratorError;
3262
+ }
3263
+ }
3264
+ }
3265
+
3266
+ this.allSelected = this.data.filter(function (row) {
3267
+ return row.selected && !row.disabled && row.visible;
3268
+ }).length === this.data.filter(function (row) {
3269
+ return !row.disabled && row.visible;
3270
+ }).length;
3271
+
3272
+ if (!ignoreTrigger) {
3273
+ if (this.allSelected) {
3274
+ this.options.onCheckAll();
3275
+ } else if (selectedTotal === 0) {
3276
+ this.options.onUncheckAll();
3277
+ }
3278
+ }
3279
+ }
3280
+ }, {
3281
+ key: "initFilter",
3282
+ value: function initFilter() {
3283
+ this.filterText = '';
3284
+
3285
+ if (this.options.filter || !this.options.filterByDataLength) {
3286
+ return;
3287
+ }
3288
+
3289
+ var length = 0;
3290
+ var _iteratorNormalCompletion2 = true;
3291
+ var _didIteratorError2 = false;
3292
+ var _iteratorError2 = undefined;
3293
+
3294
+ try {
3295
+ for (var _iterator2 = this.data[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
3296
+ var option = _step2.value;
3297
+
3298
+ if (option.type === 'optgroup') {
3299
+ length += option.children.length;
3300
+ } else {
3301
+ length += 1;
3302
+ }
3303
+ }
3304
+ } catch (err) {
3305
+ _didIteratorError2 = true;
3306
+ _iteratorError2 = err;
3307
+ } finally {
3308
+ try {
3309
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
3310
+ _iterator2.return();
3311
+ }
3312
+ } finally {
3313
+ if (_didIteratorError2) {
3314
+ throw _iteratorError2;
3315
+ }
3316
+ }
3317
+ }
3318
+
3319
+ this.options.filter = length > this.options.filterByDataLength;
3320
+ }
3321
+ }, {
3322
+ key: "initDrop",
3323
+ value: function initDrop() {
3324
+ var _this4 = this;
3325
+
3326
+ this.initList();
3327
+ this.update(true);
3328
+
3329
+ if (this.options.isOpen) {
3330
+ setTimeout(function () {
3331
+ _this4.open();
3332
+ }, 50);
3333
+ }
3334
+
3335
+ if (this.options.openOnHover) {
3336
+ this.$parent.hover(function () {
3337
+ _this4.open();
3338
+ }, function () {
3339
+ _this4.close();
3340
+ });
3341
+ }
3342
+ }
3343
+ }, {
3344
+ key: "initList",
3345
+ value: function initList() {
3346
+ var html = [];
3347
+
3348
+ if (this.options.filter) {
3349
+ html.push("\n <div class=\"ms-search\">\n <input type=\"text\" autocomplete=\"off\" autocorrect=\"off\"\n autocapitalize=\"off\" spellcheck=\"false\"\n placeholder=\"".concat(this.options.filterPlaceholder, "\">\n </div>\n "));
3350
+ }
3351
+
3352
+ html.push('<ul></ul>');
3353
+ this.$drop.html(html.join(''));
3354
+ this.$ul = this.$drop.find('>ul');
3355
+ this.initListItems();
3356
+ }
3357
+ }, {
3358
+ key: "initListItems",
3359
+ value: function initListItems() {
3360
+ var _this5 = this;
3361
+
3362
+ var rows = this.getListRows();
3363
+ var offset = 0;
3364
+
3365
+ if (this.options.selectAll && !this.options.single) {
3366
+ offset = -1;
3367
+ }
3368
+
3369
+ if (rows.length > Constants.BLOCK_ROWS * Constants.CLUSTER_BLOCKS) {
3370
+ if (this.virtualScroll) {
3371
+ this.virtualScroll.destroy();
3372
+ }
3373
 
3374
+ var dropVisible = this.$drop.is(':visible');
 
 
3375
 
3376
+ if (!dropVisible) {
3377
+ this.$drop.css('left', -10000).show();
3378
+ }
3379
 
3380
+ var updateDataOffset = function updateDataOffset() {
3381
+ _this5.updateDataStart = _this5.virtualScroll.dataStart + offset;
3382
+ _this5.updateDataEnd = _this5.virtualScroll.dataEnd + offset;
3383
+
3384
+ if (_this5.updateDataStart < 0) {
3385
+ _this5.updateDataStart = 0;
3386
  }
3387
 
3388
+ if (_this5.updateDataEnd > _this5.data.length) {
3389
+ _this5.updateDataEnd = _this5.data.length;
 
 
 
 
 
 
 
 
 
3390
  }
3391
+ };
3392
 
3393
+ this.virtualScroll = new VirtualScroll({
3394
+ rows: rows,
3395
+ scrollEl: this.$ul[0],
3396
+ contentEl: this.$ul[0],
3397
+ callback: function callback() {
3398
+ updateDataOffset();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3399
 
3400
+ _this5.events();
 
 
 
 
 
 
 
 
 
 
3401
  }
3402
+ });
3403
+ updateDataOffset();
3404
 
3405
+ if (!dropVisible) {
3406
+ this.$drop.css('left', 0).hide();
3407
+ }
3408
+ } else {
3409
+ this.$ul.html(rows.join(''));
3410
+ this.updateDataStart = 0;
3411
+ this.updateDataEnd = this.updateData.length;
3412
+ this.virtualScroll = null;
3413
+ }
3414
 
3415
+ this.events();
3416
+ }
3417
+ }, {
3418
+ key: "getListRows",
3419
+ value: function getListRows() {
3420
+ var _this6 = this;
 
 
3421
 
3422
+ var rows = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3423
 
3424
+ if (this.options.selectAll && !this.options.single) {
3425
+ rows.push("\n <li class=\"ms-select-all\">\n <label>\n <input type=\"checkbox\" ".concat(this.selectAllName).concat(this.allSelected ? ' checked="checked"' : '', " />\n <span>").concat(this.options.formatSelectAll(), "</span>\n </label>\n </li>\n "));
3426
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3427
 
3428
+ this.updateData = [];
3429
+ this.data.forEach(function (row) {
3430
+ rows.push.apply(rows, _toConsumableArray(_this6.initListItem(row)));
3431
+ });
3432
+ rows.push("<li class=\"ms-no-results\">".concat(this.options.formatNoMatchesFound(), "</li>"));
3433
+ return rows;
3434
+ }
3435
+ }, {
3436
+ key: "initListItem",
3437
+ value: function initListItem(row) {
3438
+ var _this7 = this;
3439
+
3440
+ var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3441
+ var title = row.title ? "title=\"".concat(row.title, "\"") : '';
3442
+ var multiple = this.options.multiple ? 'multiple' : '';
3443
+ var type = this.options.single ? 'radio' : 'checkbox';
3444
+ var classes = '';
3445
+
3446
+ if (!row.visible) {
3447
+ return [];
3448
+ }
3449
+
3450
+ this.updateData.push(row);
3451
+
3452
+ if (this.options.single && !this.options.singleRadio) {
3453
+ classes = 'hide-radio ';
3454
+ }
3455
+
3456
+ if (row.selected) {
3457
+ classes += 'selected ';
3458
+ }
3459
+
3460
+ if (row.type === 'optgroup') {
3461
+ var _customStyle = this.options.styler(row);
3462
+
3463
+ var _style = _customStyle ? "style=\"".concat(_customStyle, "\"") : '';
3464
+
3465
+ var html = [];
3466
+ var group = this.options.hideOptgroupCheckboxes || this.options.single ? "<span ".concat(this.selectGroupName, " data-key=\"").concat(row._key, "\"></span>") : "<input type=\"checkbox\"\n ".concat(this.selectGroupName, "\n data-key=\"").concat(row._key, "\"\n ").concat(row.selected ? ' checked="checked"' : '', "\n ").concat(row.disabled ? ' disabled="disabled"' : '', "\n >");
3467
+
3468
+ if (!classes.includes('hide-radio') && (this.options.hideOptgroupCheckboxes || this.options.single)) {
3469
+ classes += 'hide-radio ';
3470
+ }
3471
+
3472
+ html.push("\n <li class=\"group ".concat(classes, "\" ").concat(_style, ">\n <label class=\"optgroup").concat(this.options.single || row.disabled ? ' disabled' : '', "\">\n ").concat(group).concat(row.label, "\n </label>\n </li>\n "));
3473
+ row.children.forEach(function (child) {
3474
+ html.push.apply(html, _toConsumableArray(_this7.initListItem(child, 1)));
3475
+ });
3476
+ return html;
3477
+ }
3478
+
3479
+ var customStyle = this.options.styler(row);
3480
+ var style = customStyle ? "style=\"".concat(customStyle, "\"") : '';
3481
+ classes += row.classes || '';
3482
+
3483
+ if (level && this.options.single) {
3484
+ classes += "option-level-".concat(level, " ");
3485
+ }
3486
+
3487
+ return ["\n <li class=\"".concat(multiple, " ").concat(classes, "\" ").concat(title, " ").concat(style, ">\n <label class=\"").concat(row.disabled ? 'disabled' : '', "\">\n <input type=\"").concat(type, "\"\n value=\"").concat(row.value, "\"\n data-key=\"").concat(row._key, "\"\n ").concat(this.selectItemName, "\n ").concat(row.selected ? ' checked="checked"' : '', "\n ").concat(row.disabled ? ' disabled="disabled"' : '', "\n >\n <span>").concat(row.text, "</span>\n </label>\n </li>\n ")];
3488
+ }
3489
+ }, {
3490
+ key: "events",
3491
+ value: function events() {
3492
+ var _this8 = this;
3493
+
3494
+ this.$searchInput = this.$drop.find('.ms-search input');
3495
+ this.$selectAll = this.$drop.find("input[".concat(this.selectAllName, "]"));
3496
+ this.$selectGroups = this.$drop.find("input[".concat(this.selectGroupName, "],span[").concat(this.selectGroupName, "]"));
3497
+ this.$selectItems = this.$drop.find("input[".concat(this.selectItemName, "]:enabled"));
3498
+ this.$disableItems = this.$drop.find("input[".concat(this.selectItemName, "]:disabled"));
3499
+ this.$noResults = this.$drop.find('.ms-no-results');
3500
+
3501
+ var toggleOpen = function toggleOpen(e) {
3502
+ e.preventDefault();
3503
+
3504
+ if ($(e.target).hasClass('icon-close')) {
3505
+ return;
3506
+ }
3507
+
3508
+ _this8[_this8.options.isOpen ? 'close' : 'open']();
3509
+ };
3510
+
3511
+ if (this.$label && this.$label.length) {
3512
+ this.$label.off('click').on('click', function (e) {
3513
+ if (e.target.nodeName.toLowerCase() !== 'label') {
3514
+ return;
 
 
 
 
 
 
 
3515
  }
3516
 
3517
+ toggleOpen(e);
3518
+
3519
+ if (!_this8.options.filter || !_this8.options.isOpen) {
3520
+ _this8.focus();
3521
  }
3522
 
3523
+ e.stopPropagation(); // Causes lost focus otherwise
3524
+ });
3525
+ }
3526
+
3527
+ this.$choice.off('click').on('click', toggleOpen).off('focus').on('focus', this.options.onFocus).off('blur').on('blur', this.options.onBlur);
3528
+ this.$parent.off('keydown').on('keydown', function (e) {
3529
+ // esc key
3530
+ if (e.which === 27 && !_this8.options.keepOpen) {
3531
+ _this8.close();
3532
 
3533
+ _this8.$choice.focus();
3534
+ }
3535
+ });
3536
+ this.$close.off('click').on('click', function (e) {
3537
+ e.preventDefault();
3538
+
3539
+ _this8._checkAll(false, true);
3540
 
3541
+ _this8.initSelected(false);
3542
+
3543
+ _this8.updateSelected();
3544
+
3545
+ _this8.update();
3546
+
3547
+ _this8.options.onClear();
3548
+ });
3549
+ this.$searchInput.off('keydown').on('keydown', function (e) {
3550
+ // Ensure shift-tab causes lost focus from filter as with clicking away
3551
+ if (e.keyCode === 9 && e.shiftKey) {
3552
+ _this8.close();
3553
+ }
3554
+ }).off('keyup').on('keyup', function (e) {
3555
+ // enter or space
3556
+ // Avoid selecting/deselecting if no choices made
3557
+ if (_this8.options.filterAcceptOnEnter && [13, 32].includes(e.which) && _this8.$searchInput.val()) {
3558
+ if (_this8.options.single) {
3559
+ var $items = _this8.$selectItems.closest('li').filter(':visible');
3560
+
3561
+ if ($items.length) {
3562
+ _this8.setSelects([$items.first().find("input[".concat(_this8.selectItemName, "]")).val()]);
3563
+ }
3564
+ } else {
3565
+ _this8.$selectAll.click();
3566
  }
 
3567
 
3568
+ _this8.close();
3569
+
3570
+ _this8.focus();
3571
+
3572
+ return;
3573
+ }
3574
+
3575
+ _this8.filter();
3576
+ });
3577
+ this.$selectAll.off('click').on('click', function (e) {
3578
+ _this8._checkAll($(e.currentTarget).prop('checked'));
3579
+ });
3580
+ this.$selectGroups.off('click').on('click', function (e) {
3581
+ var $this = $(e.currentTarget);
3582
+ var checked = $this.prop('checked');
3583
+ var group = findByParam(_this8.data, '_key', $this.data('key'));
3584
+
3585
+ _this8._checkGroup(group, checked);
3586
+
3587
+ _this8.options.onOptgroupClick(removeUndefined({
3588
+ label: group.label,
3589
+ selected: group.selected,
3590
+ data: group._data,
3591
+ children: group.children.map(function (child) {
3592
+ return removeUndefined({
3593
+ text: child.text,
3594
+ value: child.value,
3595
+ selected: child.selected,
3596
+ disabled: child.disabled,
3597
+ data: child._data
3598
+ });
3599
+ })
3600
+ }));
3601
+ });
3602
+ this.$selectItems.off('click').on('click', function (e) {
3603
+ var $this = $(e.currentTarget);
3604
+ var checked = $this.prop('checked');
3605
+ var option = findByParam(_this8.data, '_key', $this.data('key'));
3606
+
3607
+ _this8._check(option, checked);
3608
+
3609
+ _this8.options.onClick(removeUndefined({
3610
+ text: option.text,
3611
+ value: option.value,
3612
+ selected: option.selected,
3613
+ data: option._data
3614
+ }));
3615
+
3616
+ if (_this8.options.single && _this8.options.isOpen && !_this8.options.keepOpen) {
3617
+ _this8.close();
3618
+ }
3619
+ });
3620
+ }
3621
+ }, {
3622
+ key: "initView",
3623
+ value: function initView() {
3624
+ var computedWidth;
3625
+
3626
+ if (window.getComputedStyle) {
3627
+ computedWidth = window.getComputedStyle(this.$el[0]).width;
3628
+
3629
+ if (computedWidth === 'auto') {
3630
+ computedWidth = this.$drop.outerWidth() + 20;
3631
+ }
3632
+ } else {
3633
+ computedWidth = this.$el.outerWidth() + 20;
3634
+ }
3635
+
3636
+ this.$parent.css('width', this.options.width || computedWidth);
3637
+ this.$el.show().addClass('ms-offscreen');
3638
+ }
3639
+ }, {
3640
+ key: "open",
3641
+ value: function open() {
3642
+ if (this.$choice.hasClass('disabled')) {
3643
+ return;
3644
+ }
3645
+
3646
+ this.options.isOpen = true;
3647
+ this.$choice.find('>div').addClass('open');
3648
+ this.$drop[this.animateMethod('show')](); // fix filter bug: no results show
3649
 
3650
+ this.$selectAll.parent().show();
3651
+ this.$noResults.hide(); // Fix #77: 'All selected' when no options
3652
+
3653
+ if (!this.data.length) {
3654
+ this.$selectAll.parent().hide();
3655
+ this.$noResults.show();
3656
+ }
3657
+
3658
+ if (this.options.container) {
3659
+ var offset = this.$drop.offset();
3660
+ this.$drop.appendTo($(this.options.container));
3661
+ this.$drop.offset({
3662
+ top: offset.top,
3663
+ left: offset.left
3664
+ }).css('min-width', 'auto').outerWidth(this.$parent.outerWidth());
3665
+ }
3666
+
3667
+ var maxHeight = this.options.maxHeight;
3668
+
3669
+ if (this.options.maxHeightUnit === 'row') {
3670
+ maxHeight = this.$drop.find('>ul>li').first().outerHeight() * this.options.maxHeight;
3671
+ }
3672
+
3673
+ this.$drop.find('>ul').css('max-height', "".concat(maxHeight, "px"));
3674
+ this.$drop.find('.multiple').css('width', "".concat(this.options.multipleWidth, "px"));
3675
+
3676
+ if (this.data.length && this.options.filter) {
3677
+ this.$searchInput.val('');
3678
+ this.$searchInput.focus();
3679
+ this.filter(true);
3680
+ }
3681
+
3682
+ this.options.onOpen();
3683
+ }
3684
+ }, {
3685
+ key: "close",
3686
+ value: function close() {
3687
+ this.options.isOpen = false;
3688
+ this.$choice.find('>div').removeClass('open');
3689
+ this.$drop[this.animateMethod('hide')]();
3690
+
3691
+ if (this.options.container) {
3692
+ this.$parent.append(this.$drop);
3693
+ this.$drop.css({
3694
+ 'top': 'auto',
3695
+ 'left': 'auto'
3696
+ });
3697
+ }
3698
+
3699
+ this.options.onClose();
3700
+ }
3701
+ }, {
3702
+ key: "animateMethod",
3703
+ value: function animateMethod(method) {
3704
+ var methods = {
3705
+ show: {
3706
+ fade: 'fadeIn',
3707
+ slide: 'slideDown'
3708
+ },
3709
+ hide: {
3710
+ fade: 'fadeOut',
3711
+ slide: 'slideUp'
3712
+ }
3713
+ };
3714
+ return methods[method][this.options.animate] || method;
3715
+ }
3716
+ }, {
3717
+ key: "update",
3718
+ value: function update(ignoreTrigger) {
3719
+ var valueSelects = this.getSelects();
3720
+ var textSelects = this.getSelects('text');
3721
+
3722
+ if (this.options.displayValues) {
3723
+ textSelects = valueSelects;
3724
+ }
3725
+
3726
+ var $span = this.$choice.find('>span');
3727
+ var sl = valueSelects.length;
3728
+ var html = '';
3729
+
3730
+ if (sl === 0) {
3731
+ $span.addClass('placeholder').html(this.options.placeholder);
3732
+ } else if (sl < this.options.minimumCountSelected) {
3733
+ html = textSelects.join(this.options.displayDelimiter);
3734
+ } else if (this.options.formatAllSelected() && sl === this.dataTotal) {
3735
+ html = this.options.formatAllSelected();
3736
+ } else if (this.options.ellipsis && sl > this.options.minimumCountSelected) {
3737
+ html = "".concat(textSelects.slice(0, this.options.minimumCountSelected).join(this.options.displayDelimiter), "...");
3738
+ } else if (this.options.formatCountSelected() && sl > this.options.minimumCountSelected) {
3739
+ html = this.options.formatCountSelected(sl, this.dataTotal);
3740
+ } else {
3741
+ html = textSelects.join(this.options.displayDelimiter);
3742
+ }
3743
+
3744
+ if (html) {
3745
+ $span.removeClass('placeholder').html(html);
3746
+ }
3747
+
3748
+ if (this.options.displayTitle) {
3749
+ $span.prop('title', this.getSelects('text'));
3750
+ } // set selects to select
3751
+
3752
+
3753
+ this.$el.val(this.getSelects()); // trigger <select> change event
3754
+
3755
+ if (!ignoreTrigger) {
3756
+ this.$el.trigger('change');
3757
+ }
3758
+ }
3759
+ }, {
3760
+ key: "updateSelected",
3761
+ value: function updateSelected() {
3762
+ for (var i = this.updateDataStart; i < this.updateDataEnd; i++) {
3763
+ var row = this.updateData[i];
3764
+ this.$drop.find("input[data-key=".concat(row._key, "]")).prop('checked', row.selected).closest('li').toggleClass('selected', row.selected);
3765
+ }
3766
+
3767
+ var noResult = this.data.filter(function (row) {
3768
+ return row.visible;
3769
+ }).length === 0;
3770
+
3771
+ if (this.$selectAll.length) {
3772
+ this.$selectAll.prop('checked', this.allSelected).closest('li').toggle(!noResult);
3773
+ }
3774
+
3775
+ this.$noResults.toggle(noResult);
3776
+
3777
+ if (this.virtualScroll) {
3778
+ this.virtualScroll.rows = this.getListRows();
3779
+ }
3780
+ }
3781
+ }, {
3782
+ key: "getOptions",
3783
+ value: function getOptions() {
3784
+ // deep copy and remove data
3785
+ var options = $.extend({}, this.options);
3786
+ delete options.data;
3787
+ return $.extend(true, {}, options);
3788
+ }
3789
+ }, {
3790
+ key: "refreshOptions",
3791
+ value: function refreshOptions(options) {
3792
+ // If the objects are equivalent then avoid the call of destroy / init methods
3793
+ if (compareObjects(this.options, options, true)) {
3794
+ return;
3795
+ }
3796
+
3797
+ this.options = $.extend(this.options, options);
3798
+ this.destroy();
3799
+ this.init();
3800
+ } // value html, or text, default: 'value'
3801
+
3802
+ }, {
3803
+ key: "getSelects",
3804
+ value: function getSelects() {
3805
+ var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'value';
3806
+ var values = [];
3807
+ var _iteratorNormalCompletion3 = true;
3808
+ var _didIteratorError3 = false;
3809
+ var _iteratorError3 = undefined;
3810
+
3811
+ try {
3812
+ for (var _iterator3 = this.data[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
3813
+ var row = _step3.value;
3814
+
3815
+ if (row.type === 'optgroup') {
3816
+ var selectedChildren = row.children.filter(function (child) {
3817
+ return child.selected;
3818
+ });
3819
+
3820
+ if (!selectedChildren.length) {
3821
+ continue;
3822
+ }
3823
+
3824
+ if (type === 'value' || this.options.single) {
3825
+ values.push.apply(values, _toConsumableArray(selectedChildren.map(function (child) {
3826
+ return type === 'value' ? child._value || child[type] : child[type];
3827
+ })));
3828
+ } else {
3829
+ var value = [];
3830
+ value.push('[');
3831
+ value.push(row.label);
3832
+ value.push(": ".concat(selectedChildren.map(function (child) {
3833
+ return child[type];
3834
+ }).join(', ')));
3835
+ value.push(']');
3836
+ values.push(value.join(''));
3837
+ }
3838
+ } else if (row.selected) {
3839
+ values.push(type === 'value' ? row._value || row[type] : row[type]);
3840
  }
3841
+ }
3842
+ } catch (err) {
3843
+ _didIteratorError3 = true;
3844
+ _iteratorError3 = err;
3845
+ } finally {
3846
+ try {
3847
+ if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
3848
+ _iterator3.return();
3849
  }
3850
+ } finally {
3851
+ if (_didIteratorError3) {
3852
+ throw _iteratorError3;
3853
+ }
3854
+ }
3855
+ }
3856
 
3857
+ return values;
3858
+ }
3859
+ }, {
3860
+ key: "setSelects",
3861
+ value: function setSelects(values, ignoreTrigger) {
3862
+ var hasChanged = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
3863
 
3864
+ var _setSelects = function _setSelects(rows) {
3865
+ var _iteratorNormalCompletion4 = true;
3866
+ var _didIteratorError4 = false;
3867
+ var _iteratorError4 = undefined;
 
 
 
 
 
 
 
 
3868
 
3869
+ try {
3870
+ for (var _iterator4 = rows[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
3871
+ var row = _step4.value;
3872
+ var selected = values.includes(row._value || row.value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3873
 
3874
+ if (!selected && row.value === +row.value + '') {
3875
+ selected = values.includes(+row.value);
3876
+ }
3877
 
3878
+ if (row.selected !== selected) {
3879
+ hasChanged = true;
3880
+ }
3881
 
3882
+ row.selected = selected;
3883
+ }
3884
+ } catch (err) {
3885
+ _didIteratorError4 = true;
3886
+ _iteratorError4 = err;
3887
+ } finally {
3888
+ try {
3889
+ if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
3890
+ _iterator4.return();
3891
+ }
3892
+ } finally {
3893
+ if (_didIteratorError4) {
3894
+ throw _iteratorError4;
3895
+ }
3896
+ }
3897
+ }
3898
+ };
3899
 
3900
+ var _iteratorNormalCompletion5 = true;
3901
+ var _didIteratorError5 = false;
3902
+ var _iteratorError5 = undefined;
 
 
 
 
3903
 
3904
+ try {
3905
+ for (var _iterator5 = this.data[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
3906
+ var row = _step5.value;
3907
+
3908
+ if (row.type === 'optgroup') {
3909
+ _setSelects(row.children);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3910
  } else {
3911
+ _setSelects([row]);
3912
+ }
3913
+ }
3914
+ } catch (err) {
3915
+ _didIteratorError5 = true;
3916
+ _iteratorError5 = err;
3917
+ } finally {
3918
+ try {
3919
+ if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
3920
+ _iterator5.return();
3921
+ }
3922
+ } finally {
3923
+ if (_didIteratorError5) {
3924
+ throw _iteratorError5;
 
 
 
 
 
 
3925
  }
3926
+ }
3927
+ }
3928
+
3929
+ if (hasChanged) {
3930
+ this.initSelected(ignoreTrigger);
3931
+ this.updateSelected();
3932
+ this.update(ignoreTrigger);
3933
+ }
3934
+ }
3935
+ }, {
3936
+ key: "enable",
3937
+ value: function enable() {
3938
+ this.$choice.removeClass('disabled');
3939
+ }
3940
+ }, {
3941
+ key: "disable",
3942
+ value: function disable() {
3943
+ this.$choice.addClass('disabled');
3944
+ }
3945
+ }, {
3946
+ key: "check",
3947
+ value: function check(value) {
3948
+ var option = findByParam(this.data, 'value', value);
3949
+
3950
+ if (!option) {
3951
+ return;
3952
+ }
3953
+
3954
+ this._check(option, true);
3955
+ }
3956
+ }, {
3957
+ key: "uncheck",
3958
+ value: function uncheck(value) {
3959
+ var option = findByParam(this.data, 'value', value);
3960
+
3961
+ if (!option) {
3962
+ return;
3963
  }
 
3964
 
3965
+ this._check(option, false);
3966
+ }
3967
+ }, {
3968
+ key: "_check",
3969
+ value: function _check(option, checked) {
3970
+ if (this.options.single) {
3971
+ this._checkAll(false, true);
3972
+ }
3973
+
3974
+ option.selected = checked;
3975
+ this.initSelected();
3976
+ this.updateSelected();
3977
+ this.update();
3978
+ }
3979
+ }, {
3980
+ key: "checkAll",
3981
+ value: function checkAll() {
3982
+ this._checkAll(true);
3983
+ }
3984
+ }, {
3985
+ key: "uncheckAll",
3986
+ value: function uncheckAll() {
3987
+ this._checkAll(false);
3988
+ }
3989
+ }, {
3990
+ key: "_checkAll",
3991
+ value: function _checkAll(checked, ignoreUpdate) {
3992
+ var _iteratorNormalCompletion6 = true;
3993
+ var _didIteratorError6 = false;
3994
+ var _iteratorError6 = undefined;
3995
+
3996
+ try {
3997
+ for (var _iterator6 = this.data[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
3998
+ var row = _step6.value;
3999
+
4000
+ if (row.type === 'optgroup') {
4001
+ this._checkGroup(row, checked, true);
4002
+ } else if (!row.disabled && (ignoreUpdate || row.visible)) {
4003
+ row.selected = checked;
4004
+ }
4005
+ }
4006
+ } catch (err) {
4007
+ _didIteratorError6 = true;
4008
+ _iteratorError6 = err;
4009
+ } finally {
4010
+ try {
4011
+ if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
4012
+ _iterator6.return();
4013
+ }
4014
+ } finally {
4015
+ if (_didIteratorError6) {
4016
+ throw _iteratorError6;
4017
+ }
4018
+ }
4019
+ }
4020
+
4021
+ if (!ignoreUpdate) {
4022
+ this.initSelected();
4023
+ this.updateSelected();
4024
+ this.update();
4025
+ }
4026
+ }
4027
+ }, {
4028
+ key: "_checkGroup",
4029
+ value: function _checkGroup(group, checked, ignoreUpdate) {
4030
+ group.selected = checked;
4031
+ group.children.forEach(function (row) {
4032
+ if (!row.disabled && (ignoreUpdate || row.visible)) {
4033
+ row.selected = checked;
4034
+ }
4035
+ });
4036
+
4037
+ if (!ignoreUpdate) {
4038
+ this.initSelected();
4039
+ this.updateSelected();
4040
+ this.update();
4041
+ }
4042
+ }
4043
+ }, {
4044
+ key: "checkInvert",
4045
+ value: function checkInvert() {
4046
+ if (this.options.single) {
4047
+ return;
4048
+ }
4049
+
4050
+ var _iteratorNormalCompletion7 = true;
4051
+ var _didIteratorError7 = false;
4052
+ var _iteratorError7 = undefined;
4053
+
4054
+ try {
4055
+ for (var _iterator7 = this.data[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
4056
+ var row = _step7.value;
4057
+
4058
+ if (row.type === 'optgroup') {
4059
+ var _iteratorNormalCompletion8 = true;
4060
+ var _didIteratorError8 = false;
4061
+ var _iteratorError8 = undefined;
4062
+
4063
+ try {
4064
+ for (var _iterator8 = row.children[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
4065
+ var child = _step8.value;
4066
+ child.selected = !child.selected;
4067
  }
4068
+ } catch (err) {
4069
+ _didIteratorError8 = true;
4070
+ _iteratorError8 = err;
4071
+ } finally {
4072
+ try {
4073
+ if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
4074
+ _iterator8.return();
4075
+ }
4076
+ } finally {
4077
+ if (_didIteratorError8) {
4078
+ throw _iteratorError8;
4079
+ }
4080
+ }
4081
+ }
4082
  } else {
4083
+ row.selected = !row.selected;
4084
+ }
4085
+ }
4086
+ } catch (err) {
4087
+ _didIteratorError7 = true;
4088
+ _iteratorError7 = err;
4089
+ } finally {
4090
+ try {
4091
+ if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
4092
+ _iterator7.return();
4093
+ }
4094
+ } finally {
4095
+ if (_didIteratorError7) {
4096
+ throw _iteratorError7;
4097
+ }
4098
+ }
4099
+ }
4100
+
4101
+ this.initSelected();
4102
+ this.updateSelected();
4103
+ this.update();
4104
+ }
4105
+ }, {
4106
+ key: "focus",
4107
+ value: function focus() {
4108
+ this.$choice.focus();
4109
+ this.options.onFocus();
4110
+ }
4111
+ }, {
4112
+ key: "blur",
4113
+ value: function blur() {
4114
+ this.$choice.blur();
4115
+ this.options.onBlur();
4116
+ }
4117
+ }, {
4118
+ key: "refresh",
4119
+ value: function refresh() {
4120
+ this.destroy();
4121
+ this.init();
4122
+ }
4123
+ }, {
4124
+ key: "filter",
4125
+ value: function filter(ignoreTrigger) {
4126
+ var originalText = $.trim(this.$searchInput.val());
4127
+ var text = originalText.toLowerCase();
4128
+
4129
+ if (this.filterText === text) {
4130
+ return;
4131
+ }
4132
+
4133
+ this.filterText = text;
4134
+ var _iteratorNormalCompletion9 = true;
4135
+ var _didIteratorError9 = false;
4136
+ var _iteratorError9 = undefined;
4137
+
4138
+ try {
4139
+ for (var _iterator9 = this.data[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
4140
+ var row = _step9.value;
4141
+
4142
+ if (row.type === 'optgroup') {
4143
+ if (this.options.filterGroup) {
4144
+ var visible = this.options.customFilter(removeDiacritics(row.label.toLowerCase()), removeDiacritics(text), row.label, originalText);
4145
+ row.visible = visible;
4146
+ var _iteratorNormalCompletion10 = true;
4147
+ var _didIteratorError10 = false;
4148
+ var _iteratorError10 = undefined;
4149
+
4150
+ try {
4151
+ for (var _iterator10 = row.children[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {
4152
+ var child = _step10.value;
4153
+ child.visible = visible;
4154
+ }
4155
+ } catch (err) {
4156
+ _didIteratorError10 = true;
4157
+ _iteratorError10 = err;
4158
+ } finally {
4159
+ try {
4160
+ if (!_iteratorNormalCompletion10 && _iterator10.return != null) {
4161
+ _iterator10.return();
4162
+ }
4163
+ } finally {
4164
+ if (_didIteratorError10) {
4165
+ throw _iteratorError10;
4166
+ }
4167
+ }
4168
  }
4169
+ } else {
4170
+ var _iteratorNormalCompletion11 = true;
4171
+ var _didIteratorError11 = false;
4172
+ var _iteratorError11 = undefined;
4173
+
4174
+ try {
4175
+ for (var _iterator11 = row.children[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {
4176
+ var _child = _step11.value;
4177
+ _child.visible = this.options.customFilter(removeDiacritics(_child.text.toLowerCase()), removeDiacritics(text), _child.text, originalText);
4178
+ }
4179
+ } catch (err) {
4180
+ _didIteratorError11 = true;
4181
+ _iteratorError11 = err;
4182
+ } finally {
4183
+ try {
4184
+ if (!_iteratorNormalCompletion11 && _iterator11.return != null) {
4185
+ _iterator11.return();
4186
+ }
4187
+ } finally {
4188
+ if (_didIteratorError11) {
4189
+ throw _iteratorError11;
4190
+ }
4191
+ }
4192
+ }
4193
+
4194
+ row.visible = row.children.filter(function (child) {
4195
+ return child.visible;
4196
+ }).length > 0;
4197
+ }
4198
+ } else {
4199
+ row.visible = this.options.customFilter(removeDiacritics(row.text.toLowerCase()), removeDiacritics(text), row.text, originalText);
4200
  }
4201
+ }
4202
+ } catch (err) {
4203
+ _didIteratorError9 = true;
4204
+ _iteratorError9 = err;
4205
+ } finally {
4206
+ try {
4207
+ if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
4208
+ _iterator9.return();
4209
+ }
4210
+ } finally {
4211
+ if (_didIteratorError9) {
4212
+ throw _iteratorError9;
4213
+ }
4214
+ }
4215
+ }
4216
 
4217
+ this.initListItems();
4218
+ this.initSelected(ignoreTrigger);
4219
+ this.updateSelected();
4220
 
4221
+ if (!ignoreTrigger) {
4222
+ this.options.onFilter(text);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4223
  }
4224
+ }
4225
+ }, {
4226
+ key: "destroy",
4227
+ value: function destroy() {
4228
+ if (!this.$parent) {
4229
+ return;
4230
+ }
4231
+
4232
+ this.$el.before(this.$parent).removeClass('ms-offscreen');
4233
+
4234
+ if (this.tabIndex !== null) {
4235
+ this.$el.attr('tabindex', this.tabIndex);
4236
+ }
4237
+
4238
+ this.$parent.remove();
4239
+
4240
+ if (this.fromHtml) {
4241
+ delete this.options.data;
4242
+ this.fromHtml = false;
4243
+ }
4244
+ }
4245
+ }]);
4246
+
4247
+ return MultipleSelect;
4248
+ }();
4249
+
4250
+ $.fn.multipleSelect = function (option) {
4251
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4252
+ args[_key - 1] = arguments[_key];
4253
+ }
4254
+
4255
+ var value;
4256
+ this.each(function (i, el) {
4257
+ var $this = $(el);
4258
+ var data = $this.data('multipleSelect');
4259
+ var options = $.extend({}, $this.data(), _typeof(option) === 'object' && option);
4260
+
4261
+ if (!data) {
4262
+ data = new MultipleSelect($this, options);
4263
+ $this.data('multipleSelect', data);
4264
+ }
4265
+
4266
+ if (typeof option === 'string') {
4267
+ var _data;
4268
+
4269
+ if ($.inArray(option, Constants.METHODS) < 0) {
4270
+ throw new Error("Unknown method: ".concat(option));
4271
+ }
4272
+
4273
+ value = (_data = data)[option].apply(_data, args);
4274
+
4275
+ if (option === 'destroy') {
4276
+ $this.removeData('multipleSelect');
4277
+ }
4278
+ } else {
4279
+ data.init();
4280
+ }
4281
+ });
4282
+ return typeof value !== 'undefined' ? value : this;
4283
+ };
4284
+
4285
+ $.fn.multipleSelect.defaults = Constants.DEFAULTS;
4286
+ $.fn.multipleSelect.locales = Constants.LOCALES;
4287
+ $.fn.multipleSelect.methods = Constants.METHODS;
4288
+
4289
+ }));
js/multiple-select.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * multiple-select - Multiple select is a jQuery plugin to select multiple elements with checkboxes :).
3
+ *
4
+ * @version v1.5.2
5
+ * @homepage http://multiple-select.wenzhixin.net.cn
6
+ * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7
+ * @license MIT
8
+ */
9
+
10
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t=t||self).jQuery)}(this,(function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function r(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],i=!0,r=!1,u=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,u=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw u}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t=t&&t.hasOwnProperty("default")?t.default:t;var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t,e){return t(e={exports:{}},e.exports),e.exports}var a,c,h,f="object",p=function(t){return t&&t.Math==Math&&t},d=p(typeof globalThis==f&&globalThis)||p(typeof window==f&&window)||p(typeof self==f&&self)||p(typeof s==f&&s)||Function("return this")(),v=function(t){try{return!!t()}catch(t){return!0}},g=!v((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),y={}.propertyIsEnumerable,E=Object.getOwnPropertyDescriptor,b={f:E&&!y.call({1:2},1)?function(t){var e=E(this,t);return!!e&&e.enumerable}:y},m=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},A={}.toString,F=function(t){return A.call(t).slice(8,-1)},S="".split,C=v((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==F(t)?S.call(t,""):Object(t)}:Object,k=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},D=function(t){return C(k(t))},O=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t,e){if(!O(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!O(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!O(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!O(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},x={}.hasOwnProperty,$=function(t,e){return x.call(t,e)},B=d.document,j=O(B)&&O(B.createElement),T=function(t){return j?B.createElement(t):{}},L=!g&&!v((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),_=Object.getOwnPropertyDescriptor,I={f:g?_:function(t,e){if(t=D(t),e=w(e,!0),L)try{return _(t,e)}catch(t){}if($(t,e))return m(!b.f.call(t,e),t[e])}},R=function(t){if(!O(t))throw TypeError(String(t)+" is not an object");return t},M=Object.defineProperty,P={f:g?M:function(t,e,n){if(R(t),e=w(e,!0),R(n),L)try{return M(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},N=g?function(t,e,n){return P.f(t,e,m(1,n))}:function(t,e,n){return t[e]=n,t},H=function(t,e){try{N(d,t,e)}catch(n){d[t]=e}return e},G=l((function(t){var e=d["__core-js_shared__"]||H("__core-js_shared__",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),U=G("native-function-to-string",Function.toString),W=d.WeakMap,V="function"==typeof W&&/native code/.test(U.call(W)),K=0,z=Math.random(),q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++K+z).toString(36)},Y=G("keys"),J=function(t){return Y[t]||(Y[t]=q(t))},Q={},Z=d.WeakMap;if(V){var X=new Z,tt=X.get,et=X.has,nt=X.set;a=function(t,e){return nt.call(X,t,e),e},c=function(t){return tt.call(X,t)||{}},h=function(t){return et.call(X,t)}}else{var it=J("state");Q[it]=!0,a=function(t,e){return N(t,it,e),e},c=function(t){return $(t,it)?t[it]:{}},h=function(t){return $(t,it)}}var rt={set:a,get:c,has:h,enforce:function(t){return h(t)?c(t):a(t,{})},getterFor:function(t){return function(e){var n;if(!O(e)||(n=c(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},ut=l((function(t){var e=rt.get,n=rt.enforce,i=String(U).split("toString");G("inspectSource",(function(t){return U.call(t)})),(t.exports=function(t,e,r,u){var o=!!u&&!!u.unsafe,s=!!u&&!!u.enumerable,l=!!u&&!!u.noTargetGet;"function"==typeof r&&("string"!=typeof e||$(r,"name")||N(r,"name",e),n(r).source=i.join("string"==typeof e?e:"")),t!==d?(o?!l&&t[e]&&(s=!0):delete t[e],s?t[e]=r:N(t,e,r)):s?t[e]=r:H(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||U.call(this)}))})),ot=d,st=function(t){return"function"==typeof t?t:void 0},lt=function(t,e){return arguments.length<2?st(ot[t])||st(d[t]):ot[t]&&ot[t][e]||d[t]&&d[t][e]},at=Math.ceil,ct=Math.floor,ht=function(t){return isNaN(t=+t)?0:(t>0?ct:at)(t)},ft=Math.min,pt=function(t){return t>0?ft(ht(t),9007199254740991):0},dt=Math.max,vt=Math.min,gt=function(t,e){var n=ht(t);return n<0?dt(n+e,0):vt(n,e)},yt=function(t){return function(e,n,i){var r,u=D(e),o=pt(u.length),s=gt(i,o);if(t&&n!=n){for(;o>s;)if((r=u[s++])!=r)return!0}else for(;o>s;s++)if((t||s in u)&&u[s]===n)return t||s||0;return!t&&-1}},Et={includes:yt(!0),indexOf:yt(!1)},bt=Et.indexOf,mt=function(t,e){var n,i=D(t),r=0,u=[];for(n in i)!$(Q,n)&&$(i,n)&&u.push(n);for(;e.length>r;)$(i,n=e[r++])&&(~bt(u,n)||u.push(n));return u},At=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ft=At.concat("length","prototype"),St={f:Object.getOwnPropertyNames||function(t){return mt(t,Ft)}},Ct={f:Object.getOwnPropertySymbols},kt=lt("Reflect","ownKeys")||function(t){var e=St.f(R(t)),n=Ct.f;return n?e.concat(n(t)):e},Dt=function(t,e){for(var n=kt(e),i=P.f,r=I.f,u=0;u<n.length;u++){var o=n[u];$(t,o)||i(t,o,r(e,o))}},Ot=/#|\.prototype\./,wt=function(t,e){var n=$t[xt(t)];return n==jt||n!=Bt&&("function"==typeof e?v(e):!!e)},xt=wt.normalize=function(t){return String(t).replace(Ot,".").toLowerCase()},$t=wt.data={},Bt=wt.NATIVE="N",jt=wt.POLYFILL="P",Tt=wt,Lt=I.f,_t=function(t,e){var n,i,r,u,o,s=t.target,l=t.global,a=t.stat;if(n=l?d:a?d[s]||H(s,{}):(d[s]||{}).prototype)for(i in e){if(u=e[i],r=t.noTargetGet?(o=Lt(n,i))&&o.value:n[i],!Tt(l?i:s+(a?".":"#")+i,t.forced)&&void 0!==r){if(typeof u==typeof r)continue;Dt(u,r)}(t.sham||r&&r.sham)&&N(u,"sham",!0),ut(n,i,u,t)}},It=!!Object.getOwnPropertySymbols&&!v((function(){return!String(Symbol())})),Rt=d.Symbol,Mt=G("wks"),Pt=function(t){return Mt[t]||(Mt[t]=It&&Rt[t]||(It?Rt:q)("Symbol."+t))},Nt=Object.keys||function(t){return mt(t,At)},Ht=g?Object.defineProperties:function(t,e){R(t);for(var n,i=Nt(e),r=i.length,u=0;r>u;)P.f(t,n=i[u++],e[n]);return t},Gt=lt("document","documentElement"),Ut=J("IE_PROTO"),Wt=function(){},Vt=function(){var t,e=T("iframe"),n=At.length;for(e.style.display="none",Gt.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Vt=t.F;n--;)delete Vt.prototype[At[n]];return Vt()},Kt=Object.create||function(t,e){var n;return null!==t?(Wt.prototype=R(t),n=new Wt,Wt.prototype=null,n[Ut]=t):n=Vt(),void 0===e?n:Ht(n,e)};Q[Ut]=!0;var zt=Pt("unscopables"),qt=Array.prototype;null==qt[zt]&&N(qt,zt,Kt(null));var Yt=function(t){qt[zt][t]=!0},Jt=Et.includes;_t({target:"Array",proto:!0},{includes:function(t){return Jt(this,t,arguments.length>1?arguments[1]:void 0)}}),Yt("includes");var Qt=function(t){return Object(k(t))},Zt=Object.assign,Xt=!Zt||v((function(){var t={},e={},n=Symbol();return t[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=Zt({},t)[n]||"abcdefghijklmnopqrst"!=Nt(Zt({},e)).join("")}))?function(t,e){for(var n=Qt(t),i=arguments.length,r=1,u=Ct.f,o=b.f;i>r;)for(var s,l=C(arguments[r++]),a=u?Nt(l).concat(u(l)):Nt(l),c=a.length,h=0;c>h;)s=a[h++],g&&!o.call(l,s)||(n[s]=l[s]);return n}:Zt;_t({target:"Object",stat:!0,forced:Object.assign!==Xt},{assign:Xt});var te=Pt("match"),ee=function(t){var e;return O(t)&&(void 0!==(e=t[te])?!!e:"RegExp"==F(t))},ne=function(t){if(ee(t))throw TypeError("The method doesn't accept regular expressions");return t},ie=Pt("match");_t({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[ie]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(k(this)).indexOf(ne(t),arguments.length>1?arguments[1]:void 0)}});var re="\t\n\v\f\r                 \u2028\u2029\ufeff",ue="["+re+"]",oe=RegExp("^"+ue+ue+"*"),se=RegExp(ue+ue+"*$"),le=function(t){return function(e){var n=String(k(e));return 1&t&&(n=n.replace(oe,"")),2&t&&(n=n.replace(se,"")),n}},ae={start:le(1),end:le(2),trim:le(3)},ce=ae.trim;_t({target:"String",proto:!0,forced:function(t){return v((function(){return!!re[t]()||"​…᠎"!="​…᠎"[t]()||re[t].name!==t}))}("trim")},{trim:function(){return ce(this)}});var he={name:"",placeholder:"",data:void 0,locale:void 0,selectAll:!0,single:void 0,singleRadio:!1,multiple:!1,hideOptgroupCheckboxes:!1,multipleWidth:80,width:void 0,dropWidth:void 0,maxHeight:250,maxHeightUnit:"px",position:"bottom",displayValues:!1,displayTitle:!1,displayDelimiter:", ",minimumCountSelected:3,ellipsis:!1,isOpen:!1,keepOpen:!1,openOnHover:!1,container:null,filter:!1,filterGroup:!1,filterPlaceholder:"",filterAcceptOnEnter:!1,filterByDataLength:void 0,customFilter:function(t,e){return t.includes(e)},showClear:!1,animate:void 0,styler:function(){return!1},textTemplate:function(t){return t[0].innerHTML.trim()},labelTemplate:function(t){return t[0].getAttribute("label")},onOpen:function(){return!1},onClose:function(){return!1},onCheckAll:function(){return!1},onUncheckAll:function(){return!1},onFocus:function(){return!1},onBlur:function(){return!1},onOptgroupClick:function(){return!1},onClick:function(){return!1},onFilter:function(){return!1},onClear:function(){return!1},onAfterCreate:function(){return!1}},fe={formatSelectAll:function(){return"[Select all]"},formatAllSelected:function(){return"All selected"},formatCountSelected:function(t,e){return t+" of "+e+" selected"},formatNoMatchesFound:function(){return"No matches found"}};Object.assign(he,fe);var pe={VERSION:"1.5.2",BLOCK_ROWS:50,CLUSTER_BLOCKS:4,DEFAULTS:he,METHODS:["getOptions","refreshOptions","getSelects","setSelects","enable","disable","open","close","check","uncheck","checkAll","uncheckAll","checkInvert","focus","blur","refresh","destroy"],LOCALES:{en:fe,"en-US":fe}},de=Array.isArray||function(t){return"Array"==F(t)},ve=St.f,ge={}.toString,ye="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ee={f:function(t){return ye&&"[object Window]"==ge.call(t)?function(t){try{return ve(t)}catch(t){return ye.slice()}}(t):ve(D(t))}},be={f:Pt},me=P.f,Ae=function(t){var e=ot.Symbol||(ot.Symbol={});$(e,t)||me(e,t,{value:be.f(t)})},Fe=P.f,Se=Pt("toStringTag"),Ce=function(t,e,n){t&&!$(t=n?t:t.prototype,Se)&&Fe(t,Se,{configurable:!0,value:e})},ke=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},De=Pt("species"),Oe=function(t,e){var n;return de(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!de(n.prototype)?O(n)&&null===(n=n[De])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},we=[].push,xe=function(t){var e=1==t,n=2==t,i=3==t,r=4==t,u=6==t,o=5==t||u;return function(s,l,a,c){for(var h,f,p=Qt(s),d=C(p),v=function(t,e,n){if(ke(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}(l,a,3),g=pt(d.length),y=0,E=c||Oe,b=e?E(s,g):n?E(s,0):void 0;g>y;y++)if((o||y in d)&&(f=v(h=d[y],y,p),t))if(e)b[y]=f;else if(f)switch(t){case 3:return!0;case 5:return h;case 6:return y;case 2:we.call(b,h)}else if(r)return!1;return u?-1:i||r?r:b}},$e={forEach:xe(0),map:xe(1),filter:xe(2),some:xe(3),every:xe(4),find:xe(5),findIndex:xe(6)},Be=$e.forEach,je=J("hidden"),Te=Pt("toPrimitive"),Le=rt.set,_e=rt.getterFor("Symbol"),Ie=Object.prototype,Re=d.Symbol,Me=d.JSON,Pe=Me&&Me.stringify,Ne=I.f,He=P.f,Ge=Ee.f,Ue=b.f,We=G("symbols"),Ve=G("op-symbols"),Ke=G("string-to-symbol-registry"),ze=G("symbol-to-string-registry"),qe=G("wks"),Ye=d.QObject,Je=!Ye||!Ye.prototype||!Ye.prototype.findChild,Qe=g&&v((function(){return 7!=Kt(He({},"a",{get:function(){return He(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=Ne(Ie,e);i&&delete Ie[e],He(t,e,n),i&&t!==Ie&&He(Ie,e,i)}:He,Ze=function(t,e){var n=We[t]=Kt(Re.prototype);return Le(n,{type:"Symbol",tag:t,description:e}),g||(n.description=e),n},Xe=It&&"symbol"==typeof Re.iterator?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof Re},tn=function(t,e,n){t===Ie&&tn(Ve,e,n),R(t);var i=w(e,!0);return R(n),$(We,i)?(n.enumerable?($(t,je)&&t[je][i]&&(t[je][i]=!1),n=Kt(n,{enumerable:m(0,!1)})):($(t,je)||He(t,je,m(1,{})),t[je][i]=!0),Qe(t,i,n)):He(t,i,n)},en=function(t,e){R(t);var n=D(e),i=Nt(n).concat(on(n));return Be(i,(function(e){g&&!nn.call(n,e)||tn(t,e,n[e])})),t},nn=function(t){var e=w(t,!0),n=Ue.call(this,e);return!(this===Ie&&$(We,e)&&!$(Ve,e))&&(!(n||!$(this,e)||!$(We,e)||$(this,je)&&this[je][e])||n)},rn=function(t,e){var n=D(t),i=w(e,!0);if(n!==Ie||!$(We,i)||$(Ve,i)){var r=Ne(n,i);return!r||!$(We,i)||$(n,je)&&n[je][i]||(r.enumerable=!0),r}},un=function(t){var e=Ge(D(t)),n=[];return Be(e,(function(t){$(We,t)||$(Q,t)||n.push(t)})),n},on=function(t){var e=t===Ie,n=Ge(e?Ve:D(t)),i=[];return Be(n,(function(t){!$(We,t)||e&&!$(Ie,t)||i.push(We[t])})),i};It||(ut((Re=function(){if(this instanceof Re)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=q(t),n=function(t){this===Ie&&n.call(Ve,t),$(this,je)&&$(this[je],e)&&(this[je][e]=!1),Qe(this,e,m(1,t))};return g&&Je&&Qe(Ie,e,{configurable:!0,set:n}),Ze(e,t)}).prototype,"toString",(function(){return _e(this).tag})),b.f=nn,P.f=tn,I.f=rn,St.f=Ee.f=un,Ct.f=on,g&&(He(Re.prototype,"description",{configurable:!0,get:function(){return _e(this).description}}),ut(Ie,"propertyIsEnumerable",nn,{unsafe:!0})),be.f=function(t){return Ze(Pt(t),t)}),_t({global:!0,wrap:!0,forced:!It,sham:!It},{Symbol:Re}),Be(Nt(qe),(function(t){Ae(t)})),_t({target:"Symbol",stat:!0,forced:!It},{for:function(t){var e=String(t);if($(Ke,e))return Ke[e];var n=Re(e);return Ke[e]=n,ze[n]=e,n},keyFor:function(t){if(!Xe(t))throw TypeError(t+" is not a symbol");if($(ze,t))return ze[t]},useSetter:function(){Je=!0},useSimple:function(){Je=!1}}),_t({target:"Object",stat:!0,forced:!It,sham:!g},{create:function(t,e){return void 0===e?Kt(t):en(Kt(t),e)},defineProperty:tn,defineProperties:en,getOwnPropertyDescriptor:rn}),_t({target:"Object",stat:!0,forced:!It},{getOwnPropertyNames:un,getOwnPropertySymbols:on}),_t({target:"Object",stat:!0,forced:v((function(){Ct.f(1)}))},{getOwnPropertySymbols:function(t){return Ct.f(Qt(t))}}),Me&&_t({target:"JSON",stat:!0,forced:!It||v((function(){var t=Re();return"[null]"!=Pe([t])||"{}"!=Pe({a:t})||"{}"!=Pe(Object(t))}))},{stringify:function(t){for(var e,n,i=[t],r=1;arguments.length>r;)i.push(arguments[r++]);if(n=e=i[1],(O(e)||void 0!==t)&&!Xe(t))return de(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Xe(e))return e}),i[1]=e,Pe.apply(Me,i)}}),Re.prototype[Te]||N(Re.prototype,Te,Re.prototype.valueOf),Ce(Re,"Symbol"),Q[je]=!0;var sn=P.f,ln=d.Symbol;if(g&&"function"==typeof ln&&(!("description"in ln.prototype)||void 0!==ln().description)){var an={},cn=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof cn?new ln(t):void 0===t?ln():ln(t);return""===t&&(an[e]=!0),e};Dt(cn,ln);var hn=cn.prototype=ln.prototype;hn.constructor=cn;var fn=hn.toString,pn="Symbol(test)"==String(ln("test")),dn=/^Symbol\((.*)\)[^)]+$/;sn(hn,"description",{configurable:!0,get:function(){var t=O(this)?this.valueOf():this,e=fn.call(t);if($(an,t))return"";var n=pn?e.slice(7,-1):e.replace(dn,"$1");return""===n?void 0:n}}),_t({global:!0,forced:!0},{Symbol:cn})}Ae("iterator");var vn=function(t,e,n){var i=w(e);i in t?P.f(t,i,m(0,n)):t[i]=n},gn=Pt("species"),yn=function(t){return!v((function(){var e=[];return(e.constructor={})[gn]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},En=Pt("isConcatSpreadable"),bn=!v((function(){var t=[];return t[En]=!1,t.concat()[0]!==t})),mn=yn("concat"),An=function(t){if(!O(t))return!1;var e=t[En];return void 0!==e?!!e:de(t)};_t({target:"Array",proto:!0,forced:!bn||!mn},{concat:function(t){var e,n,i,r,u,o=Qt(this),s=Oe(o,0),l=0;for(e=-1,i=arguments.length;e<i;e++)if(u=-1===e?o:arguments[e],An(u)){if(l+(r=pt(u.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<r;n++,l++)n in u&&vn(s,l,u[n])}else{if(l>=9007199254740991)throw TypeError("Maximum allowed index exceeded");vn(s,l++,u)}return s.length=l,s}});var Fn=$e.filter;_t({target:"Array",proto:!0,forced:!yn("filter")},{filter:function(t){return Fn(this,t,arguments.length>1?arguments[1]:void 0)}});var Sn=$e.find,Cn=!0;"find"in[]&&Array(1).find((function(){Cn=!1})),_t({target:"Array",proto:!0,forced:Cn},{find:function(t){return Sn(this,t,arguments.length>1?arguments[1]:void 0)}}),Yt("find");var kn,Dn,On,wn=!v((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),xn=J("IE_PROTO"),$n=Object.prototype,Bn=wn?Object.getPrototypeOf:function(t){return t=Qt(t),$(t,xn)?t[xn]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?$n:null},jn=Pt("iterator"),Tn=!1;[].keys&&("next"in(On=[].keys())?(Dn=Bn(Bn(On)))!==Object.prototype&&(kn=Dn):Tn=!0),null==kn&&(kn={}),$(kn,jn)||N(kn,jn,(function(){return this}));var Ln={IteratorPrototype:kn,BUGGY_SAFARI_ITERATORS:Tn},_n=Ln.IteratorPrototype,In=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return R(n),function(t){if(!O(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(i),e?t.call(n,i):n.__proto__=i,n}}():void 0),Rn=Ln.IteratorPrototype,Mn=Ln.BUGGY_SAFARI_ITERATORS,Pn=Pt("iterator"),Nn=function(){return this},Hn=function(t,e,n,i,r,u,o){!function(t,e,n){var i=e+" Iterator";t.prototype=Kt(_n,{next:m(1,n)}),Ce(t,i,!1)}(n,e,i);var s,l,a,c=function(t){if(t===r&&v)return v;if(!Mn&&t in p)return p[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",f=!1,p=t.prototype,d=p[Pn]||p["@@iterator"]||r&&p[r],v=!Mn&&d||c(r),g="Array"==e&&p.entries||d;if(g&&(s=Bn(g.call(new t)),Rn!==Object.prototype&&s.next&&(Bn(s)!==Rn&&(In?In(s,Rn):"function"!=typeof s[Pn]&&N(s,Pn,Nn)),Ce(s,h,!0))),"values"==r&&d&&"values"!==d.name&&(f=!0,v=function(){return d.call(this)}),p[Pn]!==v&&N(p,Pn,v),r)if(l={values:c("values"),keys:u?v:c("keys"),entries:c("entries")},o)for(a in l)!Mn&&!f&&a in p||ut(p,a,l[a]);else _t({target:e,proto:!0,forced:Mn||f},l);return l},Gn=rt.set,Un=rt.getterFor("Array Iterator"),Wn=Hn(Array,"Array",(function(t,e){Gn(this,{type:"Array Iterator",target:D(t),index:0,kind:e})}),(function(){var t=Un(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values");Yt("keys"),Yt("values"),Yt("entries");var Vn=function(t,e){var n=[][t];return!n||!v((function(){n.call(null,e||function(){throw 1},1)}))},Kn=[].join,zn=C!=Object,qn=Vn("join",",");_t({target:"Array",proto:!0,forced:zn||qn},{join:function(t){return Kn.call(D(this),void 0===t?",":t)}});var Yn=$e.map;_t({target:"Array",proto:!0,forced:!yn("map")},{map:function(t){return Yn(this,t,arguments.length>1?arguments[1]:void 0)}});var Jn=Pt("species"),Qn=[].slice,Zn=Math.max;_t({target:"Array",proto:!0,forced:!yn("slice")},{slice:function(t,e){var n,i,r,u=D(this),o=pt(u.length),s=gt(t,o),l=gt(void 0===e?o:e,o);if(de(u)&&("function"!=typeof(n=u.constructor)||n!==Array&&!de(n.prototype)?O(n)&&null===(n=n[Jn])&&(n=void 0):n=void 0,n===Array||void 0===n))return Qn.call(u,s,l);for(i=new(void 0===n?Array:n)(Zn(l-s,0)),r=0;s<l;s++,r++)s in u&&vn(i,r,u[s]);return i.length=r,i}});var Xn=P.f,ti=Function.prototype,ei=ti.toString,ni=/^\s*function ([^ (]*)/;!g||"name"in ti||Xn(ti,"name",{configurable:!0,get:function(){try{return ei.call(this).match(ni)[1]}catch(t){return""}}});var ii=b.f,ri=function(t){return function(e){for(var n,i=D(e),r=Nt(i),u=r.length,o=0,s=[];u>o;)n=r[o++],g&&!ii.call(i,n)||s.push(t?[n,i[n]]:i[n]);return s}},ui={entries:ri(!0),values:ri(!1)}.entries;_t({target:"Object",stat:!0},{entries:function(t){return ui(t)}});var oi=v((function(){Nt(1)}));_t({target:"Object",stat:!0,forced:oi},{keys:function(t){return Nt(Qt(t))}});var si=Pt("toStringTag"),li="Arguments"==F(function(){return arguments}()),ai={};ai[Pt("toStringTag")]="z";var ci="[object z]"!==String(ai)?function(){return"[object "+function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),si))?n:li?F(e):"Object"==(i=F(e))&&"function"==typeof e.callee?"Arguments":i}(this)+"]"}:ai.toString,hi=Object.prototype;ci!==hi.toString&&ut(hi,"toString",ci,{unsafe:!0});var fi=function(t){return function(e,n){var i,r,u=String(k(e)),o=ht(n),s=u.length;return o<0||o>=s?t?"":void 0:(i=u.charCodeAt(o))<55296||i>56319||o+1===s||(r=u.charCodeAt(o+1))<56320||r>57343?t?u.charAt(o):i:t?u.slice(o,o+2):r-56320+(i-55296<<10)+65536}},pi={codeAt:fi(!1),charAt:fi(!0)},di=pi.charAt,vi=rt.set,gi=rt.getterFor("String Iterator");Hn(String,"String",(function(t){vi(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=gi(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=di(n,i),e.index+=t.length,{value:t,done:!1})}));var yi,Ei,bi=function(){var t=R(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},mi=RegExp.prototype.exec,Ai=String.prototype.replace,Fi=mi,Si=(yi=/a/,Ei=/b*/g,mi.call(yi,"a"),mi.call(Ei,"a"),0!==yi.lastIndex||0!==Ei.lastIndex),Ci=void 0!==/()??/.exec("")[1];(Si||Ci)&&(Fi=function(t){var e,n,i,r,u=this;return Ci&&(n=new RegExp("^"+u.source+"$(?!\\s)",bi.call(u))),Si&&(e=u.lastIndex),i=mi.call(u,t),Si&&i&&(u.lastIndex=u.global?i.index+i[0].length:e),Ci&&i&&i.length>1&&Ai.call(i[0],n,(function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(i[r]=void 0)})),i});var ki=Fi,Di=Pt("species"),Oi=!v((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),wi=!v((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),xi=function(t,e,n,i){var r=Pt(t),u=!v((function(){var e={};return e[r]=function(){return 7},7!=""[t](e)})),o=u&&!v((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[Di]=function(){return n}),n[r](""),!e}));if(!u||!o||"replace"===t&&!Oi||"split"===t&&!wi){var s=/./[r],l=n(r,""[t],(function(t,e,n,i,r){return e.exec===ki?u&&!r?{done:!0,value:s.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}})),a=l[0],c=l[1];ut(String.prototype,t,a),ut(RegExp.prototype,r,2==e?function(t,e){return c.call(t,this,e)}:function(t){return c.call(t,this)}),i&&N(RegExp.prototype[r],"sham",!0)}},$i=Pt("species"),Bi=pi.charAt,ji=function(t,e,n){return e+(n?Bi(t,e).length:1)},Ti=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==F(t))throw TypeError("RegExp#exec called on incompatible receiver");return ki.call(t,e)},Li=[].push,_i=Math.min,Ii=!v((function(){return!RegExp(4294967295,"y")}));xi("split",2,(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=String(k(this)),r=void 0===n?4294967295:n>>>0;if(0===r)return[];if(void 0===t)return[i];if(!ee(t))return e.call(i,t,r);for(var u,o,s,l=[],a=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),c=0,h=new RegExp(t.source,a+"g");(u=ki.call(h,i))&&!((o=h.lastIndex)>c&&(l.push(i.slice(c,u.index)),u.length>1&&u.index<i.length&&Li.apply(l,u.slice(1)),s=u[0].length,c=o,l.length>=r));)h.lastIndex===u.index&&h.lastIndex++;return c===i.length?!s&&h.test("")||l.push(""):l.push(i.slice(c)),l.length>r?l.slice(0,r):l}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var r=k(this),u=null==e?void 0:e[t];return void 0!==u?u.call(e,r,n):i.call(String(r),e,n)},function(t,r){var u=n(i,t,this,r,i!==e);if(u.done)return u.value;var o=R(t),s=String(this),l=function(t,e){var n,i=R(t).constructor;return void 0===i||null==(n=R(i)[$i])?e:ke(n)}(o,RegExp),a=o.unicode,c=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Ii?"y":"g"),h=new l(Ii?o:"^(?:"+o.source+")",c),f=void 0===r?4294967295:r>>>0;if(0===f)return[];if(0===s.length)return null===Ti(h,s)?[s]:[];for(var p=0,d=0,v=[];d<s.length;){h.lastIndex=Ii?d:0;var g,y=Ti(h,Ii?s:s.slice(d));if(null===y||(g=_i(pt(h.lastIndex+(Ii?0:d)),s.length))===p)d=ji(s,d,a);else{if(v.push(s.slice(p,d)),v.length===f)return v;for(var E=1;E<=y.length-1;E++)if(v.push(y[E]),v.length===f)return v;d=p=g}}return v.push(s.slice(p)),v}]}),!Ii);var Ri={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Mi=$e.forEach,Pi=Vn("forEach")?function(t){return Mi(this,t,arguments.length>1?arguments[1]:void 0)}:[].forEach;for(var Ni in Ri){var Hi=d[Ni],Gi=Hi&&Hi.prototype;if(Gi&&Gi.forEach!==Pi)try{N(Gi,"forEach",Pi)}catch(t){Gi.forEach=Pi}}var Ui=Pt("iterator"),Wi=Pt("toStringTag"),Vi=Wn.values;for(var Ki in Ri){var zi=d[Ki],qi=zi&&zi.prototype;if(qi){if(qi[Ui]!==Vi)try{N(qi,Ui,Vi)}catch(t){qi[Ui]=Vi}if(qi[Wi]||N(qi,Wi,Ki),Ri[Ki])for(var Yi in Wn)if(qi[Yi]!==Wn[Yi])try{N(qi,Yi,Wn[Yi])}catch(t){qi[Yi]=Wn[Yi]}}}var Ji=function(){function t(e){var i=this;n(this,t),this.rows=e.rows,this.scrollEl=e.scrollEl,this.contentEl=e.contentEl,this.callback=e.callback,this.cache={},this.scrollTop=this.scrollEl.scrollTop,this.initDOM(this.rows),this.scrollEl.scrollTop=this.scrollTop,this.lastCluster=0;var r=function(){i.lastCluster!==(i.lastCluster=i.getNum())&&(i.initDOM(i.rows),i.callback())};this.scrollEl.addEventListener("scroll",r,!1),this.destroy=function(){i.contentEl.innerHtml="",i.scrollEl.removeEventListener("scroll",r,!1)}}return r(t,[{key:"initDOM",value:function(t){void 0===this.clusterHeight&&(this.cache.scrollTop=this.scrollEl.scrollTop,this.cache.data=this.contentEl.innerHTML=t[0]+t[0]+t[0],this.getRowsHeight(t));var e=this.initData(t,this.getNum()),n=e.rows.join(""),i=this.checkChanges("data",n),r=this.checkChanges("top",e.topOffset),u=this.checkChanges("bottom",e.bottomOffset),o=[];i&&r?(e.topOffset&&o.push(this.getExtra("top",e.topOffset)),o.push(n),e.bottomOffset&&o.push(this.getExtra("bottom",e.bottomOffset)),this.contentEl.innerHTML=o.join("")):u&&(this.contentEl.lastChild.style.height="".concat(e.bottomOffset,"px"))}},{key:"getRowsHeight",value:function(){if(void 0===this.itemHeight){var t=this.contentEl.children,e=t[Math.floor(t.length/2)];this.itemHeight=e.offsetHeight}this.blockHeight=this.itemHeight*pe.BLOCK_ROWS,this.clusterRows=pe.BLOCK_ROWS*pe.CLUSTER_BLOCKS,this.clusterHeight=this.blockHeight*pe.CLUSTER_BLOCKS}},{key:"getNum",value:function(){return this.scrollTop=this.scrollEl.scrollTop,Math.floor(this.scrollTop/(this.clusterHeight-this.blockHeight))||0}},{key:"initData",value:function(t,e){if(t.length<pe.BLOCK_ROWS)return{topOffset:0,bottomOffset:0,rowsAbove:0,rows:t};var n=Math.max((this.clusterRows-pe.BLOCK_ROWS)*e,0),i=n+this.clusterRows,r=Math.max(n*this.itemHeight,0),u=Math.max((t.length-i)*this.itemHeight,0),o=[],s=n;r<1&&s++;for(var l=n;l<i;l++)t[l]&&o.push(t[l]);return this.dataStart=n,this.dataEnd=i,{topOffset:r,bottomOffset:u,rowsAbove:s,rows:o}}},{key:"checkChanges",value:function(t,e){var n=e!==this.cache[t];return this.cache[t]=e,n}},{key:"getExtra",value:function(t,e){var n=document.createElement("li");return n.className="virtual-scroll-".concat(t),e&&(n.style.height="".concat(e,"px")),n.outerHTML}}]),t}(),Qi=Math.max,Zi=Math.min,Xi=Math.floor,tr=/\$([$&'`]|\d\d?|<[^>]*>)/g,er=/\$([$&'`]|\d\d?)/g;xi("replace",2,(function(t,e,n){return[function(n,i){var r=k(this),u=null==n?void 0:n[t];return void 0!==u?u.call(n,r,i):e.call(String(r),n,i)},function(t,r){var u=n(e,t,this,r);if(u.done)return u.value;var o=R(t),s=String(this),l="function"==typeof r;l||(r=String(r));var a=o.global;if(a){var c=o.unicode;o.lastIndex=0}for(var h=[];;){var f=Ti(o,s);if(null===f)break;if(h.push(f),!a)break;""===String(f[0])&&(o.lastIndex=ji(s,pt(o.lastIndex),c))}for(var p,d="",v=0,g=0;g<h.length;g++){f=h[g];for(var y=String(f[0]),E=Qi(Zi(ht(f.index),s.length),0),b=[],m=1;m<f.length;m++)b.push(void 0===(p=f[m])?p:String(p));var A=f.groups;if(l){var F=[y].concat(b,E,s);void 0!==A&&F.push(A);var S=String(r.apply(void 0,F))}else S=i(y,s,E,b,A,r);E>=v&&(d+=s.slice(v,E)+S,v=E+y.length)}return d+s.slice(v)}];function i(t,n,i,r,u,o){var s=i+t.length,l=r.length,a=er;return void 0!==u&&(u=Qt(u),a=tr),e.call(o,a,(function(e,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,i);case"'":return n.slice(s);case"<":a=u[o.slice(1,-1)];break;default:var c=+o;if(0===c)return e;if(c>l){var h=Xi(c/10);return 0===h?e:h<=l?void 0===r[h-1]?o.charAt(1):r[h-1]+o.charAt(1):e}a=r[c-1]}return void 0===a?"":a}))}}));var nr=function(t){if(t.normalize)return t.normalize("NFD").replace(/[\u0300-\u036F]/g,"");return[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}].reduce((function(t,e){var n=e.letters,i=e.base;return t.replace(n,i)}),t)},ir=function(t,e,n){var i=!0,r=!1,u=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value;if(l[e]===n||l[e]===+l[e]+""&&+l[e]===n)return l;if("optgroup"===l.type){var a=!0,c=!1,h=void 0;try{for(var f,p=l.children[Symbol.iterator]();!(a=(f=p.next()).done);a=!0){var d=f.value;if(d[e]===n||d[e]===+d[e]+""&&+d[e]===n)return d}}catch(t){c=!0,h=t}finally{try{a||null==p.return||p.return()}finally{if(c)throw h}}}}}catch(t){r=!0,u=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw u}}},rr=function(t){return Object.keys(t).forEach((function(e){return void 0===t[e]?delete t[e]:""})),t},ur=function(){function i(e,r){n(this,i),this.$el=e,this.options=t.extend({},pe.DEFAULTS,r)}return r(i,[{key:"init",value:function(){this.initLocale(),this.initContainer(),this.initData(),this.initSelected(!0),this.initFilter(),this.initDrop(),this.initView(),this.options.onAfterCreate()}},{key:"initLocale",value:function(){if(this.options.locale){var e=t.fn.multipleSelect.locales,n=this.options.locale.split(/-|_/);n[0]=n[0].toLowerCase(),n[1]&&(n[1]=n[1].toUpperCase()),e[this.options.locale]?t.extend(this.options,e[this.options.locale]):e[n.join("-")]?t.extend(this.options,e[n.join("-")]):e[n[0]]&&t.extend(this.options,e[n[0]])}}},{key:"initContainer",value:function(){var e=this,n=this.$el[0],i=n.getAttribute("name")||this.options.name||"";this.$el.hide(),this.$label=this.$el.closest("label"),!this.$label.length&&this.$el.attr("id")&&(this.$label=t('label[for="'.concat(this.$el.attr("id"),'"]'))),this.$label.find(">input").length&&(this.$label=null),void 0===this.options.single&&(this.options.single=null===n.getAttribute("multiple")),this.$parent=t('\n <div class="ms-parent '.concat(n.getAttribute("class")||"",'"\n title="').concat(n.getAttribute("title")||"",'" />\n ')),this.options.placeholder=this.options.placeholder||n.getAttribute("placeholder")||"",this.tabIndex=n.getAttribute("tabindex");var r="";if(null!==this.tabIndex&&(this.$el.attr("tabindex",-1),r=this.tabIndex&&'tabindex="'.concat(this.tabIndex,'"')),this.$choice=t('\n <button type="button" class="ms-choice"'.concat(r,'>\n <span class="placeholder">').concat(this.options.placeholder,"</span>\n ").concat(this.options.showClear?'<div class="icon-close"></div>':"",'\n <div class="icon-caret"></div>\n </button>\n ')),this.$drop=t('<div class="ms-drop '.concat(this.options.position,'" />')),this.$close=this.$choice.find(".icon-close"),this.options.dropWidth&&this.$drop.css("width",this.options.dropWidth),this.$el.after(this.$parent),this.$parent.append(this.$choice),this.$parent.append(this.$drop),n.disabled&&this.$choice.addClass("disabled"),this.selectAllName='data-name="selectAll'.concat(i,'"'),this.selectGroupName='data-name="selectGroup'.concat(i,'"'),this.selectItemName='data-name="selectItem'.concat(i,'"'),!this.options.keepOpen){var u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t=t||"".concat(+new Date).concat(~~(1e6*Math.random())),"click.multiple-select-".concat(t)}(this.$el.attr("id"));t(document).off(u).on(u,(function(i){t(i.target)[0]!==e.$choice[0]&&t(i.target).parents(".ms-choice")[0]!==e.$choice[0]&&(t(i.target)[0]===e.$drop[0]||t(i.target).parents(".ms-drop")[0]!==e.$drop[0]&&i.target!==n)&&e.options.isOpen&&e.close()}))}}},{key:"initData",value:function(){var n=this,i=[];if(this.options.data){if(Array.isArray(this.options.data))this.data=this.options.data.map((function(t){return"string"==typeof t||"number"==typeof t?{text:t,value:t}:t}));else if("object"===e(this.options.data)){for(var r=0,o=Object.entries(this.options.data);r<o.length;r++){var s=u(o[r],2),l=s[0],a=s[1];i.push({value:l,text:a})}this.data=i}}else t.each(this.$el.children(),(function(t,e){n.initRow(t,e)&&i.push(n.initRow(t,e))})),this.options.data=i,this.data=i,this.fromHtml=!0;this.dataTotal=function(t){var e=0;return t.forEach((function(t,n){"optgroup"===t.type?(t._key="group_".concat(n),t.visible=void 0===t.visible||t.visible,t.children.forEach((function(t,e){t._key="option_".concat(n,"_").concat(e),t.visible=void 0===t.visible||t.visible})),e+=t.children.length):(t._key="option_".concat(n),t.visible=void 0===t.visible||t.visible,e+=1)})),e}(this.data)}},{key:"initRow",value:function(e,n,i){var r=this,u={},o=t(n);return o.is("option")?(u.type="option",u.text=this.options.textTemplate(o),u.value=n.value,u.visible=!0,u.selected=!!n.selected,u.disabled=i||n.disabled,u.classes=n.getAttribute("class")||"",u.title=n.getAttribute("title")||"",o.data("value")&&(u._value=o.data("value")),Object.keys(o.data()).length&&(u._data=o.data()),u):o.is("optgroup")?(u.type="optgroup",u.label=this.options.labelTemplate(o),u.visible=!0,u.selected=!!n.selected,u.disabled=n.disabled,u.children=[],Object.keys(o.data()).length&&(u._data=o.data()),t.each(o.children(),(function(t,e){u.children.push(r.initRow(t,e,u.disabled))})),u):null}},{key:"initSelected",value:function(t){var e=0,n=!0,i=!1,r=void 0;try{for(var u,o=this.data[Symbol.iterator]();!(n=(u=o.next()).done);n=!0){var s=u.value;if("optgroup"===s.type){var l=s.children.filter((function(t){return t.selected&&!t.disabled&&t.visible})).length;s.selected=l&&l===s.children.filter((function(t){return!t.disabled&&t.visible})).length,e+=l}else e+=s.selected&&!s.disabled&&s.visible?1:0}}catch(t){i=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}this.allSelected=this.data.filter((function(t){return t.selected&&!t.disabled&&t.visible})).length===this.data.filter((function(t){return!t.disabled&&t.visible})).length,t||(this.allSelected?this.options.onCheckAll():0===e&&this.options.onUncheckAll())}},{key:"initFilter",value:function(){if(this.filterText="",!this.options.filter&&this.options.filterByDataLength){var t=0,e=!0,n=!1,i=void 0;try{for(var r,u=this.data[Symbol.iterator]();!(e=(r=u.next()).done);e=!0){var o=r.value;"optgroup"===o.type?t+=o.children.length:t+=1}}catch(t){n=!0,i=t}finally{try{e||null==u.return||u.return()}finally{if(n)throw i}}this.options.filter=t>this.options.filterByDataLength}}},{key:"initDrop",value:function(){var t=this;this.initList(),this.update(!0),this.options.isOpen&&setTimeout((function(){t.open()}),50),this.options.openOnHover&&this.$parent.hover((function(){t.open()}),(function(){t.close()}))}},{key:"initList",value:function(){var t=[];this.options.filter&&t.push('\n <div class="ms-search">\n <input type="text" autocomplete="off" autocorrect="off"\n autocapitalize="off" spellcheck="false"\n placeholder="'.concat(this.options.filterPlaceholder,'">\n </div>\n ')),t.push("<ul></ul>"),this.$drop.html(t.join("")),this.$ul=this.$drop.find(">ul"),this.initListItems()}},{key:"initListItems",value:function(){var t=this,e=this.getListRows(),n=0;if(this.options.selectAll&&!this.options.single&&(n=-1),e.length>pe.BLOCK_ROWS*pe.CLUSTER_BLOCKS){this.virtualScroll&&this.virtualScroll.destroy();var i=this.$drop.is(":visible");i||this.$drop.css("left",-1e4).show();var r=function(){t.updateDataStart=t.virtualScroll.dataStart+n,t.updateDataEnd=t.virtualScroll.dataEnd+n,t.updateDataStart<0&&(t.updateDataStart=0),t.updateDataEnd>t.data.length&&(t.updateDataEnd=t.data.length)};this.virtualScroll=new Ji({rows:e,scrollEl:this.$ul[0],contentEl:this.$ul[0],callback:function(){r(),t.events()}}),r(),i||this.$drop.css("left",0).hide()}else this.$ul.html(e.join("")),this.updateDataStart=0,this.updateDataEnd=this.updateData.length,this.virtualScroll=null;this.events()}},{key:"getListRows",value:function(){var t=this,e=[];return this.options.selectAll&&!this.options.single&&e.push('\n <li class="ms-select-all">\n <label>\n <input type="checkbox" '.concat(this.selectAllName).concat(this.allSelected?' checked="checked"':""," />\n <span>").concat(this.options.formatSelectAll(),"</span>\n </label>\n </li>\n ")),this.updateData=[],this.data.forEach((function(n){e.push.apply(e,o(t.initListItem(n)))})),e.push('<li class="ms-no-results">'.concat(this.options.formatNoMatchesFound(),"</li>")),e}},{key:"initListItem",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.title?'title="'.concat(t.title,'"'):"",r=this.options.multiple?"multiple":"",u=this.options.single?"radio":"checkbox",s="";if(!t.visible)return[];if(this.updateData.push(t),this.options.single&&!this.options.singleRadio&&(s="hide-radio "),t.selected&&(s+="selected "),"optgroup"===t.type){var l=this.options.styler(t),a=l?'style="'.concat(l,'"'):"",c=[],h=this.options.hideOptgroupCheckboxes||this.options.single?"<span ".concat(this.selectGroupName,' data-key="').concat(t._key,'"></span>'):'<input type="checkbox"\n '.concat(this.selectGroupName,'\n data-key="').concat(t._key,'"\n ').concat(t.selected?' checked="checked"':"","\n ").concat(t.disabled?' disabled="disabled"':"","\n >");return s.includes("hide-radio")||!this.options.hideOptgroupCheckboxes&&!this.options.single||(s+="hide-radio "),c.push('\n <li class="group '.concat(s,'" ').concat(a,'>\n <label class="optgroup').concat(this.options.single||t.disabled?" disabled":"",'">\n ').concat(h).concat(t.label,"\n </label>\n </li>\n ")),t.children.forEach((function(t){c.push.apply(c,o(e.initListItem(t,1)))})),c}var f=this.options.styler(t),p=f?'style="'.concat(f,'"'):"";return s+=t.classes||"",n&&this.options.single&&(s+="option-level-".concat(n," ")),['\n <li class="'.concat(r," ").concat(s,'" ').concat(i," ").concat(p,'>\n <label class="').concat(t.disabled?"disabled":"",'">\n <input type="').concat(u,'"\n value="').concat(t.value,'"\n data-key="').concat(t._key,'"\n ').concat(this.selectItemName,"\n ").concat(t.selected?' checked="checked"':"","\n ").concat(t.disabled?' disabled="disabled"':"","\n >\n <span>").concat(t.text,"</span>\n </label>\n </li>\n ")]}},{key:"events",value:function(){var e=this;this.$searchInput=this.$drop.find(".ms-search input"),this.$selectAll=this.$drop.find("input[".concat(this.selectAllName,"]")),this.$selectGroups=this.$drop.find("input[".concat(this.selectGroupName,"],span[").concat(this.selectGroupName,"]")),this.$selectItems=this.$drop.find("input[".concat(this.selectItemName,"]:enabled")),this.$disableItems=this.$drop.find("input[".concat(this.selectItemName,"]:disabled")),this.$noResults=this.$drop.find(".ms-no-results");var n=function(n){n.preventDefault(),t(n.target).hasClass("icon-close")||e[e.options.isOpen?"close":"open"]()};this.$label&&this.$label.length&&this.$label.off("click").on("click",(function(t){"label"===t.target.nodeName.toLowerCase()&&(n(t),e.options.filter&&e.options.isOpen||e.focus(),t.stopPropagation())})),this.$choice.off("click").on("click",n).off("focus").on("focus",this.options.onFocus).off("blur").on("blur",this.options.onBlur),this.$parent.off("keydown").on("keydown",(function(t){27!==t.which||e.options.keepOpen||(e.close(),e.$choice.focus())})),this.$close.off("click").on("click",(function(t){t.preventDefault(),e._checkAll(!1,!0),e.initSelected(!1),e.updateSelected(),e.update(),e.options.onClear()})),this.$searchInput.off("keydown").on("keydown",(function(t){9===t.keyCode&&t.shiftKey&&e.close()})).off("keyup").on("keyup",(function(t){if(e.options.filterAcceptOnEnter&&[13,32].includes(t.which)&&e.$searchInput.val()){if(e.options.single){var n=e.$selectItems.closest("li").filter(":visible");n.length&&e.setSelects([n.first().find("input[".concat(e.selectItemName,"]")).val()])}else e.$selectAll.click();return e.close(),void e.focus()}e.filter()})),this.$selectAll.off("click").on("click",(function(n){e._checkAll(t(n.currentTarget).prop("checked"))})),this.$selectGroups.off("click").on("click",(function(n){var i=t(n.currentTarget),r=i.prop("checked"),u=ir(e.data,"_key",i.data("key"));e._checkGroup(u,r),e.options.onOptgroupClick(rr({label:u.label,selected:u.selected,data:u._data,children:u.children.map((function(t){return rr({text:t.text,value:t.value,selected:t.selected,disabled:t.disabled,data:t._data})}))}))})),this.$selectItems.off("click").on("click",(function(n){var i=t(n.currentTarget),r=i.prop("checked"),u=ir(e.data,"_key",i.data("key"));e._check(u,r),e.options.onClick(rr({text:u.text,value:u.value,selected:u.selected,data:u._data})),e.options.single&&e.options.isOpen&&!e.options.keepOpen&&e.close()}))}},{key:"initView",value:function(){var t;window.getComputedStyle?"auto"===(t=window.getComputedStyle(this.$el[0]).width)&&(t=this.$drop.outerWidth()+20):t=this.$el.outerWidth()+20,this.$parent.css("width",this.options.width||t),this.$el.show().addClass("ms-offscreen")}},{key:"open",value:function(){if(!this.$choice.hasClass("disabled")){if(this.options.isOpen=!0,this.$choice.find(">div").addClass("open"),this.$drop[this.animateMethod("show")](),this.$selectAll.parent().show(),this.$noResults.hide(),this.data.length||(this.$selectAll.parent().hide(),this.$noResults.show()),this.options.container){var e=this.$drop.offset();this.$drop.appendTo(t(this.options.container)),this.$drop.offset({top:e.top,left:e.left}).css("min-width","auto").outerWidth(this.$parent.outerWidth())}var n=this.options.maxHeight;"row"===this.options.maxHeightUnit&&(n=this.$drop.find(">ul>li").first().outerHeight()*this.options.maxHeight),this.$drop.find(">ul").css("max-height","".concat(n,"px")),this.$drop.find(".multiple").css("width","".concat(this.options.multipleWidth,"px")),this.data.length&&this.options.filter&&(this.$searchInput.val(""),this.$searchInput.focus(),this.filter(!0)),this.options.onOpen()}}},{key:"close",value:function(){this.options.isOpen=!1,this.$choice.find(">div").removeClass("open"),this.$drop[this.animateMethod("hide")](),this.options.container&&(this.$parent.append(this.$drop),this.$drop.css({top:"auto",left:"auto"})),this.options.onClose()}},{key:"animateMethod",value:function(t){return{show:{fade:"fadeIn",slide:"slideDown"},hide:{fade:"fadeOut",slide:"slideUp"}}[t][this.options.animate]||t}},{key:"update",value:function(t){var e=this.getSelects(),n=this.getSelects("text");this.options.displayValues&&(n=e);var i=this.$choice.find(">span"),r=e.length,u="";0===r?i.addClass("placeholder").html(this.options.placeholder):u=r<this.options.minimumCountSelected?n.join(this.options.displayDelimiter):this.options.formatAllSelected()&&r===this.dataTotal?this.options.formatAllSelected():this.options.ellipsis&&r>this.options.minimumCountSelected?"".concat(n.slice(0,this.options.minimumCountSelected).join(this.options.displayDelimiter),"..."):this.options.formatCountSelected()&&r>this.options.minimumCountSelected?this.options.formatCountSelected(r,this.dataTotal):n.join(this.options.displayDelimiter),u&&i.removeClass("placeholder").html(u),this.options.displayTitle&&i.prop("title",this.getSelects("text")),this.$el.val(this.getSelects()),t||this.$el.trigger("change")}},{key:"updateSelected",value:function(){for(var t=this.updateDataStart;t<this.updateDataEnd;t++){var e=this.updateData[t];this.$drop.find("input[data-key=".concat(e._key,"]")).prop("checked",e.selected).closest("li").toggleClass("selected",e.selected)}var n=0===this.data.filter((function(t){return t.visible})).length;this.$selectAll.length&&this.$selectAll.prop("checked",this.allSelected).closest("li").toggle(!n),this.$noResults.toggle(n),this.virtualScroll&&(this.virtualScroll.rows=this.getListRows())}},{key:"getOptions",value:function(){var e=t.extend({},this.options);return delete e.data,t.extend(!0,{},e)}},{key:"refreshOptions",value:function(e){(function(t,e,n){var i=Object.keys(t),r=Object.keys(e);if(n&&i.length!==r.length)return!1;for(var u=0,o=i;u<o.length;u++){var s=o[u];if(r.includes(s)&&t[s]!==e[s])return!1}return!0})(this.options,e,!0)||(this.options=t.extend(this.options,e),this.destroy(),this.init())}},{key:"getSelects",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"value",e=[],n=!0,i=!1,r=void 0;try{for(var u,s=this.data[Symbol.iterator]();!(n=(u=s.next()).done);n=!0){var l=u.value;if("optgroup"===l.type){var a=l.children.filter((function(t){return t.selected}));if(!a.length)continue;if("value"===t||this.options.single)e.push.apply(e,o(a.map((function(e){return"value"===t&&e._value||e[t]}))));else{var c=[];c.push("["),c.push(l.label),c.push(": ".concat(a.map((function(e){return e[t]})).join(", "))),c.push("]"),e.push(c.join(""))}}else l.selected&&e.push("value"===t&&l._value||l[t])}}catch(t){i=!0,r=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return e}},{key:"setSelects",value:function(t,e){var n=!1,i=function(e){var i=!0,r=!1,u=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value,a=t.includes(l._value||l.value);a||l.value!==+l.value+""||(a=t.includes(+l.value)),l.selected!==a&&(n=!0),l.selected=a}}catch(t){r=!0,u=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw u}}},r=!0,u=!1,o=void 0;try{for(var s,l=this.data[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var a=s.value;"optgroup"===a.type?i(a.children):i([a])}}catch(t){u=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(u)throw o}}n&&(this.initSelected(e),this.updateSelected(),this.update(e))}},{key:"enable",value:function(){this.$choice.removeClass("disabled")}},{key:"disable",value:function(){this.$choice.addClass("disabled")}},{key:"check",value:function(t){var e=ir(this.data,"value",t);e&&this._check(e,!0)}},{key:"uncheck",value:function(t){var e=ir(this.data,"value",t);e&&this._check(e,!1)}},{key:"_check",value:function(t,e){this.options.single&&this._checkAll(!1,!0),t.selected=e,this.initSelected(),this.updateSelected(),this.update()}},{key:"checkAll",value:function(){this._checkAll(!0)}},{key:"uncheckAll",value:function(){this._checkAll(!1)}},{key:"_checkAll",value:function(t,e){var n=!0,i=!1,r=void 0;try{for(var u,o=this.data[Symbol.iterator]();!(n=(u=o.next()).done);n=!0){var s=u.value;"optgroup"===s.type?this._checkGroup(s,t,!0):s.disabled||!e&&!s.visible||(s.selected=t)}}catch(t){i=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}e||(this.initSelected(),this.updateSelected(),this.update())}},{key:"_checkGroup",value:function(t,e,n){t.selected=e,t.children.forEach((function(t){t.disabled||!n&&!t.visible||(t.selected=e)})),n||(this.initSelected(),this.updateSelected(),this.update())}},{key:"checkInvert",value:function(){if(!this.options.single){var t=!0,e=!1,n=void 0;try{for(var i,r=this.data[Symbol.iterator]();!(t=(i=r.next()).done);t=!0){var u=i.value;if("optgroup"===u.type){var o=!0,s=!1,l=void 0;try{for(var a,c=u.children[Symbol.iterator]();!(o=(a=c.next()).done);o=!0){var h=a.value;h.selected=!h.selected}}catch(t){s=!0,l=t}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}}else u.selected=!u.selected}}catch(t){e=!0,n=t}finally{try{t||null==r.return||r.return()}finally{if(e)throw n}}this.initSelected(),this.updateSelected(),this.update()}}},{key:"focus",value:function(){this.$choice.focus(),this.options.onFocus()}},{key:"blur",value:function(){this.$choice.blur(),this.options.onBlur()}},{key:"refresh",value:function(){this.destroy(),this.init()}},{key:"filter",value:function(e){var n=t.trim(this.$searchInput.val()),i=n.toLowerCase();if(this.filterText!==i){this.filterText=i;var r=!0,u=!1,o=void 0;try{for(var s,l=this.data[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var a=s.value;if("optgroup"===a.type)if(this.options.filterGroup){var c=this.options.customFilter(nr(a.label.toLowerCase()),nr(i),a.label,n);a.visible=c;var h=!0,f=!1,p=void 0;try{for(var d,v=a.children[Symbol.iterator]();!(h=(d=v.next()).done);h=!0){d.value.visible=c}}catch(t){f=!0,p=t}finally{try{h||null==v.return||v.return()}finally{if(f)throw p}}}else{var g=!0,y=!1,E=void 0;try{for(var b,m=a.children[Symbol.iterator]();!(g=(b=m.next()).done);g=!0){var A=b.value;A.visible=this.options.customFilter(nr(A.text.toLowerCase()),nr(i),A.text,n)}}catch(t){y=!0,E=t}finally{try{g||null==m.return||m.return()}finally{if(y)throw E}}a.visible=a.children.filter((function(t){return t.visible})).length>0}else a.visible=this.options.customFilter(nr(a.text.toLowerCase()),nr(i),a.text,n)}}catch(t){u=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(u)throw o}}this.initListItems(),this.initSelected(e),this.updateSelected(),e||this.options.onFilter(i)}}},{key:"destroy",value:function(){this.$parent&&(this.$el.before(this.$parent).removeClass("ms-offscreen"),null!==this.tabIndex&&this.$el.attr("tabindex",this.tabIndex),this.$parent.remove(),this.fromHtml&&(delete this.options.data,this.fromHtml=!1))}}]),i}();t.fn.multipleSelect=function(n){for(var i=arguments.length,r=new Array(i>1?i-1:0),u=1;u<i;u++)r[u-1]=arguments[u];var o;return this.each((function(i,u){var s=t(u),l=s.data("multipleSelect"),a=t.extend({},s.data(),"object"===e(n)&&n);if(l||(l=new ur(s,a),s.data("multipleSelect",l)),"string"==typeof n){var c;if(t.inArray(n,pe.METHODS)<0)throw new Error("Unknown method: ".concat(n));o=(c=l)[n].apply(c,r),"destroy"===n&&s.removeData("multipleSelect")}else l.init()})),void 0!==o?o:this},t.fn.multipleSelect.defaults=pe.DEFAULTS,t.fn.multipleSelect.locales=pe.LOCALES,t.fn.multipleSelect.methods=pe.METHODS}));
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vladi
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 4.0
6
  Tested up to: 5.6
7
- Stable tag: 4.57
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -80,6 +80,11 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
80
 
81
 
82
  == Changelog =
 
 
 
 
 
83
  = [4.57] 09.11.2020 =
84
  * Update: Marked as compatible with WordPress 5.6.
85
  * Update: " jQuery( document ).ready( handler ) " was replaced globally with " jQuery( handler ) " for compatibility with [jQuery 3.0](https://api.jquery.com/ready/) and WordPress 5.6.
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 4.0
6
  Tested up to: 5.6
7
+ Stable tag: 4.57.1
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
80
 
81
 
82
  == Changelog =
83
+ = [4.57.1] 10.12.2020 =
84
+ * Fix: Nextgen Gallery's user capabilities were not shown as granted after current role change via roles selection dropdown list.
85
+ * Fix: PHP Warning: The magic method __wakeup() must have public visibility. __wakeup() method was defined as private as a part of the Singleton design partern. Method was redefined as public but with exception inside to prevent its usage.
86
+ * Update: jQuery [MultiSelect](http://multiple-select.wenzhixin.net.cn/) plugin was updated to version 1.5.2
87
+
88
  = [4.57] 09.11.2020 =
89
  * Update: Marked as compatible with WordPress 5.6.
90
  * Update: " jQuery( document ).ready( handler ) " was replaced globally with " jQuery( handler ) " for compatibility with [jQuery 3.0](https://api.jquery.com/ready/) and WordPress 5.6.
user-role-editor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: User Role Editor
4
  Plugin URI: https://www.role-editor.com
5
  Description: Change/add/delete WordPress user roles and capabilities.
6
- Version: 4.57
7
  Author: Vladimir Garagulya
8
  Author URI: https://www.role-editor.com
9
  Text Domain: user-role-editor
@@ -23,7 +23,7 @@ if ( defined( 'URE_PLUGIN_URL' ) ) {
23
  wp_die( 'It seems that other version of User Role Editor is active. Please deactivate it before use this version' );
24
  }
25
 
26
- define( 'URE_VERSION', '4.57' );
27
  define( 'URE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
28
  define( 'URE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
29
  define( 'URE_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );
3
  Plugin Name: User Role Editor
4
  Plugin URI: https://www.role-editor.com
5
  Description: Change/add/delete WordPress user roles and capabilities.
6
+ Version: 4.57.1
7
  Author: Vladimir Garagulya
8
  Author URI: https://www.role-editor.com
9
  Text Domain: user-role-editor
23
  wp_die( 'It seems that other version of User Role Editor is active. Please deactivate it before use this version' );
24
  }
25
 
26
+ define( 'URE_VERSION', '4.57.1' );
27
  define( 'URE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
28
  define( 'URE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
29
  define( 'URE_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );