Popup Builder – Responsive WordPress Pop up - Version 3.1.6

Version Description

Current Version of Popup Builder is 3.1.5

Download this release

Release Info

Developer Sygnoos
Plugin Icon 128x128 Popup Builder – Responsive WordPress Pop up
Version 3.1.6
Comparing to
See all releases

Code changes from version 3.1.5.2 to 3.1.6

com/classes/Actions.php CHANGED
@@ -725,6 +725,9 @@ class Actions
725
  if ($column == 'shortcode') {
726
  echo '<input type="text" onfocus="this.select();" readonly value="[sg_popup id='.$postId.']" class="large-text code">';
727
  }
 
 
 
728
  else if ($column == 'counter') {
729
  $count = $popup->getPopupOpeningCountById($postId);
730
  echo '<div class="sgpb-counter-wrapper"><div class="sgpb-dashboard-popup-count-wrapper">'.$count.'</div>'.'<input onclick="SGPBBackend.resetCount('.$postId.');" type="button" name="" class="button sgpb-reset-count-btn" value="'.__('reset', SG_POPUP_TEXT_DOMAIN).'"></div>';
725
  if ($column == 'shortcode') {
726
  echo '<input type="text" onfocus="this.select();" readonly value="[sg_popup id='.$postId.']" class="large-text code">';
727
  }
728
+ if ($column == 'className') {
729
+ echo '<input type="text" onfocus="this.select();" readonly value="sg-popup-id-'.esc_attr($postId).'" class="large-text code">';
730
+ }
731
  else if ($column == 'counter') {
732
  $count = $popup->getPopupOpeningCountById($postId);
733
  echo '<div class="sgpb-counter-wrapper"><div class="sgpb-dashboard-popup-count-wrapper">'.$count.'</div>'.'<input onclick="SGPBBackend.resetCount('.$postId.');" type="button" name="" class="button sgpb-reset-count-btn" value="'.__('reset', SG_POPUP_TEXT_DOMAIN).'"></div>';
com/classes/ConditionBuilder.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
2
  namespace sgpb;
 
3
  class ConditionBuilder
4
  {
5
  private $savedData = array();
6
- private $groupId;
7
- private $ruleId;
8
  private $conditionName;
9
  private $groupTotal;
10
  private $popupId;
@@ -202,4 +203,41 @@ class ConditionBuilder
202
 
203
  return $dataObj;
204
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  }
1
  <?php
2
  namespace sgpb;
3
+
4
  class ConditionBuilder
5
  {
6
  private $savedData = array();
7
+ private $groupId = 0;
8
+ private $ruleId = 0;
9
  private $conditionName;
10
  private $groupTotal;
11
  private $popupId;
203
 
204
  return $dataObj;
205
  }
206
+
207
+ public static function additionalConditionBuilder()
208
+ {
209
+ $dataObj = apply_filters('sgpbAdditionalConditionBuilder', array());
210
+
211
+ if (empty($dataObj)) {
212
+ return array();
213
+ }
214
+
215
+ foreach ($dataObj as $data) {
216
+ if (empty($data['conditionName'])) {
217
+ continue;
218
+ }
219
+ $conditionName = $data['conditionName'];
220
+ unset($data['conditionName']);
221
+
222
+ foreach ($data as $groupId => $groupData) {
223
+ if (empty($groupData)) {
224
+ continue;
225
+ }
226
+
227
+ foreach ($groupData as $ruleId => $ruleData) {
228
+
229
+ $builderObj = new ConditionBuilder();
230
+ $builderObj->setGroupId(0);
231
+ $builderObj->setRuleId($ruleId);
232
+ $builderObj->setSavedData($ruleData);
233
+ $builderObj->setConditionName($conditionName);
234
+ $builderObj->setGroupTotal(count($groupData) - 1);
235
+ $builderObj->setTakeValueFrom('operator');
236
+ $dataObj[$conditionName] = $builderObj;
237
+ }
238
+ }
239
+ }
240
+
241
+ return $dataObj;
242
+ }
243
  }
com/classes/ConditionCreator.php CHANGED
@@ -38,8 +38,14 @@ class ConditionCreator
38
  $conditionsObj = $this->getConditionsObj();
39
  $view = '';
40
 
 
 
 
 
41
  foreach ($conditionsObj as $conditionObj) {
 
42
  $currentGroupId = $conditionObj->getGroupId();
 
43
  $prevGroupId = $this->getPrevGroupId();
44
  $openGroupDiv = '';
45
  $separator = '';
@@ -78,32 +84,32 @@ class ConditionCreator
78
  <div class="sg-target-rule sg-target-rule-<?php echo $conditionDataObj->getRuleId(); ?> sgpb-event-row" data-rule-id="<?php echo $conditionDataObj->getRuleId(); ?>">
79
  <div class="row">
80
  <?php
81
- $savedData = $conditionDataObj->getSavedData();
82
 
83
- if (!isset($savedData['value'])) {
84
- $savedData['value'] = '';
85
- }
86
  ?>
87
  <?php $idHiddenDiv = $conditionDataObj->getConditionName().'_'.$conditionDataObj->getGroupId().'_'.$conditionDataObj->getRuleId();?>
88
  <?php foreach ($savedData as $conditionName => $conditionSavedData): ?>
89
  <?php
90
- $showRowStatusClass = '';
91
- $hideStatus = self::getParamRowHideStatus($conditionDataObj, $conditionName);
92
- $ruleElementData = self::getRuleElementData($conditionDataObj, 'param');
93
- $ruleSavedData = $ruleElementData['saved'];
94
- $currentArgs = array('savedData' => $ruleSavedData, 'conditionName' => $conditionName);
95
-
96
- if (!self::allowToShowOperatorColumn($conditionDataObj, $currentArgs)) {
97
- $hideStatus = true;
98
- }
99
- $showRowStatusClass = ($hideStatus) ? 'sg-hide-condition-row' : $showRowStatusClass;
100
- ?>
101
  <?php if ($conditionName != 'hiddenOption'): ?>
102
  <div data-condition-name="<?php echo $conditionName;?>" class="<?php echo 'col-sm-3 sg-condition-'.$conditionName.'-wrapper'.' '.$showRowStatusClass; ?>">
103
  <?php
104
- if (!$hideStatus) {
105
- echo self::createConditionElement($conditionDataObj, $conditionName);
106
- }
107
  ?>
108
  </div>
109
  <?php endif; ?>
@@ -127,7 +133,12 @@ class ConditionCreator
127
  global $SGPB_DATA_CONFIG_ARRAY;
128
  $conditionName = $conditionDataObj->getConditionName();
129
  $conditionData = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
130
- $operatorAllowInConditions = @$conditionData['operatorAllowInConditions'];
 
 
 
 
 
131
  $savedData = $conditionDataObj->getSavedData();
132
 
133
  $status = true;
@@ -138,7 +149,7 @@ class ConditionCreator
138
  if (($currentSavedData == 'not_rule' || $currentSavedData == 'select_role' || $currentSavedData == 'select_event')) {
139
  $status = false;
140
  }
141
-
142
  if (is_array($operatorAllowInConditions)) {
143
  if (in_array($savedData['param'], $operatorAllowInConditions)) {
144
  $SGPB_DATA_CONFIG_ARRAY[$conditionName]['paramsData']['operator'] = $conditionData['paramsData'][$savedData['param'].'Operator'];
@@ -182,7 +193,7 @@ class ConditionCreator
182
  continue;
183
  }
184
  $saveData = $conditionDataObj->getSavedData();
185
- if (empty($saveData['hiddenOption']) && $operator['name'] == 'Edit' && @$saveData["param"] != 'load') {
186
  continue;
187
  }
188
  if ($operator['operator'] == 'edit') {
@@ -285,18 +296,29 @@ class ConditionCreator
285
  $savedParam = $saveData[$ruleName];
286
  }
287
  else if (!empty($saveData['hiddenOption'])) {
288
- $savedParam = @$saveData['hiddenOption'][$ruleName];
289
  }
290
 
291
  $ruleElementData['ruleName'] = $ruleName;
292
- if ($ruleName == 'value') {
293
  $ruleName = $saveData[$conditionDataObj->getTakeValueFrom()];
294
  }
295
 
296
- $type = $rulesType[$ruleName];
297
- $data = $paramsData[$ruleName];
 
 
 
 
 
 
 
 
 
 
 
 
298
 
299
- $optionAttr = $attrs[$ruleName];
300
  $attr = array();
301
 
302
  if (!empty($optionAttr['htmlAttrs'])) {
@@ -349,7 +371,7 @@ class ConditionCreator
349
  }
350
  }
351
 
352
- $rowField .= AdminHelper::createSelectBox($ruleElementData['data'], $savedData, $attr);
353
  break;
354
  case 'text':
355
  case 'url':
@@ -413,7 +435,7 @@ class ConditionCreator
413
  $titleKey = $ruleName;
414
 
415
 
416
- if ($ruleName == 'value') {
417
  $titleKey = $saveData[$conditionObj->getTakeValueFrom()];
418
  }
419
 
@@ -455,17 +477,17 @@ class ConditionCreator
455
  <div class="sgpb-wrapper">
456
  <div class="tab">
457
  <?php
458
- $activeTab = '';
459
- if (!empty($tabs[0])) {
460
- $activeTab = $tabs[0];
461
- }
462
  ?>
463
  <?php foreach ($tabs as $tab): ?>
464
  <?php
465
- $activeClassName = '';
466
- if ($activeTab == $tab) {
467
- $activeClassName = 'sgpb-active';
468
- }
469
  ?>
470
  <button class="tablinks sgpb-tab-links <?php echo $activeClassName;?>" data-rule-id="<?php echo $ruleId; ?>" data-content-id="<?php echo $tab.'-'.$ruleId; ?>"><?php echo ucfirst($tab); ?></button>
471
  <?php endforeach;?>
@@ -488,33 +510,33 @@ class ConditionCreator
488
  ob_start();
489
  ?>
490
  <?php foreach ($hiddenOptionsData as $key => $hiddenData): ?>
491
- <div id="<?php echo $key.'-'.$ruleId; ?>" class="sgpb-tab-content-<?php echo $ruleId;?>">
492
- <div id="<?php echo $key; ?>" class="sgpb-tab-content-options">
493
- <?php foreach ($hiddenData as $name => $label): ?>
494
- <?php
495
- $hiddenOptionsView = self::optionLabelSupplement($conditionDataObj, $name);
496
- $colMdValue = 6;
497
- if (!empty($hiddenOptionsView)) {
498
- $colMdValue = 2;
499
- }
500
- ?>
501
- <div class="row form-group">
502
- <div class="col-md-6">
503
- <?php echo self::createConditionFieldHeader($conditionDataObj, $name); ?>
504
- </div>
505
- <div class="col-md-<?php echo $colMdValue; ?>">
506
- <?php echo self::createConditionField($conditionDataObj, $name); ?>
507
- </div>
508
- <?php if (!empty($hiddenOptionsView)): ?>
509
- <div class="col-md-4">
510
- <?php echo $hiddenOptionsView; ?>
511
- </div>
512
- <?php endif; ?>
513
  </div>
514
- <?php endforeach; ?>
515
- </div>
 
 
 
 
 
 
 
 
516
  </div>
517
- <?php endforeach;?>
 
518
  <?php
519
  $hiddenPopupContent = ob_get_contents();
520
  ob_end_clean();
@@ -540,12 +562,12 @@ class ConditionCreator
540
  ?>
541
  <div class="row <?php echo 'sgpb-popup-hidden-content-'.$name.'-'.$conditionDataObj->getRuleId().'-wrapper'?> form-group">
542
  <?php foreach ($subOptions as $subOption): ?>
543
- <div class="col-md-6">
544
- <?php echo self::createConditionFieldHeader($conditionDataObj, $subOption); ?>
545
- </div>
546
- <div class="col-md-6">
547
- <?php echo self::createConditionField($conditionDataObj, $subOption); ?>
548
- </div>
549
  <?php echo self::hiddenSubOptionsView($subOption, $conditionDataObj)?>
550
  <?php endforeach;?>
551
  </div>
@@ -585,13 +607,16 @@ class ConditionCreator
585
  $conditionName = $conditionDataObj->getConditionName();
586
  $saveData = $conditionDataObj->getSavedData();
587
  $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
588
- $paramsData = $conditionConfig['paramsData'];
 
 
 
589
 
590
  $ruleElementData['ruleName'] = $ruleName;
591
- if ($ruleName == 'value') {
592
- $ruleName = @$saveData[$conditionDataObj->getTakeValueFrom()];
593
  }
594
- if (is_null(@$paramsData[$ruleName])) {
595
  $status = true;
596
  }
597
 
38
  $conditionsObj = $this->getConditionsObj();
39
  $view = '';
40
 
41
+ if (empty($conditionsObj)) {
42
+ return array();
43
+ }
44
+
45
  foreach ($conditionsObj as $conditionObj) {
46
+
47
  $currentGroupId = $conditionObj->getGroupId();
48
+
49
  $prevGroupId = $this->getPrevGroupId();
50
  $openGroupDiv = '';
51
  $separator = '';
84
  <div class="sg-target-rule sg-target-rule-<?php echo $conditionDataObj->getRuleId(); ?> sgpb-event-row" data-rule-id="<?php echo $conditionDataObj->getRuleId(); ?>">
85
  <div class="row">
86
  <?php
87
+ $savedData = $conditionDataObj->getSavedData();
88
 
89
+ if (!isset($savedData['value'])) {
90
+ $savedData['value'] = '';
91
+ }
92
  ?>
93
  <?php $idHiddenDiv = $conditionDataObj->getConditionName().'_'.$conditionDataObj->getGroupId().'_'.$conditionDataObj->getRuleId();?>
94
  <?php foreach ($savedData as $conditionName => $conditionSavedData): ?>
95
  <?php
96
+ $showRowStatusClass = '';
97
+ $hideStatus = self::getParamRowHideStatus($conditionDataObj, $conditionName);
98
+ $ruleElementData = self::getRuleElementData($conditionDataObj, 'param');
99
+ $ruleSavedData = $ruleElementData['saved'];
100
+ $currentArgs = array('savedData' => $ruleSavedData, 'conditionName' => $conditionName);
101
+
102
+ if (!self::allowToShowOperatorColumn($conditionDataObj, $currentArgs)) {
103
+ $hideStatus = true;
104
+ }
105
+ $showRowStatusClass = ($hideStatus) ? 'sg-hide-condition-row' : $showRowStatusClass;
106
+ ?>
107
  <?php if ($conditionName != 'hiddenOption'): ?>
108
  <div data-condition-name="<?php echo $conditionName;?>" class="<?php echo 'col-sm-3 sg-condition-'.$conditionName.'-wrapper'.' '.$showRowStatusClass; ?>">
109
  <?php
110
+ if (!$hideStatus) {
111
+ echo self::createConditionElement($conditionDataObj, $conditionName);
112
+ }
113
  ?>
114
  </div>
115
  <?php endif; ?>
133
  global $SGPB_DATA_CONFIG_ARRAY;
134
  $conditionName = $conditionDataObj->getConditionName();
135
  $conditionData = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
136
+ $operatorAllowInConditions = array();
137
+
138
+ if (!empty($conditionData['operatorAllowInConditions'])) {
139
+ $operatorAllowInConditions = $conditionData['operatorAllowInConditions'];
140
+ }
141
+
142
  $savedData = $conditionDataObj->getSavedData();
143
 
144
  $status = true;
149
  if (($currentSavedData == 'not_rule' || $currentSavedData == 'select_role' || $currentSavedData == 'select_event')) {
150
  $status = false;
151
  }
152
+
153
  if (is_array($operatorAllowInConditions)) {
154
  if (in_array($savedData['param'], $operatorAllowInConditions)) {
155
  $SGPB_DATA_CONFIG_ARRAY[$conditionName]['paramsData']['operator'] = $conditionData['paramsData'][$savedData['param'].'Operator'];
193
  continue;
194
  }
195
  $saveData = $conditionDataObj->getSavedData();
196
+ if (empty($saveData['hiddenOption']) && $operator['name'] == 'Edit' && $saveData["param"] != 'load') {
197
  continue;
198
  }
199
  if ($operator['operator'] == 'edit') {
296
  $savedParam = $saveData[$ruleName];
297
  }
298
  else if (!empty($saveData['hiddenOption'])) {
299
+ $savedParam = $saveData['hiddenOption'][$ruleName];
300
  }
301
 
302
  $ruleElementData['ruleName'] = $ruleName;
303
+ if ($ruleName == 'value' && !empty($saveData[$conditionDataObj->getTakeValueFrom()])) {
304
  $ruleName = $saveData[$conditionDataObj->getTakeValueFrom()];
305
  }
306
 
307
+ $type = array();
308
+ if (!empty($rulesType[$ruleName])) {
309
+ $type = $rulesType[$ruleName];
310
+ }
311
+ $data = array();
312
+ if (!empty($paramsData[$ruleName])) {
313
+ $data = $paramsData[$ruleName];
314
+ }
315
+
316
+
317
+ $optionAttr = array();
318
+ if (!empty($attrs[$ruleName])) {
319
+ $optionAttr = $attrs[$ruleName];
320
+ }
321
 
 
322
  $attr = array();
323
 
324
  if (!empty($optionAttr['htmlAttrs'])) {
371
  }
372
  }
373
 
374
+ $rowField .= AdminHelper::createSelectBox($ruleElementData['data'], $savedData, $attr);
375
  break;
376
  case 'text':
377
  case 'url':
435
  $titleKey = $ruleName;
436
 
437
 
438
+ if ($ruleName == 'value' && !empty($saveData[$conditionObj->getTakeValueFrom()])) {
439
  $titleKey = $saveData[$conditionObj->getTakeValueFrom()];
440
  }
441
 
477
  <div class="sgpb-wrapper">
478
  <div class="tab">
479
  <?php
480
+ $activeTab = '';
481
+ if (!empty($tabs[0])) {
482
+ $activeTab = $tabs[0];
483
+ }
484
  ?>
485
  <?php foreach ($tabs as $tab): ?>
486
  <?php
487
+ $activeClassName = '';
488
+ if ($activeTab == $tab) {
489
+ $activeClassName = 'sgpb-active';
490
+ }
491
  ?>
492
  <button class="tablinks sgpb-tab-links <?php echo $activeClassName;?>" data-rule-id="<?php echo $ruleId; ?>" data-content-id="<?php echo $tab.'-'.$ruleId; ?>"><?php echo ucfirst($tab); ?></button>
493
  <?php endforeach;?>
510
  ob_start();
511
  ?>
512
  <?php foreach ($hiddenOptionsData as $key => $hiddenData): ?>
513
+ <div id="<?php echo $key.'-'.$ruleId; ?>" class="sgpb-tab-content-<?php echo $ruleId;?>">
514
+ <div id="<?php echo $key; ?>" class="sgpb-tab-content-options">
515
+ <?php foreach ($hiddenData as $name => $label): ?>
516
+ <?php
517
+ $hiddenOptionsView = self::optionLabelSupplement($conditionDataObj, $name);
518
+ $colMdValue = 6;
519
+ if (!empty($hiddenOptionsView)) {
520
+ $colMdValue = 2;
521
+ }
522
+ ?>
523
+ <div class="row form-group">
524
+ <div class="col-md-6">
525
+ <?php echo self::createConditionFieldHeader($conditionDataObj, $name); ?>
 
 
 
 
 
 
 
 
 
526
  </div>
527
+ <div class="col-md-<?php echo $colMdValue; ?>">
528
+ <?php echo self::createConditionField($conditionDataObj, $name); ?>
529
+ </div>
530
+ <?php if (!empty($hiddenOptionsView)): ?>
531
+ <div class="col-md-4">
532
+ <?php echo $hiddenOptionsView; ?>
533
+ </div>
534
+ <?php endif; ?>
535
+ </div>
536
+ <?php endforeach; ?>
537
  </div>
538
+ </div>
539
+ <?php endforeach;?>
540
  <?php
541
  $hiddenPopupContent = ob_get_contents();
542
  ob_end_clean();
562
  ?>
563
  <div class="row <?php echo 'sgpb-popup-hidden-content-'.$name.'-'.$conditionDataObj->getRuleId().'-wrapper'?> form-group">
564
  <?php foreach ($subOptions as $subOption): ?>
565
+ <div class="col-md-6">
566
+ <?php echo self::createConditionFieldHeader($conditionDataObj, $subOption); ?>
567
+ </div>
568
+ <div class="col-md-6">
569
+ <?php echo self::createConditionField($conditionDataObj, $subOption); ?>
570
+ </div>
571
  <?php echo self::hiddenSubOptionsView($subOption, $conditionDataObj)?>
572
  <?php endforeach;?>
573
  </div>
607
  $conditionName = $conditionDataObj->getConditionName();
608
  $saveData = $conditionDataObj->getSavedData();
609
  $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$conditionName];
610
+ $paramsData = array();
611
+ if (!empty($conditionConfig['paramsData'])) {
612
+ $paramsData = $conditionConfig['paramsData'];
613
+ }
614
 
615
  $ruleElementData['ruleName'] = $ruleName;
616
+ if ($ruleName == 'value' && !empty($saveData) && !empty($saveData[$conditionDataObj->getTakeValueFrom()])) {
617
+ $ruleName = $saveData[$conditionDataObj->getTakeValueFrom()];
618
  }
619
+ if ((!isset($paramsData[$ruleName]) && empty($paramsData[$ruleName])) || is_null($paramsData[$ruleName])) {
620
  $status = true;
621
  }
622
 
com/classes/Filters.php CHANGED
@@ -316,6 +316,7 @@ class Filters
316
  $additionalItems['onOff'] = __('Enabled (show popup)', SG_POPUP_TEXT_DOMAIN);
317
  $additionalItems['type'] = __('Type', SG_POPUP_TEXT_DOMAIN);
318
  $additionalItems['shortcode'] = __('Shortcode', SG_POPUP_TEXT_DOMAIN);
 
319
 
320
  return $columns + $additionalItems;
321
  }
316
  $additionalItems['onOff'] = __('Enabled (show popup)', SG_POPUP_TEXT_DOMAIN);
317
  $additionalItems['type'] = __('Type', SG_POPUP_TEXT_DOMAIN);
318
  $additionalItems['shortcode'] = __('Shortcode', SG_POPUP_TEXT_DOMAIN);
319
+ $additionalItems['className'] = __('Class', SG_POPUP_TEXT_DOMAIN);
320
 
321
  return $columns + $additionalItems;
322
  }
com/classes/Installer.php CHANGED
File without changes
com/classes/Javascript.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
  namespace sgpb;
3
-
4
  /**
5
  * Popup Builder Style
6
  *
@@ -28,7 +27,7 @@ class Javascript
28
  $pageName = 'popupspage';
29
  }
30
  else if ($hook == 'popupbuilder_page_subscribers') {
31
- $pageName = 'subscribers';
32
  }
33
 
34
  $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
1
  <?php
2
  namespace sgpb;
 
3
  /**
4
  * Popup Builder Style
5
  *
27
  $pageName = 'popupspage';
28
  }
29
  else if ($hook == 'popupbuilder_page_subscribers') {
30
+ $pageName = 'sgpbSubscribers';
31
  }
32
 
33
  $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
com/classes/PopupChecker.php CHANGED
@@ -314,6 +314,33 @@ class PopupChecker
314
  $isSatisfy = true;
315
  }
316
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  else if ($targetData['param'] == 'post_type' && !empty($targetData['value'])) {
318
  $selectedCustomPostTypes = array_values($targetData['value']);
319
  $currentPostType = get_post_type($postId);
314
  $isSatisfy = true;
315
  }
316
  }
317
+ else if (strpos($targetData['param'], '_categories')) {
318
+ $values = array();
319
+ $isSatisfy = false;
320
+
321
+ if (!empty($targetData['value'])) {
322
+ $values = array_values($targetData['value']);
323
+ }
324
+
325
+ global $post;
326
+ // get current all taxonomies of the current post
327
+ $taxonomies = get_post_taxonomies($post);
328
+ foreach ($taxonomies as $taxonomy) {
329
+ // get current post all categories
330
+ $terms = get_the_terms($post->ID, $taxonomy);
331
+ if (!empty($terms)) {
332
+ foreach ($terms as $term) {
333
+ if (empty($term)) {
334
+ continue;
335
+ }
336
+ if (in_array($term->term_id, $values)) {
337
+ $isSatisfy = true;
338
+ break;
339
+ }
340
+ }
341
+ }
342
+ }
343
+ }
344
  else if ($targetData['param'] == 'post_type' && !empty($targetData['value'])) {
345
  $selectedCustomPostTypes = array_values($targetData['value']);
346
  $currentPostType = get_post_type($postId);
com/classes/RegisterPostType.php CHANGED
@@ -2,7 +2,6 @@
2
  namespace sgpb;
3
  use \SgpbDataConfig;
4
  use \SgpbPopupConfig;
5
-
6
  class RegisterPostType
7
  {
8
  private $popupTypeObj;
@@ -173,7 +172,7 @@ class RegisterPostType
173
  $args = $this->getPostTypeArgs();
174
 
175
  register_post_type($postType, $args);
176
-
177
  $this->createPopupObjFromPopupType();
178
  $this->registerTaxonomy();
179
  }
@@ -269,7 +268,8 @@ class RegisterPostType
269
  public function rightBannerMetabox()
270
  {
271
  $banner = AdminHelper::getRightMetaboxBannerText();
272
- if ($banner == '') {
 
273
  return;
274
  }
275
  add_meta_box(
@@ -347,7 +347,7 @@ class RegisterPostType
347
  __('Subscribers', SG_POPUP_TEXT_DOMAIN),
348
  __('Subscribers', SG_POPUP_TEXT_DOMAIN),
349
  'sgpb_manage_options',
350
- 'subscribers',
351
  array($this, 'subscribersPage')
352
  );
353
 
2
  namespace sgpb;
3
  use \SgpbDataConfig;
4
  use \SgpbPopupConfig;
 
5
  class RegisterPostType
6
  {
7
  private $popupTypeObj;
172
  $args = $this->getPostTypeArgs();
173
 
174
  register_post_type($postType, $args);
175
+
176
  $this->createPopupObjFromPopupType();
177
  $this->registerTaxonomy();
178
  }
268
  public function rightBannerMetabox()
269
  {
270
  $banner = AdminHelper::getRightMetaboxBannerText();
271
+ $isSubscriptionPlusActive = is_plugin_active(SGPB_POPUP_SUBSCRIPTION_PLUS_EXTENSION_KEY);
272
+ if ($banner == '' || $isSubscriptionPlusActive) {
273
  return;
274
  }
275
  add_meta_box(
347
  __('Subscribers', SG_POPUP_TEXT_DOMAIN),
348
  __('Subscribers', SG_POPUP_TEXT_DOMAIN),
349
  'sgpb_manage_options',
350
+ 'sgpbSubscribers',
351
  array($this, 'subscribersPage')
352
  );
353
 
com/classes/ScriptsLoader.php CHANGED
@@ -71,10 +71,11 @@ class ScriptsLoader
71
  }
72
 
73
  global $post;
74
- if (empty($post)) {
75
- return false;
 
 
76
  }
77
- $postId = $post->ID;
78
 
79
  foreach ($popups as $popup) {
80
  $popupId = $popup->getId();
71
  }
72
 
73
  global $post;
74
+ $postId = 0;
75
+
76
+ if (!empty($post)) {
77
+ $postId = $post->ID;
78
  }
 
79
 
80
  foreach ($popups as $popup) {
81
  $popupId = $popup->getId();
com/classes/Style.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
  namespace sgpb;
3
-
4
  /**
5
  * Popup Builder Style
6
  *
@@ -30,7 +29,7 @@ class Style
30
  $pageName = 'popupspage';
31
  }
32
  else if ($hook == 'popupbuilder_page_subscribers') {
33
- $pageName = 'subscribers';
34
  }
35
 
36
  $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
1
  <?php
2
  namespace sgpb;
 
3
  /**
4
  * Popup Builder Style
5
  *
29
  $pageName = 'popupspage';
30
  }
31
  else if ($hook == 'popupbuilder_page_subscribers') {
32
+ $pageName = 'sgpbSubscribers';
33
  }
34
 
35
  $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
com/classes/dataTable/Subscribers.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
-
3
  require_once(SG_POPUP_CLASSES_PATH.'/Ajax.php');
4
  require_once(SG_POPUP_HELPERS_PATH.'AdminHelper.php');
5
 
6
  use sgpb\SGPopup;
7
  use sgpb\AdminHelper;
8
  use sgpbDataTable\SGPBTable;
 
9
 
10
  class Subscribers extends SGPBTable
11
  {
@@ -80,4 +80,87 @@ class Subscribers extends SGPBTable
80
  {
81
  $query = AdminHelper::subscribersRelatedQuery($query);
82
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
1
  <?php
 
2
  require_once(SG_POPUP_CLASSES_PATH.'/Ajax.php');
3
  require_once(SG_POPUP_HELPERS_PATH.'AdminHelper.php');
4
 
5
  use sgpb\SGPopup;
6
  use sgpb\AdminHelper;
7
  use sgpbDataTable\SGPBTable;
8
+ use sgpb\SubscriptionPopup;
9
 
10
  class Subscribers extends SGPBTable
11
  {
80
  {
81
  $query = AdminHelper::subscribersRelatedQuery($query);
82
  }
83
+
84
+ public function getNavPopupsConditions()
85
+ {
86
+ $subscriptionPopups = SubscriptionPopup::getAllSubscriptionForms();
87
+ $list = '';
88
+ $selectedPopup = '';
89
+
90
+ if (isset($_GET['sgpb-subscription-popup-id'])) {
91
+ $selectedPopup = (int)$_GET['sgpb-subscription-popup-id'];
92
+ }
93
+
94
+ ob_start();
95
+ ?>
96
+ <input type="hidden" class="sgpb-subscription-popup-id" name="sgpb-subscription-popup-id" value="<?php echo $selectedPopup;?>">
97
+ <input type="hidden" name="page" value="sgpbSubscribers" />
98
+
99
+ <select name="sgpb-subscription-popup" id="sgpb-subscription-popup">
100
+ <?php
101
+ $list .= '<option value="all">'.__('All', SG_POPUP_TEXT_DOMAIN).'</option>';
102
+ foreach ($subscriptionPopups as $popupId => $popupTitle) {
103
+ if ($selectedPopup == $popupId) {
104
+ $selected = ' selected';
105
+ }
106
+ else {
107
+ $selected = '';
108
+ }
109
+ $list .= '<option value="'.esc_attr($popupId).'"'.$selected.'>'.$popupTitle.'</option>';
110
+ }
111
+ echo $list;
112
+ ?>
113
+ </select>
114
+
115
+ <?php
116
+ $content = ob_get_contents();
117
+ ob_end_clean();
118
+
119
+ return $content;
120
+ }
121
+
122
+ public function getNavDateConditions() {
123
+ $subscribersDates = SubscriptionPopup::getAllSubscribersDate();
124
+ $uniqueDates = array();
125
+
126
+ foreach ($subscribersDates as $arr) {
127
+ $uniqueDates[] = $arr;
128
+ }
129
+ $uniqueDates = array_unique($uniqueDates, SORT_REGULAR);
130
+
131
+ $selectedDate = '';
132
+ $dateList = '';
133
+ $selected = '';
134
+
135
+ if (isset($_GET['sgpb-subscribers-date'])) {
136
+ $selectedDate = esc_sql($_GET['sgpb-subscribers-date']);
137
+ }
138
+
139
+ ob_start();
140
+ ?>
141
+ <input type="hidden" class="sgpb-subscribers-date" name="sgpb-subscribers-date" value="<?php echo $selectedDate;?>">
142
+ <select name="sgpb-subscribers-dates" id="sgpb-subscribers-dates">
143
+ <?php
144
+ $gotDateList = '<option value="all">'.__('All dates', SG_POPUP_TEXT_DOMAIN).'</option>';
145
+ foreach ($uniqueDates as $date) {
146
+ if ($selectedDate == $date['date-value']) {
147
+ $selected = ' selected';
148
+ }
149
+ else {
150
+ $selected = '';
151
+ }
152
+ $gotDateList .= '<option value="'.$date['date-value'].'"'.$selected.'>'.$date['date-title'].'</option>';
153
+ }
154
+ if (empty($subscribersDates)) {
155
+ $gotDateList = '<option value="'.@$date['date-value'].'"'.$selected.'>'.__('Date', SG_POPUP_TEXT_DOMAIN).'</option>';
156
+ }
157
+ echo $dateList.$gotDateList;
158
+ ?>
159
+ </select>
160
+ <?php
161
+ $content = ob_get_contents();
162
+ ob_end_clean();
163
+
164
+ return $content;
165
+ }
166
  }
com/classes/extension/SgpbPopupExtension.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  require_once(SG_POPUP_EXTENSION_PATH.'SgpbIPopupExtension.php');
3
  use sgpb\AdminHelper;
4
  if (class_exists('SgpbPopupExtension')) {
@@ -22,6 +23,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
22
  $jsFiles = array();
23
  $localizeData = array();
24
  $translatedData = ConfigDataHelper::getJsLocalizedData();
 
25
  $newsletterPage = $this->getNewsletterPageKey();
26
  $settingsPage = $this->getSettingsPageKey();
27
 
@@ -85,7 +87,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
85
  )
86
  );
87
 
88
- if (in_array($pageName, $allowPages)) {
89
  $jsFiles[] = array('folderUrl'=> '', 'filename' => 'wp-color-picker');
90
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
91
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
@@ -137,7 +139,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
137
  'data' => SG_POPUP_PUBLIC_URL
138
  );
139
  }
140
- else if ($pageName == 'subscribers') {
141
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
142
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
143
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Subscribers.js');
@@ -230,7 +232,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
230
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'theme.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
231
  $cssFiles[] = array('folderUrl' => '', 'filename' => 'wp-color-picker');
232
  }
233
- else if ($pageName == 'subscribers') {
234
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'sgbp-bootstrap.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
235
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'popupAdminStyles.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
236
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'select2.min.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
@@ -327,4 +329,4 @@ class SgpbPopupExtension implements SgpbIPopupExtension
327
 
328
  return $cssData;
329
  }
330
- }
1
  <?php
2
+
3
  require_once(SG_POPUP_EXTENSION_PATH.'SgpbIPopupExtension.php');
4
  use sgpb\AdminHelper;
5
  if (class_exists('SgpbPopupExtension')) {
23
  $jsFiles = array();
24
  $localizeData = array();
25
  $translatedData = ConfigDataHelper::getJsLocalizedData();
26
+ $currentPostType = AdminHelper::getCurrentPostType();
27
  $newsletterPage = $this->getNewsletterPageKey();
28
  $settingsPage = $this->getSettingsPageKey();
29
 
87
  )
88
  );
89
 
90
+ if (in_array($pageName, $allowPages) || $currentPostType == SG_POPUP_AUTORESPONDER_POST_TYPE) {
91
  $jsFiles[] = array('folderUrl'=> '', 'filename' => 'wp-color-picker');
92
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
93
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
139
  'data' => SG_POPUP_PUBLIC_URL
140
  );
141
  }
142
+ else if ($pageName == 'sgpbSubscribers') {
143
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
144
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
145
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Subscribers.js');
232
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'theme.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
233
  $cssFiles[] = array('folderUrl' => '', 'filename' => 'wp-color-picker');
234
  }
235
+ else if ($pageName == 'sgpbSubscribers') {
236
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'sgbp-bootstrap.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
237
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'popupAdminStyles.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
238
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'select2.min.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
329
 
330
  return $cssData;
331
  }
332
+ }
com/classes/popups/SubscriptionPopup.php CHANGED
@@ -49,6 +49,7 @@ class SubscriptionPopup extends SGPopup
49
  public static function getTablesSql()
50
  {
51
  $tablesSql = array();
 
52
 
53
  $tablesSql[] = SGPB_SUBSCRIBERS_TABLE_NAME.' (
54
  `id` int(12) NOT NULL AUTO_INCREMENT,
@@ -60,7 +61,7 @@ class SubscriptionPopup extends SGPopup
60
  `status` varchar(255),
61
  `unsubscribed` int(11) default 0,
62
  PRIMARY KEY (id)
63
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;';
64
 
65
  $tablesSql[] = SGPB_SUBSCRIBERS_ERROR_TABLE_NAME.' (
66
  `id` int(12) NOT NULL AUTO_INCREMENT,
@@ -69,7 +70,7 @@ class SubscriptionPopup extends SGPopup
69
  `email` varchar(255),
70
  `date` varchar(255),
71
  PRIMARY KEY (id)
72
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;';
73
 
74
  return $tablesSql;
75
  }
49
  public static function getTablesSql()
50
  {
51
  $tablesSql = array();
52
+ $dbEngine = Functions::getDatabaseEngine();
53
 
54
  $tablesSql[] = SGPB_SUBSCRIBERS_TABLE_NAME.' (
55
  `id` int(12) NOT NULL AUTO_INCREMENT,
61
  `status` varchar(255),
62
  `unsubscribed` int(11) default 0,
63
  PRIMARY KEY (id)
64
+ ) ENGINE='.$dbEngine.' DEFAULT CHARSET=utf8;';
65
 
66
  $tablesSql[] = SGPB_SUBSCRIBERS_ERROR_TABLE_NAME.' (
67
  `id` int(12) NOT NULL AUTO_INCREMENT,
70
  `email` varchar(255),
71
  `date` varchar(255),
72
  PRIMARY KEY (id)
73
+ ) ENGINE='.$dbEngine.' DEFAULT CHARSET=utf8;';
74
 
75
  return $tablesSql;
76
  }
com/config/config.php CHANGED
@@ -114,6 +114,7 @@ class SgpbPopupConfig
114
  self::addDefine('SGPB_ASK_REVIEW_POPUP_COUNT', 80);
115
  self::addDefine('SGPB_REVIEW_POPUP_PERIOD', 30);
116
  self::addDefine('SGPB_POPUP_EXPORT_FILE_NAME', 'PopupBuilderPopups.xml');
 
117
  self::popupTypesInit();
118
  }
119
 
114
  self::addDefine('SGPB_ASK_REVIEW_POPUP_COUNT', 80);
115
  self::addDefine('SGPB_REVIEW_POPUP_PERIOD', 30);
116
  self::addDefine('SGPB_POPUP_EXPORT_FILE_NAME', 'PopupBuilderPopups.xml');
117
+ self::addDefine('SG_POPUP_AUTORESPONDER_POST_TYPE', 'sgpbautoresponder');
118
  self::popupTypesInit();
119
  }
120
 
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.1.5.2');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
3
  exit();
4
  }
5
 
6
+ define('SG_POPUP_VERSION', '3.1.6');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/config/dataConfig.php CHANGED
@@ -476,6 +476,7 @@ class SgpbDataConfig
476
  $SGPB_DATA_CONFIG_ARRAY['conditions'] = $popupConditions;
477
 
478
  $SGPB_DATA_CONFIG_ARRAY['behavior-after-special-events'] = self::getBehaviorAfterSpecialEventsConfig();
 
479
  /*Target condition config*/
480
  }
481
 
@@ -821,9 +822,12 @@ class SgpbDataConfig
821
  $options[] = array('name' => 'sgpb-background-image', 'type' => 'text', 'defaultValue' => '');
822
  $options[] = array('name' => 'sgpb-show-background', 'type' => 'checkbox', 'defaultValue' => '');
823
  $options[] = array('name' => 'sgpb-force-rtl', 'type' => 'checkbox', 'defaultValue' => '');
 
824
  $options[] = array('name' => 'sgpb-background-image-mode', 'type' => 'text', 'defaultValue' => 'no-repeat');
825
  $options[] = array('name' => 'sgpb-image-url', 'type' => 'text', 'defaultValue' => '');
826
  $options[] = array('name' => 'sgpb-close-button-delay', 'type' => 'number', 'defaultValue' => 0);
 
 
827
  $options[] = array('name' => 'sgpb-button-image', 'type' => 'text', 'defaultValue' => '');
828
  $options[] = array('name' => 'sgpb-button-image-width', 'type' => 'text', 'defaultValue' => 21);
829
  $options[] = array('name' => 'sgpb-button-image-height', 'type' => 'text', 'defaultValue' => 21);
@@ -849,11 +853,13 @@ class SgpbDataConfig
849
  $options[] = array('name' => 'sgpb-restriction-no-btn', 'type' => 'text', 'defaultValue' => __('No', SG_POPUP_TEXT_DOMAIN));
850
  $options[] = array('name' => 'sgpb-countdown-show-on-top', 'type' => 'checkbox', 'defaultValue' => 'on');
851
  $options[] = array('name' => 'sgpb-countdown-close-timeout', 'type' => 'checkbox', 'defaultValue' => 'on');
 
852
  $options[] = array('name' => 'sgpb-counter-background-color', 'type' => 'text', 'defaultValue' => '#333333');
853
  $options[] = array('name' => 'sgpb-counter-text-color', 'type' => 'text', 'defaultValue' => '#cccccc');
854
  $options[] = array('name' => 'sgpb-countdown-timezone', 'type' => 'text', 'defaultValue' => ConfigDataHelper::getDefaultTimezone());
855
  $options[] = array('name' => 'sgpb-countdown-due-date', 'type' => 'text', 'defaultValue' => ConfigDataHelper::getCurrentDateTime());
856
  $options[] = array('name' => 'sgpb-countdown-date-format', 'type' => 'text', 'defaultValue' => 'date');
 
857
  $options[] = array('name' => 'sgpb-countdown-date-days', 'type' => 'text', 'defaultValue' => '1');
858
  $options[] = array('name' => 'sgpb-countdown-date-hours', 'type' => 'number', 'defaultValue' => '0');
859
  $options[] = array('name' => 'sgpb-countdown-date-minutes', 'type' => 'number', 'defaultValue' => '0');
476
  $SGPB_DATA_CONFIG_ARRAY['conditions'] = $popupConditions;
477
 
478
  $SGPB_DATA_CONFIG_ARRAY['behavior-after-special-events'] = self::getBehaviorAfterSpecialEventsConfig();
479
+ $SGPB_DATA_CONFIG_ARRAY = apply_filters('sgpbConfigArray', $SGPB_DATA_CONFIG_ARRAY);
480
  /*Target condition config*/
481
  }
482
 
822
  $options[] = array('name' => 'sgpb-background-image', 'type' => 'text', 'defaultValue' => '');
823
  $options[] = array('name' => 'sgpb-show-background', 'type' => 'checkbox', 'defaultValue' => '');
824
  $options[] = array('name' => 'sgpb-force-rtl', 'type' => 'checkbox', 'defaultValue' => '');
825
+ $options[] = array('name' => 'sgpb-disable-border', 'type' => 'checkbox', 'defaultValue' => '');
826
  $options[] = array('name' => 'sgpb-background-image-mode', 'type' => 'text', 'defaultValue' => 'no-repeat');
827
  $options[] = array('name' => 'sgpb-image-url', 'type' => 'text', 'defaultValue' => '');
828
  $options[] = array('name' => 'sgpb-close-button-delay', 'type' => 'number', 'defaultValue' => 0);
829
+ $options[] = array('name' => 'sgpb-button-position-bottom', 'type' => 'number', 'defaultValue' => 9);
830
+ $options[] = array('name' => 'sgpb-button-position-right', 'type' => 'number', 'defaultValue' => 9);
831
  $options[] = array('name' => 'sgpb-button-image', 'type' => 'text', 'defaultValue' => '');
832
  $options[] = array('name' => 'sgpb-button-image-width', 'type' => 'text', 'defaultValue' => 21);
833
  $options[] = array('name' => 'sgpb-button-image-height', 'type' => 'text', 'defaultValue' => 21);
853
  $options[] = array('name' => 'sgpb-restriction-no-btn', 'type' => 'text', 'defaultValue' => __('No', SG_POPUP_TEXT_DOMAIN));
854
  $options[] = array('name' => 'sgpb-countdown-show-on-top', 'type' => 'checkbox', 'defaultValue' => 'on');
855
  $options[] = array('name' => 'sgpb-countdown-close-timeout', 'type' => 'checkbox', 'defaultValue' => 'on');
856
+ $options[] = array('name' => 'sgpb-countdown-repetitive-timer', 'type' => 'checkbox', 'defaultValue' => '');
857
  $options[] = array('name' => 'sgpb-counter-background-color', 'type' => 'text', 'defaultValue' => '#333333');
858
  $options[] = array('name' => 'sgpb-counter-text-color', 'type' => 'text', 'defaultValue' => '#cccccc');
859
  $options[] = array('name' => 'sgpb-countdown-timezone', 'type' => 'text', 'defaultValue' => ConfigDataHelper::getDefaultTimezone());
860
  $options[] = array('name' => 'sgpb-countdown-due-date', 'type' => 'text', 'defaultValue' => ConfigDataHelper::getCurrentDateTime());
861
  $options[] = array('name' => 'sgpb-countdown-date-format', 'type' => 'text', 'defaultValue' => 'date');
862
+ $options[] = array('name' => 'sgpb-countdown-repetitive-seconds', 'type' => 'text', 'defaultValue' => '');
863
  $options[] = array('name' => 'sgpb-countdown-date-days', 'type' => 'text', 'defaultValue' => '1');
864
  $options[] = array('name' => 'sgpb-countdown-date-hours', 'type' => 'number', 'defaultValue' => '0');
865
  $options[] = array('name' => 'sgpb-countdown-date-minutes', 'type' => 'number', 'defaultValue' => '0');
com/helpers/AdminHelper.php CHANGED
@@ -257,7 +257,7 @@ class AdminHelper
257
  else {
258
  $str .= '<div class="row form-group">';
259
  $str .= '<label class="col-md-5 control-label">'.__($element['title'], SG_POPUP_TEXT_DOMAIN).'</label>';
260
- $str .= '<div class="col-sm-7"><input type="radio" name="'.esc_attr($name).'" value="'.esc_attr($value).'" '.$checked.'></div>';
261
  $str .= '</div>';
262
  }
263
  }
@@ -923,7 +923,7 @@ class AdminHelper
923
  $remoteData = wp_remote_get($imageUrl);
924
 
925
  if (is_wp_error($remoteData)) {
926
- return $data;
927
  }
928
 
929
  $imageData = wp_remote_retrieve_body($remoteData);
@@ -1037,6 +1037,7 @@ class AdminHelper
1037
  if (isset($extension['key']) && $extension['key'] == $key) {
1038
  if (is_plugin_active($extension['pluginKey'])) {
1039
  $isActive = true;
 
1040
  }
1041
  }
1042
  }
@@ -1195,8 +1196,11 @@ class AdminHelper
1195
  if (!$periodNextTime) {
1196
  $usageDays = self::getPopupMainTableCreationDate();
1197
  update_option('SGPBUsageDays', $usageDays);
 
 
 
1198
  // For old users
1199
- if ($usageDays > SG_REVIEW_POPUP_PERIOD && !$dontShowAgain) {
1200
  return $shouldOpen;
1201
  }
1202
  $remainingDays = SG_REVIEW_POPUP_PERIOD - $usageDays;
257
  else {
258
  $str .= '<div class="row form-group">';
259
  $str .= '<label class="col-md-5 control-label">'.__($element['title'], SG_POPUP_TEXT_DOMAIN).'</label>';
260
+ $str .= '<div class="col-sm-7"><input type="radio" name="'.esc_attr($name).'" value="'.esc_attr($value).'" '.$checked.' autocomplete="off"></div>';
261
  $str .= '</div>';
262
  }
263
  }
923
  $remoteData = wp_remote_get($imageUrl);
924
 
925
  if (is_wp_error($remoteData)) {
926
+ return $imageUrl;
927
  }
928
 
929
  $imageData = wp_remote_retrieve_body($remoteData);
1037
  if (isset($extension['key']) && $extension['key'] == $key) {
1038
  if (is_plugin_active($extension['pluginKey'])) {
1039
  $isActive = true;
1040
+ return $isActive;
1041
  }
1042
  }
1043
  }
1196
  if (!$periodNextTime) {
1197
  $usageDays = self::getPopupMainTableCreationDate();
1198
  update_option('SGPBUsageDays', $usageDays);
1199
+ if (!defined('SG_REVIEW_POPUP_PERIOD')) {
1200
+ define('SG_REVIEW_POPUP_PERIOD', '500');
1201
+ }
1202
  // For old users
1203
+ if (defined('SG_REVIEW_POPUP_PERIOD') && $usageDays > SG_REVIEW_POPUP_PERIOD && !$dontShowAgain) {
1204
  return $shouldOpen;
1205
  }
1206
  $remainingDays = SG_REVIEW_POPUP_PERIOD - $usageDays;
com/helpers/ConfigDataHelper.php CHANGED
@@ -33,7 +33,7 @@ class ConfigDataHelper
33
  return $query;
34
  }
35
 
36
- private static function getAllCustomPosts()
37
  {
38
  $args = array(
39
  'public' => true,
@@ -41,9 +41,11 @@ class ConfigDataHelper
41
  );
42
 
43
  $allCustomPosts = get_post_types($args);
 
44
  if (isset($allCustomPosts[SG_POPUP_POST_TYPE])) {
45
  unset($allCustomPosts[SG_POPUP_POST_TYPE]);
46
  }
 
47
  return $allCustomPosts;
48
  }
49
 
@@ -72,7 +74,8 @@ class ConfigDataHelper
72
  foreach ($allCustomPostTypes as $customPostType) {
73
  $targetParams[$customPostType] = array(
74
  $customPostType.'_all' => 'All '.ucfirst($customPostType).'s',
75
- $customPostType.'_selected' => 'Select '.ucfirst($customPostType).'s'
 
76
  );
77
  }
78
 
@@ -86,17 +89,30 @@ class ConfigDataHelper
86
  foreach ($allCustomPostTypes as $customPostType) {
87
  $targetData[$customPostType.'_all'] = null;
88
  $targetData[$customPostType.'_selected'] = '';
 
89
  }
90
 
91
  return $targetData;
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
94
  public static function addPopupTargetTypes($targetTypes)
95
  {
96
  $allCustomPostTypes = self::getAllCustomPosts();
97
 
98
  foreach ($allCustomPostTypes as $customPostType) {
99
  $targetTypes[$customPostType.'_selected'] = 'select';
 
100
  }
101
 
102
  return $targetTypes;
@@ -109,6 +125,9 @@ class ConfigDataHelper
109
  foreach ($allCustomPostTypes as $customPostType) {
110
  $targetAttrs[$customPostType.'_selected']['htmlAttrs'] = array('class' => 'js-sg-select2 js-select-ajax', 'data-select-class' => 'js-select-ajax', 'data-select-type' => 'ajax', 'data-value-param' => $customPostType, 'multiple' => 'multiple');
111
  $targetAttrs[$customPostType.'_selected']['infoAttrs'] = array('label' => __('Select ', SG_POPUP_TEXT_DOMAIN).$customPostType);
 
 
 
112
  }
113
 
114
  return $targetAttrs;
@@ -138,19 +157,21 @@ class ConfigDataHelper
138
  return $allCustomPosts;
139
  }
140
 
141
- public static function getPostsAllCategories()
142
  {
143
 
144
  $cats = get_terms(
145
  array(
146
  'hide_empty' => 0,
147
- 'type' => 'post',
148
  'orderby' => 'name',
149
  'order' => 'ASC'
150
  )
151
  );
152
-
153
- $supportedTaxonomies = array('category', 'product_cat');
 
 
154
 
155
  $catsParams = array();
156
  foreach ($cats as $cat) {
@@ -587,7 +608,7 @@ class ConfigDataHelper
587
  'value' => 'input'
588
  ),
589
  'label' => array(
590
- 'name' => __('Duration', SG_POPUP_TEXT_DOMAIN).':'
591
  )
592
  )
593
  )
33
  return $query;
34
  }
35
 
36
+ public static function getAllCustomPosts()
37
  {
38
  $args = array(
39
  'public' => true,
41
  );
42
 
43
  $allCustomPosts = get_post_types($args);
44
+
45
  if (isset($allCustomPosts[SG_POPUP_POST_TYPE])) {
46
  unset($allCustomPosts[SG_POPUP_POST_TYPE]);
47
  }
48
+
49
  return $allCustomPosts;
50
  }
51
 
74
  foreach ($allCustomPostTypes as $customPostType) {
75
  $targetParams[$customPostType] = array(
76
  $customPostType.'_all' => 'All '.ucfirst($customPostType).'s',
77
+ $customPostType.'_selected' => 'Select '.ucfirst($customPostType).'s',
78
+ $customPostType.'_categories' => 'Select '.ucfirst($customPostType).' categories'
79
  );
80
  }
81
 
89
  foreach ($allCustomPostTypes as $customPostType) {
90
  $targetData[$customPostType.'_all'] = null;
91
  $targetData[$customPostType.'_selected'] = '';
92
+ $targetData[$customPostType.'_categories'] = self::getCustomPostCategories($customPostType);
93
  }
94
 
95
  return $targetData;
96
  }
97
 
98
+ public static function getCustomPostCategories($postTypeName)
99
+ {
100
+ $taxonomyObjects = get_object_taxonomies($postTypeName);
101
+ if ($postTypeName == 'product') {
102
+ $taxonomyObjects = array('product_cat');
103
+ }
104
+ $categories = self::getPostsAllCategories($postTypeName, $taxonomyObjects);
105
+
106
+ return $categories;
107
+ }
108
+
109
  public static function addPopupTargetTypes($targetTypes)
110
  {
111
  $allCustomPostTypes = self::getAllCustomPosts();
112
 
113
  foreach ($allCustomPostTypes as $customPostType) {
114
  $targetTypes[$customPostType.'_selected'] = 'select';
115
+ $targetTypes[$customPostType.'_categories'] = 'select';
116
  }
117
 
118
  return $targetTypes;
125
  foreach ($allCustomPostTypes as $customPostType) {
126
  $targetAttrs[$customPostType.'_selected']['htmlAttrs'] = array('class' => 'js-sg-select2 js-select-ajax', 'data-select-class' => 'js-select-ajax', 'data-select-type' => 'ajax', 'data-value-param' => $customPostType, 'multiple' => 'multiple');
127
  $targetAttrs[$customPostType.'_selected']['infoAttrs'] = array('label' => __('Select ', SG_POPUP_TEXT_DOMAIN).$customPostType);
128
+
129
+ $targetAttrs[$customPostType.'_categories']['htmlAttrs'] = array('class' => 'js-sg-select2 js-select-ajax', 'data-select-class' => 'js-select-ajax', 'isNotPostType' => true, 'data-value-param' => $customPostType, 'multiple' => 'multiple');
130
+ $targetAttrs[$customPostType.'_categories']['infoAttrs'] = array('label' => __('Select ', SG_POPUP_TEXT_DOMAIN).$customPostType.' categories');
131
  }
132
 
133
  return $targetAttrs;
157
  return $allCustomPosts;
158
  }
159
 
160
+ public static function getPostsAllCategories($postType = 'post', $taxonomies = array())
161
  {
162
 
163
  $cats = get_terms(
164
  array(
165
  'hide_empty' => 0,
166
+ 'type' => $postType,
167
  'orderby' => 'name',
168
  'order' => 'ASC'
169
  )
170
  );
171
+ $supportedTaxonomies = array();
172
+ if (!empty($taxonomies)) {
173
+ $supportedTaxonomies = $taxonomies;
174
+ }
175
 
176
  $catsParams = array();
177
  foreach ($cats as $cat) {
608
  'value' => 'input'
609
  ),
610
  'label' => array(
611
+ 'name' => __('Timer', SG_POPUP_TEXT_DOMAIN).':'
612
  )
613
  )
614
  )
com/helpers/Functions.php CHANGED
@@ -200,4 +200,22 @@ class Functions
200
 
201
  return $dir;
202
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  }
200
 
201
  return $dir;
202
  }
203
+
204
+ public static function getDatabaseEngine()
205
+ {
206
+ global $wpdb;
207
+ $dbName = $wpdb->dbname;
208
+ $engine = 'InnoDB';
209
+ $engineCheckSql = "SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = '$dbName'";
210
+ $result = $wpdb->get_results($engineCheckSql, ARRAY_A);
211
+ if (!empty($result)) {
212
+ $engineCheckSql = "SHOW TABLE STATUS WHERE Name = '".$wpdb->prefix."users' AND Engine = 'MyISAM'";
213
+ $result = $wpdb->get_results($engineCheckSql, ARRAY_A);
214
+ if (isset($result[0]['Engine']) && $result[0]['Engine'] == 'MyISAM') {
215
+ $engine = 'MyISAM';
216
+ }
217
+ }
218
+
219
+ return $engine;
220
+ }
221
  }
com/libs/Table.php CHANGED
@@ -16,6 +16,7 @@ class SGPBTable extends SGPBListTable
16
  protected $rowsPerPage = 10;
17
  protected $initialOrder = array();
18
  private $previewPopup = false;
 
19
 
20
  public function __construct($id, $popupPreviewId = false)
21
  {
@@ -73,6 +74,21 @@ class SGPBTable extends SGPBListTable
73
  return $this->displayColumns;
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  public function prepare_items()
77
  {
78
  global $wpdb;
@@ -179,7 +195,6 @@ class SGPBTable extends SGPBListTable
179
  <form method="get" id="posts-filter">
180
  <p class="search-box">
181
  <input type="hidden" name="post_type" value="popupbuilder" />
182
- <input type="hidden" name="page" value="subscribers" />
183
  <?php $this->search_box('search', 'search_id'); ?>
184
  </p>
185
  <?php $this->display();?>
@@ -191,63 +206,24 @@ class SGPBTable extends SGPBListTable
191
  // parent class method overriding
192
  public function extra_tablenav($which)
193
  {
194
- $subscriptionPopups = SubscriptionPopup::getAllSubscriptionForms();
195
- $subscribersDates = SubscriptionPopup::getAllSubscribersDate();
196
- $uniqueDates = array();
197
- foreach ($subscribersDates as $arr) {
198
- $uniqueDates[] = $arr;
199
- }
200
- $uniqueDates = array_unique($uniqueDates, SORT_REGULAR);
201
- $selectedPopup = '';
202
- $selectedDate = '';
203
- $dateList = '';
204
- $list = '';
205
- $selected = '';
206
- if (isset($_GET['sgpb-subscription-popup-id'])) {
207
- $selectedPopup = (int)$_GET['sgpb-subscription-popup-id'];
208
- }
209
- if (isset($_GET['sgpb-subscribers-date'])) {
210
- $selectedDate = esc_sql($_GET['sgpb-subscribers-date']);
211
  }
 
 
 
 
 
212
  ?>
213
  <div class="alignleft actions daterangeactions">
214
  <label class="screen-reader-text" for="sgpb-subscription-popup"><?php _e('Filter by popup', SG_POPUP_TEXT_DOMAIN)?></label>
215
- <input type="hidden" class="sgpb-subscription-popup-id" name="sgpb-subscription-popup-id" value="<?php echo $selectedPopup;?>">
216
- <select name="sgpb-subscription-popup" id="sgpb-subscription-popup">
217
- <?php
218
- $list .= '<option value="all">'.__('All', SG_POPUP_TEXT_DOMAIN).'</option>';
219
- foreach ($subscriptionPopups as $popupId => $popupTitle) {
220
- if ($selectedPopup == $popupId) {
221
- $selected = ' selected';
222
- }
223
- else {
224
- $selected = '';
225
- }
226
- $list .= '<option value="'.esc_attr($popupId).'"'.$selected.'>'.$popupTitle.'</option>';
227
- }
228
- echo $list;
229
- ?>
230
- </select>
231
  <label class="screen-reader-text" for="sgpb-subscribers-dates"><?php _e('Filter by date', SG_POPUP_TEXT_DOMAIN)?></label>
232
- <input type="hidden" class="sgpb-subscribers-date" name="sgpb-subscribers-date" value="<?php echo $selectedDate;?>">
233
- <select name="sgpb-subscribers-dates" id="sgpb-subscribers-dates">
234
- <?php
235
- $gotDateList = '<option value="all">'.__('All dates', SG_POPUP_TEXT_DOMAIN).'</option>';
236
- foreach ($uniqueDates as $date) {
237
- if ($selectedDate == $date['date-value']) {
238
- $selected = ' selected';
239
- }
240
- else {
241
- $selected = '';
242
- }
243
- $gotDateList .= '<option value="'.$date['date-value'].'"'.$selected.'>'.$date['date-title'].'</option>';
244
- }
245
- if (empty($subscribersDates)) {
246
- $gotDateList = '<option value="'.$date['date-value'].'"'.$selected.'>'.__('Date', SG_POPUP_TEXT_DOMAIN).'</option>';
247
- }
248
- echo $dateList.$gotDateList;
249
- ?>
250
- </select>
251
  <input name="filter_action" id="post-query-submit" class="button" value="<?php _e('Filter', SG_POPUP_TEXT_DOMAIN)?>" type="submit">
252
  </div>
253
  <?php
16
  protected $rowsPerPage = 10;
17
  protected $initialOrder = array();
18
  private $previewPopup = false;
19
+ private $isVisibleExtraNav = true;
20
 
21
  public function __construct($id, $popupPreviewId = false)
22
  {
74
  return $this->displayColumns;
75
  }
76
 
77
+ public function setIsVisibleExtraNav($isVisibleExtraNav)
78
+ {
79
+ $this->isVisibleExtraNav = $isVisibleExtraNav;
80
+ }
81
+
82
+ public function getIsVisibleExtraNav()
83
+ {
84
+ return $this->isVisibleExtraNav;
85
+ }
86
+
87
+ public function getNavPopupsConditions()
88
+ {
89
+ return '';
90
+ }
91
+
92
  public function prepare_items()
93
  {
94
  global $wpdb;
195
  <form method="get" id="posts-filter">
196
  <p class="search-box">
197
  <input type="hidden" name="post_type" value="popupbuilder" />
 
198
  <?php $this->search_box('search', 'search_id'); ?>
199
  </p>
200
  <?php $this->display();?>
206
  // parent class method overriding
207
  public function extra_tablenav($which)
208
  {
209
+ $isVisibleExtraNav = $this->getIsVisibleExtraNav();
210
+
211
+ if (!$isVisibleExtraNav) {
212
+ return '';
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  }
214
+
215
+
216
+
217
+
218
+
219
  ?>
220
  <div class="alignleft actions daterangeactions">
221
  <label class="screen-reader-text" for="sgpb-subscription-popup"><?php _e('Filter by popup', SG_POPUP_TEXT_DOMAIN)?></label>
222
+ <?php echo $this->getNavPopupsConditions(); ?>
223
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  <label class="screen-reader-text" for="sgpb-subscribers-dates"><?php _e('Filter by date', SG_POPUP_TEXT_DOMAIN)?></label>
225
+ <?php echo $this->getNavDateConditions(); ?>
226
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  <input name="filter_action" id="post-query-submit" class="button" value="<?php _e('Filter', SG_POPUP_TEXT_DOMAIN)?>" type="submit">
228
  </div>
229
  <?php
popup-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
- * Version: 3.1.5.2
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
+ * Version: 3.1.6
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/css/popupAdminStyles.css CHANGED
@@ -1333,6 +1333,7 @@ input:checked + .sgpb-slider:before {
1333
  }
1334
 
1335
  .sgpb-box-target .sgpb-event-row:not(:first-child),
 
1336
  .sgpb-box-woocommerce-special-events .sgpb-event-row:not(:first-child),
1337
  .sgpb-box-conditions .sgpb-event-row:not(:first-child),
1338
  .sgpb-box-events .sgpb-event-row:not(:first-child) {
@@ -1345,6 +1346,10 @@ input:checked + .sgpb-slider:before {
1345
  display: none;
1346
  }
1347
 
 
 
 
 
1348
  .col-md-2.sg-rules-edit-button-wrapper {
1349
  max-width: 144px;
1350
  }
@@ -2121,3 +2126,8 @@ input:checked + .sgpb-slider:before {
2121
  .sgpb-gutenberg-form-selector-wrapper .components-base-control {
2122
  width: 100% !important;
2123
  }
 
 
 
 
 
1333
  }
1334
 
1335
  .sgpb-box-target .sgpb-event-row:not(:first-child),
1336
+ .sgpb-box-autoresponder-events .sgpb-event-row:not(:first-child),
1337
  .sgpb-box-woocommerce-special-events .sgpb-event-row:not(:first-child),
1338
  .sgpb-box-conditions .sgpb-event-row:not(:first-child),
1339
  .sgpb-box-events .sgpb-event-row:not(:first-child) {
1346
  display: none;
1347
  }
1348
 
1349
+ .sgpb-box-autoresponder-events .sgpb-event-row:not(:last-child) .sg-rules-add-button-wrapper.sgpb-static-padding-top {
1350
+ display: none;
1351
+ }
1352
+
1353
  .col-md-2.sg-rules-edit-button-wrapper {
1354
  max-width: 144px;
1355
  }
2126
  .sgpb-gutenberg-form-selector-wrapper .components-base-control {
2127
  width: 100% !important;
2128
  }
2129
+
2130
+ .subscribers-wrapper .tablenav.top,
2131
+ .subscribers-wrapper .tablenav.bottom {
2132
+ margin-left: -8px !important;
2133
+ }
public/js/Backend.js CHANGED
@@ -1,5 +1,38 @@
1
  function SGPBBackend() {
2
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  }
4
 
5
  SGPBBackend.sgAddEvent = function(element, eventName, fn)
@@ -22,6 +55,7 @@ SGPBBackend.prototype.sgInit = function()
22
  this.initRadioAccordions();
23
  this.fixedPositionSelection();
24
  this.popupThemesPreview();
 
25
  this.colorPicker();
26
  this.rangeSlider();
27
  this.backgroundRangeSliderInit();
@@ -850,19 +884,29 @@ SGPBBackend.prototype.popupHiddenContentAccordions = function()
850
 
851
  SGPBBackend.prototype.popupThemesPreview = function()
852
  {
 
853
  if (!jQuery('.js-sgpb-popup-themes').length){
854
  return false;
855
  }
856
 
857
- this.themeRelatedSettings();
858
  jQuery('.js-sgpb-popup-themes').bind("mouseover",function(e) {
859
  var themeId = jQuery(this).attr('data-popup-theme-number');
860
  jQuery('.theme-preview-'+themeId).css('display', 'block');
861
- jQuery(this).click(function(){
 
 
 
 
 
 
 
862
  if (themeId == 4) {/* for theme with close button type=button */
863
  jQuery('.sgpb-close-button-image-option-wrapper').addClass('sg-hide');
864
  jQuery('.sgpb-close-button-border-options').addClass('sg-hide');
865
  jQuery('.sgpb-close-button-text-option-wrapper').removeClass('sg-hide');
 
 
866
  }
867
  else if (themeId == 3) {
868
  jQuery('.sgpb-close-button-text-option-wrapper').addClass('sg-hide');
@@ -871,28 +915,42 @@ SGPBBackend.prototype.popupThemesPreview = function()
871
  /* set default close button sizes for the current theme */
872
  jQuery('input[name=sgpb-button-image-width]').val('38');
873
  jQuery('input[name=sgpb-button-image-height]').val('19');
 
 
 
874
  }
875
  else {
876
  if (themeId == 2) {
877
  /* default theme 2 button size */
878
  jQuery('input[name=sgpb-button-image-width]').val('20');
879
  jQuery('input[name=sgpb-button-image-height]').val('20');
 
 
 
880
  }
881
  else if (themeId == 5) {
882
  /* default theme 5 button size */
883
  jQuery('input[name=sgpb-button-image-width]').val('17');
884
  jQuery('input[name=sgpb-button-image-height]').val('17');
 
 
885
  }
886
  else if (themeId == 6) {
887
  /* default theme 6 button size */
888
  jQuery('input[name=sgpb-button-image-width]').val('30');
889
  jQuery('input[name=sgpb-button-image-height]').val('30');
 
 
890
  }
891
  else {
892
  /* for other themes default sizes equel to 21 */
893
  jQuery('input[name=sgpb-button-image-width]').val('21');
894
  jQuery('input[name=sgpb-button-image-height]').val('21');
895
  }
 
 
 
 
896
  jQuery('.sgpb-close-button-text-option-wrapper').addClass('sg-hide');
897
  jQuery('.sgpb-close-button-border-options').addClass('sg-hide');
898
  jQuery('.sgpb-close-button-image-option-wrapper').removeClass('sg-hide');
@@ -905,6 +963,144 @@ SGPBBackend.prototype.popupThemesPreview = function()
905
  });
906
  };
907
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
908
  SGPBBackend.prototype.rangeSlider = function()
909
  {
910
  if (typeof Powerange != 'undefined') {
1
  function SGPBBackend() {
2
+ this.closeButtonDefaultPositions = {};
3
+ this.closeButtonDefaultPositions[1] = {
4
+ 'left': 9,
5
+ 'right': 9,
6
+ 'bottom': 9
7
+ };
8
+ this.closeButtonDefaultPositions[2] = {
9
+ 'left': 0,
10
+ 'right': 0,
11
+ 'top': parseInt('-20'),
12
+ 'bottom': parseInt('-20')
13
+ };
14
+ this.closeButtonDefaultPositions[3] = {
15
+ 'right': 4,
16
+ 'bottom': 4,
17
+ 'left': 4,
18
+ 'top': 4
19
+ };
20
+ this.closeButtonDefaultPositions[4] = {
21
+ 'left': 12,
22
+ 'right': 12,
23
+ 'bottom': 9
24
+ };
25
+ this.closeButtonDefaultPositions[5] = {
26
+ 'left': 8,
27
+ 'right': 8,
28
+ 'bottom': 8
29
+ };
30
+ this.closeButtonDefaultPositions[6] = {
31
+ 'left': parseInt('-18.5'),
32
+ 'right': parseInt('-18.5'),
33
+ 'bottom': parseInt('-18.5'),
34
+ 'top': parseInt('-18.5')
35
+ };
36
  }
37
 
38
  SGPBBackend.sgAddEvent = function(element, eventName, fn)
55
  this.initRadioAccordions();
56
  this.fixedPositionSelection();
57
  this.popupThemesPreview();
58
+ this.setCloseButtonDefaultPositionValues();
59
  this.colorPicker();
60
  this.rangeSlider();
61
  this.backgroundRangeSliderInit();
884
 
885
  SGPBBackend.prototype.popupThemesPreview = function()
886
  {
887
+ var that = this;
888
  if (!jQuery('.js-sgpb-popup-themes').length){
889
  return false;
890
  }
891
 
892
+ that.themeRelatedSettings();
893
  jQuery('.js-sgpb-popup-themes').bind("mouseover",function(e) {
894
  var themeId = jQuery(this).attr('data-popup-theme-number');
895
  jQuery('.theme-preview-'+themeId).css('display', 'block');
896
+ jQuery(this).click(function() {
897
+ jQuery('.sgpb-disable-border-wrapper').addClass('sg-hide');
898
+ that.setCloseButtonDefaultPositions();
899
+ that.setCloseButtonDefaultPositionValues();
900
+ document.getElementById('sgpb-button-position-top').value = 'none';
901
+ document.getElementById('sgpb-button-position-right').value = 'none';
902
+ document.getElementById('sgpb-button-position-bottom').value = 'none';
903
+ document.getElementById('sgpb-button-position-left').value = 'none';
904
  if (themeId == 4) {/* for theme with close button type=button */
905
  jQuery('.sgpb-close-button-image-option-wrapper').addClass('sg-hide');
906
  jQuery('.sgpb-close-button-border-options').addClass('sg-hide');
907
  jQuery('.sgpb-close-button-text-option-wrapper').removeClass('sg-hide');
908
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[themeId].bottom;
909
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[themeId].right;
910
  }
911
  else if (themeId == 3) {
912
  jQuery('.sgpb-close-button-text-option-wrapper').addClass('sg-hide');
915
  /* set default close button sizes for the current theme */
916
  jQuery('input[name=sgpb-button-image-width]').val('38');
917
  jQuery('input[name=sgpb-button-image-height]').val('19');
918
+ jQuery('.sgpb-disable-border-wrapper').removeClass('sg-hide');
919
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[themeId].right;
920
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[themeId].top;
921
  }
922
  else {
923
  if (themeId == 2) {
924
  /* default theme 2 button size */
925
  jQuery('input[name=sgpb-button-image-width]').val('20');
926
  jQuery('input[name=sgpb-button-image-height]').val('20');
927
+ jQuery('.sgpb-disable-border-wrapper').removeClass('sg-hide');
928
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[themeId].right;
929
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[themeId].top;
930
  }
931
  else if (themeId == 5) {
932
  /* default theme 5 button size */
933
  jQuery('input[name=sgpb-button-image-width]').val('17');
934
  jQuery('input[name=sgpb-button-image-height]').val('17');
935
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[themeId].bottom;
936
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[themeId].right;
937
  }
938
  else if (themeId == 6) {
939
  /* default theme 6 button size */
940
  jQuery('input[name=sgpb-button-image-width]').val('30');
941
  jQuery('input[name=sgpb-button-image-height]').val('30');
942
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[themeId].top;
943
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[themeId].right;
944
  }
945
  else {
946
  /* for other themes default sizes equel to 21 */
947
  jQuery('input[name=sgpb-button-image-width]').val('21');
948
  jQuery('input[name=sgpb-button-image-height]').val('21');
949
  }
950
+ if (themeId == 1) {
951
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[themeId].bottom;
952
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[themeId].right;
953
+ }
954
  jQuery('.sgpb-close-button-text-option-wrapper').addClass('sg-hide');
955
  jQuery('.sgpb-close-button-border-options').addClass('sg-hide');
956
  jQuery('.sgpb-close-button-image-option-wrapper').removeClass('sg-hide');
963
  });
964
  };
965
 
966
+ /* set default positions while changing theme */
967
+ SGPBBackend.prototype.setCloseButtonDefaultPositions = function()
968
+ {
969
+ var theme = jQuery('.js-sgpb-popup-themes:checked').attr('data-popup-theme-number');
970
+ if (theme == 1 || theme == 4 || theme == 5) {
971
+ jQuery('.sgpb-button-position-top-js').hide();
972
+ jQuery('.sgpb-button-position-right-js').show();
973
+ jQuery('.sgpb-button-position-left-js').hide();
974
+ jQuery('.sgpb-button-position-bottom-js').show();
975
+ }
976
+ else if (theme == 2 || theme == 3 || theme == 6) {
977
+ jQuery('.sgpb-button-position-top-js').show();
978
+ jQuery('.sgpb-button-position-right-js').show();
979
+ jQuery('.sgpb-button-position-left-js').hide();
980
+ jQuery('.sgpb-button-position-bottom-js').hide();
981
+ }
982
+ };
983
+
984
+ SGPBBackend.prototype.setCloseButtonDefaultPositionValues = function()
985
+ {
986
+ var that = this;
987
+ jQuery('.sgpb-close-button-position').on('change', function(){
988
+ var theme = jQuery('.js-sgpb-popup-themes:checked').attr('data-popup-theme-number');
989
+ /* button location => like topRight, bottomLeft, etc. */
990
+ var buttonLocation = jQuery('.sgpb-close-button-position option:selected').val();
991
+ that.setCloseButtonLocation(buttonLocation);
992
+ document.getElementById('sgpb-button-position-top').value = 'none';
993
+ document.getElementById('sgpb-button-position-right').value = 'none';
994
+ document.getElementById('sgpb-button-position-bottom').value = 'none';
995
+ document.getElementById('sgpb-button-position-left').value = 'none';
996
+ if (theme == 1) {
997
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
998
+ if (buttonLocation == 'bottomRight') {
999
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1000
+ }
1001
+ else if (buttonLocation == 'bottomLeft') {
1002
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1003
+ }
1004
+ }
1005
+ else if (theme == 2) {
1006
+ if (buttonLocation == 'topLeft') {
1007
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1008
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[theme].top;
1009
+ }
1010
+ else if (buttonLocation == 'topRight') {
1011
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1012
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[theme].top;
1013
+ }
1014
+ else if (buttonLocation == 'bottomLeft') {
1015
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1016
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
1017
+ }
1018
+ else if (buttonLocation == 'bottomRight') {
1019
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1020
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
1021
+ }
1022
+ }
1023
+ else if (theme == 3) {
1024
+ if (buttonLocation == 'topLeft') {
1025
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1026
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[theme].top;
1027
+ }
1028
+ else if (buttonLocation == 'topRight') {
1029
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1030
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[theme].top;
1031
+ }
1032
+ else if (buttonLocation == 'bottomLeft') {
1033
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1034
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
1035
+ }
1036
+ else if (buttonLocation == 'bottomRight') {
1037
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1038
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
1039
+ }
1040
+ }
1041
+ else if (theme == 4) {
1042
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
1043
+ if (buttonLocation == 'bottomRight') {
1044
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1045
+ }
1046
+ else if (buttonLocation == 'bottomLeft') {
1047
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1048
+ }
1049
+ }
1050
+ else if (theme == 5) {
1051
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
1052
+ if (buttonLocation == 'bottomRight') {
1053
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1054
+ }
1055
+ else if (buttonLocation == 'bottomLeft') {
1056
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1057
+ }
1058
+ }
1059
+ else if (theme == 6) {
1060
+ if (buttonLocation == 'topRight') {
1061
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1062
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[theme].top;
1063
+ }
1064
+ else if (buttonLocation == 'topLeft') {
1065
+ document.getElementById('sgpb-button-position-top').value = that.closeButtonDefaultPositions[theme].top;
1066
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1067
+ }
1068
+ else if (buttonLocation == 'bottomLeft') {
1069
+ document.getElementById('sgpb-button-position-left').value = that.closeButtonDefaultPositions[theme].left;
1070
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
1071
+ }
1072
+ else if (buttonLocation == 'bottomRight') {
1073
+ document.getElementById('sgpb-button-position-right').value = that.closeButtonDefaultPositions[theme].right;
1074
+ document.getElementById('sgpb-button-position-bottom').value = that.closeButtonDefaultPositions[theme].bottom;
1075
+ }
1076
+ }
1077
+ });
1078
+ };
1079
+
1080
+ SGPBBackend.prototype.setCloseButtonLocation = function(location)
1081
+ {
1082
+ jQuery('.sgpb-button-position-top-js').hide();
1083
+ jQuery('.sgpb-button-position-right-js').hide();
1084
+ jQuery('.sgpb-button-position-left-js').hide();
1085
+ jQuery('.sgpb-button-position-bottom-js').hide();
1086
+ if (location == 'topRight') {
1087
+ jQuery('.sgpb-button-position-top-js').show();
1088
+ jQuery('.sgpb-button-position-right-js').show();
1089
+ }
1090
+ else if (location == 'topLeft') {
1091
+ jQuery('.sgpb-button-position-top-js').show();
1092
+ jQuery('.sgpb-button-position-left-js').show();
1093
+ }
1094
+ else if (location == 'bottomLeft') {
1095
+ jQuery('.sgpb-button-position-left-js').show();
1096
+ jQuery('.sgpb-button-position-bottom-js').show();
1097
+ }
1098
+ else if (location == 'bottomRight') {
1099
+ jQuery('.sgpb-button-position-right-js').show();
1100
+ jQuery('.sgpb-button-position-bottom-js').show();
1101
+ }
1102
+ };
1103
+
1104
  SGPBBackend.prototype.rangeSlider = function()
1105
  {
1106
  if (typeof Powerange != 'undefined') {
public/js/PopupBuilder.js CHANGED
@@ -18,6 +18,40 @@ function SGPBPopup()
18
  this.onceListener();
19
  this.initialsListeners();
20
  this.countPopupOpen = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
  SGPBPopup.listeners = function () {
@@ -655,7 +689,15 @@ SGPBPopup.prototype.themeCreator = function()
655
  var closeButtonWidth = popupData['sgpb-button-image-width'];
656
  var closeButtonHeight = popupData['sgpb-button-image-height'];
657
  var contentPadding = parseInt(popupData['sgpb-content-padding']);
 
 
 
 
 
 
658
  var contentClass = popupData['sgpb-content-custom-class'];
 
 
659
  var closeButtonImage = popupConfig.closeButtonImage;
660
  var themeNumber = 1;
661
  var backgroundColor = 'black';
@@ -666,11 +708,27 @@ SGPBPopup.prototype.themeCreator = function()
666
  popupTheme = 'sgpb-theme-2';
667
  closeButtonPosition = 'topRight';
668
  backgroundColor = 'white';
 
 
669
  popupConfig.magicCall('setShadowSpread', 3);
670
  popupConfig.magicCall('setContentShadowBlur', 5);
671
  popupConfig.magicCall('setOverlayVisible', false);
672
  }
673
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
674
  if (forceRtl) {
675
  forceRtlClass = ' sgpb-popup-content-direction-right';
676
  }
@@ -698,12 +756,12 @@ SGPBPopup.prototype.themeCreator = function()
698
  popupConfig.magicCall('setShadowSpread', 14);
699
  /* 9px theme default close button position for all cases */
700
  if (noPositionSelected || closeButtonPosition == 'bottomRight') {
701
- popupConfig.magicCall('setCloseButtonPositionRight', '9px');
702
- popupConfig.magicCall('setCloseButtonPositionBottom', '9px');
703
  }
704
  else {
705
- popupConfig.magicCall('setCloseButtonPositionLeft', '9px');
706
- popupConfig.magicCall('setCloseButtonPositionBottom', '9px');
707
  }
708
  }
709
  else if (popupTheme == 'sgpb-theme-2') {
@@ -722,23 +780,27 @@ SGPBPopup.prototype.themeCreator = function()
722
  }
723
  if (noPositionSelected || closeButtonPosition == 'topRight') {
724
  /* this theme has 1px border */
725
- popupConfig.magicCall('setCloseButtonPositionRight', rightPosition);
726
- popupConfig.magicCall('setCloseButtonPositionTop', topPosition);
727
  }
728
  else {
729
  if (closeButtonPosition == 'topLeft') {
730
- popupConfig.magicCall('setCloseButtonPositionLeft', '0');
731
- popupConfig.magicCall('setCloseButtonPositionTop', '-' + closeButtonHeight + 'px');
732
  }
733
  else if (closeButtonPosition == 'bottomRight') {
734
- popupConfig.magicCall('setCloseButtonPositionRight', '0');
735
- popupConfig.magicCall('setCloseButtonPositionBottom', '-' + closeButtonHeight + 'px');
736
  }
737
  else if (closeButtonPosition == 'bottomLeft') {
738
- popupConfig.magicCall('setCloseButtonPositionLeft', '0');
739
- popupConfig.magicCall('setCloseButtonPositionBottom', '-' + closeButtonHeight + 'px');
740
  }
741
  }
 
 
 
 
742
  }
743
  else if (popupTheme == 'sgpb-theme-3') {
744
  themeNumber = 3;
@@ -746,28 +808,33 @@ SGPBPopup.prototype.themeCreator = function()
746
  popupConfig.magicCall('setContentBorderRadius', popupData['sgpb-border-radius']);
747
  popupConfig.magicCall('setContentBorderRadiusType', popupData['sgpb-border-radius-type']);
748
  popupConfig.magicCall('setContentBorderColor', popupData['sgpb-border-color']);
 
 
 
 
 
749
  if (noPositionSelected) {
750
  popupConfig.magicCall('setCloseButtonWidth', 38);
751
  popupConfig.magicCall('setCloseButtonHeight', 19);
752
- popupConfig.magicCall('setCloseButtonPositionRight', '4px');
753
- popupConfig.magicCall('setCloseButtonPositionTop', '4px');
754
  }
755
  else {
756
  if (closeButtonPosition == 'topRight') {
757
- popupConfig.magicCall('setCloseButtonPositionRight', '4px');
758
- popupConfig.magicCall('setCloseButtonPositionTop', '4px');
759
  }
760
  else if (closeButtonPosition == 'topLeft') {
761
- popupConfig.magicCall('setCloseButtonPositionLeft', '4px');
762
- popupConfig.magicCall('setCloseButtonPositionTop', '4px');
763
  }
764
  else if (closeButtonPosition == 'bottomRight') {
765
- popupConfig.magicCall('setCloseButtonPositionLeft', '4px');
766
- popupConfig.magicCall('setCloseButtonPositionBottom', '4px');
767
  }
768
  else if (closeButtonPosition == 'bottomLeft') {
769
- popupConfig.magicCall('setCloseButtonPositionLeft', '4px');
770
- popupConfig.magicCall('setCloseButtonPositionBottom', '4px');
771
  }
772
  }
773
  }
@@ -788,12 +855,12 @@ SGPBPopup.prototype.themeCreator = function()
788
  popupConfig.magicCall('setContentShadowBlur', 8);
789
  /* 8px/12px theme default close button position for all cases */
790
  if (noPositionSelected || closeButtonPosition == 'bottomRight') {
791
- popupConfig.magicCall('setCloseButtonPositionRight', '12px');
792
- popupConfig.magicCall('setCloseButtonPositionBottom', '9px');
793
  }
794
  else {
795
- popupConfig.magicCall('setCloseButtonPositionLeft', '12px');
796
- popupConfig.magicCall('setCloseButtonPositionBottom', '9px');
797
  }
798
  }
799
  else if (popupTheme == 'sgpb-theme-5') {
@@ -801,12 +868,12 @@ SGPBPopup.prototype.themeCreator = function()
801
  popupConfig.magicCall('setBoxBorderWidth', 10);
802
  popupConfig.magicCall('setContentBorderColor', '#4B4B4B');
803
  if (noPositionSelected || closeButtonPosition == 'bottomRight') {
804
- popupConfig.magicCall('setCloseButtonPositionRight', '8px');
805
- popupConfig.magicCall('setCloseButtonPositionBottom', '8px');
806
  }
807
  else {
808
- popupConfig.magicCall('setCloseButtonPositionLeft', '8px');
809
- popupConfig.magicCall('setCloseButtonPositionBottom', '8px');
810
  }
811
  }
812
  else if (popupTheme == 'sgpb-theme-6') {
@@ -817,25 +884,31 @@ SGPBPopup.prototype.themeCreator = function()
817
  if (noPositionSelected) {
818
  popupConfig.magicCall('setCloseButtonWidth', 37);
819
  popupConfig.magicCall('setCloseButtonHeight', 37);
820
- popupConfig.magicCall('setCloseButtonPositionRight', '-18.5px');
821
- popupConfig.magicCall('setCloseButtonPositionTop', '-18.5px');
822
  }
823
  else {
 
 
 
 
 
 
824
  if (closeButtonPosition == 'topRight') {
825
- popupConfig.magicCall('setCloseButtonPositionRight', '-' + (closeButtonWidth / 2) + 'px');
826
- popupConfig.magicCall('setCloseButtonPositionTop', '-' + (closeButtonHeight / 2) + 'px');
827
  }
828
  else if (closeButtonPosition == 'topLeft') {
829
- popupConfig.magicCall('setCloseButtonPositionLeft', '-' + (closeButtonWidth / 2) + 'px');
830
- popupConfig.magicCall('setCloseButtonPositionTop', '-' + (closeButtonHeight / 2) + 'px');
831
  }
832
  else if (closeButtonPosition == 'bottomRight') {
833
- popupConfig.magicCall('setCloseButtonPositionRight', '-' + (closeButtonWidth / 2) + 'px');
834
- popupConfig.magicCall('setCloseButtonPositionBottom', '-' + (closeButtonHeight / 2) + 'px');
835
  }
836
  else if (closeButtonPosition == 'bottomLeft') {
837
- popupConfig.magicCall('setCloseButtonPositionLeft', '-' + (closeButtonWidth / 2) + 'px');
838
- popupConfig.magicCall('setCloseButtonPositionBottom', '-' + (closeButtonHeight / 2) + 'px');
839
  }
840
  }
841
  }
@@ -849,7 +922,10 @@ SGPBPopup.prototype.themeCreator = function()
849
  }
850
  }
851
  else {
852
- popupConfig.magicCall('setButtonImage', 'data:image/png;base64,'+popupData['sgpb-button-image-data']);
 
 
 
853
  }
854
 
855
  };
@@ -905,9 +981,12 @@ SGPBPopup.prototype.themeCustomizations = function()
905
  }
906
 
907
  var overlayClasses = popupTheme+'-overlay sgpb-popup-overlay-'+popupId;
908
- if (typeof popupData['sgpb-enable-popup-overlay'] == 'undefined' && !SGPB_JS_PACKAGES.extensions['advanced-closing']) {
909
- popupData['sgpb-enable-popup-overlay'] = true;
 
 
910
  }
 
911
  popupConfig.magicCall('setOverlayVisible', SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay']));
912
  if (SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])) {
913
  popupConfig.magicCall('setOverlayAddClass', overlayClasses + ' ' + popupData['sgpb-overlay-custom-class']);
@@ -1981,7 +2060,7 @@ SGPBPopup.setCookie = function(cName, cValue, exDays, cPageLevel)
1981
  expires = '';
1982
  }
1983
 
1984
- if (cPageLevel) {
1985
  cookiePageLevel = 'path=' + cPageLevel + ';';
1986
  }
1987
  if (!cookieExpirationData) {
@@ -2439,12 +2518,20 @@ SgpbEventListener.prototype.sgpbAttronload = function(listenerObj, eventData)
2439
  SgpbEventListener.prototype.filterPopupId = function(popupId)
2440
  {
2441
  var convertedIds = SGPB_POPUP_PARAMS.convertedIdsReverse;
2442
-
2443
  if (convertedIds[popupId]) {
2444
  return convertedIds[popupId];
2445
  }
 
 
 
 
 
 
 
 
2446
 
2447
- return popupId;
2448
  };
2449
 
2450
  SgpbEventListener.findCF7InPopup = function(popupId)
18
  this.onceListener();
19
  this.initialsListeners();
20
  this.countPopupOpen = true;
21
+ this.closeButtonDefaultPositions = {};
22
+ this.closeButtonDefaultPositions[1] = {
23
+ 'left': 9,
24
+ 'right': 9,
25
+ 'bottom': 9
26
+ };
27
+ this.closeButtonDefaultPositions[2] = {
28
+ 'left': 0,
29
+ 'right': 0,
30
+ 'top': parseInt('-20'),
31
+ 'bottom': parseInt('-20')
32
+ };
33
+ this.closeButtonDefaultPositions[3] = {
34
+ 'right': 4,
35
+ 'bottom': 4,
36
+ 'left': 4,
37
+ 'top': 4
38
+ };
39
+ this.closeButtonDefaultPositions[4] = {
40
+ 'left': 12,
41
+ 'right': 12,
42
+ 'bottom': 9
43
+ };
44
+ this.closeButtonDefaultPositions[5] = {
45
+ 'left': 8,
46
+ 'right': 8,
47
+ 'bottom': 8
48
+ };
49
+ this.closeButtonDefaultPositions[6] = {
50
+ 'left': parseInt('-18.5'),
51
+ 'right': parseInt('-18.5'),
52
+ 'bottom': parseInt('-18.5'),
53
+ 'top': parseInt('-18.5')
54
+ };
55
  }
56
 
57
  SGPBPopup.listeners = function () {
689
  var closeButtonWidth = popupData['sgpb-button-image-width'];
690
  var closeButtonHeight = popupData['sgpb-button-image-height'];
691
  var contentPadding = parseInt(popupData['sgpb-content-padding']);
692
+ /* close button position */
693
+ var top = parseInt(popupData['sgpb-button-position-top']);
694
+ var right = parseInt(popupData['sgpb-button-position-right']);
695
+ var bottom = parseInt(popupData['sgpb-button-position-bottom']);
696
+ var left = parseInt(popupData['sgpb-button-position-left']);
697
+
698
  var contentClass = popupData['sgpb-content-custom-class'];
699
+ /* for the 2-nd and 3-rd themes only */
700
+ var popupBorder = SGPBPopup.varToBool(popupData['sgpb-disable-border']);
701
  var closeButtonImage = popupConfig.closeButtonImage;
702
  var themeNumber = 1;
703
  var backgroundColor = 'black';
708
  popupTheme = 'sgpb-theme-2';
709
  closeButtonPosition = 'topRight';
710
  backgroundColor = 'white';
711
+ top = '-10';
712
+ right = '-10';
713
  popupConfig.magicCall('setShadowSpread', 3);
714
  popupConfig.magicCall('setContentShadowBlur', 5);
715
  popupConfig.magicCall('setOverlayVisible', false);
716
  }
717
  }
718
+ var themeIndexNum = popupTheme[popupTheme.length -1];
719
+
720
+ if (isNaN(top)) {
721
+ top = this.closeButtonDefaultPositions[themeIndexNum].top;
722
+ }
723
+ if (isNaN(right)) {
724
+ right = this.closeButtonDefaultPositions[themeIndexNum].right;
725
+ }
726
+ if (isNaN(bottom)) {
727
+ bottom = this.closeButtonDefaultPositions[themeIndexNum].bottom;
728
+ }
729
+ if (isNaN(left)) {
730
+ left = this.closeButtonDefaultPositions[themeIndexNum].left;
731
+ }
732
  if (forceRtl) {
733
  forceRtlClass = ' sgpb-popup-content-direction-right';
734
  }
756
  popupConfig.magicCall('setShadowSpread', 14);
757
  /* 9px theme default close button position for all cases */
758
  if (noPositionSelected || closeButtonPosition == 'bottomRight') {
759
+ popupConfig.magicCall('setCloseButtonPositionRight', right+'px');
760
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
761
  }
762
  else {
763
+ popupConfig.magicCall('setCloseButtonPositionLeft', left+'px');
764
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
765
  }
766
  }
767
  else if (popupTheme == 'sgpb-theme-2') {
780
  }
781
  if (noPositionSelected || closeButtonPosition == 'topRight') {
782
  /* this theme has 1px border */
783
+ popupConfig.magicCall('setCloseButtonPositionRight', right+'px');
784
+ popupConfig.magicCall('setCloseButtonPositionTop', top+'px');
785
  }
786
  else {
787
  if (closeButtonPosition == 'topLeft') {
788
+ popupConfig.magicCall('setCloseButtonPositionLeft', left+'px');
789
+ popupConfig.magicCall('setCloseButtonPositionTop', top+'px');
790
  }
791
  else if (closeButtonPosition == 'bottomRight') {
792
+ popupConfig.magicCall('setCloseButtonPositionRight', right+'px');
793
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
794
  }
795
  else if (closeButtonPosition == 'bottomLeft') {
796
+ popupConfig.magicCall('setCloseButtonPositionLeft', left+'px');
797
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
798
  }
799
  }
800
+
801
+ if (popupBorder) {
802
+ popupConfig.magicCall('setContentBorderWidth', 0);
803
+ }
804
  }
805
  else if (popupTheme == 'sgpb-theme-3') {
806
  themeNumber = 3;
808
  popupConfig.magicCall('setContentBorderRadius', popupData['sgpb-border-radius']);
809
  popupConfig.magicCall('setContentBorderRadiusType', popupData['sgpb-border-radius-type']);
810
  popupConfig.magicCall('setContentBorderColor', popupData['sgpb-border-color']);
811
+ var closeButtonPositionPx = '4px';
812
+ if (popupBorder) {
813
+ popupConfig.magicCall('setContentBorderWidth', 0);
814
+ closeButtonPositionPx = '0px';
815
+ }
816
  if (noPositionSelected) {
817
  popupConfig.magicCall('setCloseButtonWidth', 38);
818
  popupConfig.magicCall('setCloseButtonHeight', 19);
819
+ popupConfig.magicCall('setCloseButtonPositionRight', right+'px');
820
+ popupConfig.magicCall('setCloseButtonPositionTop', top+'px');
821
  }
822
  else {
823
  if (closeButtonPosition == 'topRight') {
824
+ popupConfig.magicCall('setCloseButtonPositionRight', right+'px');
825
+ popupConfig.magicCall('setCloseButtonPositionTop', top+'px');
826
  }
827
  else if (closeButtonPosition == 'topLeft') {
828
+ popupConfig.magicCall('setCloseButtonPositionLeft', left+'px');
829
+ popupConfig.magicCall('setCloseButtonPositionTop', top+'px');
830
  }
831
  else if (closeButtonPosition == 'bottomRight') {
832
+ popupConfig.magicCall('setCloseButtonPositionLeft', right+'px');
833
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
834
  }
835
  else if (closeButtonPosition == 'bottomLeft') {
836
+ popupConfig.magicCall('setCloseButtonPositionLeft', left+'px');
837
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
838
  }
839
  }
840
  }
855
  popupConfig.magicCall('setContentShadowBlur', 8);
856
  /* 8px/12px theme default close button position for all cases */
857
  if (noPositionSelected || closeButtonPosition == 'bottomRight') {
858
+ popupConfig.magicCall('setCloseButtonPositionRight', right+'px');
859
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
860
  }
861
  else {
862
+ popupConfig.magicCall('setCloseButtonPositionLeft', left+'px');
863
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
864
  }
865
  }
866
  else if (popupTheme == 'sgpb-theme-5') {
868
  popupConfig.magicCall('setBoxBorderWidth', 10);
869
  popupConfig.magicCall('setContentBorderColor', '#4B4B4B');
870
  if (noPositionSelected || closeButtonPosition == 'bottomRight') {
871
+ popupConfig.magicCall('setCloseButtonPositionRight', right+'px');
872
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
873
  }
874
  else {
875
+ popupConfig.magicCall('setCloseButtonPositionLeft', left+'px');
876
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom+'px');
877
  }
878
  }
879
  else if (popupTheme == 'sgpb-theme-6') {
884
  if (noPositionSelected) {
885
  popupConfig.magicCall('setCloseButtonWidth', 37);
886
  popupConfig.magicCall('setCloseButtonHeight', 37);
887
+ popupConfig.magicCall('setCloseButtonPositionRight', right+'px');
888
+ popupConfig.magicCall('setCloseButtonPositionTop', top+'px');
889
  }
890
  else {
891
+ if (typeof popupData['sgpb-button-position-right'] == 'undefined') {
892
+ right = '-' + (closeButtonWidth / 2);
893
+ top = '-' + (closeButtonHeight / 2);
894
+ left = '-' + (closeButtonWidth / 2);
895
+ bottom = '-' + (closeButtonHeight / 2);
896
+ }
897
  if (closeButtonPosition == 'topRight') {
898
+ popupConfig.magicCall('setCloseButtonPositionRight', right + 'px');
899
+ popupConfig.magicCall('setCloseButtonPositionTop', top + 'px');
900
  }
901
  else if (closeButtonPosition == 'topLeft') {
902
+ popupConfig.magicCall('setCloseButtonPositionLeft', left + 'px');
903
+ popupConfig.magicCall('setCloseButtonPositionTop', top + 'px');
904
  }
905
  else if (closeButtonPosition == 'bottomRight') {
906
+ popupConfig.magicCall('setCloseButtonPositionRight', right + 'px');
907
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom + 'px');
908
  }
909
  else if (closeButtonPosition == 'bottomLeft') {
910
+ popupConfig.magicCall('setCloseButtonPositionLeft', left + 'px');
911
+ popupConfig.magicCall('setCloseButtonPositionBottom', bottom + 'px');
912
  }
913
  }
914
  }
922
  }
923
  }
924
  else {
925
+ popupConfig.magicCall('setButtonImage', popupData['sgpb-button-image-data']);
926
+ if (popupData['sgpb-button-image-data'] == '' || popupData['sgpb-button-image-data'].indexOf('http') != -1) {
927
+ popupConfig.magicCall('setButtonImage', popupData['sgpb-button-image']);
928
+ }
929
  }
930
 
931
  };
981
  }
982
 
983
  var overlayClasses = popupTheme+'-overlay sgpb-popup-overlay-'+popupId;
984
+ /* for old users, which didn't have enable/disable overlay option */
985
+ popupData['sgpb-enable-popup-overlay'] = true;
986
+ if (SGPB_JS_PACKAGES.extensions['advanced-closing'] && SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])) {
987
+ popupData['sgpb-enable-popup-overlay'] = false;
988
  }
989
+
990
  popupConfig.magicCall('setOverlayVisible', SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay']));
991
  if (SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])) {
992
  popupConfig.magicCall('setOverlayAddClass', overlayClasses + ' ' + popupData['sgpb-overlay-custom-class']);
2060
  expires = '';
2061
  }
2062
 
2063
+ if (cPageLevel && typeof cPageLevel != 'boolean') {
2064
  cookiePageLevel = 'path=' + cPageLevel + ';';
2065
  }
2066
  if (!cookieExpirationData) {
2518
  SgpbEventListener.prototype.filterPopupId = function(popupId)
2519
  {
2520
  var convertedIds = SGPB_POPUP_PARAMS.convertedIdsReverse;
2521
+ var popupNewId = popupId;
2522
  if (convertedIds[popupId]) {
2523
  return convertedIds[popupId];
2524
  }
2525
+ else {
2526
+ for(var i in convertedIds) {
2527
+ if (popupId == convertedIds[i]) {
2528
+ popupNewId = parseInt(i);
2529
+ break;
2530
+ }
2531
+ }
2532
+ }
2533
 
2534
+ return popupNewId;
2535
  };
2536
 
2537
  SgpbEventListener.findCF7InPopup = function(popupId)
public/js/select2.min.js CHANGED
@@ -1 +1 @@
1
- /*! Select2 4.0.4 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f<this._currentData.length;f++){var g=this._currentData[f];e.push.apply(e,d(g,this.$element.val().split(this._valueSeparator)))}c(e)},b.prototype.select=function(b,c){if(this.options.get("multiple")){var d=this.$element.val();d+=this._valueSeparator+c.id,this.$element.val(d),this.$element.trigger("change")}else this.current(function(b){a.map(b,function(a){a.selected=!1})}),this.$element.val(c.id),this.$element.trigger("change")},b.prototype.unselect=function(a,b){var c=this;b.selected=!1,this.current(function(a){for(var d=[],e=0;e<a.length;e++){var f=a[e];b.id!=f.id&&d.push(f.id)}c.$element.val(d.join(c._valueSeparator)),c.$element.trigger("change")})},b.prototype.query=function(a,b,c){for(var d=[],e=0;e<this._currentData.length;e++){var f=this._currentData[e],g=this.matches(b,f);null!==g&&d.push(g)}c({results:d})},b.prototype.addOptions=function(b,c){var d=a.map(c,function(b){return a.data(b[0],"data")});this._currentData.push.apply(this._currentData,d)},b}),b.define("select2/compat/matcher",["jquery"],function(a){function b(b){function c(c,d){var e=a.extend(!0,{},d);if(null==c.term||""===a.trim(c.term))return e;if(d.children){for(var f=d.children.length-1;f>=0;f--){var g=d.children[f];b(c.term,g.text,g)||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c,this.options.get("query").call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){c.find(".dropdown-wrapper").append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||n<f)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
1
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,n){return void 0===n&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(n),n}:e(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.sgpbselect2&&e.fn.sgpbselect2.amd)var t=e.fn.sgpbselect2.amd;var n,i,o,s;return t&&t.requirejs||(t?o=t:t={},function(e){function t(e,t){return w.call(e,t)}function n(e,t){var n,i,o,s,r,a,l,c,u,d,p,h=t&&t.split("/"),f=v.map,g=f&&f["*"]||{};if(e){for(r=(e=e.split("/")).length-1,v.nodeIdCompat&&$.test(e[r])&&(e[r]=e[r].replace($,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),u-=1;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;u>0;u-=1){if(i=n.slice(0,u).join("/"),h)for(d=h.length;d>0;d-=1)if((o=f[h.slice(0,d).join("/")])&&(o=o[i])){s=o,a=u;break}if(s)break;!l&&g&&g[i]&&(l=g[i],c=u)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function r(t,n){return function(){var i=_.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),p.apply(e,i.concat([t,n]))}}function a(e){return function(t){g[e]=t}}function l(n){if(t(m,n)){var i=m[n];delete m[n],y[n]=!0,d.apply(e,i)}if(!t(g,n)&&!t(y,n))throw new Error("No "+n);return g[n]}function c(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function u(e){return e?c(e):[]}var d,p,h,f,g={},m={},v={},y={},w=Object.prototype.hasOwnProperty,_=[].slice,$=/\.js$/;h=function(e,t){var i,o,s=c(e),r=s[0],a=t[1];return e=s[1],r&&(i=l(r=n(r,a))),r?e=i&&i.normalize?i.normalize(e,(o=a,function(e){return n(e,o)})):n(e,a):(r=(s=c(e=n(e,a)))[0],e=s[1],r&&(i=l(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:i}},f={require:function(e){return r(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:(t=e,function(){return v&&v.config&&v.config[t]||{}})};var t}},d=function(n,i,o,s){var c,d,p,v,w,_,$,b=[],x=typeof o;if(_=u(s=s||n),"undefined"===x||"function"===x){for(i=!i.length&&o.length?["require","exports","module"]:i,w=0;w<i.length;w+=1)if(v=h(i[w],_),"require"===(d=v.f))b[w]=f.require(n);else if("exports"===d)b[w]=f.exports(n),$=!0;else if("module"===d)c=b[w]=f.module(n);else if(t(g,d)||t(m,d)||t(y,d))b[w]=l(d);else{if(!v.p)throw new Error(n+" missing "+d);v.p.load(v.n,r(s,!0),a(d),{}),b[w]=g[d]}p=o?o.apply(g[n],b):void 0,n&&(c&&c.exports!==e&&c.exports!==g[n]?g[n]=c.exports:p===e&&$||(g[n]=p))}else n&&(g[n]=o)},i=o=p=function(t,n,i,o,s){if("string"==typeof t)return f[t]?f[t](n):l(h(t,u(n)).f);if(!t.splice){if((v=t).deps&&p(v.deps,v.callback),!n)return;n.splice?(t=n,n=i,i=null):t=e}return n=n||function(){},"function"==typeof i&&(i=o,o=s),o?d(e,t,n,i):setTimeout(function(){d(e,t,n,i)},4),p},p.config=function(e){return p(e)},i._defined=g,(s=function(e,n,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");n.splice||(i=n,n=[]),t(g,e)||t(m,e)||(m[e]=[e,n,i])}).amd={jQuery:!0}}(),t.requirejs=i,t.require=o,t.define=s),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){function t(e){var t=e.prototype,n=[];for(var i in t)"function"==typeof t[i]&&"constructor"!==i&&n.push(i);return n}var n={Extend:function(e,t){function n(){this.constructor=e}var i={}.hasOwnProperty;for(var o in t)i.call(t,o)&&(e[o]=t[o]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},Decorate:function(e,n){function i(){var t=Array.prototype.unshift,i=n.prototype.constructor.length,o=e.prototype.constructor;i>0&&(t.call(arguments,e.prototype.constructor),o=n.prototype.constructor),o.apply(this,arguments)}var o=t(n),s=t(e);n.displayName=e.displayName,i.prototype=new function(){this.constructor=i};for(var r=0;r<s.length;r++){var a=s[r];i.prototype[a]=e.prototype[a]}for(var l=function(e){var t=function(){};e in i.prototype&&(t=i.prototype[e]);var o=n.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),o.apply(this,arguments)}},c=0;c<o.length;c++){var u=o[c];i.prototype[u]=l(u)}return i}},i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},n.Observable=i,n.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},n.bind=function(e,t){return function(){e.apply(t,arguments)}},n._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var o=0;o<n.length;o++){var s=n[o];(s=s.substring(0,1).toLowerCase()+s.substring(1))in i||(i[s]={}),o==n.length-1&&(i[s]=e[t]),i=i[s]}delete e[t]}}return e},n.hasScroll=function(t,n){var i=e(n),o=n.style.overflowX,s=n.style.overflowY;return(o!==s||"hidden"!==s&&"visible"!==s)&&("scroll"===o||"scroll"===s||i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth)},n.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,function(e){i=i.add(e)}),n=i}t.append(n)},n}),t.define("select2/results",["jquery","./utils"],function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),o=this.options.get("translations").get(t.message);i.append(n(o(t.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],o=this.option(i);t.push(o)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},n.prototype.position=function(e,t){t.find(".select2-results").append(e)},n.prototype.sort=function(e){return this.options.get("sorter")(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var i=e.map(n,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var t=e(this),n=e.data(this,"data"),o=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(o,i)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")})})},n.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="select2-results__option";var i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==t.id&&delete i["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(var o in i){var s=i[o];n.setAttribute(o,s)}if(t.children){var r=e(n),a=document.createElement("strong");a.className="select2-results__group",e(a),this.template(t,a);for(var l=[],c=0;c<t.children.length;c++){var u=t.children[c],d=this.option(u);l.push(d)}var p=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});p.append(l),r.append(a),r.append(p)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var i=this,o=t.id+"-results";this.$results.attr("id",o),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=i.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var o=n-1;0===e.length&&(o=0);var s=t.eq(o);s.trigger("mouseenter");var r=i.$results.offset().top,a=s.offset().top,l=i.$results.scrollTop()+(a-r);0===o?i.$results.scrollTop(0):a-r<0&&i.$results.scrollTop(l)}}),t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var o=t.eq(n);o.trigger("mouseenter");var s=i.$results.offset().top+i.$results.outerHeight(!1),r=o.offset().top+o.outerHeight(!1),a=i.$results.scrollTop()+r-s;0===n?i.$results.scrollTop(0):r>s&&i.$results.scrollTop(a)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){i.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,o=e.deltaY>0&&t-e.deltaY<=0,s=e.deltaY<0&&n<=i.$results.height();o?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):s&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var n=e(this),o=n.data("data");"true"!==n.attr("aria-selected")?i.trigger("select",{originalEvent:t,data:o}):i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:o}):i.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("select2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,i=e.offset().top,o=this.$results.scrollTop()+(i-n),s=i-n;o-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(o)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),s=i(t,n);null==s?n.style.display="none":"string"==typeof s?n.innerHTML=o(s):e(n).append(s)},n}),t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},i.prototype.bind=function(e,t){var i=this,o=(e.id,e.id+"-results");this.container=e,this.$selection.on("focus",function(e){i.trigger("focus",e)}),this.$selection.on("blur",function(e){i._handleBlur(e)}),this.$selection.on("keydown",function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){i.update(e.data)}),e.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",o),i._attachCloseHandler(e)}),e.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(e)}),e.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),e.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.select2."+t.id,function(t){var n=e(t.target).closest(".select2");e(".select2.select2-container--open").each(function(){var t=e(this);this!=n[0]&&t.data("element").select2("close")})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},i.prototype.position=function(e,t){t.find(".selection").append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function o(){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},o.prototype.bind=function(e,t){var n=this;o.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("focus",function(t){e.isOpen()||n.$selection.focus()}),e.on("selection:update",function(e){n.update(e.data)})},o.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},o.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},o.prototype.selectionContainer=function(){return e("<span></span>")},o.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)}else this.clear()},o}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,n){var o=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(t){if(!o.options.get("disabled")){var n=e(this).parent().data("data");o.trigger("unselect",{originalEvent:t,data:n})}})},i.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var o=e[i],s=this.selectionContainer(),r=this.display(o,s);s.append(r),s.prop("title",o.title||o.text),s.data("data",o),t.push(s)}var a=this.$selection.find(".select2-selection__rendered");n.appendMany(a,t)}},i}),t.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}),t.define("select2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),o=0;o<i.length;o++){var s={data:i[o]};if(this.trigger("unselect",s),s.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".select2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="select2-selection__clear">&times;</span>');i.data("data",n),this.$selection.find(".select2-selection__rendered").prepend(i)}},n}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,t,i){var o=this;e.call(this,t,i),t.on("open",function(){o.$search.trigger("focus")}),t.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),t.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),t.on("disable",function(){o.$search.prop("disabled",!0)}),t.on("focus",function(e){o.$search.trigger("focus")}),t.on("results:focus",function(e){o.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".select2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===o.$search.val()){var t=o.$searchContainer.prev(".select2-selection__choice");if(t.length>0){var i=t.data("data");o.searchRemoveChoice(i),e.preventDefault()}}});var s=document.documentMode,r=s&&s<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){r?o.$selection.off("input.search input.searchcheck"):o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(r&&"input"===e.type)o.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&o.handleSearch(e)}})},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e;e=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").innerWidth():.75*(this.$search.val().length+1)+"em",this.$search.css("width",e)},i}),t.define("select2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,i){var o=this,s=["open","opening","close","closing","select","selecting","unselect","unselecting"],r=["opening","closing","selecting","unselecting"];t.call(this,n,i),n.on("*",function(t,n){if(-1!==e.inArray(t,s)){n=n||{};var i=e.Event("select2:"+t,{params:n});o.$element.trigger(i),-1!==e.inArray(t,r)&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n}),t.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),t.define("select2/data/base",["../utils"],function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),null!=n.id?i+="-"+n.id.toString():i+="-"+e.generateChars(4),i},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=n(this),o=i.item(e);t.push(o)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var o=[];(e=[e]).push.apply(e,i);for(var s=0;s<e.length;s++){var r=e[s].id;-1===n.inArray(r,o)&&o.push(r)}t.$element.val(o),t.$element.trigger("change")});else{var i=e.id;this.$element.val(i),this.$element.trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,n(e.element).is("option"))return e.element.selected=!1,void this.$element.trigger("change");this.current(function(i){for(var o=[],s=0;s<i.length;s++){var r=i[s].id;r!==e.id&&-1===n.inArray(r,o)&&o.push(r)}t.$element.val(o),t.$element.trigger("change")})}},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},i.prototype.query=function(e,t){var i=[],o=this;this.$element.children().each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var s=o.item(t),r=o.matches(e,s);null!==r&&i.push(r)}}),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var i=n(t),o=this._normalizeItem(e);return o.element=t,n.data(t,"data",o),i},i.prototype.item=function(e){var t={};if(null!=(t=n.data(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),o=[],s=0;s<i.length;s++){var r=n(i[s]),a=this.item(r);o.push(a)}t.children=o}return(t=this._normalizeItem(t)).element=e[0],n.data(e[0],"data",t),t},i.prototype._normalizeItem=function(e){return n.isPlainObject(e)||(e={id:e,text:e}),null!=(e=n.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},{selected:!1,disabled:!1},e)},i.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},i}),t.define("select2/data/array",["./select","../utils","jquery"],function(e,t,n){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(i,e),i.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,n){return n.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){function i(e){return function(){return n(this).val()==e.id}}for(var o=this,s=this.$element.find("option"),r=s.map(function(){return o.item(n(this)).id}).get(),a=[],l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,r)>=0){var u=s.filter(i(c)),d=this.item(u),p=n.extend(!0,{},c,d),h=this.option(p);u.replaceWith(h)}else{var f=this.option(c);if(c.children){var g=this.convertToOptions(c.children);t.appendMany(f,g)}a.push(f)}}return a},i}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var o=n.ajax(e);return o.then(t),o.fail(i),o}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){function i(){var i=s.transport(s,function(i){var s=o.processResults(i,e);o.options.get("debug")&&window.console&&console.error&&(s&&s.results&&n.isArray(s.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(s)},function(){i.status&&"0"===i.status||o.trigger("results:message",{message:"errorLoading"})});o._request=i}var o=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var s=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof s.url&&(s.url=s.url.call(this.$element,e)),"function"==typeof s.data&&(s.data=s.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),t.define("select2/data/tags",["jquery"],function(e){function t(t,n,i){var o=i.get("tags"),s=i.get("createTag");void 0!==s&&(this.createTag=s);var r=i.get("insertTag");if(void 0!==r&&(this.insertTag=r),t.call(this,n,i),e.isArray(o))for(var a=0;a<o.length;a++){var l=o[a],c=this._normalizeItem(l),u=this.option(c);this.$element.append(u)}}return t.prototype.query=function(e,t,n){var i=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,function e(o,s){for(var r=o.results,a=0;a<r.length;a++){var l=r[a],c=null!=l.children&&!e({results:l.children},!0);if((l.text||"").toUpperCase()===(t.term||"").toUpperCase()||c)return!s&&(o.data=r,void n(o))}if(s)return!0;var u=i.createTag(t);if(null!=u){var d=i.option(u);d.attr("data-select2-tag",!0),i.addOptions([d]),i.insertTag(r,u)}o.results=r,n(o)}):e.call(this,t,n)},t.prototype.createTag=function(t,n){var i=e.trim(n.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){this._lastTag,this.$element.find("option[data-select2-tag]").each(function(){this.selected||e(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,i){var o=this;n.term=n.term||"";var s=this.tokenizer(n,this.options,function(t){var n,i=o._normalizeItem(t);if(!o.$element.find("option").filter(function(){return e(this).val()===i.id}).length){var s=o.option(i);s.attr("data-select2-tag",!0),o._removeOldTags(),o.addOptions([s])}n=i,o.trigger("select",{data:n})});s.term!==n.term&&(this.$search.length&&(this.$search.val(s.term),this.$search.focus()),n.term=s.term),t.call(this,n,i)},t.prototype.tokenizer=function(t,n,i,o){for(var s=i.get("tokenSeparators")||[],r=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<r.length;){var c=r[a];if(-1!==e.inArray(c,s)){var u=r.substr(0,a),d=l(e.extend({},n,{term:u}));null!=d?(o(d),r=r.substr(a+1)||"",a=0):a++}else a++}return{term:r}},t}),t.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),t.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),t.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var i=this;this.current(function(o){var s=null!=o?o.length:0;i.maximumSelectionLength>0&&s>=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):e.call(i,t,n)})},e}),t.define("select2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("select2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),this.$search.on("keydown",function(e){o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){o.handleSearch(e)}),n.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus(),window.setTimeout(function(){o.$search.focus()},0)}),n.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val("")}),n.on("focus",function(){n.isOpen()||o.$search.focus()}),n.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(o.showSearch(e)?o.$searchContainer.removeClass("select2-search--hide"):o.$searchContainer.addClass("select2-search--hide"))})},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n}),t.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var o=t[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},e}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),n.on("query",function(e){o.lastParams=e,o.loading=!0}),n.on("query:append",function(e){o.lastParams=e,o.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,o.$loadingMore[0]);!o.loading&&t&&o.$results.offset().top+o.$results.outerHeight(!1)+50>=o.$loadingMore.offset().top+o.$loadingMore.outerHeight(!1)&&o.loadMore()})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,i){this.$dropdownParent=i.get("dropdownParent")||e(document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this,o=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),o||(o=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var o=this,s="scroll.select2."+i.id,r="resize.select2."+i.id,a="orientationchange.select2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(s,function(t){var n=e(this).data("select2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(s+" "+r+" "+a,function(e){o._positionDropdown(),o._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var o="scroll.select2."+i.id,s="resize.select2."+i.id,r="orientationchange.select2."+i.id;this.$container.parents().filter(t.hasScroll).off(o),e(window).off(o+" "+s+" "+r)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),i=this.$dropdown.hasClass("select2-dropdown--below"),o=null,s=this.$container.offset();s.bottom=s.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=s.top,r.bottom=s.top+r.height;var a=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),u=l<s.top-a,d=c>s.bottom+a,p={left:s.left,top:r.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var f=h.offset();p.top-=f.top,p.left-=f.left,n||i||(o="below"),d||!u||n?!u&&d&&n&&(o="below"):o="above",("above"==o||n&&"below"!==o)&&(p.top=r.top-f.top-a),null!=o&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+o),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+o)),this.$dropdownContainer.css(p)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i<t.length;i++){var o=t[i];o.children?n+=e(o.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),t.define("select2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var o=i.data("data");null!=o.element&&o.element.selected||null==o.element&&o.selected||this.trigger("select",{data:o})}},e}),t.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,n,i,o,s,r,a,l,c,u,d,p,h,f,g,m,v,y,w,_,$,b,x,A,C,S,O,E){function D(){this.reset()}return D.prototype.apply=function(d){if(null==(d=e.extend(!0,{},this.defaults,d)).dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,w)),d.tags&&(d.dataAdapter=c.Decorate(d.dataAdapter,g)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=c.Decorate(d.dataAdapter,m)),null!=d.query){var E=t(d.amdBase+"compat/query");d.dataAdapter=c.Decorate(d.dataAdapter,E)}if(null!=d.initSelection){var D=t(d.amdBase+"compat/initSelection");d.dataAdapter=c.Decorate(d.dataAdapter,D)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,x)),null!=d.placeholder&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,b)),d.selectOnClose&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,S))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=_;else{var T=c.Decorate(_,$);d.dropdownAdapter=T}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,C)),d.closeOnSelect&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,O)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var q=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=c.Decorate(d.dropdownAdapter,q)}d.dropdownAdapter=c.Decorate(d.dropdownAdapter,A)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=o:d.selectionAdapter=i,null!=d.placeholder&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,s)),d.allowClear&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,r)),d.multiple&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var j=t(d.amdBase+"compat/containerCss");d.selectionAdapter=c.Decorate(d.selectionAdapter,j)}d.selectionAdapter=c.Decorate(d.selectionAdapter,l)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var L=d.language.split("-")[0];d.language=[d.language,L]}else d.language=[d.language];if(e.isArray(d.language)){var k=new u;d.language.push("en");for(var P=d.language,I=0;I<P.length;I++){var M=P[I],R={};try{R=u.loadPath(M)}catch(e){try{M=this.defaults.amdLanguageBase+M,R=u.loadPath(M)}catch(e){d.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}k.extend(R)}d.translations=k}else{var z=u.loadPath(this.defaults.amdLanguageBase+"en"),H=new u(d.language);H.extend(z),d.translations=H}return d},D.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return d[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:E,matcher:function n(i,o){if(""===e.trim(i.term))return o;if(o.children&&o.children.length>0){for(var s=e.extend(!0,{},o),r=o.children.length-1;r>=0;r--)null==n(i,o.children[r])&&s.children.splice(r,1);return s.children.length>0?s:n(i,s)}var a=t(o.text).toUpperCase(),l=t(i.term).toUpperCase();return a.indexOf(l)>-1?o:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},D.prototype.set=function(t,n){var i={};i[e.camelCase(t)]=n;var o=c._convertData(i);e.extend(this.defaults,o)},new D}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(e,t,n,i){function o(t,o){if(this.options=t,null!=o&&this.fromElement(o),this.options=n.apply(this.options),o&&o.is("input")){var s=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,s)}}return o.prototype.fromElement=function(e){var n,o=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl"))),n=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var s=t.extend(!0,{},n);s=i._convertData(s);for(var r in s)t.inArray(r,o)>-1||(t.isPlainObject(this.options[r])?t.extend(this.options[r],s[r]):this.options[r]=s[r]);return this},o.prototype.get=function(e){return this.options[e]},o.prototype.set=function(e,t){this.options[e]=t},o}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var o=function(e,n){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),o.__super__.constructor.call(this);var i=e.attr("tabindex")||0;e.data("old-tabindex",i),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var r=this.render();this._placeContainer(r);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var u=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){u.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return n.Extend(o,n.Observable),o.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var o=e.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"==t){var s=e.attr("style");if("string"!=typeof s)return null;for(var r=s.split(";"),a=0,l=r.length;a<l;a+=1){var c=r[a].replace(/\s/g,"").match(n);if(null!==c&&c.length>=1)return c[1]}return null}return t},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){e.each(n,t._syncA),e.each(n,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},o.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,o){-1===e.inArray(i,n)&&t.trigger(i,o)})},o.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("select2-container--open")}),this.on("close",function(){e.$container.removeClass("select2-container--open")}),this.on("enable",function(){e.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){e.$container.addClass("select2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("select2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype._syncSubtree=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(var o=0;o<t.addedNodes.length;o++)t.addedNodes[o].selected&&(n=!0);else t.removedNodes&&t.removedNodes.length>0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===t&&(t={}),e in i){var s=i[e],r={prevented:!1,name:e,args:t};if(n.call(this,s,r),r.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.trigger("query",{})},o.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},o.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},o.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},o.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),t.data("element",this.$element),t},o}),t.define("select2/compat/utils",["jquery"],function(e){return{syncCssClasses:function(t,n,i){var o,s,r=[];(o=e.trim(t.attr("class")))&&e((o=""+o).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&r.push(this)}),(o=e.trim(n.attr("class")))&&e((o=""+o).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(s=i(this))&&r.push(s)}),t.attr("class",r.join(" "))}}}),t.define("select2/compat/containerCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),s=this.options.get("containerCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var r=this.options.get("adaptContainerCssClass");if(r=r||n,-1!==s.indexOf(":all:")){s=s.replace(":all:","");var a=r;r=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,r),o.css(l),o.addClass(s),o},i}),t.define("select2/compat/dropdownCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),s=this.options.get("dropdownCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var r=this.options.get("adaptDropdownCssClass");if(r=r||n,-1!==s.indexOf(":all:")){s=s.replace(":all:","");var a=r;r=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,r),o.css(l),o.addClass(s),o},i}),t.define("select2/compat/initSelection",["jquery"],function(e){function t(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return t.prototype.current=function(t,n){var i=this;this._isInitialized?t.call(this,n):this.initSelection.call(null,this.$element,function(t){i._isInitialized=!0,e.isArray(t)||(t=[t]),n(t)})},t}),t.define("select2/compat/inputData",["jquery"],function(e){function t(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),e.call(this,t,n)}return t.prototype.current=function(t,n){function i(t,n){var o=[];return t.selected||-1!==e.inArray(t.id,n)?(t.selected=!0,o.push(t)):t.selected=!1,t.children&&o.push.apply(o,i(t.children,n)),o}for(var o=[],s=0;s<this._currentData.length;s++){var r=this._currentData[s];o.push.apply(o,i(r,this.$element.val().split(this._valueSeparator)))}n(o)},t.prototype.select=function(t,n){if(this.options.get("multiple")){var i=this.$element.val();i+=this._valueSeparator+n.id,this.$element.val(i),this.$element.trigger("change")}else this.current(function(t){e.map(t,function(e){e.selected=!1})}),this.$element.val(n.id),this.$element.trigger("change")},t.prototype.unselect=function(e,t){var n=this;t.selected=!1,this.current(function(e){for(var i=[],o=0;o<e.length;o++){var s=e[o];t.id!=s.id&&i.push(s.id)}n.$element.val(i.join(n._valueSeparator)),n.$element.trigger("change")})},t.prototype.query=function(e,t,n){for(var i=[],o=0;o<this._currentData.length;o++){var s=this._currentData[o],r=this.matches(t,s);null!==r&&i.push(r)}n({results:i})},t.prototype.addOptions=function(t,n){var i=e.map(n,function(t){return e.data(t[0],"data")});this._currentData.push.apply(this._currentData,i)},t}),t.define("select2/compat/matcher",["jquery"],function(e){return function(t){return function(n,i){var o=e.extend(!0,{},i);if(null==n.term||""===e.trim(n.term))return o;if(i.children){for(var s=i.children.length-1;s>=0;s--){var r=i.children[s];t(n.term,r.text,r)||o.children.splice(s,1)}if(o.children.length>0)return o}return t(n.term,i.text,i)?o:null}}}),t.define("select2/compat/query",[],function(){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.callback=n,this.options.get("query").call(null,t)},e}),t.define("select2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){n.find(".dropdown-wrapper").append(t),t.addClass("select2-dropdown--below"),n.addClass("select2-container--below")},e}),t.define("select2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),t.define("select2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),n=function(e){function t(t){var r=t||window.event,a=l.call(arguments,1),c=0,d=0,p=0,h=0,f=0,g=0;if((t=e.event.fix(r)).type="mousewheel","detail"in r&&(p=-1*r.detail),"wheelDelta"in r&&(p=r.wheelDelta),"wheelDeltaY"in r&&(p=r.wheelDeltaY),"wheelDeltaX"in r&&(d=-1*r.wheelDeltaX),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(d=-1*p,p=0),c=0===p?d:p,"deltaY"in r&&(c=p=-1*r.deltaY),"deltaX"in r&&(d=r.deltaX,0===p&&(c=-1*d)),0!==p||0!==d){if(1===r.deltaMode){var m=e.data(this,"mousewheel-line-height");c*=m,p*=m,d*=m}else if(2===r.deltaMode){var v=e.data(this,"mousewheel-page-height");c*=v,p*=v,d*=v}if(h=Math.max(Math.abs(p),Math.abs(d)),(!s||h<s)&&(s=h,i(r,h)&&(s/=40)),i(r,h)&&(c/=40,d/=40,p/=40),c=Math[c>=1?"floor":"ceil"](c/s),d=Math[d>=1?"floor":"ceil"](d/s),p=Math[p>=1?"floor":"ceil"](p/s),u.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=t.clientX-y.left,g=t.clientY-y.top}return t.deltaX=d,t.deltaY=p,t.deltaFactor=s,t.offsetX=f,t.offsetY=g,t.deltaMode=0,a.unshift(t,c,d,p),o&&clearTimeout(o),o=setTimeout(n,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function n(){s=null}function i(e,t){return u.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}var o,s,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var c=r.length;c;)e.event.fixHooks[r[--c]]=e.event.mouseHooks;var u=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=a.length;n;)this.addEventListener(a[--n],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",u.getLineHeight(this)),e.data(this,"mousewheel-page-height",u.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=a.length;n;)this.removeEventListener(a[--n],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})},"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],n):"object"==typeof exports?module.exports=n:n(e),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(e,t,n,i){if(null==e.fn.sgpbselect2){var o=["open","close","destroy"];e.fn.sgpbselect2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=e(this).data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),i=n[t].apply(n,s)}),e.inArray(t,o)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.sgpbselect2.defaults&&(e.fn.sgpbselect2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.sgpbselect2.amd=t,n});
public/js/sgpbSelect2.js CHANGED
@@ -1,6 +1 @@
1
- jQuery.fn.sgpbselect2=jQuery.fn.select2;function SGPBSelect2(){this.init();}
2
- SGPBSelect2.prototype.init=function(){if(!jQuery('.js-sg-select2').length){return;}
3
- this.hideProOptions();jQuery('select.js-sg-select2').each(function(){var type=jQuery(this).attr('data-select-type');var className=jQuery(this).attr('data-select-class');var options={width:'100%'};if(type=='ajax'){options=jQuery.extend(options,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:'json',delay:250,type:"POST",data:function(params){var searchKey=jQuery(this).attr('data-value-param');return{action:'select2_search_data',nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:params.term,searchKey:searchKey};},processResults:function(data){return{results:jQuery.map(data.items,function(item){return{text:item.text,id:item.id}})};}}});}
4
- jQuery(this).sgpbselect2(options);});};SGPBSelect2.prototype.hideProOptions=function(){if(typeof SGPB_JS_PACKAGES=='undefined'){return;}
5
- if(SGPB_JS_PACKAGES.packages['current']<SGPB_JS_PACKAGES.packages['platinum']){var disabledOptions=SGPB_JS_PACKAGES.proEvents;if(SGPB_JS_PACKAGES.packages['current']<SGPB_JS_PACKAGES.packages['silver']){for(var option in disabledOptions){var disabledOption=disabledOptions[option];jQuery('.sgpb-selectbox-settings option').each(function(){if(jQuery(this).val()==disabledOption){jQuery(this).attr('disabled','disabled');}});}}
6
- if(typeof SGPB_JS_PACKAGES.extensions=='undefined'){return;}}};jQuery(document).ready(function(){var sgpbSelect2=new SGPBSelect2();});
1
+ function SGPBSelect2(){this.init()}SGPBSelect2.prototype.init=function(){jQuery(".js-sg-select2").length&&(this.hideProOptions(),jQuery("select.js-sg-select2").each(function(){var e=jQuery(this).attr("data-select-type"),t=(jQuery(this).attr("data-select-class"),{width:"100%"});"ajax"==e&&(t=jQuery.extend(t,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:"json",delay:250,type:"POST",data:function(e){var t=jQuery(this).attr("data-value-param");return{action:"select2_search_data",nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:e.term,searchKey:t}},processResults:function(e){return{results:jQuery.map(e.items,function(e){return{text:e.text,id:e.id}})}}}})),jQuery(this).sgpbselect2(t)}))},SGPBSelect2.prototype.hideProOptions=function(){if("undefined"!=typeof SGPB_JS_PACKAGES&&SGPB_JS_PACKAGES.packages.current<SGPB_JS_PACKAGES.packages.platinum){var e=SGPB_JS_PACKAGES.proEvents;if(SGPB_JS_PACKAGES.packages.current<SGPB_JS_PACKAGES.packages.silver)for(var t in e){var a=e[t];jQuery(".sgpb-selectbox-settings option").each(function(){jQuery(this).val()==a&&jQuery(this).attr("disabled","disabled")})}if(void 0===SGPB_JS_PACKAGES.extensions)return}},jQuery(document).ready(function(){new SGPBSelect2});
 
 
 
 
 
public/views/closeSettingsView.php CHANGED
@@ -9,6 +9,23 @@
9
  $popupTypeObj->getOptionValue('sgpb-popup-themes')
10
  );
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  $defaultCloseButtonPositions = $defaultData['closeButtonPositions'];
13
  if ($popupTypeObj->getOptionValue('sgpb-popup-themes') == 'sgpb-theme-1' ||
14
  $popupTypeObj->getOptionValue('sgpb-popup-themes') == 'sgpb-theme-4' ||
@@ -24,6 +41,9 @@
24
  $popupTypeObj->getOptionValue('sgpb-popup-themes'),
25
  $popupTypeObj->getOptionValue('sgpb-button-image')
26
  );
 
 
 
27
  $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-popup-closing');
28
  ?>
29
  <div class="sgpb-wrapper form-horizontal">
@@ -80,6 +100,50 @@
80
  </label>
81
  <div class="col-md-6"><?php echo AdminHelper::createSelectBox($defaultCloseButtonPositions, $closeButtonPosition, array('name' => 'sgpb-close-button-position', 'class'=>'js-sg-select2 sgpb-close-button-position')); ?></div>
82
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  <?php endif; ?>
84
  <div class="<?php echo ($popupTypeObj->getOptionValue('sgpb-popup-themes') == 'sgpb-theme-4') ? 'sg-hide ' : '' ;?>sgpb-close-button-image-option-wrapper">
85
  <div class="row form-group">
@@ -94,7 +158,7 @@
94
  <div class="col-md-7">
95
  <div class="row">
96
  <div class="col-md-3 sgpb-close-btn-image-wrapper">
97
- <div class="sgpb-show-button-image-container" style="background-image: url(<?php echo 'data:image/png;base64,'.$buttonImage;?>);">
98
  <span class="sgpb-no-image"></span>
99
  </div>
100
  </div>
9
  $popupTypeObj->getOptionValue('sgpb-popup-themes')
10
  );
11
 
12
+ $hideTopPosition = '';
13
+ if ($closeButtonPosition == 'bottomRight' || $closeButtonPosition == 'bottomLeft') {
14
+ $hideTopPosition = ' style="display:none;"';
15
+ }
16
+ $hideBottomPosition = '';
17
+ if ($closeButtonPosition == 'topRight' || $closeButtonPosition == 'topLeft') {
18
+ $hideBottomPosition = ' style="display:none;"';
19
+ }
20
+ $hideRightPosition = '';
21
+ if ($closeButtonPosition == 'topLeft' || $closeButtonPosition == 'bottomLeft') {
22
+ $hideRightPosition = ' style="display:none;"';
23
+ }
24
+ $hideLeftPosition = '';
25
+ if ($closeButtonPosition == 'topRight' || $closeButtonPosition == 'bottomRight') {
26
+ $hideLeftPosition = ' style="display:none;"';
27
+ }
28
+
29
  $defaultCloseButtonPositions = $defaultData['closeButtonPositions'];
30
  if ($popupTypeObj->getOptionValue('sgpb-popup-themes') == 'sgpb-theme-1' ||
31
  $popupTypeObj->getOptionValue('sgpb-popup-themes') == 'sgpb-theme-4' ||
41
  $popupTypeObj->getOptionValue('sgpb-popup-themes'),
42
  $popupTypeObj->getOptionValue('sgpb-button-image')
43
  );
44
+ if (strpos($buttonImage, 'http') === false) {
45
+ $buttonImage = 'data:image/png;base64,'.$buttonImage;
46
+ }
47
  $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-popup-closing');
48
  ?>
49
  <div class="sgpb-wrapper form-horizontal">
100
  </label>
101
  <div class="col-md-6"><?php echo AdminHelper::createSelectBox($defaultCloseButtonPositions, $closeButtonPosition, array('name' => 'sgpb-close-button-position', 'class'=>'js-sg-select2 sgpb-close-button-position')); ?></div>
102
  </div>
103
+ <div class="row form-group sgpb-button-position-top-js"<?php echo $hideTopPosition ;?>>
104
+ <label for="sgpb-button-position-top" class="col-md-5 control-label sgpb-double-sub-option">
105
+ <?php _e('top', SG_POPUP_TEXT_DOMAIN)?>:
106
+ </label>
107
+ <div class="col-md-6">
108
+ <input id="sgpb-button-position-top" class="sgpb-full-width form-control sgpb-full-width-events" step="0.5" type="number" name="sgpb-button-position-top" value="<?php echo $popupTypeObj->getOptionValue('sgpb-button-position-top'); ?>">
109
+ </div>
110
+ <div class="col-md-1">
111
+ <span class="sgpb-restriction-unit">px</span>
112
+ </div>
113
+ </div>
114
+ <div class="row form-group sgpb-button-position-right-js"<?php echo $hideRightPosition ;?>>
115
+ <label for="sgpb-button-position-right" class="col-md-5 control-label sgpb-double-sub-option">
116
+ <?php _e('right', SG_POPUP_TEXT_DOMAIN)?>:
117
+ </label>
118
+ <div class="col-md-6">
119
+ <input id="sgpb-button-position-right" class="sgpb-full-width form-control sgpb-full-width-events" step="0.5" type="number" name="sgpb-button-position-right" value="<?php echo $popupTypeObj->getOptionValue('sgpb-button-position-right'); ?>">
120
+ </div>
121
+ <div class="col-md-1">
122
+ <span class="sgpb-restriction-unit">px</span>
123
+ </div>
124
+ </div>
125
+ <div class="row form-group sgpb-button-position-bottom-js"<?php echo $hideBottomPosition ;?>>
126
+ <label for="sgpb-button-position-bottom" class="col-md-5 control-label sgpb-double-sub-option">
127
+ <?php _e('bottom', SG_POPUP_TEXT_DOMAIN)?>:
128
+ </label>
129
+ <div class="col-md-6">
130
+ <input id="sgpb-button-position-bottom" class="sgpb-full-width form-control sgpb-full-width-events" step="0.5" type="number" name="sgpb-button-position-bottom" value="<?php echo $popupTypeObj->getOptionValue('sgpb-button-position-bottom'); ?>">
131
+ </div>
132
+ <div class="col-md-1">
133
+ <span class="sgpb-restriction-unit">px</span>
134
+ </div>
135
+ </div>
136
+ <div class="row form-group sgpb-button-position-left-js"<?php echo $hideLeftPosition ;?>>
137
+ <label for="sgpb-button-position-left" class="col-md-5 control-label sgpb-double-sub-option">
138
+ <?php _e('left', SG_POPUP_TEXT_DOMAIN)?>:
139
+ </label>
140
+ <div class="col-md-6">
141
+ <input id="sgpb-button-position-left" class="sgpb-full-width form-control sgpb-full-width-events" step="0.5" type="number" name="sgpb-button-position-left" value="<?php echo $popupTypeObj->getOptionValue('sgpb-button-position-left'); ?>">
142
+ </div>
143
+ <div class="col-md-1">
144
+ <span class="sgpb-restriction-unit">px</span>
145
+ </div>
146
+ </div>
147
  <?php endif; ?>
148
  <div class="<?php echo ($popupTypeObj->getOptionValue('sgpb-popup-themes') == 'sgpb-theme-4') ? 'sg-hide ' : '' ;?>sgpb-close-button-image-option-wrapper">
149
  <div class="row form-group">
158
  <div class="col-md-7">
159
  <div class="row">
160
  <div class="col-md-3 sgpb-close-btn-image-wrapper">
161
+ <div class="sgpb-show-button-image-container" style="background-image: url(<?php echo $buttonImage;?>);">
162
  <span class="sgpb-no-image"></span>
163
  </div>
164
  </div>
public/views/mediaButton.php CHANGED
File without changes
public/views/popupDesignView.php CHANGED
@@ -4,6 +4,12 @@ use sgpb\PopupBuilderActivePackage;
4
  $defaultData = ConfigDataHelper::defaultData();
5
  $enablePopupOverlay = PopupBuilderActivePackage::canUseOption('sgpb-enable-popup-overlay');
6
  $removedOptions = $popupTypeObj->getRemoveOptions();
 
 
 
 
 
 
7
  ?>
8
  <div class="sgpb-wrapper">
9
  <div class="row">
@@ -54,7 +60,7 @@ $removedOptions = $popupTypeObj->getRemoveOptions();
54
  <label for="sgpb-popup-themes" class="col-md-5 control-label sgpb-static-padding-top">
55
  <?php _e('Theme', SG_POPUP_TEXT_DOMAIN)?>:
56
  </label>
57
- <div class="col-md-7"><?php AdminHelper::createRadioButtons($defaultData['theme'], "sgpb-popup-themes", esc_html($popupTypeObj->getOptionValue('sgpb-popup-themes')), true); ?></div>
58
  </div>
59
  <div class="row">
60
  <div class="col-md-10">
@@ -66,6 +72,14 @@ $removedOptions = $popupTypeObj->getRemoveOptions();
66
  <div class="themes-preview theme-preview-6" style="display: none;"></div>
67
  </div>
68
  </div>
 
 
 
 
 
 
 
 
69
  <!-- popup overlay start -->
70
  <?php if (empty($removedOptions['sgpb-enable-popup-overlay'])) :?>
71
  <div class="row form-group">
4
  $defaultData = ConfigDataHelper::defaultData();
5
  $enablePopupOverlay = PopupBuilderActivePackage::canUseOption('sgpb-enable-popup-overlay');
6
  $removedOptions = $popupTypeObj->getRemoveOptions();
7
+ $popupTheme = $popupTypeObj->getOptionValue('sgpb-popup-themes');
8
+ $hidePopupBorderOption = ' sg-hide';
9
+ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
10
+ $hidePopupBorderOption = '';
11
+ }
12
+
13
  ?>
14
  <div class="sgpb-wrapper">
15
  <div class="row">
60
  <label for="sgpb-popup-themes" class="col-md-5 control-label sgpb-static-padding-top">
61
  <?php _e('Theme', SG_POPUP_TEXT_DOMAIN)?>:
62
  </label>
63
+ <div class="col-md-7"><?php AdminHelper::createRadioButtons($defaultData['theme'], "sgpb-popup-themes", esc_html($popupTheme), true); ?></div>
64
  </div>
65
  <div class="row">
66
  <div class="col-md-10">
72
  <div class="themes-preview theme-preview-6" style="display: none;"></div>
73
  </div>
74
  </div>
75
+ <div class="row form-group sgpb-disable-border-wrapper<?php echo $hidePopupBorderOption ;?>">
76
+ <label for="sgpb-force-rtl" class="col-md-5 control-label sgpb-static-padding-top">
77
+ <?php _e('Disable popup border', SG_POPUP_TEXT_DOMAIN)?>:
78
+ </label>
79
+ <div class="col-md-6">
80
+ <input type="checkbox" id="sgpb-disable-border" name="sgpb-disable-border" <?php echo $popupTypeObj->getOptionValue('sgpb-disable-border', true); ?>>
81
+ </div>
82
+ </div>
83
  <!-- popup overlay start -->
84
  <?php if (empty($removedOptions['sgpb-enable-popup-overlay'])) :?>
85
  <div class="row form-group">
readme.txt CHANGED
@@ -5,9 +5,9 @@ Author: Popup Builder
5
  Donate link: https://popup-builder.com
6
  Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wordpress popup plugin
7
  Requires at least: 3.8
8
- Tested up to: 5.0
9
  Requires PHP: 5.3.3
10
- Stable tag: 3.1.5.2
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -180,6 +180,16 @@ Go to the Popup Builder settings and set your desired options.
180
 
181
  == Changelog ==
182
 
 
 
 
 
 
 
 
 
 
 
183
  = Version 3.1.5.2 =
184
  * Added new extension Web Push Notification.
185
  * Gutenberg block improvements.
5
  Donate link: https://popup-builder.com
6
  Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wordpress popup plugin
7
  Requires at least: 3.8
8
+ Tested up to: 5.0.3
9
  Requires PHP: 5.3.3
10
+ Stable tag: 3.1.6
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
180
 
181
  == Changelog ==
182
 
183
+ = Version 3.1.6 =
184
+ * Added new feature to change Close Button position.
185
+ * Added new feature to hide/change popup's border (2nd and 3rd themes).
186
+ * Added new feature inside the 'Display Rules' to show popup by post categories.
187
+ * Improvement related to MyISAM and InnoDB when one if this engines don't supported.
188
+ * Added class selector inside the popups' data table.
189
+ * Fixed PHP notices.
190
+ * Bug fixed related to extension licenses.
191
+ * Code improvements and minor bug fixes.
192
+
193
  = Version 3.1.5.2 =
194
  * Added new extension Web Push Notification.
195
  * Gutenberg block improvements.