HubSpot – Free Marketing Plugin for WordPress - Version 3.1.8

Version Description

(2015.05.15) =

  • Added email connector sync to onboarding
  • Sources now check the UTM tags on the first page view visit
  • Privacy policy added to plugin

  • Bug fixes

  • Fixed dismiss button conflict on WordPress notifications

  • Icon styles no longer conflict with other plugins

  • Deleted contacts no longer show up in the dashboard

  • Popup sync now looks at the actual inputs instead of the field names so itll work in other languages

  • Popup labels now work in IE

  • Fixed bug with SendGrid email delivery for Leadin Pro

Download this release

Release Info

Developer AndyGCook
Plugin Icon 128x128 HubSpot – Free Marketing Plugin for WordPress
Version 3.1.8
Comparing to
See all releases

Code changes from version 3.1.7 to 3.1.8

admin/inc/class-leadin-contact.php CHANGED
@@ -51,6 +51,11 @@ class LI_Contact {
51
  {
52
  global $wpdb;
53
 
 
 
 
 
 
54
  $lead = $this->get_contact_details($this->hashkey);
55
  $pageviews = $this->get_contact_pageviews($this->hashkey, 'ARRAY_A');
56
  $submissions = $this->get_contact_submissions($this->hashkey, 'ARRAY_A');
@@ -192,7 +197,7 @@ class LI_Contact {
192
  $lead->total_submissions = $total_submissions;
193
 
194
  $this->history = (object)NULL;
195
- $this->history->submission = $submissions[0];
196
  $this->history->sessions = $sessions;
197
  $this->history->lead = $lead;
198
  $this->history->tags = $tags;
@@ -510,6 +515,14 @@ class LI_Contact {
510
  else
511
  $company_data->country = '';
512
 
 
 
 
 
 
 
 
 
513
  if ( isset($response->properties->state) )
514
  {
515
  $company_data->state = $response->properties->state;
51
  {
52
  global $wpdb;
53
 
54
+ $lead = (object)NULL;
55
+ $pageviews = (object)NULL;
56
+ $submissions = (object)NULL;
57
+ $tags = (object)NULL;
58
+
59
  $lead = $this->get_contact_details($this->hashkey);
60
  $pageviews = $this->get_contact_pageviews($this->hashkey, 'ARRAY_A');
61
  $submissions = $this->get_contact_submissions($this->hashkey, 'ARRAY_A');
197
  $lead->total_submissions = $total_submissions;
198
 
199
  $this->history = (object)NULL;
200
+ $this->history->submission = ( isset($submissions[0]) ? $submissions[0] : '');
201
  $this->history->sessions = $sessions;
202
  $this->history->lead = $lead;
203
  $this->history->tags = $tags;
515
  else
516
  $company_data->country = '';
517
 
518
+ if ( isset($response->properties->city) )
519
+ {
520
+ $company_data->city = $response->properties->city;
521
+ $company_data_exists = TRUE;
522
+ }
523
+ else
524
+ $company_data->city = '';
525
+
526
  if ( isset($response->properties->state) )
527
  {
528
  $company_data->state = $response->properties->state;
admin/inc/class-leadin-list-table.php CHANGED
@@ -503,6 +503,7 @@ class LI_List_Table extends WP_List_Table {
503
  lead_email != '' AND lead_deleted = 0 AND hashkey != '' ";
504
 
505
  $total_contacts = $wpdb->get_var($q);
 
506
  return $total_contacts;
507
  }
508
 
503
  lead_email != '' AND lead_deleted = 0 AND hashkey != '' ";
504
 
505
  $total_contacts = $wpdb->get_var($q);
506
+
507
  return $total_contacts;
508
  }
509
 
admin/inc/class-stats-dashboard.php CHANGED
@@ -176,8 +176,8 @@ class LI_StatsDashboard {
176
  FROM
177
  $wpdb->li_leads
178
  WHERE
179
- lead_date BETWEEN CURDATE() - INTERVAL 30 DAY AND NOW() AND lead_email != ''";
180
-
181
  $contacts = $wpdb->get_results($q);
182
 
183
  foreach ( $contacts as $contact )
@@ -217,16 +217,16 @@ class LI_StatsDashboard {
217
 
218
  function check_lead_source ( $source, $origin_url = '' )
219
  {
220
- if ( $source )
221
  {
222
- $decoded_source = urldecode($source);
223
 
224
- if ( stristr($decoded_source, 'utm_medium=cpc') || stristr($decoded_source, 'utm_medium=ppc') || stristr($decoded_source, 'aclk') || stristr($decoded_source, 'gclid') )
225
  return 'paid';
226
 
227
- if ( stristr($source, 'utm_') )
228
  {
229
- $url = $source;
230
  $url_parts = parse_url($url);
231
  parse_str($url_parts['query'], $path_parts);
232
 
@@ -251,26 +251,18 @@ class LI_StatsDashboard {
251
  return 'email';
252
  }
253
  }
254
-
255
- $referer = $this->parser->parse(
256
- $source
257
- );
258
-
259
- if ( $referer->isKnown() )
260
- return $referer->getMedium();
261
- else
262
- return 'referral';
263
  }
264
- else
 
265
  {
266
- $decoded_origin_url = urldecode($origin_url);
267
 
268
- if ( stristr($decoded_origin_url, 'utm_medium=cpc') || stristr($decoded_origin_url, 'utm_medium=ppc') || stristr($decoded_origin_url, 'aclk') || stristr($decoded_origin_url, 'gclid') )
269
  return 'paid';
270
 
271
- if ( stristr($decoded_origin_url, 'utm_') )
272
  {
273
- $url = $decoded_origin_url;
274
  $url_parts = parse_url($url);
275
  parse_str($url_parts['query'], $path_parts);
276
 
@@ -296,8 +288,17 @@ class LI_StatsDashboard {
296
  }
297
  }
298
 
299
- return 'direct';
 
 
 
 
 
 
 
300
  }
 
 
301
  }
302
 
303
  function print_readable_source ( $source )
176
  FROM
177
  $wpdb->li_leads
178
  WHERE
179
+ lead_date BETWEEN CURDATE() - INTERVAL 30 DAY AND NOW() AND lead_email != '' AND lead_deleted = 0";
180
+
181
  $contacts = $wpdb->get_results($q);
182
 
183
  foreach ( $contacts as $contact )
217
 
218
  function check_lead_source ( $source, $origin_url = '' )
219
  {
220
+ if ( $origin_url )
221
  {
222
+ $decoded_origin_url = urldecode($origin_url);
223
 
224
+ if ( stristr($decoded_origin_url, 'utm_medium=cpc') || stristr($decoded_origin_url, 'utm_medium=ppc') || stristr($decoded_origin_url, 'aclk') || stristr($decoded_origin_url, 'gclid') || stristr($decoded_origin_url, 'utm_medium=paid') )
225
  return 'paid';
226
 
227
+ if ( stristr($decoded_origin_url, 'utm_') )
228
  {
229
+ $url = $decoded_origin_url;
230
  $url_parts = parse_url($url);
231
  parse_str($url_parts['query'], $path_parts);
232
 
251
  return 'email';
252
  }
253
  }
 
 
 
 
 
 
 
 
 
254
  }
255
+
256
+ if ( $source )
257
  {
258
+ $decoded_source = urldecode($source);
259
 
260
+ if ( stristr($decoded_source, 'utm_medium=cpc') || stristr($decoded_source, 'utm_medium=ppc') || stristr($decoded_source, 'aclk') || stristr($decoded_source, 'gclid') )
261
  return 'paid';
262
 
263
+ if ( stristr($source, 'utm_') )
264
  {
265
+ $url = $source;
266
  $url_parts = parse_url($url);
267
  parse_str($url_parts['query'], $path_parts);
268
 
288
  }
289
  }
290
 
291
+ $referer = $this->parser->parse(
292
+ $source
293
+ );
294
+
295
+ if ( $referer->isKnown() )
296
+ return $referer->getMedium();
297
+ else
298
+ return 'referral';
299
  }
300
+
301
+ return 'direct';
302
  }
303
 
304
  function print_readable_source ( $source )
admin/leadin-admin.php CHANGED
@@ -50,6 +50,7 @@ class WPLeadInAdmin {
50
  var $power_up_icon;
51
  var $stats_dashboard;
52
  var $action;
 
53
 
54
  /**
55
  * Class constructor
@@ -77,20 +78,15 @@ class WPLeadInAdmin {
77
 
78
  if ( isset($_GET['page']) && $_GET['page'] == 'leadin_stats' )
79
  {
 
 
 
 
 
 
 
80
  add_action('admin_footer', array($this, 'build_contacts_chart'));
81
  }
82
-
83
- /*
84
- //Turned off the updater in 3.1.7
85
-
86
- $updater_type = '';
87
-
88
- if ( isset($options['pro']) && $options['pro'] )
89
- $updater_type = 'pro';
90
-
91
- if ( $updater_type )
92
- $li_wp_updater = new WPLeadInUpdater($updater_type);
93
- */
94
  }
95
 
96
  function leadin_update_check ()
@@ -278,32 +274,35 @@ class WPLeadInAdmin {
278
 
279
  add_menu_page('Leadin', 'Leadin', $capability, 'leadin_stats', array($this, 'leadin_build_stats_page'), $leadin_icon , '25.100713');
280
 
281
- foreach ( $this->admin_power_ups as $power_up )
282
  {
283
- if ( $power_up->activated )
284
  {
285
- $power_up->admin_init();
 
 
286
 
287
- // Creates the menu icon for power-up if it's set. Overrides the main Leadin menu to hit the contacts power-up
288
- if ( $power_up->menu_text )
289
- add_submenu_page('leadin_stats', $power_up->menu_text, $power_up->menu_text, $capability, 'leadin_' . $power_up->menu_link, array($power_up, 'power_up_setup_callback'));
 
290
  }
291
- }
292
 
293
- add_submenu_page('leadin_stats', 'Tags', 'Tags', $capability, 'leadin_tags', array(&$this, 'leadin_build_tag_page'));
294
- add_submenu_page('leadin_stats', 'Settings', 'Settings', 'activate_plugins', 'leadin_settings', array(&$this, 'leadin_plugin_options'));
295
- add_submenu_page('leadin_stats', 'Power-ups', 'Power-ups', 'activate_plugins', 'leadin_power_ups', array(&$this, 'leadin_power_ups_page'));
296
-
297
- if ( ! leadin_check_pro_user() )
298
- add_submenu_page('leadin_stats', 'Pro Upgrade', 'Pro Upgrade', 'activate_plugins', 'leadin_pro_upgrade', array(&$this, 'leadin_pro_upgrade_page'));
299
 
300
- $submenu['leadin_stats'][0][0] = 'Stats';
301
 
302
- if ( !isset($_GET['page']) || $_GET['page'] != 'leadin_settings' )
303
- {
304
- $options = get_option('leadin_options');
305
- if ( !isset($options['ignore_settings_popup']) || !$options['ignore_settings_popup'] )
306
- $li_pointers = new LI_Pointers();
 
307
  }
308
 
309
 
@@ -400,26 +399,35 @@ class WPLeadInAdmin {
400
  function leadin_build_stats_page ()
401
  {
402
  global $wp_version;
403
- $this->stats_dashboard = new LI_StatsDashboard();
404
-
405
- echo '<div id="leadin" class="li-stats wrap '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
406
 
407
- $this->leadin_header('Leadin Stats: ' . date('F j Y, g:ia', current_time('timestamp')), 'leadin-stats__header', 'Loaded Stats Page');
 
 
 
 
 
 
408
 
409
- echo '<div class="leadin-stats__top-container">';
410
- echo $this->leadin_postbox('leadin-stats__chart', leadin_single_plural_label(number_format($this->stats_dashboard->total_contacts_last_30_days), 'new contact', 'new contacts') . ' last 30 days', $this->leadin_build_contacts_chart_stats());
411
- echo '</div>';
412
 
413
- echo '<div class="leadin-stats__postbox_containter">';
414
- echo $this->leadin_postbox('leadin-stats__new-contacts', leadin_single_plural_label(number_format($this->stats_dashboard->total_new_contacts), 'new contact', 'new contacts') . ' today', $this->leadin_build_new_contacts_postbox());
415
- echo $this->leadin_postbox('leadin-stats__returning-contacts', leadin_single_plural_label(number_format($this->stats_dashboard->total_returning_contacts), 'returning contact', 'returning contacts') . ' today', $this->leadin_build_returning_contacts_postbox());
416
- echo '</div>';
417
 
418
 
419
 
420
- echo '<div class="leadin-stats__postbox_containter">';
421
- echo $this->leadin_postbox('leadin-stats__sources', 'New contact sources last 30 days', $this->leadin_build_sources_postbox());
422
- echo '</div>';
 
 
 
 
 
 
423
 
424
  $this->leadin_footer();
425
  }
@@ -603,22 +611,17 @@ class WPLeadInAdmin {
603
 
604
 
605
  <?php
606
- $esp_power_ups = array(
607
- 'MailChimp' => 'mailchimp_connect',
608
- 'Constant Contact' => 'constant_contact_connect',
609
- 'AWeber' => 'aweber_connect',
610
- 'GetResponse' => 'getresponse_connect',
611
- 'MailPoet' => 'mailpoet_connect',
612
- 'Campaign Monitor' => 'campaign_monitor_connect'
613
- );
614
-
615
- foreach ( $esp_power_ups as $power_up_name => $power_up_slug )
616
  {
617
  if ( WPLeadIn::is_power_up_active($power_up_slug) )
618
  {
619
  global ${'leadin_' . $power_up_slug . '_wp'}; // e.g leadin_mailchimp_connect_wp
620
  $esp_name = strtolower(str_replace('_connect', '', $power_up_slug)); // e.g. mailchimp
621
- $lists = ${'leadin_' . $power_up_slug . '_wp'}->admin->li_get_lists();
 
 
 
622
  $synced_lists = ( isset($tagger->details->tag_synced_lists) ? unserialize($tagger->details->tag_synced_lists) : '' );
623
 
624
  echo '<tr>';
@@ -676,7 +679,7 @@ class WPLeadInAdmin {
676
  echo 'It looks like you haven\'t set up your ' . $esp_name_readable . ' integration yet...<br/><br/>';
677
  echo '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_settings' . $settings_page_anchor_id . '">Set up your ' . $esp_name_readable . ' integration</a>';
678
  }
679
- else if ( ${'leadin_' . $power_up_slug . '_wp'}->admin->invalid_key )
680
  {
681
  echo $invalid_key_message;
682
  echo '<p>' . $invalid_key_link . ' then try copying and pasting it again in <a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_settings' . $settings_page_anchor_id . '">Leadin → Settings</a></p>';
@@ -973,10 +976,6 @@ class WPLeadInAdmin {
973
  function leadin_build_settings_page ()
974
  {
975
  global $leadin_contacts;
976
-
977
- //echo get_site_url();
978
-
979
- //print_r($_POST);
980
 
981
  // Show the settings popup on all pages except the settings page
982
  if ( isset($_GET['page']) && $_GET['page'] == 'leadin_settings' )
@@ -1032,26 +1031,19 @@ class WPLeadInAdmin {
1032
  2
1033
  );
1034
 
 
 
 
 
 
 
 
 
1035
  }
1036
 
1037
  function leadin_options_section_heading ( )
1038
  {
1039
  $this->print_hidden_settings_fields();
1040
-
1041
- if ( $this->has_leads() )
1042
- {
1043
- echo '<div class="leadin-section">';
1044
- echo '<p style="color: #090; font-weight: bold;">Visitor tracking is installed and tracking visitors.</p>';
1045
- echo '<p>The next time a visitor fills out a form on your WordPress site with an email address, Leadin will send you an email with the contact\'s referral source and page view history.</p>';
1046
- echo '</div>';
1047
- }
1048
- else
1049
- {
1050
- echo '<div class="leadin-section">';
1051
- echo '<p style="color: #f67d42; font-weight: bold;">Leadin is set up and waiting for a form submission...</p>';
1052
- echo '<p>Can\'t wait to see Leadin in action? Go fill out a form on your site to see your first contact.</p>';
1053
- echo '</div>';
1054
- }
1055
  }
1056
 
1057
  function print_hidden_settings_fields ()
@@ -1148,6 +1140,7 @@ class WPLeadInAdmin {
1148
 
1149
  function update_option_leadin_options_callback ( $old_value, $new_value )
1150
  {
 
1151
  }
1152
 
1153
  /**
@@ -1158,10 +1151,15 @@ class WPLeadInAdmin {
1158
  $li_options = get_option('leadin_options');
1159
 
1160
  // Load onboarding if not complete
1161
- if ( $li_options['onboarding_complete'] == 0 ) {
 
1162
  $this->leadin_plugin_onboarding();
 
 
 
1163
  }
1164
- else {
 
1165
  $this->leadin_plugin_settings();
1166
  }
1167
  }
@@ -1175,37 +1173,48 @@ class WPLeadInAdmin {
1175
 
1176
  $li_options = get_option('leadin_options');
1177
 
1178
- echo '<div id="leadin" class="li-onboarding wrap '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
1179
-
1180
 
1181
  ?>
1182
 
1183
- <?php if ( ! isset($_GET['activate_popup']) ) : ?>
1184
 
1185
- <?php if ( $li_options['onboarding_step'] == 1 ) : ?>
1186
-
1187
- <?php $this->leadin_header('Leadin Setup', 'li_setup', 'Onboarding Step 2 - Get Contact Reports'); ?>
1188
-
1189
- <div class="oboarding-steps">
1190
- <ol class="oboarding-steps-names">
1191
- <li class="oboarding-step-name completed">Activate Leadin</li>
1192
- <li class="oboarding-step-name active">Get Contact Reports</li>
1193
- <li class="oboarding-step-name">Grow Your Contacts List</li>
1194
- </ol>
1195
- <div class="oboarding-step">
1196
- <h2 class="oboarding-step-title">Where should we send your contact reports?</h2>
1197
- <div class="oboarding-step-content">
1198
- <p class="oboarding-step-description">Leadin will help you get to know your website visitors by sending you a report including traffic source and pageview history each time a visitor fills out a form.</p>
1199
- <form id="li-onboarding-form" method="post" action="options.php">
1200
- <div>
1201
- <?php settings_fields('leadin_settings_options'); ?>
1202
- <?php $this->li_email_callback(); ?>
1203
- </div>
1204
- <?php $this->print_hidden_settings_fields(); ?>
1205
- <input type="hidden" id="next_onboarding_step" name="next_onboarding_step" value="2">
1206
- <input type="submit" name="submit" id="submit" class="button button-primary button-big" value="<?php esc_attr_e('Save Email'); ?>">
1207
- </form>
1208
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
1209
  </div>
1210
  </div>
1211
  <!-- Facebook Conversion Code for Installed plugin -->
@@ -1225,89 +1234,129 @@ class WPLeadInAdmin {
1225
  </script>
1226
  <noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6024677413664&amp;cd[value]=0.00&amp;cd[currency]=USD&amp;noscript=1" /></noscript>
1227
 
1228
- <?php elseif ( $li_options['onboarding_step'] == 2 ) : ?>
1229
 
1230
- <?php $this->leadin_header('Leadin Setup', 'li_setup', 'Onboarding Step 3 - Grow Your Contact List'); ?>
 
 
 
1231
 
1232
- <div class="oboarding-steps">
1233
- <ol class="oboarding-steps-names">
1234
- <li class="oboarding-step-name completed">Activate Leadin</li>
1235
- <li class="oboarding-step-name completed">Get Contact Reports</li>
1236
- <li class="oboarding-step-name active">Grow Your Contacts List</li>
1237
- </ol>
1238
- <div class="oboarding-step">
1239
- <h2 class="oboarding-step-title">Grow your contacts list with our popup form<br><small>and start converting visitors on <?php echo get_bloginfo('wpurl') ?></small></h2>
1240
- <form id="li-onboarding-form" method="post" action="options.php">
1241
- <?php $this->print_hidden_settings_fields(); ?>
1242
- <div class="popup-options">
1243
- <label class="popup-option">
1244
- <input type="radio" name="popup-position" value="slide_in" checked="checked" >Slide in
1245
- <img src="<?php echo LEADIN_PATH ?>/images/popup-bottom.png">
1246
- </label>
1247
- <label class="popup-option">
1248
- <input type="radio" name="popup-position" value="popup">Popup
1249
- <img src="<?php echo LEADIN_PATH ?>/images/popup-over.png">
1250
- </label>
1251
- <label class="popup-option">
1252
- <input type="radio" name="popup-position" value="top">Top
1253
- <img src="<?php echo LEADIN_PATH ?>/images/popup-top.png">
1254
- </label>
1255
- </div>
1256
- <input type="hidden" id="next_onboarding_step" name="next_onboarding_step" value="3">
1257
- <a id="btn-activate-subscribe" href="<?php echo get_admin_url() .'admin.php?page=leadin_settings&leadin_action=activate&power_up=subscribe_widget&redirect_to=' . get_admin_url() . urlencode('admin.php?page=leadin_settings&activate_popup=true&popup_position=slide_in'); ?>" class="button button-primary button-big"><?php esc_attr_e('Activate the popup form');?></a>
1258
- <p><a href="<?php echo get_admin_url() .'admin.php?page=leadin_settings&activate_popup=false'; ?>">Don't activate the popup form right now</a></p>
1259
- </form>
1260
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1261
  </div>
1262
 
1263
- <?php endif; ?>
1264
-
1265
- <?php else : ?>
1266
-
1267
- <?php
1268
- // Set the popup position based on get URL
1269
-
1270
- if ( isset($_GET['popup_position']) )
1271
- {
1272
- $vex_class_option = '';
1273
- switch ( $_GET['popup_position'] )
1274
- {
1275
- case 'slide_in' :
1276
- $vex_class_option = 'vex-theme-bottom-right-corner';
1277
- break;
1278
-
1279
- case 'popup' :
1280
- $vex_class_option = 'vex-theme-default';
1281
- break;
 
1282
 
1283
- case 'top' :
1284
- $vex_class_option = 'vex-theme-top';
1285
- break;
 
 
 
1286
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1287
 
1288
- leadin_update_option('leadin_subscribe_options', 'li_subscribe_vex_class', $vex_class_option);
1289
- leadin_track_plugin_activity('Onboarding Popup Activated');
1290
- }
1291
- else
1292
- leadin_track_plugin_activity('Onboarding Popup Not Activated');
1293
 
1294
- // Update the onboarding settings
1295
- if ( ! isset($options['onboarding_complete']) || ! $options['onboarding_complete'] )
1296
- {
1297
- leadin_update_option('leadin_options', 'onboarding_complete', 1);
1298
- }
1299
- ?>
1300
-
1301
- <?php $this->leadin_header('Leadin Setup', 'li_setup', 'Onboarding Complete'); ?>
1302
 
1303
- <div class="oboarding-steps">
1304
  <ol class="oboarding-steps-names">
1305
  <li class="oboarding-step-name completed">Activate Leadin</li>
1306
  <li class="oboarding-step-name completed">Get Contact Reports</li>
1307
  <li class="oboarding-step-name completed">Grow Your Contacts List</li>
 
1308
  </ol>
1309
  <div class="oboarding-step">
1310
- <h2 class="oboarding-step-title">Setup Complete!<br>Leadin is waiting for your first form submission.</h2>
1311
  <div class="oboarding-step-content">
1312
  <p class="oboarding-step-description">Leadin is set up and waiting for a form submission. Once Leadin detects a form submission, a new contact will be added to your contacts list. We recommend filling out a form on your site to test that Leadin is working correctly.</p>
1313
  <form id="li-onboarding-form" method="post" action="options.php">
@@ -1316,16 +1365,15 @@ class WPLeadInAdmin {
1316
  </form>
1317
  </div>
1318
  </div>
1319
- </div>
1320
 
1321
- <?php endif; ?>
 
 
 
 
1322
 
1323
  <?php
1324
 
1325
- $this->leadin_footer();
1326
-
1327
- //end wrap
1328
- echo '</div>';
1329
  }
1330
 
1331
  /**
@@ -1703,8 +1751,11 @@ class WPLeadInAdmin {
1703
  */
1704
  function leadin_header ( $page_title = '', $css_class = '', $event_name = '' )
1705
  {
1706
- $options = get_option('li_options');
1707
- $leadin_user = leadin_get_current_user();
 
 
 
1708
  ?>
1709
 
1710
  <?php if ( leadin_check_pro_user() ) : ?>
@@ -1719,10 +1770,8 @@ class WPLeadInAdmin {
1719
  "wp-version" : "<?php echo $leadin_user['wp_version']; ?>",
1720
  "li-version" : "<?php echo $leadin_user['li_version']; ?>",
1721
  "li-source" : "<?php echo LEADIN_SOURCE; ?>",
1722
- "createdAt" : "<?php echo date('Y-m-d H:i:s'); ?>",
1723
  "website" : "<?php echo $leadin_user['wp_url']; ?>",
1724
  "company" : "<?php echo $leadin_user['wp_url']; ?>",
1725
- "contacts" : <?php echo $leadin_user['total_contacts']; ?>,
1726
  "utm_source" : "<?php echo $leadin_user['utm_source']; ?>",
1727
  "utm_medium" : "<?php echo $leadin_user['utm_medium']; ?>",
1728
  "utm_term" : "<?php echo $leadin_user['utm_term']; ?>",
@@ -1746,55 +1795,69 @@ class WPLeadInAdmin {
1746
  }}();
1747
  </script>
1748
  <?php endif; ?>
 
 
 
 
 
1749
 
1750
- <?php screen_icon('leadin'); ?>
 
 
 
 
1751
 
1752
- <h2 class="<?php echo $css_class ?>"><?php echo $page_title; ?></h2>
 
1753
 
1754
- <?php if ( $options['onboarding_complete'] ) : ?>
1755
- <?php if ( $this->has_leads() == FALSE ) : ?>
1756
- <div id="message" class="updated">
1757
- <p>Leadin is set up and waiting for a form submission... Need help? <a href="http://wordpress.org/support/plugin/leadin">Contact Us</a>.</p>
1758
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1759
  <?php endif; ?>
1760
- <?php endif; ?>
 
 
 
 
1761
 
1762
- <?php $options = get_option('leadin_options'); ?>
1763
 
1764
- <?php if ( isset($_GET['settings-updated']) && $options['onboarding_complete'] ) : ?>
1765
- <div id="message" class="updated">
1766
- <p><strong><?php _e('Settings saved.') ?></strong></p>
 
 
1767
  </div>
1768
  <?php endif; ?>
1769
- <?php if ( isset($options['onboarding_complete']) && $options['onboarding_complete'] && ! isset($_COOKIE['ignore_social_share']) ) : ?>
1770
- <?php if ( leadin_check_first_pageview_data() ) : ?>
1771
- <div class="dialog-bottom-right">
1772
- <h1>Hey, do you like Leadin?</h1>
1773
- <a href="javscript:void(0);" id="close-share" class="close">&#10006;</a>
1774
- <p>Looks like you've been using Leadin for at least 30 days. Want to help support us by spreading the word?</p>
1775
- <p>We'd love it if you could tell your friends about us or leave us a review on WordPress.org.</p>
1776
- <a class="big-button--share fb" href="https://www.facebook.com/sharer/sharer.php?u=http://leadin.com/facebook-share" target="_blank"></a>
1777
- <a class="big-button--share tw" href="https://twitter.com/home?status=I've%20been%20using%20%40LeadinApp%20to%20track%20visitors%20on%20my%20Wordpress%20site.%20Try%20it%20for%20free!%20http://leadin.com/twitter-share" target="_blank"></a>
1778
- <a class="big-button--share wp" href="https://wordpress.org/support/view/plugin-reviews/leadin?rate=5#postform" target="_blank"></a>
1779
- </div>
1780
- <script type="text/javascript">
1781
- jQuery(document).ready(function($){
1782
- var BR = $(".dialog-bottom-right");
1783
- var close = $(".close");
1784
- BR.animate({
1785
- "bottom" : 0
1786
- },
1787
- 1000);
1788
- close.click(function(){
1789
- BR.animate({
1790
- "bottom" : -400
1791
- },
1792
- 1000);
1793
- });
1794
- });
1795
- </script>
1796
- <?php endif; ?>
1797
- <?php endif; ?>
1798
  <?php
1799
  }
1800
 
@@ -1802,7 +1865,6 @@ class WPLeadInAdmin {
1802
  {
1803
  $li_options = get_option('leadin_options');
1804
  global $wp_version;
1805
-
1806
 
1807
  ?>
1808
  <div id="leadin-footer">
@@ -1814,7 +1876,6 @@ class WPLeadInAdmin {
1814
  </p>
1815
 
1816
  <p class="sharing"><a href="https://twitter.com/leadinapp" class="twitter-follow-button" data-show-count="false">Follow @leadinapp</a><p>
1817
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
1818
  </div>
1819
 
1820
  <?php
50
  var $power_up_icon;
51
  var $stats_dashboard;
52
  var $action;
53
+ var $esp_power_ups;
54
 
55
  /**
56
  * Class constructor
78
 
79
  if ( isset($_GET['page']) && $_GET['page'] == 'leadin_stats' )
80
  {
81
+ if ( $this->action == 'restore_tables' )
82
+ {
83
+ leadin_db_install();
84
+ wp_redirect(get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_stats&tables_restored=1');
85
+ exit;
86
+ }
87
+
88
  add_action('admin_footer', array($this, 'build_contacts_chart'));
89
  }
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
 
92
  function leadin_update_check ()
274
 
275
  add_menu_page('Leadin', 'Leadin', $capability, 'leadin_stats', array($this, 'leadin_build_stats_page'), $leadin_icon , '25.100713');
276
 
277
+ if ( count(leadin_check_tables_exist()) == 5 )
278
  {
279
+ foreach ( $this->admin_power_ups as $power_up )
280
  {
281
+ if ( $power_up->activated )
282
+ {
283
+ $power_up->admin_init();
284
 
285
+ // Creates the menu icon for power-up if it's set. Overrides the main Leadin menu to hit the contacts power-up
286
+ if ( $power_up->menu_text )
287
+ add_submenu_page('leadin_stats', $power_up->menu_text, $power_up->menu_text, $capability, 'leadin_' . $power_up->menu_link, array($power_up, 'power_up_setup_callback'));
288
+ }
289
  }
 
290
 
291
+ add_submenu_page('leadin_stats', 'Tags', 'Tags', $capability, 'leadin_tags', array(&$this, 'leadin_build_tag_page'));
292
+ add_submenu_page('leadin_stats', 'Settings', 'Settings', 'activate_plugins', 'leadin_settings', array(&$this, 'leadin_plugin_options'));
293
+ add_submenu_page('leadin_stats', 'Power-ups', 'Power-ups', 'activate_plugins', 'leadin_power_ups', array(&$this, 'leadin_power_ups_page'));
294
+
295
+ if ( ! leadin_check_pro_user() )
296
+ add_submenu_page('leadin_stats', 'Pro Upgrade', 'Pro Upgrade', 'activate_plugins', 'leadin_pro_upgrade', array(&$this, 'leadin_pro_upgrade_page'));
297
 
298
+ $submenu['leadin_stats'][0][0] = 'Stats';
299
 
300
+ if ( !isset($_GET['page']) || $_GET['page'] != 'leadin_settings' )
301
+ {
302
+ $options = get_option('leadin_options');
303
+ if ( !isset($options['ignore_settings_popup']) || !$options['ignore_settings_popup'] )
304
+ $li_pointers = new LI_Pointers();
305
+ }
306
  }
307
 
308
 
399
  function leadin_build_stats_page ()
400
  {
401
  global $wp_version;
 
 
 
402
 
403
+ if ( count(leadin_check_tables_exist()) == 5 )
404
+ {
405
+ $this->stats_dashboard = new LI_StatsDashboard();
406
+
407
+ echo '<div id="leadin" class="li-stats wrap '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
408
+
409
+ $this->leadin_header('Leadin Stats: ' . date('F j Y, g:ia', current_time('timestamp')), 'leadin-stats__header', 'Loaded Stats Page');
410
 
411
+ echo '<div class="leadin-stats__top-container">';
412
+ echo $this->leadin_postbox('leadin-stats__chart', leadin_single_plural_label(number_format($this->stats_dashboard->total_contacts_last_30_days), 'new contact', 'new contacts') . ' last 30 days', $this->leadin_build_contacts_chart_stats());
413
+ echo '</div>';
414
 
415
+ echo '<div class="leadin-stats__postbox_containter">';
416
+ echo $this->leadin_postbox('leadin-stats__new-contacts', leadin_single_plural_label(number_format($this->stats_dashboard->total_new_contacts), 'new contact', 'new contacts') . ' today', $this->leadin_build_new_contacts_postbox());
417
+ echo $this->leadin_postbox('leadin-stats__returning-contacts', leadin_single_plural_label(number_format($this->stats_dashboard->total_returning_contacts), 'returning contact', 'returning contacts') . ' today', $this->leadin_build_returning_contacts_postbox());
418
+ echo '</div>';
419
 
420
 
421
 
422
+ echo '<div class="leadin-stats__postbox_containter">';
423
+ echo $this->leadin_postbox('leadin-stats__sources', 'New contact sources last 30 days', $this->leadin_build_sources_postbox());
424
+ echo '</div>';
425
+ }
426
+ else
427
+ {
428
+ $this->leadin_header(' ', 'leadin-stats__header', 'Error - No Database Tables');
429
+
430
+ }
431
 
432
  $this->leadin_footer();
433
  }
611
 
612
 
613
  <?php
614
+
615
+ foreach ( $this->esp_power_ups as $power_up_name => $power_up_slug )
 
 
 
 
 
 
 
 
616
  {
617
  if ( WPLeadIn::is_power_up_active($power_up_slug) )
618
  {
619
  global ${'leadin_' . $power_up_slug . '_wp'}; // e.g leadin_mailchimp_connect_wp
620
  $esp_name = strtolower(str_replace('_connect', '', $power_up_slug)); // e.g. mailchimp
621
+
622
+ if ( ${'leadin_' . $power_up_slug . '_wp'}->admin->authed && ! ${'leadin_' . $power_up_slug . '_wp'}->admin->invalid_key )
623
+ $lists = ${'leadin_' . $power_up_slug . '_wp'}->admin->li_get_lists();
624
+
625
  $synced_lists = ( isset($tagger->details->tag_synced_lists) ? unserialize($tagger->details->tag_synced_lists) : '' );
626
 
627
  echo '<tr>';
679
  echo 'It looks like you haven\'t set up your ' . $esp_name_readable . ' integration yet...<br/><br/>';
680
  echo '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_settings' . $settings_page_anchor_id . '">Set up your ' . $esp_name_readable . ' integration</a>';
681
  }
682
+ else if ( isset(${'leadin_' . $power_up_slug . '_wp'}->admin->invalid_key) && ${'leadin_' . $power_up_slug . '_wp'}->admin->invalid_key )
683
  {
684
  echo $invalid_key_message;
685
  echo '<p>' . $invalid_key_link . ' then try copying and pasting it again in <a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_settings' . $settings_page_anchor_id . '">Leadin → Settings</a></p>';
976
  function leadin_build_settings_page ()
977
  {
978
  global $leadin_contacts;
 
 
 
 
979
 
980
  // Show the settings popup on all pages except the settings page
981
  if ( isset($_GET['page']) && $_GET['page'] == 'leadin_settings' )
1031
  2
1032
  );
1033
 
1034
+ $this->esp_power_ups = array(
1035
+ 'MailChimp' => 'mailchimp_connect',
1036
+ 'Constant Contact' => 'constant_contact_connect',
1037
+ 'AWeber' => 'aweber_connect',
1038
+ 'GetResponse' => 'getresponse_connect',
1039
+ 'MailPoet' => 'mailpoet_connect',
1040
+ 'Campaign Monitor' => 'campaign_monitor_connect'
1041
+ );
1042
  }
1043
 
1044
  function leadin_options_section_heading ( )
1045
  {
1046
  $this->print_hidden_settings_fields();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1047
  }
1048
 
1049
  function print_hidden_settings_fields ()
1140
 
1141
  function update_option_leadin_options_callback ( $old_value, $new_value )
1142
  {
1143
+
1144
  }
1145
 
1146
  /**
1151
  $li_options = get_option('leadin_options');
1152
 
1153
  // Load onboarding if not complete
1154
+ if ( $li_options['onboarding_complete'] == 0 )
1155
+ {
1156
  $this->leadin_plugin_onboarding();
1157
+ wp_register_script('leadin-admin-js', LEADIN_PATH . '/assets/js/build/leadin-admin.min.js', array ( 'jquery' ), FALSE, TRUE);
1158
+ wp_enqueue_script('leadin-admin-js');
1159
+ wp_localize_script('leadin-admin-js', 'li_admin_ajax', array('ajax_url' => get_admin_url(NULL,'') . '/admin-ajax.php'));
1160
  }
1161
+ else
1162
+ {
1163
  $this->leadin_plugin_settings();
1164
  }
1165
  }
1173
 
1174
  $li_options = get_option('leadin_options');
1175
 
1176
+ echo '<div id="leadin" class="li-onboarding wrap centered'. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
 
1177
 
1178
  ?>
1179
 
1180
+ <div class="oboarding-steps">
1181
 
1182
+ <img src="<?php echo LEADIN_PATH . '/images/leadin_logo.png' ; ?>" width="147px">
1183
+
1184
+ <?php if ( $li_options['onboarding_step'] <= 1 ) : ?>
1185
+
1186
+ <?php $this->leadin_header('You\'re 3 steps away from understanding your visitors better.' , 'li_setup_header', 'Onboarding Step 2 - Get Contact Reports'); ?>
1187
+
1188
+ <ol class="oboarding-steps-names">
1189
+ <li class="oboarding-step-name completed">Activate Leadin</li>
1190
+ <li class="oboarding-step-name active">Get Contact Reports</li>
1191
+ <li class="oboarding-step-name">Grow Your Contacts List</li>
1192
+ <li class="oboarding-step-name">Email your new contacts</li>
1193
+ </ol>
1194
+ <div class="oboarding-step">
1195
+ <h2 class="oboarding-step-title">Where should we send your contact reports?</h2>
1196
+ <div class="oboarding-step-content">
1197
+ <p class="oboarding-step-description">Leadin will help you get to know your website visitors by sending you a report including traffic source and pageview history each time a visitor fills out a form.</p>
1198
+ <form id="li-onboarding-form" method="post" action="options.php">
1199
+ <div>
1200
+ <?php settings_fields('leadin_settings_options'); ?>
1201
+ <?php $this->li_email_callback(); ?>
1202
+ </div>
1203
+ <?php $this->print_hidden_settings_fields(); ?>
1204
+
1205
+ <p id="agree-pp-error" style="display: none; border-left: 4px solid #dd3d36; padding: 8px 12px; margin-bottom: 25px; background: #fff;">
1206
+ Before you can unlock the awesomeness of Leadin , we need you to agree to our Privacy Policy, you know... because lawyers.
1207
+ </p>
1208
+
1209
+ <p>
1210
+ <label for="agree-pp">
1211
+ <input type="checkbox" id="agree-pp" name="agree-pp"/>
1212
+ I agree to Leadin's <a href="http://leadin.com/legal/privacy-policy" target="_blank">Privacy Policy</a>
1213
+ </label>
1214
+ </p>
1215
+
1216
+ <input type="submit" name="submit" id="onboarding-step-1-button" class="button button-primary button-big" style="margin-top: 15px;" value="<?php esc_attr_e('Save Email'); ?>">
1217
+ </form>
1218
  </div>
1219
  </div>
1220
  <!-- Facebook Conversion Code for Installed plugin -->
1234
  </script>
1235
  <noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6024677413664&amp;cd[value]=0.00&amp;cd[currency]=USD&amp;noscript=1" /></noscript>
1236
 
1237
+ <?php elseif ( $li_options['onboarding_step'] == 2 && !isset($_GET['activate_popup']) && !isset($_GET['activate_esp']) ) : ?>
1238
 
1239
+ <?php
1240
+ // Upgrade to Pro in the database
1241
+ leadin_upgrade_to_pro('onboarding');
1242
+ ?>
1243
 
1244
+ <?php $this->leadin_header('You\'re 2 steps away from understanding your visitors better.', 'li_setup_header', 'Onboarding Step 3 - Grow Your Contact List'); ?>
1245
+
1246
+ <ol class="oboarding-steps-names">
1247
+ <li class="oboarding-step-name completed">Activate Leadin</li>
1248
+ <li class="oboarding-step-name completed">Get Contact Reports</li>
1249
+ <li class="oboarding-step-name active">Grow Your Contacts List</li>
1250
+ <li class="oboarding-step-name">Email your new contacts</li>
1251
+ </ol>
1252
+ <div class="oboarding-step">
1253
+ <h2 class="oboarding-step-title">Grow your contacts list with our popup form</h2>
1254
+ <div class="oboarding-step-content">
1255
+ <p class="oboarding-step-description">Start converting more visitors to contacts on <?php echo get_bloginfo('wpurl') ?>. Don't worry, you'll be able to customize this form more later.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1256
  </div>
1257
+ <form id="li-onboarding-form" method="post" action="options.php">
1258
+ <?php $this->print_hidden_settings_fields(); ?>
1259
+ <div class="popup-options">
1260
+ <label class="popup-option">
1261
+ <input type="radio" name="popup-position" value="slide_in" checked="checked" >Slide in
1262
+ <img src="<?php echo LEADIN_PATH ?>/images/popup-bottom.png">
1263
+ </label>
1264
+ <label class="popup-option">
1265
+ <input type="radio" name="popup-position" value="popup">Popup
1266
+ <img src="<?php echo LEADIN_PATH ?>/images/popup-over.png">
1267
+ </label>
1268
+ <label class="popup-option">
1269
+ <input type="radio" name="popup-position" value="top">Top
1270
+ <img src="<?php echo LEADIN_PATH ?>/images/popup-top.png">
1271
+ </label>
1272
+ </div>
1273
+ <a id="btn-activate-subscribe" href="<?php echo get_admin_url() .'admin.php?page=leadin_settings&leadin_action=activate&power_up=subscribe_widget&redirect_to=' . get_admin_url() . urlencode('admin.php?page=leadin_settings&activate_popup=true&popup_position=slide_in'); ?>" class="button button-primary button-big"><?php esc_attr_e('Activate the popup form');?></a>
1274
+ <p><a href="<?php echo get_admin_url() .'admin.php?page=leadin_settings&activate_popup=false'; ?>">Don't activate the popup form right now</a></p>
1275
+ </form>
1276
  </div>
1277
 
1278
+ <?php elseif ( isset($_GET['activate_popup']) && !isset($_GET['activate_esp']) ) : ?>
1279
+
1280
+ <?php
1281
+ // Set the popup position based on get URL
1282
+ if ( isset($_GET['activate_popup']) ) {
1283
+ if ( isset($_GET['popup_position']) ) {
1284
+ $vex_class_option = '';
1285
+ switch ( $_GET['popup_position'] ) {
1286
+ case 'slide_in' :
1287
+ $vex_class_option = 'vex-theme-bottom-right-corner';
1288
+ break;
1289
+
1290
+ case 'popup' :
1291
+ $vex_class_option = 'vex-theme-default';
1292
+ break;
1293
+
1294
+ case 'top' :
1295
+ $vex_class_option = 'vex-theme-top';
1296
+ break;
1297
+ }
1298
 
1299
+ leadin_update_option('leadin_subscribe_options', 'li_subscribe_vex_class', $vex_class_option);
1300
+ leadin_track_plugin_activity('Onboarding Popup Activated');
1301
+ }
1302
+ else {
1303
+ leadin_track_plugin_activity('Onboarding Popup Not Activated');
1304
+ }
1305
  }
1306
+
1307
+ ?>
1308
+
1309
+ <?php $this->leadin_header('You\'re 1 step away from understanding your visitors better.', 'li_setup_header', 'Onboarding Step 4 - Email your contacts'); ?>
1310
+
1311
+ <ol class="oboarding-steps-names">
1312
+ <li class="oboarding-step-name completed">Activate Leadin</li>
1313
+ <li class="oboarding-step-name completed">Get Contact Reports</li>
1314
+ <li class="oboarding-step-name completed">Grow Your Contacts List</li>
1315
+ <li class="oboarding-step-name active">Email your new contacts</li>
1316
+ </ol>
1317
+ <div class="oboarding-step">
1318
+ <h2 class="oboarding-step-title">Which email provider do you use?</h2>
1319
+ <div class="oboarding-step-content">
1320
+ <p class="oboarding-step-description">Leadin works best when connected to an email provider. Don’t worry, we won’t start syncing contacts until we get your account details later.</p>
1321
+ </div>
1322
+ <form id="li-onboarding-form" method="post" action="options.php">
1323
+ <?php $this->print_hidden_settings_fields(); ?>
1324
+ <div class="popup-options">
1325
+ <label class="esp-option">
1326
+ <input type="radio" name="esp" value="mailchimp_connect" checked="checked" ><span class="esp-name mailchimp">MailChimp</span>
1327
+ </label>
1328
+ <label class="esp-option">
1329
+ <input type="radio" name="esp" value="constant_contact_connect"><span class="esp-name constant-contact">Constant Contact</span>
1330
+ </label>
1331
+ <label class="esp-option">
1332
+ <input type="radio" name="esp" value="aweber_connect"><span class="esp-name aweber">Aweber</span>
1333
+ </label>
1334
+ <label class="esp-option">
1335
+ <input type="radio" name="esp" value="getresponse_connect"><span class="esp-name getresponse">GetResponse</span>
1336
+ </label>
1337
+ <label class="esp-option">
1338
+ <input type="radio" name="esp" value="campaign_monitor_connect"><span class="esp-name campaign-monitor">CampaignMonitor</span>
1339
+ </label>
1340
+ </div>
1341
+ <a id="btn-activate-esp" href="<?php echo get_admin_url() .'admin.php?page=leadin_settings&leadin_action=activate&power_up=mailchimp_connect&redirect_to=' . get_admin_url() . urlencode('admin.php?page=leadin_settings&activate_esp=true&esp=mailchimp'); ?>" class="button button-primary button-big"><?php esc_attr_e('Select your email tool');?></a>
1342
+ <p><a href="<?php echo get_admin_url() .'admin.php?page=leadin_settings&activate_esp=false'; ?>">Don't connect an email provider right now</a></p>
1343
+ </form>
1344
+ </div>
1345
 
1346
+ <?php elseif ( isset($_GET['activate_esp']) ) : ?>
 
 
 
 
1347
 
1348
+ <?php leadin_update_option('leadin_options', 'onboarding_complete', 1); ?>
1349
+
1350
+ <?php $this->leadin_header('Setup Complete!', 'li_setup_header', 'Onboarding Complete'); ?>
 
 
 
 
 
1351
 
 
1352
  <ol class="oboarding-steps-names">
1353
  <li class="oboarding-step-name completed">Activate Leadin</li>
1354
  <li class="oboarding-step-name completed">Get Contact Reports</li>
1355
  <li class="oboarding-step-name completed">Grow Your Contacts List</li>
1356
+ <li class="oboarding-step-name completed">Email your new contacts</li>
1357
  </ol>
1358
  <div class="oboarding-step">
1359
+ <h2 class="oboarding-step-title">Leadin is waiting for your first form submission.</h2>
1360
  <div class="oboarding-step-content">
1361
  <p class="oboarding-step-description">Leadin is set up and waiting for a form submission. Once Leadin detects a form submission, a new contact will be added to your contacts list. We recommend filling out a form on your site to test that Leadin is working correctly.</p>
1362
  <form id="li-onboarding-form" method="post" action="options.php">
1365
  </form>
1366
  </div>
1367
  </div>
 
1368
 
1369
+ <?php endif; ?>
1370
+
1371
+ </div><!--/oboarding-steps -->
1372
+
1373
+ </div><!--/wrap -->
1374
 
1375
  <?php
1376
 
 
 
 
 
1377
  }
1378
 
1379
  /**
1751
  */
1752
  function leadin_header ( $page_title = '', $css_class = '', $event_name = '' )
1753
  {
1754
+ $li_options = get_option('leadin_options');
1755
+
1756
+ // if database doesn't exist then don't
1757
+ if ( $event_name != 'Error - No Database Tables' )
1758
+ $leadin_user = leadin_get_current_user();
1759
  ?>
1760
 
1761
  <?php if ( leadin_check_pro_user() ) : ?>
1770
  "wp-version" : "<?php echo $leadin_user['wp_version']; ?>",
1771
  "li-version" : "<?php echo $leadin_user['li_version']; ?>",
1772
  "li-source" : "<?php echo LEADIN_SOURCE; ?>",
 
1773
  "website" : "<?php echo $leadin_user['wp_url']; ?>",
1774
  "company" : "<?php echo $leadin_user['wp_url']; ?>",
 
1775
  "utm_source" : "<?php echo $leadin_user['utm_source']; ?>",
1776
  "utm_medium" : "<?php echo $leadin_user['utm_medium']; ?>",
1777
  "utm_term" : "<?php echo $leadin_user['utm_term']; ?>",
1795
  }}();
1796
  </script>
1797
  <?php endif; ?>
1798
+
1799
+ <?php if ( $page_title ) : ?>
1800
+ <?php screen_icon('leadin'); ?>
1801
+ <h2 class="<?php echo $css_class ?>"><?php echo $page_title; ?></h2>
1802
+ <?php endif; ?>
1803
 
1804
+ <?php if ( isset($_GET['tables_restored']) && $_GET['tables_restored'] ) : ?>
1805
+ <div id="message" class="updated">
1806
+ <p>Your Leadin database tables were successfully restored and the product should start working correctly again.</p>
1807
+ </div>
1808
+ <?php endif; ?>
1809
 
1810
+ <?php if ( $event_name != 'Error - No Database Tables' ) : ?>
1811
+ <?php if ( $li_options['onboarding_complete'] ) : ?>
1812
 
1813
+ <?php if ( isset($_GET['settings-updated']) ) : ?>
1814
+ <div id="message" class="updated">
1815
+ <p><strong><?php _e('Settings saved.') ?></strong></p>
1816
+ </div>
1817
+
1818
+ <?php
1819
+ foreach ( $this->esp_power_ups as $power_up_name => $power_up_slug )
1820
+ {
1821
+ if ( WPLeadIn::is_power_up_active($power_up_slug) )
1822
+ {
1823
+ global ${'leadin_' . $power_up_slug . '_wp'}; // e.g leadin_mailchimp_connect_wp
1824
+ $esp_name = strtolower(str_replace('_connect', '', $power_up_slug)); // e.g. mailchimp
1825
+
1826
+ if ( ${'leadin_' . $power_up_slug . '_wp'}->admin->invalid_key )
1827
+ {
1828
+ echo '<div id="message" class="error">';
1829
+ echo '<p>' . 'Your ' . $power_up_name . ' key seems to not be correct.' . '</p>';
1830
+ echo '</div>';
1831
+ }
1832
+ }
1833
+ }
1834
+ ?>
1835
+ <?php elseif ( $this->has_leads() == FALSE ) : ?>
1836
+ <div id="message" class="updated">
1837
+ <p>Leadin is set up and waiting for a form submission... Need help? <a href="http://wordpress.org/support/plugin/leadin">Contact Us</a>.</p>
1838
+ </div>
1839
+ <?php elseif ( !leadin_check_pro_user() ) : ?>
1840
+ <div id="message" class="updated">
1841
+ <p>Did you know that Leadin Pro is a free upgrade with even more feaures? <a href="<?php echo admin_url(); ?>admin.php?page=leadin_pro_upgrade">Learn more</a>.</p>
1842
+ </div>
1843
+ <?php endif; ?>
1844
  <?php endif; ?>
1845
+ <?php else : ?>
1846
+ <div style="border-left: 4px solid #dd3d36; padding: 12px; margin-bottom: 25px; background: #fff;">
1847
+ <h3><b>Your Leadin database tables are missing</b></h3>
1848
+ <p>
1849
+ The usual cause of this problem is that occasionally backup plugins drop the database tables created by Leadin which breaks your install and deletes your data.
1850
 
1851
+ Unfortunately we can't restore the data for you because we don't have access to your WordPress server.<br/><br/>
1852
 
1853
+ Sorry about the issue... we know this is a big bummer, so we actually built a version of Leadin that stores your data in our <b>securely encrypted, regularly backed-up servers</b> so you're guaranteed to <b>never lose your data again</b>. <br><br>To sweeten the deal for you, Leadin Cloud is 100% free to use.
1854
+
1855
+ <p><a href="http://leadin.com" target="_blank" class="button button-primary">Sign up for Leadin Cloud for Free</a></p>
1856
+ <p>You can also recreate the missing tables in your MySQL database if you'd prefer to store your data on your own server - <a href="<?php echo get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_stats&action=restore_tables'; ?>">Click here to restore the default Leadin tables</a></p>
1857
+ </p>
1858
  </div>
1859
  <?php endif; ?>
1860
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1861
  <?php
1862
  }
1863
 
1865
  {
1866
  $li_options = get_option('leadin_options');
1867
  global $wp_version;
 
1868
 
1869
  ?>
1870
  <div id="leadin-footer">
1876
  </p>
1877
 
1878
  <p class="sharing"><a href="https://twitter.com/leadinapp" class="twitter-follow-button" data-show-count="false">Follow @leadinapp</a><p>
 
1879
  </div>
1880
 
1881
  <?php
assets/css/build/leadin-admin.css CHANGED
@@ -1 +1 @@
1
- #leadin label{cursor:default}#leadin .col-wrap{padding:0}#leadin .col-left .col-wrap{padding-right:10px}#leadin .metabox-holder{*zoom:1}#leadin .metabox-holder:after{content:"";display:table;clear:both}#wp-admin-bar-leadin-admin-menu img{height:16px;width:16px;opacity:0.6}@media (min-width: 1200px){#leadin{*zoom:1;max-width:1420px;max-width:88.75rem;padding-left:20px;padding-left:1.25rem;padding-right:20px;padding-right:1.25rem;margin-left:auto;margin-right:auto;margin:10px 20px 0 0;padding:0}#leadin:after{content:"";display:table;clear:both}#leadin *{box-sizing:border-box}}#li_analytics-meta .li-analytics-link{float:left}#li_analytics-meta .li-analytics-link .li-analytics__face{height:35px;width:35px;margin-right:5px;margin-bottom:5px}#li_analytics-meta .hidden_face{display:none}#li_analytics-meta .show-all-faces-container{clear:both}.leadin-postbox,#leadin .leadin-meta-section,.powerup-list .powerup{background-color:#fff;border:1px solid #e5e5e5;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}.leadin-postbox__header,#leadin .leain-meta-header{margin:0;padding:18px 18px 0;font-size:13px;text-transform:uppercase;letter-spacing:0.05em;color:#444}.leadin-postbox__content{padding:18px;*zoom:1}.leadin-postbox__content:after{content:"";display:table;clear:both}.leadin-postbox__table{margin:0;width:100%}.leadin-postbox__table th{padding:6px 0;text-align:left;text-transform:uppercase;letter-spacing:0.05em;color:#999;font-weight:400;font-size:12px}.leadin-postbox__table td{padding:6px 0}.leadin-postbox__table td.sources-contacts-num{text-align:right;padding-right:20px}.leadin-postbox__table tr,.leadin-postbox__table td,.leadin-postbox__table th{vertical-align:middle !important}.leadin-dynamic-avatar_0{background-color:#F88E4B}.leadin-dynamic-avatar_1{background-color:#64AADA}.leadin-dynamic-avatar_2{background-color:#64C2B6}.leadin-dynamic-avatar_3{background-color:#CF7BAA}.leadin-dynamic-avatar_4{background-color:#E7C24B}.leadin-dynamic-avatar_5{background-color:#9387DA}.leadin-dynamic-avatar_6{background-color:#D6DD99}.leadin-dynamic-avatar_7{background-color:#FF4C4C}.leadin-dynamic-avatar_8{background-color:#99583D}.leadin-dynamic-avatar_9{background-color:#54CC14}@font-face{font-family:"icomoon";src:url("../../fonts/icomoon.eot?-lejfm6");src:url("../../fonts/icomoon.eot?#iefix-lejfm6") format("embedded-opentype"),url("../../fonts/icomoon.woff?-lejfm6") format("woff"),url("../../fonts/icomoon.ttf?-lejfm6") format("truetype"),url("../../fonts/icomoon.svg?-lejfm6#icomoon") format("svg");font-weight:normal;font-style:normal}.icon,.icon-profile,.icon-tag,.icon-tags,.icon-envelope,.icon-envelope-alt,.icon-email,.icon-user,.icon-cog,.icon-bars,.icon-lab,.icon-bulb,.icon-mover,.icon-leadin-logo,.icon-facebook,.icon-twitter,.icon-wordpress,.icon-linkedin,.icon-google-plus{font-family:"icomoon";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-leadin-logo:before{content:""}.icon-profile:before{content:""}.icon-tag:before{content:""}.icon-email:before{content:""}.icon-user:before{content:""}.icon-cog:before{content:""}.icon-bars:before{content:""}.icon-lab:before{content:""}.icon-bulb:before{content:""}.icon-tags:before{content:""}.icon-mover:before{content:""}.icon-twitter:before{content:""}.icon-linkedin:before{content:""}.icon-facebook:before{content:""}.icon-wordpress:before{content:""}.icon-google-plus:before{content:""}.icon-envelope-alt:before{content:""}.icon-envelope:before{content:""}#leadin-footer{*zoom:1;clear:both;margin-top:48px;color:#999;border-top:1px solid #dedede}#leadin-footer:after{content:"";display:table;clear:both}#leadin-footer .support .sharing{height:18px;text-align:left}@media screen and (min-width: 500px){#leadin-footer .support,#leadin-footer .version,#leadin-footer .sharing{width:50%;float:left}#leadin-footer .sharing{text-align:right}}.button-big{padding:6px 36px !important;font-size:14px !important;height:auto !important}.oboarding-steps-names{*zoom:1;margin:0}.oboarding-steps-names:after{content:"";display:table;clear:both}.oboarding-step-name{float:left;margin:0;padding-bottom:24px;list-style:decimal inside none;font-size:18px;color:#bbb}.oboarding-step-name.active{color:#1F7D71;background-image:url(../../../images/triangle.png);background-position:bottom center;background-repeat:no-repeat}.oboarding-step-name.completed{list-style-image:url(../../../images/checkmark.png)}.oboarding-step-name+.oboarding-step-name{margin-left:72px}.oboarding-steps{margin:18px 0}@media (min-width: 1200px){.oboarding-steps{width:66.19718%;float:left;margin-right:1.40845%}}.oboarding-step-content{margin:0 auto;max-width:500px}.oboarding-step-content .description{margin:12px 0;display:block;display:none}.oboarding-step{text-align:center;display:block;padding:36px;background-color:#D3EEEB;border:2px solid #2a9;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;color:#1F7D71}.oboarding-step .form-table th{display:none}.oboarding-step .form-table td{width:auto;display:block}.oboarding-step .form-table input{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block}.oboarding-step .oboarding-step-title,.oboarding-step .oboarding-step-description{color:#1F7D71;padding:0;margin-bottom:36px}.oboarding-step .button-primary{margin-top:36px}.oboarding-step .oboarding-step-description{font-size:16px;text-align:left}.oboarding-step .popup-option{width:31%;float:left;text-align:left;cursor:pointer !important}.oboarding-step .popup-option img{max-width:100%;margin-top:6px;-moz-box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.oboarding-step .popup-option:hover img{-moz-box-shadow:0 2px 4px rgba(0,0,0,0.25);-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.25);box-shadow:0 2px 4px rgba(0,0,0,0.25)}.oboarding-step .popup-option input{margin-right:8px !important}.oboarding-step .popup-option input:checked ~ img{border:2px solid #2ea2cc}.oboarding-step .popup-option+.popup-option{margin-left:3%}.oboarding-step .popup-options{*zoom:1}.oboarding-step .popup-options:after{content:"";display:table;clear:both}.oboarding-steps-help{margin-top:24px;color:#999}@media (min-width: 1200px){.oboarding-steps-help{width:15.49296%;float:left;margin-right:1.40845%;margin-top:60px}}@media (min-width: 1200px){.leadin-settings__content{width:74.64789%;float:left;margin-right:1.40845%}.leadin-settings__sidebar{width:23.94366%;float:right;margin-right:0}}.li-settings h3{border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;margin-bottom:0px;background:#fff;padding:8px 12px;font-size:15px}.li-settings .form-table{margin-top:0px;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}.li-settings .form-table th{padding-left:12px}.li-settings .leadin-section{background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;font-size:14px;padding:15px 12px 5px 12px}.li-settings .leadin-section p{margin:0;padding:0}.li-settings .power-up-settings-icon{padding-right:10px;float:left;max-height:20px;margin-top:-1px}.li-settings .dashicons{margin-right:10px;float:left;margin-top:-1px}.li-settings tr.synced-list-row td.synced-list-cell{padding:3px 0px 10px 0px}.li-settings tr.synced-list-row td.synced-list-cell .icon-tag{font-size:12px}.li-settings tr.synced-list-row span.synced-list-arrow{padding:0px 10px}.li-settings tr.synced-list-row td.synced-list-edit{padding:3px 0px 10px 20px}.li-settings.pre-mp6 h3{font-family:Georgia}.li-settings.pre-mp6 select,.li-settings.pre-mp6 input{font-family:sans-serif;font-size:12px}.li-settings.pre-mp6 .form-table,.li-settings.pre-mp6 .leadin-section,.li-settings.pre-mp6 h3{background-color:#f9f9f9 !important}.li-settings.pre-mp6 .form-table{-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.li-settings.pre-mp6 h3{background-color:#f9f9f9 !important;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.li-settings.pre-mp6 .leadin-section{font-size:12px;padding-left:6px}.li-settings.pre-mp6 h3{padding-left:6px;font-weight:normal;color:#464646;text-shadow:#fff 0px 1px 0px}.li-settings.pre-mp6 label{font-size:12px}.li-settings.pre-mp6 input[type="checkbox"],.li-settings.pre-mp6 input[type="radio"]{margin-right:2px}.li-settings .color-swatch:before{content:"";height:19px;width:19px;vertical-align:top;margin:0 8px;display:inline-block}.li-settings .color-swatch.blue:before{background-color:#3288e6}.li-settings .color-swatch.red:before{background-color:#E43833}.li-settings .color-swatch.green:before{background-color:#7ED321}.li-settings .color-swatch.yellow:before{background-color:#FFBC00}.li-settings .color-swatch.purple:before{background-color:#BD10E0}.li-settings .color-swatch.orange:before{background-color:#FF8311}#icon-leadin{background:url("../../images/leadin-icon-32x32.png") top center no-repeat}.help-notification{background:#d9edf7;border:1px solid #bce8f1;padding:10px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.leadin-contact-avatar{margin-right:10px;float:left}.power-up-settings-icon{padding-right:10px;float:left;max-height:20px;margin-top:-1px}.dashicons{margin-right:10px;float:left;margin-top:-1px}tr.synced-list-row td.synced-list-cell{padding:3px 0px 10px 0px}tr.synced-list-row td.synced-list-cell .icon-tag{font-size:12px}tr.synced-list-row span.synced-list-arrow{padding:0px 10px}tr.synced-list-row td.synced-list-edit{padding:3px 0px 10px 20px}.leadin-settings__sidebar .pro-upgrade-cta{max-width:100%}.leadin-contacts .button{transition:background-color 0.2s}@media (min-width: 1200px){.leadin-contacts__nav{margin-top:30px;width:15.49296%;float:left;margin-right:1.40845%;margin-top:30px}.leadin-contacts__content{width:83.09859%;float:right;margin-right:0;margin-top:30px;margin-bottom:18px;margin-top:30px}.leadin-contacts__export-form{width:83.09859%;float:left;margin-right:1.40845%;padding-left:16.90141%;margin-bottom:18px}}.leadin-contacts__search{float:right;padding:10px 0;padding-bottom:9px}.leadin-contacts__type-picker{margin:0 0 30px;*zoom:1}.leadin-contacts__type-picker:after{content:"";display:table;clear:both}.leadin-contacts__type-picker li{margin:0;padding:0 1em 0 0;float:left}@media (min-width: 1200px){.leadin-contacts__type-picker li{float:none;padding:0}.leadin-contacts__type-picker li+li{padding:18px 0 0}}.leadin-contacts__type-picker li a{display:block;line-height:24px;font-weight:400;font-size:16px;text-decoration:none}.leadin-contacts__type-picker li a.current{font-weight:bold}.leadin-contacts__type-picker li a.current,.leadin-contacts__type-picker li a:hover,.leadin-contacts__type-picker li a:active{color:#F67D42}.leadin-contacts__type-picker li a .icon-tag,.leadin-contacts__type-picker li a .icon-user{padding-right:1em;font-size:0.85em}.leadin-contacts__tags-header{margin:30px 0 18px;font-size:14px;text-transform:uppercase;letter-spacing:0.1em;color:#999}.leadin-contacts__filter-text{margin:0 0 18px}.leadin-contacts__filter-count{color:#F67D42}#clear-filter{font-size:0.8em;margin-left:10px}.leadin-contacts__table table th#source{width:20%}.leadin-contacts__table table th#visits,.leadin-contacts__table table th#submissions{width:8%}.leadin-contacts__table table th#status,.leadin-contacts__table table th#last_visit,.leadin-contacts__table table th#date,.leadin-contacts__table table th#pageviews{width:10%}.leadin-contacts__table table th,.leadin-contacts__table table td{display:none}.leadin-contacts__table table th:nth-child(-n+3),.leadin-contacts__table table td:nth-child(-n+3){display:table-cell}@media (min-width: 1200px){.leadin-contacts__table table th,.leadin-contacts__table table td{display:table-cell}}.leadin-contacts.pre-mp6 .table_search{float:right;padding:12px 0;padding-bottom:11px}.leadin-contacts.pre-mp6 table{background-color:#fff;border-color:#dedede}.leadin-contacts.pre-mp6 table tr.alternate{background-color:#fff}.leadin-contacts.pre-mp6 table th,.leadin-contacts.pre-mp6 table td{border-top:0;padding:12px 6px 11px}.leadin-contacts.pre-mp6 table th a,.leadin-contacts.pre-mp6 table td a{padding:0}.leadin-contacts.pre-mp6 table th[scope="col"]{background:#eee;font-family:sans-serif;font-size:12px;text-shadow:none}.leadin-contacts.pre-mp6 table td{border-color:#dedede;line-height:18px;font-size:14px}.leadin-contacts.pre-mp6 table td .row-actions{float:left}#leadin .contact-top-navigation,#leadin .contact-deatils-column,#leadin .contact-timeline-column{width:100%;float:right;margin-right:0;*margin-left:-20px;display:inline;margin-bottom:12px}@media (min-width: 1200px){#leadin .contact-deatils-column{width:32.39437%;float:left;margin-right:1.40845%}#leadin .contact-timeline-column{width:66.19718%;float:right;margin-right:0}}#leadin .contact-header-wrap{*zoom:1;padding:18px 0 24px}#leadin .contact-header-wrap:after{content:"";display:table;clear:both}#leadin .contact-header-avatar,#leadin .contact-header-info{float:left}#leadin .contact-header-info{padding-left:15px}#leadin .contact-name{line-height:30px;padding:0;margin:0}#leadin .contact-networks{margin-top:12px}#leadin .contact-networks .icon-linkedin,#leadin .contact-networks .icon-facebook,#leadin .contact-networks .icon-twitter,#leadin .contact-networks .icon-googleplus,#leadin .contact-networks .icon-envelope{height:25px;width:25px;font-size:25px;margin-right:10px;color:#999;text-decoration:none}#leadin .contact-networks .icon-linkedin:hover,#leadin .contact-networks .icon-facebook:hover,#leadin .contact-networks .icon-twitter:hover,#leadin .contact-networks .icon-googleplus:hover,#leadin .contact-networks .icon-envelope:hover{color:#666}#leadin .contact-tag{display:inline-block;padding:3px 10px;color:#999;text-decoration:none;font-weight:600;font-size:13px;border:1px solid #ccc;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}#leadin .contact-tag:hover{opacity:0.75}#leadin .contact-tag+.contact-tag{margin-left:10px}#leadin .contact-edit-tags{text-decoration:none;text-transform:none;letter-spacing:0;font-weight:400}#leadin .contact-info h3{margin:0}#leadin .contact-info label{font-weight:bold;line-height:1;cursor:default}#leadin .leadin-meta-section{margin-bottom:12px}#leadin .leadin-meta-table{width:100%;text-align:left}#leadin .leadin-meta-table th{color:#666;padding-bottom:6px}#leadin .leadin-premium-tag:after{content:"Pro";margin-left:10px;font-size:10px;color:#fff;background-color:#93C054;padding:2px 6px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#leadin .contact-history{margin-left:20px}@media (min-width: 1200px){#leadin .contact-history{padding-left:20px;border-left:2px solid #dedede}}#leadin .contact-history .sessions{margin:0}#leadin .contact-history .session+.session{margin-top:24px}#leadin .contact-history .session-date{position:relative}@media (min-width: 1200px){#leadin .contact-history .session-date:before{content:"•";font-size:32px;line-height:0;height:31px;width:31px;position:absolute;left:-27px;top:9px;color:#dedede}}#leadin .contact-history .session-time-range{color:#999;font-weight:400}#leadin .contact-history .events{background-color:#fff;border:1px solid #dedede;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}#leadin .contact-history .event{margin:0;padding:10px 20px;border-bottom:1px solid #dedede;border-left:4px solid;*zoom:1}#leadin .contact-history .event:after{content:"";display:table;clear:both}#leadin .contact-history .event:first-child{border-top:0}#leadin .contact-history .event.pageview{border-left-color:#28c;color:#28c}#leadin .contact-history .event.form-submission{border-left-color:#F67D42;color:#F67D42}#leadin .contact-history .event.source{border-left-color:#99AA1F;color:#99AA1F}#leadin .contact-history .event-title{margin:0;font-size:13px;font-weight:600}#leadin .contact-history .event-time{float:left;font-weight:400;width:75px}#leadin .contact-history .event-content{margin-left:75px}#leadin .contact-history .event-detail{margin-top:20px;color:#444}#leadin .contact-history .event-detail li+li{padding-top:6px;border-top:1px solid #eee}#leadin .contact-history .event-detail.pageview-url{color:#ccc}#leadin .contact-history .visit-source p{margin:0;color:#1F6696}#leadin .contact-history .field-label{text-transform:uppercase;letter-spacing:0.05em;color:#999;margin-bottom:6px;font-size:0.9em}#leadin .contact-history .field-value{margin:0}#leadin.pre-mp6 .events{background-color:#f9f9f9}.powerup-list{margin:0}.powerup-list .powerup{width:20%;min-width:250px;float:left;margin:20px;padding:15px}.powerup-list .powerup h2,.powerup-list .powerup p{margin:0;padding:0;color:#666;margin-bottom:15px}.powerup-list .powerup .img-containter{text-align:center;padding:30px 15px;margin-bottom:15px;background-color:#f1f1f1;color:red}.powerup-list .powerup .img-containter h2{font-size:20px}.powerup-list .powerup.activated h2,.powerup-list .powerup.activated p{color:#1F7D71}.powerup-list .powerup.activated .img-containter{background-color:#D3EEEB}@media (min-width: 1200px){.leadin-stats__top-container,.leadin-stats__chart-container,.leadin-stats__big-numbers-container{width:100%;float:right;margin-right:0}.leadin-stats__postbox_containter{width:49.29577%;float:left;margin-right:1.40845%}.leadin-stats__postbox_containter:nth-child(2n+2){width:49.29577%;float:right;margin-right:0}}h2.leadin-stats__header{margin-bottom:12px}.leadin-stats__postbox_containter .leadin-postbox,.leadin-stats__postbox_containter #leadin .leadin-meta-section,#leadin .leadin-stats__postbox_containter .leadin-meta-section,.leadin-stats__postbox_containter .powerup-list .powerup,.powerup-list .leadin-stats__postbox_containter .powerup{margin-bottom:12px}.leadin-stats__big-number{text-align:center;width:42%;float:left;padding:4%}@media (min-width: 1200px){.leadin-stats__big-number{width:25%;padding:10px}}.big-number--average .leadin-stats__big-number-top-label,.big-number--average .leadin-stats__big-number-content,.big-number--average .leadin-stats__big-number-bottom-label{color:#4CA6CF}.leadin-stats__top-container,.leadin-stats__big-number-top-label,.leadin-stats__big-number-content,.leadin-stats__big-number-bottom-label{color:#666;margin-bottom:12px}.leadin-stats__big-number-top-label{text-transform:uppercase;letter-spacing:0.05em}.big-button,.big-button--orange,.big-button--share{display:block;text-align:center;color:#fff;text-decoration:none;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:10px;font-size:16px;margin-top:15px}.big-button:hover,.big-button--orange:hover,.big-button--share:hover,.big-button:active,.big-button--orange:active,.big-button--share:active,.big-button:focus,.big-button--orange:focus,.big-button--share:focus,.big-button:visited,.big-button--orange:visited,.big-button--share:visited{color:#fff;cursor:pointer}.big-button--orange{background-color:#F67D42;border:1px solid #E75913;-webkit-box-shadow:inset 0 1px 0 rgba(255,195,166,0.5),0 1px 0 rgba(0,0,0,0.08);box-shadow:inset 0 1px 0 rgba(255,195,166,0.5),0 1px 0 rgba(0,0,0,0.08)}.big-button--orange:hover{color:#fff;background-color:#f56c2a}.big-button--orange:active{color:#f1f1f1;background-color:#f45c11;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.btn-submitting{background-color:#979797;cursor:not-allowed;border-color:grey;box-shadow:none}.btn-submitting:hover,.btn-submitting:active,.btn-submitting:focus,.btn-submitting:visited{background-color:#979797;color:#fff;box-shadow:none}.compare{width:100%;float:left;margin-right:1.40845%;display:inline;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#fff;position:relative;margin-bottom:20px}.compare:first-of-type{margin-bottom:60px}.compare:first-of-type:after{width:100%;float:left;margin-right:1.40845%;display:inline;content:"";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 48px/1 "dashicons";position:absolute;bottom:-55px;text-align:center}@media (min-width: 1200px){.compare:first-of-type:after{width:7.04225%;float:left;margin-right:1.40845%;content:"";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 48px/1 "dashicons";position:absolute;right:-40px;top:4em}}@media (min-width: 1200px){.compare{width:32.39437%;float:left;margin-right:1.40845%;margin-right:60px}}.compare .title{width:100%;height:72px;background-color:#979797;position:absolute;text-align:center;padding-top:15px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.compare .title h2{color:#fff;font-size:20px}.compare .title.teal{background-color:#6EC8C7}.compare .content{margin-top:50px;padding:30px}.compare .features{text-transform:uppercase;font-weight:bold;font-size:18px;padding-left:15px}.compare .features li{list-style-position:outside;text-indent:-16px}.compare .features p{margin-left:2px;margin-top:-5px}.compare p{text-transform:none;font-weight:normal;line-height:27px}*{box-sizing:border-box}.big-button--share{display:inline-block;margin-right:2px;width:82px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.5),0 1px 0 rgba(0,0,0,0.08);box-shadow:inset 0 1px 0 rgba(255,255,255,0.5),0 1px 0 rgba(0,0,0,0.08)}@media (min-width: 1200px){.big-button--share{margin-right:7px;width:200px}}.big-button--share.fb{background-color:#3B579D;border:1px solid #344d8a}.big-button--share.fb:after{content:""}@media (min-width: 1200px){.big-button--share.fb:after{content:"Share on Facebook"}}.big-button--share.fb:hover{background-color:#4261b0}.big-button--share.fb:before{content:"";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/1.4 "icomoon";vertical-align:top;margin-right:5px}.big-button--share.tw{background-color:#1DB1EB;border:1px solid #13a3db}.big-button--share.tw:after{content:""}@media (min-width: 1200px){.big-button--share.tw:after{content:"Share on Twitter"}}.big-button--share.tw:hover{background-color:#34b9ed}.big-button--share.tw:before{content:"";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/1.4 "icomoon";vertical-align:top;margin-right:5px}.big-button--share.wp{background-color:#1585B6;border:1px solid #12749f}.big-button--share.wp:after{content:""}@media (min-width: 1200px){.big-button--share.wp:after{content:"Write a Review"}}.big-button--share.wp:hover{background-color:#1896cd}.big-button--share.wp:before{content:"";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/1.4 "icomoon";vertical-align:top;margin-right:5px}.dialog-bottom-right{line-height:28px;background-color:#6EC8C7;color:#fff;position:fixed;z-index:1111;right:0;bottom:-400px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;width:300px;padding:20px;-moz-box-shadow:grey -1px 0 7px;-webkit-box-shadow:grey -1px 0 7px;box-shadow:grey -1px 0 7px}@media (min-width: 1200px){.dialog-bottom-right{width:668px}}.dialog-bottom-right h1{color:#1B6F6C;font-size:20px;font-weight:600;margin:0px}.dialog-bottom-right p{color:#fff;font-size:14px}.close{display:inline-block;vertical-align:top;float:right;margin-top:-30px;color:grey;font-size:18px;text-decoration:none}.close:hover{color:grey}
1
+ #leadin label{cursor:default}#leadin .col-wrap{padding:0}#leadin .col-left .col-wrap{padding-right:10px}#leadin .metabox-holder{*zoom:1}#leadin .metabox-holder:after{content:"";display:table;clear:both}#wp-admin-bar-leadin-admin-menu img{height:16px;width:16px;opacity:0.6}@media (min-width: 1200px){#leadin{*zoom:1;max-width:1420px;max-width:88.75rem;padding-left:20px;padding-left:1.25rem;padding-right:20px;padding-right:1.25rem;margin-left:auto;margin-right:auto;margin:10px 20px 0 0;padding:0}#leadin:after{content:"";display:table;clear:both}#leadin *{box-sizing:border-box}#leadin.centered{margin:10px auto 0}}#li_analytics-meta .li-analytics-link{float:left}#li_analytics-meta .li-analytics-link .li-analytics__face{height:35px;width:35px;margin-right:5px;margin-bottom:5px}#li_analytics-meta .hidden_face{display:none}#li_analytics-meta .show-all-faces-container{clear:both}.leadin-postbox,#leadin .leadin-meta-section,.powerup-list .powerup{background-color:#fff;border:1px solid #e5e5e5;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}.leadin-postbox__header,#leadin .leain-meta-header{margin:0;padding:18px 18px 0;font-size:13px;text-transform:uppercase;letter-spacing:0.05em;color:#444}.leadin-postbox__content{padding:18px;*zoom:1}.leadin-postbox__content:after{content:"";display:table;clear:both}.leadin-postbox__table{margin:0;width:100%}.leadin-postbox__table th{padding:6px 0;text-align:left;text-transform:uppercase;letter-spacing:0.05em;color:#999;font-weight:400;font-size:12px}.leadin-postbox__table td{padding:6px 0}.leadin-postbox__table td.sources-contacts-num{text-align:right;padding-right:20px}.leadin-postbox__table tr,.leadin-postbox__table td,.leadin-postbox__table th{vertical-align:middle !important}.leadin-dynamic-avatar_0{background-color:#F88E4B}.leadin-dynamic-avatar_1{background-color:#64AADA}.leadin-dynamic-avatar_2{background-color:#64C2B6}.leadin-dynamic-avatar_3{background-color:#CF7BAA}.leadin-dynamic-avatar_4{background-color:#E7C24B}.leadin-dynamic-avatar_5{background-color:#9387DA}.leadin-dynamic-avatar_6{background-color:#D6DD99}.leadin-dynamic-avatar_7{background-color:#FF4C4C}.leadin-dynamic-avatar_8{background-color:#99583D}.leadin-dynamic-avatar_9{background-color:#54CC14}@font-face{font-family:"icomoon";src:url("../../fonts/icomoon.eot?-lejfm6");src:url("../../fonts/icomoon.eot?#iefix-lejfm6") format("embedded-opentype"),url("../../fonts/icomoon.woff?-lejfm6") format("woff"),url("../../fonts/icomoon.ttf?-lejfm6") format("truetype"),url("../../fonts/icomoon.svg?-lejfm6#icomoon") format("svg");font-weight:normal;font-style:normal}.icon,.icon-profile,.icon-tag,.icon-tags,.icon-envelope,.icon-envelope-alt,.icon-email,.icon-user,.icon-cog,.icon-bars,.icon-lab,.icon-bulb,.icon-mover,.icon-leadin-logo,.icon-facebook,.icon-twitter,.icon-wordpress,.icon-linkedin,.icon-google-plus{font-family:"icomoon";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-leadin-logo:before{content:""}.icon-profile:before{content:""}.icon-tag:before{content:""}.icon-email:before{content:""}.icon-user:before{content:""}.icon-cog:before{content:""}.icon-bars:before{content:""}.icon-lab:before{content:""}.icon-bulb:before{content:""}.icon-tags:before{content:""}.icon-mover:before{content:""}.icon-twitter:before{content:""}.icon-linkedin:before{content:""}.icon-facebook:before{content:""}.icon-wordpress:before{content:""}.icon-google-plus:before{content:""}.icon-envelope-alt:before{content:""}.icon-envelope:before{content:""}#leadin-footer{*zoom:1;clear:both;margin-top:48px;color:#999;border-top:1px solid #dedede}#leadin-footer:after{content:"";display:table;clear:both}#leadin-footer .support .sharing{height:18px;text-align:left}@media screen and (min-width: 500px){#leadin-footer .support,#leadin-footer .version,#leadin-footer .sharing{width:50%;float:left}#leadin-footer .sharing{text-align:right}}.button-big{padding:6px 36px !important;font-size:14px !important;height:auto !important}.oboarding-steps{margin:18px 0}@media (min-width: 1200px){.oboarding-steps{width:83.09859%;float:right;margin-right:0;margin-left:8.4507%;margin-right:8.4507%;text-align:center}}.oboarding-steps .li_setup_header{margin:18px 0 36px;padding:0;font-size:18px}.oboarding-steps-names{*zoom:1;margin:0}.oboarding-steps-names:after{content:"";display:table;clear:both}.oboarding-step-name{margin:0;padding-bottom:24px;list-style:none;font-size:14px;color:#bbb;display:inline-block}.oboarding-step-name.active{color:#1F7D71;background-image:url(../../../images/triangle.png);background-position:bottom center;background-repeat:no-repeat}.oboarding-step-name.completed:before{background-image:url(../../../images/checkmark.png);background-position:top center;background-repeat:no-repeat;content:"";height:10px;width:13px;display:inline-block;margin-right:10px}.oboarding-step-name+.oboarding-step-name{margin-left:72px}.oboarding-step-content{margin:0 auto;max-width:500px}.oboarding-step-content .description{margin:12px 0;display:block;display:none}.oboarding-step{display:block;padding:36px;background-color:#D3EEEB;border:2px solid #2a9;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;color:#1F7D71}.oboarding-step .form-table th{display:none}.oboarding-step .form-table td{width:auto;display:block}.oboarding-step .form-table input{width:100%;font-size:16px;line-height:1.5;padding:7px 10px;display:block}.oboarding-step .oboarding-step-title,.oboarding-step .oboarding-step-description{color:#1F7D71;padding:0;margin-bottom:36px}.oboarding-step .button-primary{margin-top:36px}.oboarding-step .oboarding-step-description{font-size:16px;text-align:left}.oboarding-step .popup-option{width:31%;float:left;text-align:left;cursor:pointer !important}.oboarding-step .popup-option img{max-width:100%;margin-top:6px;-moz-box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.oboarding-step .popup-option:hover img{-moz-box-shadow:0 2px 4px rgba(0,0,0,0.25);-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.25);box-shadow:0 2px 4px rgba(0,0,0,0.25)}.oboarding-step .popup-option input{margin-right:8px !important}.oboarding-step .popup-option input:checked ~ img{border:2px solid #2ea2cc}.oboarding-step .popup-option+.popup-option{margin-left:3%}.oboarding-step .esp-option{width:48%;float:left;text-align:left;cursor:pointer !important;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:2px solid #2a9;margin-bottom:25px;padding:1.5em;font-size:16px;font-weight:600}.oboarding-step .esp-option:hover{background-color:#E0F6F4}.oboarding-step .esp-option input{margin-right:1em !important}.oboarding-step .esp-option:nth-child(2n){margin-left:4%}.oboarding-step .esp-option .esp-name:before{height:20px;background-position:center center;background-repeat:no-repeat;content:"";display:inline-block;margin:-3px 1em -3px 0}.oboarding-step .esp-option .esp-name.mailchimp:before{background-size:18px 20px;width:18px;background-image:url(../../../images/power-up-icon-mailchimp-connect_small@2x.png)}.oboarding-step .esp-option .esp-name.aweber:before{background-size:20px 20px;width:20px;background-image:url(../../../images/power-up-icon-aweber-connect_small@2x.png)}.oboarding-step .esp-option .esp-name.constant-contact:before{background-size:29px 20px;width:29px;background-image:url(../../../images/power-up-icon-constant-contact-connect_small@2x.png)}.oboarding-step .esp-option .esp-name.getresponse:before{background-size:27px 20px;width:27px;background-image:url(../../../images/power-up-icon-getresponse-list-sync_small@2x.png)}.oboarding-step .esp-option .esp-name.campaign-monitor:before{background-size:27px 20px;width:27px;background-image:url(../../../images/power-up-icon-campaign-monitor-connect_small@2x.png)}.oboarding-step .popup-options{*zoom:1}.oboarding-step .popup-options:after{content:"";display:table;clear:both}@media (min-width: 1200px){.leadin-settings__content{width:74.64789%;float:left;margin-right:1.40845%}.leadin-settings__sidebar{width:23.94366%;float:right;margin-right:0}}.li-settings h3{border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;margin-bottom:0px;background:#fff;padding:8px 12px;font-size:15px}.li-settings .form-table{margin-top:0px;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;background-color:#fff;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}.li-settings .form-table th{padding-left:12px}.li-settings .leadin-section{background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;font-size:14px;padding:15px 12px 5px 12px}.li-settings .leadin-section p{margin:0;padding:0}.li-settings .power-up-settings-icon{padding-right:10px;float:left;max-height:20px;margin-top:-1px}.li-settings .dashicons{margin-right:10px;float:left;margin-top:-1px}.li-settings tr.synced-list-row td.synced-list-cell{padding:3px 0px 10px 0px}.li-settings tr.synced-list-row td.synced-list-cell .icon-tag{font-size:12px}.li-settings tr.synced-list-row span.synced-list-arrow{padding:0px 10px}.li-settings tr.synced-list-row td.synced-list-edit{padding:3px 0px 10px 20px}.li-settings.pre-mp6 h3{font-family:Georgia}.li-settings.pre-mp6 select,.li-settings.pre-mp6 input{font-family:sans-serif;font-size:12px}.li-settings.pre-mp6 .form-table,.li-settings.pre-mp6 .leadin-section,.li-settings.pre-mp6 h3{background-color:#f9f9f9 !important}.li-settings.pre-mp6 .form-table{-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.li-settings.pre-mp6 h3{background-color:#f9f9f9 !important;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.li-settings.pre-mp6 .leadin-section{font-size:12px;padding-left:6px}.li-settings.pre-mp6 h3{padding-left:6px;font-weight:normal;color:#464646;text-shadow:#fff 0px 1px 0px}.li-settings.pre-mp6 label{font-size:12px}.li-settings.pre-mp6 input[type="checkbox"],.li-settings.pre-mp6 input[type="radio"]{margin-right:2px}.li-settings .color-swatch:before{content:"";height:19px;width:19px;vertical-align:top;margin:0 8px;display:inline-block}.li-settings .color-swatch.blue:before{background-color:#3288e6}.li-settings .color-swatch.red:before{background-color:#E43833}.li-settings .color-swatch.green:before{background-color:#7ED321}.li-settings .color-swatch.yellow:before{background-color:#FFBC00}.li-settings .color-swatch.purple:before{background-color:#BD10E0}.li-settings .color-swatch.orange:before{background-color:#FF8311}#icon-leadin{background:url("../../images/leadin-icon-32x32.png") top center no-repeat}.help-notification{background:#d9edf7;border:1px solid #bce8f1;padding:10px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.leadin-contact-avatar{margin-right:10px;float:left}.power-up-settings-icon{padding-right:10px;float:left;max-height:20px;margin-top:-1px}.dashicons{margin-right:10px;float:left;margin-top:-1px}tr.synced-list-row td.synced-list-cell{padding:3px 0px 10px 0px}tr.synced-list-row td.synced-list-cell .icon-tag{font-size:12px}tr.synced-list-row span.synced-list-arrow{padding:0px 10px}tr.synced-list-row td.synced-list-edit{padding:3px 0px 10px 20px}.leadin-settings__sidebar .pro-upgrade-cta{max-width:100%}.leadin-contacts .button{transition:background-color 0.2s}@media (min-width: 1200px){.leadin-contacts__nav{margin-top:30px;width:15.49296%;float:left;margin-right:1.40845%;margin-top:30px}.leadin-contacts__content{width:83.09859%;float:right;margin-right:0;margin-top:30px;margin-bottom:18px;margin-top:30px}.leadin-contacts__export-form{width:83.09859%;float:left;margin-right:1.40845%;padding-left:16.90141%;margin-bottom:18px}}.leadin-contacts__search{float:right;padding:10px 0;padding-bottom:9px}.leadin-contacts__type-picker{margin:0 0 30px;*zoom:1}.leadin-contacts__type-picker:after{content:"";display:table;clear:both}.leadin-contacts__type-picker li{margin:0;padding:0 1em 0 0;float:left}@media (min-width: 1200px){.leadin-contacts__type-picker li{float:none;padding:0}.leadin-contacts__type-picker li+li{padding:18px 0 0}}.leadin-contacts__type-picker li a{display:block;line-height:24px;font-weight:400;font-size:16px;text-decoration:none}.leadin-contacts__type-picker li a.current{font-weight:bold}.leadin-contacts__type-picker li a.current,.leadin-contacts__type-picker li a:hover,.leadin-contacts__type-picker li a:active{color:#F67D42}.leadin-contacts__type-picker li a .icon-tag,.leadin-contacts__type-picker li a .icon-user{padding-right:1em;font-size:0.85em}.leadin-contacts__tags-header{margin:30px 0 18px;font-size:14px;text-transform:uppercase;letter-spacing:0.1em;color:#999}.leadin-contacts__filter-text{margin:0 0 18px}.leadin-contacts__filter-count{color:#F67D42}#clear-filter{font-size:0.8em;margin-left:10px}.leadin-contacts__table table th#source{width:20%}.leadin-contacts__table table th#visits,.leadin-contacts__table table th#submissions{width:8%}.leadin-contacts__table table th#status,.leadin-contacts__table table th#last_visit,.leadin-contacts__table table th#date,.leadin-contacts__table table th#pageviews{width:10%}.leadin-contacts__table table th,.leadin-contacts__table table td{display:none}.leadin-contacts__table table th:nth-child(-n+3),.leadin-contacts__table table td:nth-child(-n+3){display:table-cell}@media (min-width: 1200px){.leadin-contacts__table table th,.leadin-contacts__table table td{display:table-cell}}.leadin-contacts.pre-mp6 .table_search{float:right;padding:12px 0;padding-bottom:11px}.leadin-contacts.pre-mp6 table{background-color:#fff;border-color:#dedede}.leadin-contacts.pre-mp6 table tr.alternate{background-color:#fff}.leadin-contacts.pre-mp6 table th,.leadin-contacts.pre-mp6 table td{border-top:0;padding:12px 6px 11px}.leadin-contacts.pre-mp6 table th a,.leadin-contacts.pre-mp6 table td a{padding:0}.leadin-contacts.pre-mp6 table th[scope="col"]{background:#eee;font-family:sans-serif;font-size:12px;text-shadow:none}.leadin-contacts.pre-mp6 table td{border-color:#dedede;line-height:18px;font-size:14px}.leadin-contacts.pre-mp6 table td .row-actions{float:left}#leadin .contact-top-navigation,#leadin .contact-deatils-column,#leadin .contact-timeline-column{width:100%;float:right;margin-right:0;*margin-left:-20px;display:inline;margin-bottom:12px}@media (min-width: 1200px){#leadin .contact-deatils-column{width:32.39437%;float:left;margin-right:1.40845%}#leadin .contact-timeline-column{width:66.19718%;float:right;margin-right:0}}#leadin .contact-header-wrap{*zoom:1;padding:18px 0 24px}#leadin .contact-header-wrap:after{content:"";display:table;clear:both}#leadin .contact-header-avatar,#leadin .contact-header-info{float:left}#leadin .contact-header-info{padding-left:15px}#leadin .contact-name{line-height:30px;padding:0;margin:0}#leadin .contact-networks{margin-top:12px}#leadin .contact-networks .icon-linkedin,#leadin .contact-networks .icon-facebook,#leadin .contact-networks .icon-twitter,#leadin .contact-networks .icon-googleplus,#leadin .contact-networks .icon-envelope{height:25px;width:25px;font-size:25px;margin-right:10px;color:#999;text-decoration:none}#leadin .contact-networks .icon-linkedin:hover,#leadin .contact-networks .icon-facebook:hover,#leadin .contact-networks .icon-twitter:hover,#leadin .contact-networks .icon-googleplus:hover,#leadin .contact-networks .icon-envelope:hover{color:#666}#leadin .contact-tag{display:inline-block;padding:3px 10px;color:#999;text-decoration:none;font-weight:600;font-size:13px;border:1px solid #ccc;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}#leadin .contact-tag:hover{opacity:0.75}#leadin .contact-tag+.contact-tag{margin-left:10px}#leadin .contact-edit-tags{text-decoration:none;text-transform:none;letter-spacing:0;font-weight:400}#leadin .contact-info h3{margin:0}#leadin .contact-info label{font-weight:bold;line-height:1;cursor:default}#leadin .leadin-meta-section{margin-bottom:12px}#leadin .leadin-meta-table{width:100%;text-align:left}#leadin .leadin-meta-table th{color:#666;padding-bottom:6px}#leadin .leadin-premium-tag:after{content:"Pro";margin-left:10px;font-size:10px;color:#fff;background-color:#93C054;padding:2px 6px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#leadin .contact-history{margin-left:20px}@media (min-width: 1200px){#leadin .contact-history{padding-left:20px;border-left:2px solid #dedede}}#leadin .contact-history .sessions{margin:0}#leadin .contact-history .session+.session{margin-top:24px}#leadin .contact-history .session-date{position:relative}@media (min-width: 1200px){#leadin .contact-history .session-date:before{content:"•";font-size:32px;line-height:0;height:31px;width:31px;position:absolute;left:-27px;top:9px;color:#dedede}}#leadin .contact-history .session-time-range{color:#999;font-weight:400}#leadin .contact-history .events{background-color:#fff;border:1px solid #dedede;-moz-box-shadow:0 1px 1px rgba(0,0,0,0.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,0.04)}#leadin .contact-history .event{margin:0;padding:10px 20px;border-bottom:1px solid #dedede;border-left:4px solid;*zoom:1}#leadin .contact-history .event:after{content:"";display:table;clear:both}#leadin .contact-history .event:first-child{border-top:0}#leadin .contact-history .event.pageview{border-left-color:#28c;color:#28c}#leadin .contact-history .event.form-submission{border-left-color:#F67D42;color:#F67D42}#leadin .contact-history .event.source{border-left-color:#99AA1F;color:#99AA1F}#leadin .contact-history .event-title{margin:0;font-size:13px;font-weight:600}#leadin .contact-history .event-time{float:left;font-weight:400;width:75px}#leadin .contact-history .event-content{margin-left:75px}#leadin .contact-history .event-detail{margin-top:20px;color:#444}#leadin .contact-history .event-detail li+li{padding-top:6px;border-top:1px solid #eee}#leadin .contact-history .event-detail.pageview-url{color:#ccc}#leadin .contact-history .visit-source p{margin:0;color:#1F6696}#leadin .contact-history .field-label{text-transform:uppercase;letter-spacing:0.05em;color:#999;margin-bottom:6px;font-size:0.9em}#leadin .contact-history .field-value{margin:0}#leadin.pre-mp6 .events{background-color:#f9f9f9}.powerup-list{margin:0}.powerup-list .powerup{width:20%;min-width:250px;float:left;margin:20px;padding:15px}.powerup-list .powerup h2,.powerup-list .powerup p{margin:0;padding:0;color:#666;margin-bottom:15px}.powerup-list .powerup .img-containter{text-align:center;padding:30px 15px;margin-bottom:15px;background-color:#f1f1f1;color:red}.powerup-list .powerup .img-containter h2{font-size:20px}.powerup-list .powerup.activated h2,.powerup-list .powerup.activated p{color:#1F7D71}.powerup-list .powerup.activated .img-containter{background-color:#D3EEEB}@media (min-width: 1200px){.leadin-stats__top-container,.leadin-stats__chart-container,.leadin-stats__big-numbers-container{width:100%;float:right;margin-right:0}.leadin-stats__postbox_containter{width:49.29577%;float:left;margin-right:1.40845%}.leadin-stats__postbox_containter:nth-child(2n+2){width:49.29577%;float:right;margin-right:0}}h2.leadin-stats__header{margin-bottom:12px}.leadin-stats__postbox_containter .leadin-postbox,.leadin-stats__postbox_containter #leadin .leadin-meta-section,#leadin .leadin-stats__postbox_containter .leadin-meta-section,.leadin-stats__postbox_containter .powerup-list .powerup,.powerup-list .leadin-stats__postbox_containter .powerup{margin-bottom:12px}.leadin-stats__big-number{text-align:center;width:42%;float:left;padding:4%}@media (min-width: 1200px){.leadin-stats__big-number{width:25%;padding:10px}}.big-number--average .leadin-stats__big-number-top-label,.big-number--average .leadin-stats__big-number-content,.big-number--average .leadin-stats__big-number-bottom-label{color:#4CA6CF}.leadin-stats__top-container,.leadin-stats__big-number-top-label,.leadin-stats__big-number-content,.leadin-stats__big-number-bottom-label{color:#666;margin-bottom:12px}.leadin-stats__big-number-top-label{text-transform:uppercase;letter-spacing:0.05em}.big-button,.big-button--orange{display:block;text-align:center;color:#fff;text-decoration:none;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:10px;font-size:16px;margin-top:15px}.big-button:hover,.big-button--orange:hover,.big-button:active,.big-button--orange:active,.big-button:focus,.big-button--orange:focus,.big-button:visited,.big-button--orange:visited{color:#fff;cursor:pointer}.big-button--orange{background-color:#F67D42;border:1px solid #E75913;-webkit-box-shadow:inset 0 1px 0 rgba(255,195,166,0.5),0 1px 0 rgba(0,0,0,0.08);box-shadow:inset 0 1px 0 rgba(255,195,166,0.5),0 1px 0 rgba(0,0,0,0.08)}.big-button--orange:hover{color:#fff;background-color:#f56c2a}.big-button--orange:active{color:#f1f1f1;background-color:#f45c11;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.btn-submitting{background-color:#979797;cursor:not-allowed;border-color:grey;box-shadow:none}.btn-submitting:hover,.btn-submitting:active,.btn-submitting:focus,.btn-submitting:visited{background-color:#979797;color:#fff;box-shadow:none}.compare{width:100%;float:left;margin-right:1.40845%;display:inline;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#fff;position:relative;margin-bottom:20px}.compare:first-of-type{margin-bottom:60px}.compare:first-of-type:after{width:100%;float:left;margin-right:1.40845%;display:inline;content:"";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 48px/1 "dashicons";position:absolute;bottom:-55px;text-align:center}@media (min-width: 1200px){.compare:first-of-type:after{width:7.04225%;float:left;margin-right:1.40845%;content:"";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 48px/1 "dashicons";position:absolute;right:-40px;top:4em}}@media (min-width: 1200px){.compare{width:32.39437%;float:left;margin-right:1.40845%;margin-right:60px}}.compare .title{width:100%;height:72px;background-color:#979797;position:absolute;text-align:center;padding-top:15px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.compare .title h2{color:#fff;font-size:20px}.compare .title.teal{background-color:#6EC8C7}.compare .content{margin-top:50px;padding:30px}.compare .features{text-transform:uppercase;font-weight:bold;font-size:18px;padding-left:15px}.compare .features li{list-style-position:outside;text-indent:-16px}.compare .features p{margin-left:2px;margin-top:-5px}.compare p{text-transform:none;font-weight:normal;line-height:27px}
assets/css/build/leadin-subscribe.css CHANGED
@@ -1 +1 @@
1
- @keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-moz-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-ms-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-o-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-moz-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-ms-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-o-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-webkit-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-moz-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-ms-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-o-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-webkit-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-moz-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-ms-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-o-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-webkit-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-moz-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-ms-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-o-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-webkit-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-moz-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-ms-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-o-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-webkit-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-moz-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-ms-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-o-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-webkit-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-moz-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-ms-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-o-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-webkit-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-moz-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-ms-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-o-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-webkit-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-moz-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-ms-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-o-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}.vex,.vex *,.vex *:before,.vex *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;border:0;margin:0;padding:0}.vex,.vex-overlay{position:fixed;top:0;right:0;bottom:0;left:0}.vex{overflow:visible;-webkit-overflow-scrolling:touch;z-index:1111;font-size:16px}.vex .vex-overlay{background:#000;filter:alpha(opacity=40);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"}.vex .vex-closing.vex-overlay{animation:vex-fadeout 0.5s;-webkit-animation:vex-fadeout 0.5s;-moz-animation:vex-fadeout 0.5s;-ms-animation:vex-fadeout 0.5s;-o-animation:vex-fadeout 0.5s;-webkit-backface-visibility:hidden}.vex .vex-overlay{animation:vex-fadein 0.5s;-webkit-animation:vex-fadein 0.5s;-moz-animation:vex-fadein 0.5s;-ms-animation:vex-fadein 0.5s;-o-animation:vex-fadein 0.5s;-webkit-backface-visibility:hidden;background-color:rgba(0,0,0,0.4)}.vex .vex-content{*zoom:1;-moz-box-shadow:0px 0px 5px rgba(0,0,0,0.25);-webkit-box-shadow:0px 0px 5px rgba(0,0,0,0.25);box-shadow:0px 0px 5px rgba(0,0,0,0.25);position:relative;padding:1em 1.5em;margin:0 auto;background:#fff;max-width:100%;width:30em}.vex .vex-content:after{content:"";display:table;clear:both}.vex .vex-content h1,.vex .vex-content h2,.vex .vex-content h3,.vex .vex-content h4,.vex .vex-content h5,.vex .vex-content h6,.vex .vex-content p,.vex .vex-content ul,.vex .vex-content li,.vex .vex-content input{line-height:1.5;text-transform:none;letter-spacing:0;margin:0}.vex .vex-content h1,.vex .vex-content h2,.vex .vex-content h3,.vex .vex-content h4,.vex .vex-content h5,.vex .vex-content h6{color:#444;font-size:1.3em;font-weight:600;margin-bottom:0.6em}.vex .vex-content p,.vex .vex-content ul,.vex .vex-content li,.vex .vex-content input{color:#666;font-size:1em;font-weight:normal;margin-bottom:1em}.vex .vex-dialog-message,.vex .vex-dialog-input,.vex .vex-dialog-buttons{*zoom:1}.vex .vex-dialog-message:after,.vex .vex-dialog-input:after,.vex .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex .leadin-subscribe-powered-by{color:#999;display:block;text-align:center;font-size:0.8em;text-decoration:none}.vex .leadin-subscribe-powered-by:hover{background:none;color:#999;text-decoration:underline;font-weight:normal}.vex .vex-close{-moz-border-radius:0.33em;-webkit-border-radius:0.33em;border-radius:0.33em;position:absolute;top:1em;right:1.5em;cursor:pointer}.vex .vex-close:before{-moz-border-radius:0.33em;-webkit-border-radius:0.33em;border-radius:0.33em;content:"×";font-size:25px;font-weight:normal;line-height:25px;height:25px;width:25px;text-align:center;color:#bbb;background:transparent}.vex .vex-close:hover:before,.vex .vex-close:active:before{color:#777}.vex .vex-dialog-form{margin:0}.vex .vex-dialog-input{margin-bottom:1em}.vex textarea,.vex input[type="date"],.vex input[type="datetime"],.vex input[type="datetime-local"],.vex input[type="email"],.vex input[type="month"],.vex input[type="number"],.vex input[type="password"],.vex input[type="search"],.vex input[type="tel"],.vex input[type="text"],.vex input[type="time"],.vex input[type="url"],.vex input[type="week"]{-moz-border-radius:0.25em;-webkit-border-radius:0.25em;border-radius:0.25em;background:#fff;width:100%;padding:0.5em 0.5em;border:1px solid #ddd;margin:0;height:auto}.vex textarea:hover,.vex input[type="date"]:hover,.vex input[type="datetime"]:hover,.vex input[type="datetime-local"]:hover,.vex input[type="email"]:hover,.vex input[type="month"]:hover,.vex input[type="number"]:hover,.vex input[type="password"]:hover,.vex input[type="search"]:hover,.vex input[type="tel"]:hover,.vex input[type="text"]:hover,.vex input[type="time"]:hover,.vex input[type="url"]:hover,.vex input[type="week"]:hover{border:1px solid #ddd}.vex textarea:focus,.vex input[type="date"]:focus,.vex input[type="datetime"]:focus,.vex input[type="datetime-local"]:focus,.vex input[type="email"]:focus,.vex input[type="month"]:focus,.vex input[type="number"]:focus,.vex input[type="password"]:focus,.vex input[type="search"]:focus,.vex input[type="tel"]:focus,.vex input[type="text"]:focus,.vex input[type="time"]:focus,.vex input[type="url"]:focus,.vex input[type="week"]:focus{border:1px solid #ddd;outline:none}.vex textarea .error,.vex input[type="date"] .error,.vex input[type="datetime"] .error,.vex input[type="datetime-local"] .error,.vex input[type="email"] .error,.vex input[type="month"] .error,.vex input[type="number"] .error,.vex input[type="password"] .error,.vex input[type="search"] .error,.vex input[type="tel"] .error,.vex input[type="text"] .error,.vex input[type="time"] .error,.vex input[type="url"] .error,.vex input[type="week"] .error{-moz-box-shadow:inset 0 0 0 2px #f33f33;-webkit-box-shadow:inset 0 0 0 2px #f33f33;box-shadow:inset 0 0 0 2px #f33f33}.vex input+input{margin-top:0.5em !important}.vex .vex-dialog-button{-moz-border-radius:0.25em;-webkit-border-radius:0.25em;border-radius:0.25em;-webkit-appearance:none;cursor:pointer;font-size:1em;font-weight:bold;line-height:1;padding:1em 1.5em;width:100%}.vex .vex-dialog-button.vex-last{margin-left:0}.vex .vex-dialog-button:focus,.vex .vex-dialog-button:hover{outline:none}.vex .vex-dialog-button.vex-dialog-button-primary{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border:0}.vex .vex-loading-spinner{animation:vex-rotation 0.7s linear infinite;-webkit-animation:vex-rotation 0.7s linear infinite;-moz-animation:vex-rotation 0.7s linear infinite;-ms-animation:vex-rotation 0.7s linear infinite;-o-animation:vex-rotation 0.7s linear infinite;-webkit-backface-visibility:hidden;-moz-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-webkit-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%;background:#f0f0f0;z-index:1112;margin:auto;height:2em;width:2em;border:0.2em solid transparent;border-top-color:#bbb}.vex.vex-theme-bottom-right-corner .vex-content,.vex.vex-theme-bottom-left-corner .vex-content,.vex.vex-theme-default .vex-content{border-top:5px solid}.vex.vex-theme-bottom-right-corner .vex-overlay,.vex.vex-theme-bottom-left-corner .vex-overlay,.vex.vex-theme-top .vex-overlay{display:none}.vex.vex-theme-bottom-right-corner,.vex.vex-theme-bottom-left-corner{top:auto;bottom:0}.vex.vex-theme-bottom-right-corner .vex-content,.vex.vex-theme-bottom-left-corner .vex-content{animation:vex-slideup 0.5s;-webkit-animation:vex-slideup 0.5s;-moz-animation:vex-slideup 0.5s;-ms-animation:vex-slideup 0.5s;-o-animation:vex-slideup 0.5s;-webkit-backface-visibility:hidden;position:fixed}.vex.vex-theme-bottom-right-corner.vex-closing .vex-content,.vex.vex-theme-bottom-left-corner.vex-closing .vex-content{animation:vex-slidedown 0.5s;-webkit-animation:vex-slidedown 0.5s;-moz-animation:vex-slidedown 0.5s;-ms-animation:vex-slidedown 0.5s;-o-animation:vex-slidedown 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-default{padding-top:200px}.vex.vex-theme-default .vex-content{animation:vex-flyin 0.5s;-webkit-animation:vex-flyin 0.5s;-moz-animation:vex-flyin 0.5s;-ms-animation:vex-flyin 0.5s;-o-animation:vex-flyin 0.5s;-webkit-backface-visibility:hidden;-moz-border-radius:0.33em;-webkit-border-radius:0.33em;border-radius:0.33em}.vex.vex-theme-default.vex-closing .vex-content{animation:vex-flyout 0.5s;-webkit-animation:vex-flyout 0.5s;-moz-animation:vex-flyout 0.5s;-ms-animation:vex-flyout 0.5s;-o-animation:vex-flyout 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-bottom-right-corner .vex-content{-moz-border-radius:0.33em 0 0 0;-webkit-border-radius:0.33em;border-radius:0.33em 0 0 0;right:0;left:auto;bottom:0}.vex.vex-theme-bottom-left-corner .vex-content{-moz-border-radius:0 0.33em 0 0;-webkit-border-radius:0;border-radius:0 0.33em 0 0;left:0;right:auto;bottom:0}.vex.vex-theme-top{bottom:inherit}.vex.vex-theme-top .vex-content{animation:vex-dropin 0.5s;-webkit-animation:vex-dropin 0.5s;-moz-animation:vex-dropin 0.5s;-ms-animation:vex-dropin 0.5s;-o-animation:vex-dropin 0.5s;-webkit-backface-visibility:hidden;width:100%;border-bottom:5px solid}.vex.vex-theme-top.vex-closing .vex-content{animation:vex-dropout 0.5s;-webkit-animation:vex-dropout 0.5s;-moz-animation:vex-dropout 0.5s;-ms-animation:vex-dropout 0.5s;-o-animation:vex-dropout 0.5s;-webkit-backface-visibility:hidden}@media only screen and (min-width: 600px){.vex.vex-theme-top .vex-dialog-message,.vex.vex-theme-top .vex-dialog-input,.vex.vex-theme-top .vex-dialog-buttons{float:left}.vex.vex-theme-top .vex-dialog-message{width:40%;text-align:right;padding-right:1em}.vex.vex-theme-top .vex-dialog-message h4{padding:0;margin:0;line-height:2.1em}.vex.vex-theme-top .vex-dialog-message p{display:none}.vex.vex-theme-top .vex-dialog-input{width:20%;margin:0}.vex.vex-theme-top .vex-dialog-buttons{width:40%;text-align:left;padding-left:1em}.vex.vex-theme-top .vex-dialog-buttons .vex-dialog-button-primary{width:auto;margin:0;padding:0.5em 1em;border:1px solid}.vex.vex-theme-top .leadin-subscribe-powered-by{position:absolute;bottom:10px;right:10px}}.vex.leadin-popup-color-blue .vex-content{border-color:#3288e6}.vex.leadin-popup-color-blue input:focus{-moz-box-shadow:inset 0 0 0 2px #8dbdf1;-webkit-box-shadow:inset 0 0 0 2px #8dbdf1;box-shadow:inset 0 0 0 2px #8dbdf1}.vex.leadin-popup-color-blue .vex-dialog-button-primary{background:#3288e6;color:#fff}.vex.leadin-popup-color-blue .vex-dialog-button-primary:hover{background:#5fa2ec}.vex.leadin-popup-color-red .vex-content{border-color:#E43833}.vex.leadin-popup-color-red input:focus{-moz-box-shadow:inset 0 0 0 2px #f0908d;-webkit-box-shadow:inset 0 0 0 2px #f0908d;box-shadow:inset 0 0 0 2px #f0908d}.vex.leadin-popup-color-red .vex-dialog-button-primary{background:#E43833;color:#fff}.vex.leadin-popup-color-red .vex-dialog-button-primary:hover{background:#ea6460}.vex.leadin-popup-color-green .vex-content{border-color:#7ED321}.vex.leadin-popup-color-green input:focus{-moz-box-shadow:inset 0 0 0 2px #b0e971;-webkit-box-shadow:inset 0 0 0 2px #b0e971;box-shadow:inset 0 0 0 2px #b0e971}.vex.leadin-popup-color-green .vex-dialog-button-primary{background:#7ED321;color:#fff}.vex.leadin-popup-color-green .vex-dialog-button-primary:hover{background:#97e245}.vex.leadin-popup-color-yellow .vex-content{border-color:#FFBC00}.vex.leadin-popup-color-yellow input:focus{-moz-box-shadow:inset 0 0 0 2px #ffd766;-webkit-box-shadow:inset 0 0 0 2px #ffd766;box-shadow:inset 0 0 0 2px #ffd766}.vex.leadin-popup-color-yellow .vex-dialog-button-primary{background:#FFBC00;color:#fff}.vex.leadin-popup-color-yellow .vex-dialog-button-primary:hover{background:#ffc933}.vex.leadin-popup-color-purple .vex-content{border-color:#BD10E0}.vex.leadin-popup-color-purple input:focus{-moz-box-shadow:inset 0 0 0 2px #db62f4;-webkit-box-shadow:inset 0 0 0 2px #db62f4;box-shadow:inset 0 0 0 2px #db62f4}.vex.leadin-popup-color-purple .vex-dialog-button-primary{background:#BD10E0;color:#fff}.vex.leadin-popup-color-purple .vex-dialog-button-primary:hover{background:#d033f0}.vex.leadin-popup-color-orange .vex-content{border-color:#FF8311}.vex.leadin-popup-color-orange input:focus{-moz-box-shadow:inset 0 0 0 2px #ffb877;-webkit-box-shadow:inset 0 0 0 2px #ffb877;box-shadow:inset 0 0 0 2px #ffb877}.vex.leadin-popup-color-orange .vex-dialog-button-primary{background:#FF8311;color:#fff}.vex.leadin-popup-color-orange .vex-dialog-button-primary:hover{background:#ff9e44}@media only screen and (max-width: 760px){.vex.leadin-subscribe-mobile-hide{display:none}}
1
+ @keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-moz-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-ms-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@-o-keyframes vex-fadein{0%{opacity:0}100%{opacity:1}}@keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-moz-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-ms-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@-o-keyframes vex-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-webkit-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-moz-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-ms-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@-o-keyframes vex-rotation{0%{transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg)}100%{transform:rotate(359deg);-webkit-transform:rotate(359deg);-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-o-transform:rotate(359deg)}}@keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-webkit-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-moz-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-ms-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-o-keyframes vex-slideup{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:0}2%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-webkit-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-moz-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-ms-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@-o-keyframes vex-slidedown{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(800px);-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px)}}@keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-webkit-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-moz-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-ms-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@-o-keyframes vex-flyin{0%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}100%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}}@keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-webkit-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-moz-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-ms-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@-o-keyframes vex-flyout{0%{opacity:1;transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{opacity:0;transform:translateY(-40px);-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px)}}@keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-webkit-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-moz-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-ms-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@-o-keyframes vex-dropin{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:0}1%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:0}2%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px);opacity:1}100%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);opacity:1}}@keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-webkit-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-moz-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-ms-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@-o-keyframes vex-dropout{0%{transform:translateY(0);-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0)}100%{transform:translateY(-800px);-webkit-transform:translateY(-800px);-moz-transform:translateY(-800px);-ms-transform:translateY(-800px);-o-transform:translateY(-800px)}}@keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-webkit-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-moz-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-ms-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}@-o-keyframes vex-pulse{0%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}70%{-moz-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);-webkit-box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25);box-shadow:inset 0 0 0 300px rgba(255,255,255,0.25)}100%{-moz-box-shadow:inset 0 0 0 300px transparent;-webkit-box-shadow:inset 0 0 0 300px transparent;box-shadow:inset 0 0 0 300px transparent}}.vex,.vex *,.vex *:before,.vex *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;border:0;margin:0;padding:0}.vex,.vex-overlay{position:fixed;top:0;right:0;bottom:0;left:0}.vex{overflow:visible;-webkit-overflow-scrolling:touch;z-index:1111;font-size:16px}.vex .vex-overlay{background:#000;filter:alpha(opacity=40);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"}.vex .vex-closing.vex-overlay{animation:vex-fadeout 0.5s;-webkit-animation:vex-fadeout 0.5s;-moz-animation:vex-fadeout 0.5s;-ms-animation:vex-fadeout 0.5s;-o-animation:vex-fadeout 0.5s;-webkit-backface-visibility:hidden}.vex .vex-overlay{animation:vex-fadein 0.5s;-webkit-animation:vex-fadein 0.5s;-moz-animation:vex-fadein 0.5s;-ms-animation:vex-fadein 0.5s;-o-animation:vex-fadein 0.5s;-webkit-backface-visibility:hidden;background-color:rgba(0,0,0,0.4)}.vex .vex-content{*zoom:1;-moz-box-shadow:0px 0px 5px rgba(0,0,0,0.25);-webkit-box-shadow:0px 0px 5px rgba(0,0,0,0.25);box-shadow:0px 0px 5px rgba(0,0,0,0.25);position:relative;padding:1em 1.5em;margin:0 auto;background:#fff;max-width:100%;width:30em}.vex .vex-content:after{content:"";display:table;clear:both}.vex .vex-content h1,.vex .vex-content h2,.vex .vex-content h3,.vex .vex-content h4,.vex .vex-content h5,.vex .vex-content h6,.vex .vex-content p,.vex .vex-content ul,.vex .vex-content li,.vex .vex-content input{line-height:1.5;text-transform:none;letter-spacing:0;margin:0}.vex .vex-content h1,.vex .vex-content h2,.vex .vex-content h3,.vex .vex-content h4,.vex .vex-content h5,.vex .vex-content h6{color:#444;font-size:1.3em;font-weight:600;margin-bottom:0.6em}.vex .vex-content p,.vex .vex-content ul,.vex .vex-content li,.vex .vex-content input{color:#666;font-size:1em;font-weight:normal;margin-bottom:1em}.vex .vex-dialog-message,.vex .vex-dialog-input,.vex .vex-dialog-buttons{*zoom:1}.vex .vex-dialog-message:after,.vex .vex-dialog-input:after,.vex .vex-dialog-buttons:after{content:"";display:table;clear:both}.vex .leadin-subscribe-powered-by{color:#999;display:block;text-align:center;font-size:0.8em;text-decoration:none}.vex .leadin-subscribe-powered-by:hover{background:none;color:#999;text-decoration:underline;font-weight:normal}.vex .vex-close{-moz-border-radius:0.33em;-webkit-border-radius:0.33em;border-radius:0.33em;position:absolute;top:1em;right:1.5em;cursor:pointer;z-index:9999}.vex .vex-close:before{-moz-border-radius:0.33em;-webkit-border-radius:0.33em;border-radius:0.33em;content:"×";font-size:25px;font-weight:normal;line-height:25px;height:25px;width:25px;text-align:center;color:#bbb;background:transparent}.vex .vex-close:hover:before,.vex .vex-close:active:before{color:#777}.vex .vex-dialog-form{margin:0}.vex .vex-dialog-input{margin-bottom:1em}.vex textarea,.vex input[type="date"],.vex input[type="datetime"],.vex input[type="datetime-local"],.vex input[type="email"],.vex input[type="month"],.vex input[type="number"],.vex input[type="password"],.vex input[type="search"],.vex input[type="tel"],.vex input[type="text"],.vex input[type="time"],.vex input[type="url"],.vex input[type="week"]{-moz-border-radius:0.25em;-webkit-border-radius:0.25em;border-radius:0.25em;background:#fff;width:100%;padding:0.5em 0.5em;border:1px solid #ddd;margin:0;height:auto}.vex textarea:hover,.vex input[type="date"]:hover,.vex input[type="datetime"]:hover,.vex input[type="datetime-local"]:hover,.vex input[type="email"]:hover,.vex input[type="month"]:hover,.vex input[type="number"]:hover,.vex input[type="password"]:hover,.vex input[type="search"]:hover,.vex input[type="tel"]:hover,.vex input[type="text"]:hover,.vex input[type="time"]:hover,.vex input[type="url"]:hover,.vex input[type="week"]:hover{border:1px solid #ddd}.vex textarea:focus,.vex input[type="date"]:focus,.vex input[type="datetime"]:focus,.vex input[type="datetime-local"]:focus,.vex input[type="email"]:focus,.vex input[type="month"]:focus,.vex input[type="number"]:focus,.vex input[type="password"]:focus,.vex input[type="search"]:focus,.vex input[type="tel"]:focus,.vex input[type="text"]:focus,.vex input[type="time"]:focus,.vex input[type="url"]:focus,.vex input[type="week"]:focus{border:1px solid #ddd;outline:none}.vex textarea .error,.vex input[type="date"] .error,.vex input[type="datetime"] .error,.vex input[type="datetime-local"] .error,.vex input[type="email"] .error,.vex input[type="month"] .error,.vex input[type="number"] .error,.vex input[type="password"] .error,.vex input[type="search"] .error,.vex input[type="tel"] .error,.vex input[type="text"] .error,.vex input[type="time"] .error,.vex input[type="url"] .error,.vex input[type="week"] .error{-moz-box-shadow:inset 0 0 0 2px #f33f33;-webkit-box-shadow:inset 0 0 0 2px #f33f33;box-shadow:inset 0 0 0 2px #f33f33}.vex input+input{margin-top:0.5em !important}.vex .vex-dialog-button{-moz-border-radius:0.25em;-webkit-border-radius:0.25em;border-radius:0.25em;-webkit-appearance:none;cursor:pointer;font-size:1em;font-weight:bold;line-height:1;padding:1em 1.5em;width:100%}.vex .vex-dialog-button.vex-last{margin-left:0}.vex .vex-dialog-button:focus,.vex .vex-dialog-button:hover{outline:none}.vex .vex-dialog-button.vex-dialog-button-primary{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border:0}.vex .vex-loading-spinner{animation:vex-rotation 0.7s linear infinite;-webkit-animation:vex-rotation 0.7s linear infinite;-moz-animation:vex-rotation 0.7s linear infinite;-ms-animation:vex-rotation 0.7s linear infinite;-o-animation:vex-rotation 0.7s linear infinite;-webkit-backface-visibility:hidden;-moz-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-webkit-box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);box-shadow:0 0 0 0.5em #f0f0f0,0 0 1px 0.5em rgba(0,0,0,0.3);-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%;background:#f0f0f0;z-index:1112;margin:auto;height:2em;width:2em;border:0.2em solid transparent;border-top-color:#bbb}.vex.vex-theme-bottom-right-corner .vex-content,.vex.vex-theme-bottom-left-corner .vex-content,.vex.vex-theme-default .vex-content{border-top:5px solid}.vex.vex-theme-bottom-right-corner .vex-overlay,.vex.vex-theme-bottom-left-corner .vex-overlay,.vex.vex-theme-top .vex-overlay{display:none}.vex.vex-theme-bottom-right-corner,.vex.vex-theme-bottom-left-corner{top:auto;bottom:0}.vex.vex-theme-bottom-right-corner .vex-content,.vex.vex-theme-bottom-left-corner .vex-content{animation:vex-slideup 0.5s;-webkit-animation:vex-slideup 0.5s;-moz-animation:vex-slideup 0.5s;-ms-animation:vex-slideup 0.5s;-o-animation:vex-slideup 0.5s;-webkit-backface-visibility:hidden;position:fixed}.vex.vex-theme-bottom-right-corner.vex-closing .vex-content,.vex.vex-theme-bottom-left-corner.vex-closing .vex-content{animation:vex-slidedown 0.5s;-webkit-animation:vex-slidedown 0.5s;-moz-animation:vex-slidedown 0.5s;-ms-animation:vex-slidedown 0.5s;-o-animation:vex-slidedown 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-default{padding-top:200px}.vex.vex-theme-default .vex-content{animation:vex-flyin 0.5s;-webkit-animation:vex-flyin 0.5s;-moz-animation:vex-flyin 0.5s;-ms-animation:vex-flyin 0.5s;-o-animation:vex-flyin 0.5s;-webkit-backface-visibility:hidden;-moz-border-radius:0.33em;-webkit-border-radius:0.33em;border-radius:0.33em}.vex.vex-theme-default.vex-closing .vex-content{animation:vex-flyout 0.5s;-webkit-animation:vex-flyout 0.5s;-moz-animation:vex-flyout 0.5s;-ms-animation:vex-flyout 0.5s;-o-animation:vex-flyout 0.5s;-webkit-backface-visibility:hidden}.vex.vex-theme-bottom-right-corner .vex-content{-moz-border-radius:0.33em 0 0 0;-webkit-border-radius:0.33em;border-radius:0.33em 0 0 0;right:0;left:auto;bottom:0}.vex.vex-theme-bottom-left-corner .vex-content{-moz-border-radius:0 0.33em 0 0;-webkit-border-radius:0;border-radius:0 0.33em 0 0;left:0;right:auto;bottom:0}.vex.vex-theme-top{bottom:inherit}.vex.vex-theme-top .vex-content{animation:vex-dropin 0.5s;-webkit-animation:vex-dropin 0.5s;-moz-animation:vex-dropin 0.5s;-ms-animation:vex-dropin 0.5s;-o-animation:vex-dropin 0.5s;-webkit-backface-visibility:hidden;width:100%;border-bottom:5px solid}.vex.vex-theme-top.vex-closing .vex-content{animation:vex-dropout 0.5s;-webkit-animation:vex-dropout 0.5s;-moz-animation:vex-dropout 0.5s;-ms-animation:vex-dropout 0.5s;-o-animation:vex-dropout 0.5s;-webkit-backface-visibility:hidden}@media only screen and (min-width: 600px){.vex.vex-theme-top .vex-dialog-message,.vex.vex-theme-top .vex-dialog-input,.vex.vex-theme-top .vex-dialog-buttons{float:left}.vex.vex-theme-top .vex-dialog-message{width:40%;text-align:right;padding-right:1em}.vex.vex-theme-top .vex-dialog-message h4{padding:0;margin:0;line-height:2.1em}.vex.vex-theme-top .vex-dialog-message p{display:none}.vex.vex-theme-top .vex-dialog-input{width:20%;margin:0}.vex.vex-theme-top .vex-dialog-buttons{width:40%;text-align:left;padding-left:1em}.vex.vex-theme-top .vex-dialog-buttons .vex-dialog-button-primary{width:auto;margin:0;padding:0.5em 1em;border:1px solid}.vex.vex-theme-top .leadin-subscribe-powered-by{position:absolute;bottom:10px;right:10px}}.vex.leadin-popup-color-blue .vex-content{border-color:#3288e6}.vex.leadin-popup-color-blue input:focus{-moz-box-shadow:inset 0 0 0 2px #8dbdf1;-webkit-box-shadow:inset 0 0 0 2px #8dbdf1;box-shadow:inset 0 0 0 2px #8dbdf1}.vex.leadin-popup-color-blue .vex-dialog-button-primary{background:#3288e6;color:#fff}.vex.leadin-popup-color-blue .vex-dialog-button-primary:hover{background:#5fa2ec}.vex.leadin-popup-color-red .vex-content{border-color:#E43833}.vex.leadin-popup-color-red input:focus{-moz-box-shadow:inset 0 0 0 2px #f0908d;-webkit-box-shadow:inset 0 0 0 2px #f0908d;box-shadow:inset 0 0 0 2px #f0908d}.vex.leadin-popup-color-red .vex-dialog-button-primary{background:#E43833;color:#fff}.vex.leadin-popup-color-red .vex-dialog-button-primary:hover{background:#ea6460}.vex.leadin-popup-color-green .vex-content{border-color:#7ED321}.vex.leadin-popup-color-green input:focus{-moz-box-shadow:inset 0 0 0 2px #b0e971;-webkit-box-shadow:inset 0 0 0 2px #b0e971;box-shadow:inset 0 0 0 2px #b0e971}.vex.leadin-popup-color-green .vex-dialog-button-primary{background:#7ED321;color:#fff}.vex.leadin-popup-color-green .vex-dialog-button-primary:hover{background:#97e245}.vex.leadin-popup-color-yellow .vex-content{border-color:#FFBC00}.vex.leadin-popup-color-yellow input:focus{-moz-box-shadow:inset 0 0 0 2px #ffd766;-webkit-box-shadow:inset 0 0 0 2px #ffd766;box-shadow:inset 0 0 0 2px #ffd766}.vex.leadin-popup-color-yellow .vex-dialog-button-primary{background:#FFBC00;color:#fff}.vex.leadin-popup-color-yellow .vex-dialog-button-primary:hover{background:#ffc933}.vex.leadin-popup-color-purple .vex-content{border-color:#BD10E0}.vex.leadin-popup-color-purple input:focus{-moz-box-shadow:inset 0 0 0 2px #db62f4;-webkit-box-shadow:inset 0 0 0 2px #db62f4;box-shadow:inset 0 0 0 2px #db62f4}.vex.leadin-popup-color-purple .vex-dialog-button-primary{background:#BD10E0;color:#fff}.vex.leadin-popup-color-purple .vex-dialog-button-primary:hover{background:#d033f0}.vex.leadin-popup-color-orange .vex-content{border-color:#FF8311}.vex.leadin-popup-color-orange input:focus{-moz-box-shadow:inset 0 0 0 2px #ffb877;-webkit-box-shadow:inset 0 0 0 2px #ffb877;box-shadow:inset 0 0 0 2px #ffb877}.vex.leadin-popup-color-orange .vex-dialog-button-primary{background:#FF8311;color:#fff}.vex.leadin-popup-color-orange .vex-dialog-button-primary:hover{background:#ff9e44}@media only screen and (max-width: 760px){.vex.leadin-subscribe-mobile-hide{display:none}}
assets/js/build/leadin-admin.js CHANGED
@@ -421,6 +421,204 @@ b!==!1&&d.redraw();D(c,f)},setTooltipPoints:function(a){var b=[],c,d,e=this.xAxi
421
  (h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&c<=d;)j[c++]=e}this.tooltipPoints=j}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===t?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;D(this,a?"select":"unselect")},drawTracker:S.drawTrackerGraph});q(R,{Axis:la,Chart:Ya,Color:ya,Point:Ea,Tick:Sa,Renderer:Za,Series:O,SVGElement:P,SVGRenderer:ta,arrayMin:Na,arrayMax:Ba,charts:V,dateFormat:cb,format:Ia,pathAnim:ub,getOptions:function(){return E},
422
  hasBidiBug:Nb,isTouchDevice:Jb,numberFormat:Ga,seriesTypes:F,setOptions:function(a){E=w(!0,E,a);Cb();return E},addEvent:K,removeEvent:W,createElement:Y,discardElement:Pa,css:G,each:p,extend:q,map:Ua,merge:w,pick:m,splat:qa,extendClass:ka,pInt:z,wrap:Ma,svg:aa,canvas:fa,vml:!aa&&!fa,product:"Highcharts",version:"4.0.1"})})();
423
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  jQuery(document).ready( function ( $ ) {
425
 
426
  $('#close-share').click( function( e ) {
@@ -546,18 +744,8 @@ jQuery(document).ready( function ( $ ) {
546
  $('#btn-activate-subscribe').attr('href', window.location.href + '&leadin_action=activate&power_up=subscribe_widget&redirect_to=' + encodeURIComponent(window.location.href + '&activate_popup=true&popup_position=' + $("input:radio[name='popup-position']:checked").val()));
547
  });
548
 
549
- $('#li_subscribe_vex_class, #li_subscribe_heading, #li_subscribe_text, #li_subscribe_btn_label, #li_subscribe_btn_color, #li_subscribe_name_fields:checkbox, #li_subscribe_phone_field:checkbox').change( function ( e ) {
550
- var preview_link = $('#wp-admin-bar-view-site a.ab-item').attr('href') + '?preview-subscribe=1';
551
-
552
- preview_link += '&lis_heading=' + $('#li_subscribe_heading').val();
553
- preview_link += '&lis_desc=' + $('#li_subscribe_text').val();
554
- preview_link += '&lis_show_names=' + ( $('#li_subscribe_name_fields').is(':checked') ? 1 : 0 );
555
- preview_link += '&lis_show_phone=' + ( $('#li_subscribe_phone_field').is(':checked') ? 1 : 0 );
556
- preview_link += '&lis_btn_label=' + $('#li_subscribe_btn_label').val();
557
- preview_link += '&lis_btn_color=' + $('#li_subscribe_btn_color').val();
558
- preview_link += '&lis_vex_class=' + $('#li_subscribe_vex_class option:selected').val();
559
-
560
- $('#preview-popup-link').attr('href', preview_link);
561
  });
562
 
563
  $('#pro-upgrade-button').click( function ( e ) {
@@ -578,7 +766,7 @@ jQuery(document).ready( function ( $ ) {
578
  type: 'POST',
579
  url: li_admin_ajax.ajax_url,
580
  data: {
581
- "action": "leadin_upgrade_to_pro"
582
  },
583
  success: function( redirect_to ) {
584
 
@@ -587,6 +775,19 @@ jQuery(document).ready( function ( $ ) {
587
  }
588
  });
589
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
590
  });
591
 
592
  function leadin_check_social_share_popup ()
421
  (h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&c<=d;)j[c++]=e}this.tooltipPoints=j}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===t?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;D(this,a?"select":"unselect")},drawTracker:S.drawTrackerGraph});q(R,{Axis:la,Chart:Ya,Color:ya,Point:Ea,Tick:Sa,Renderer:Za,Series:O,SVGElement:P,SVGRenderer:ta,arrayMin:Na,arrayMax:Ba,charts:V,dateFormat:cb,format:Ia,pathAnim:ub,getOptions:function(){return E},
422
  hasBidiBug:Nb,isTouchDevice:Jb,numberFormat:Ga,seriesTypes:F,setOptions:function(a){E=w(!0,E,a);Cb();return E},addEvent:K,removeEvent:W,createElement:Y,discardElement:Pa,css:G,each:p,extend:q,map:Ua,merge:w,pick:m,splat:qa,extendClass:ka,pInt:z,wrap:Ma,svg:aa,canvas:fa,vml:!aa&&!fa,product:"Highcharts",version:"4.0.1"})})();
423
  }
424
+ /*! http://mths.be/placeholder v2.1.1 by @mathias */
425
+ (function(factory) {
426
+ if (typeof define === 'function' && define.amd) {
427
+ // AMD
428
+ define(['jquery'], factory);
429
+ } else {
430
+ // Browser globals
431
+ factory(jQuery);
432
+ }
433
+ }(function($) {
434
+
435
+ // Opera Mini v7 doesn't support placeholder although its DOM seems to indicate so
436
+ var isOperaMini = Object.prototype.toString.call(window.operamini) == '[object OperaMini]';
437
+ var isInputSupported = 'placeholder' in document.createElement('input') && !isOperaMini;
438
+ var isTextareaSupported = 'placeholder' in document.createElement('textarea') && !isOperaMini;
439
+ var valHooks = $.valHooks;
440
+ var propHooks = $.propHooks;
441
+ var hooks;
442
+ var placeholder;
443
+
444
+ if (isInputSupported && isTextareaSupported) {
445
+
446
+ placeholder = $.fn.placeholder = function() {
447
+ return this;
448
+ };
449
+
450
+ placeholder.input = placeholder.textarea = true;
451
+
452
+ } else {
453
+
454
+ var settings = {};
455
+
456
+ placeholder = $.fn.placeholder = function(options) {
457
+
458
+ var defaults = {customClass: 'placeholder'};
459
+ settings = $.extend({}, defaults, options);
460
+
461
+ var $this = this;
462
+ $this
463
+ .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]')
464
+ .not('.'+settings.customClass)
465
+ .bind({
466
+ 'focus.placeholder': clearPlaceholder,
467
+ 'blur.placeholder': setPlaceholder
468
+ })
469
+ .data('placeholder-enabled', true)
470
+ .trigger('blur.placeholder');
471
+ return $this;
472
+ };
473
+
474
+ placeholder.input = isInputSupported;
475
+ placeholder.textarea = isTextareaSupported;
476
+
477
+ hooks = {
478
+ 'get': function(element) {
479
+ var $element = $(element);
480
+
481
+ var $passwordInput = $element.data('placeholder-password');
482
+ if ($passwordInput) {
483
+ return $passwordInput[0].value;
484
+ }
485
+
486
+ return $element.data('placeholder-enabled') && $element.hasClass(settings.customClass) ? '' : element.value;
487
+ },
488
+ 'set': function(element, value) {
489
+ var $element = $(element);
490
+
491
+ var $passwordInput = $element.data('placeholder-password');
492
+ if ($passwordInput) {
493
+ return $passwordInput[0].value = value;
494
+ }
495
+
496
+ if (!$element.data('placeholder-enabled')) {
497
+ return element.value = value;
498
+ }
499
+ if (value === '') {
500
+ element.value = value;
501
+ // Issue #56: Setting the placeholder causes problems if the element continues to have focus.
502
+ if (element != safeActiveElement()) {
503
+ // We can't use `triggerHandler` here because of dummy text/password inputs :(
504
+ setPlaceholder.call(element);
505
+ }
506
+ } else if ($element.hasClass(settings.customClass)) {
507
+ clearPlaceholder.call(element, true, value) || (element.value = value);
508
+ } else {
509
+ element.value = value;
510
+ }
511
+ // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
512
+ return $element;
513
+ }
514
+ };
515
+
516
+ if (!isInputSupported) {
517
+ valHooks.input = hooks;
518
+ propHooks.value = hooks;
519
+ }
520
+ if (!isTextareaSupported) {
521
+ valHooks.textarea = hooks;
522
+ propHooks.value = hooks;
523
+ }
524
+
525
+ $(function() {
526
+ // Look for forms
527
+ $(document).delegate('form', 'submit.placeholder', function() {
528
+ // Clear the placeholder values so they don't get submitted
529
+ var $inputs = $('.'+settings.customClass, this).each(clearPlaceholder);
530
+ setTimeout(function() {
531
+ $inputs.each(setPlaceholder);
532
+ }, 10);
533
+ });
534
+ });
535
+
536
+ // Clear placeholder values upon page reload
537
+ $(window).bind('beforeunload.placeholder', function() {
538
+ $('.'+settings.customClass).each(function() {
539
+ this.value = '';
540
+ });
541
+ });
542
+
543
+ }
544
+
545
+ function args(elem) {
546
+ // Return an object of element attributes
547
+ var newAttrs = {};
548
+ var rinlinejQuery = /^jQuery\d+$/;
549
+ $.each(elem.attributes, function(i, attr) {
550
+ if (attr.specified && !rinlinejQuery.test(attr.name)) {
551
+ newAttrs[attr.name] = attr.value;
552
+ }
553
+ });
554
+ return newAttrs;
555
+ }
556
+
557
+ function clearPlaceholder(event, value) {
558
+ var input = this;
559
+ var $input = $(input);
560
+ if (input.value == $input.attr('placeholder') && $input.hasClass(settings.customClass)) {
561
+ if ($input.data('placeholder-password')) {
562
+ $input = $input.hide().nextAll('input[type="password"]:first').show().attr('id', $input.removeAttr('id').data('placeholder-id'));
563
+ // If `clearPlaceholder` was called from `$.valHooks.input.set`
564
+ if (event === true) {
565
+ return $input[0].value = value;
566
+ }
567
+ $input.focus();
568
+ } else {
569
+ input.value = '';
570
+ $input.removeClass(settings.customClass);
571
+ input == safeActiveElement() && input.select();
572
+ }
573
+ }
574
+ }
575
+
576
+ function setPlaceholder() {
577
+ var $replacement;
578
+ var input = this;
579
+ var $input = $(input);
580
+ var id = this.id;
581
+ if (input.value === '') {
582
+ if (input.type === 'password') {
583
+ if (!$input.data('placeholder-textinput')) {
584
+ try {
585
+ $replacement = $input.clone().attr({ 'type': 'text' });
586
+ } catch(e) {
587
+ $replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' }));
588
+ }
589
+ $replacement
590
+ .removeAttr('name')
591
+ .data({
592
+ 'placeholder-password': $input,
593
+ 'placeholder-id': id
594
+ })
595
+ .bind('focus.placeholder', clearPlaceholder);
596
+ $input
597
+ .data({
598
+ 'placeholder-textinput': $replacement,
599
+ 'placeholder-id': id
600
+ })
601
+ .before($replacement);
602
+ }
603
+ $input = $input.removeAttr('id').hide().prevAll('input[type="text"]:first').attr('id', id).show();
604
+ // Note: `$input[0] != input` now!
605
+ }
606
+ $input.addClass(settings.customClass);
607
+ $input[0].value = $input.attr('placeholder');
608
+ } else {
609
+ $input.removeClass(settings.customClass);
610
+ }
611
+ }
612
+
613
+ function safeActiveElement() {
614
+ // Avoid IE9 `document.activeElement` of death
615
+ // https://github.com/mathiasbynens/jquery-placeholder/pull/99
616
+ try {
617
+ return document.activeElement;
618
+ } catch (exception) {}
619
+ }
620
+
621
+ }));
622
  jQuery(document).ready( function ( $ ) {
623
 
624
  $('#close-share').click( function( e ) {
744
  $('#btn-activate-subscribe').attr('href', window.location.href + '&leadin_action=activate&power_up=subscribe_widget&redirect_to=' + encodeURIComponent(window.location.href + '&activate_popup=true&popup_position=' + $("input:radio[name='popup-position']:checked").val()));
745
  });
746
 
747
+ $('input[name=esp]:radio').change( function ( e ) {
748
+ $('#btn-activate-esp').attr('href', window.location.href + '&leadin_action=activate&power_up=' + $("input:radio[name='esp']:checked").val() + '&redirect_to=' + encodeURIComponent(window.location.href + '&activate_esp=true'));
 
 
 
 
 
 
 
 
 
 
749
  });
750
 
751
  $('#pro-upgrade-button').click( function ( e ) {
766
  type: 'POST',
767
  url: li_admin_ajax.ajax_url,
768
  data: {
769
+ "action": "leadin_upgrade_to_pro_ajax_call"
770
  },
771
  success: function( redirect_to ) {
772
 
775
  }
776
  });
777
  });
778
+
779
+ $('#onboarding-step-1-button').click( function ( e ) {
780
+
781
+ if ( ! $('#agree-pp').is(":checked") )
782
+ {
783
+ e.preventDefault();
784
+ $('#agree-pp-error').show();
785
+ return false;
786
+ }
787
+
788
+ });
789
+
790
+ $('input, textarea').placeholder();
791
  });
792
 
793
  function leadin_check_social_share_popup ()
assets/js/build/leadin-admin.min.js CHANGED
@@ -2,7 +2,7 @@ function leadin_check_social_share_popup(){jQuery.ajax({type:"POST",url:li_admin
2
  },text:function(a,b,c,d){var e=fa||!aa&&this.forExport,f={};return d&&!this.forExport?this.html(a,b,c):(f.x=Math.round(b||0),c&&(f.y=Math.round(c)),(a||0===a)&&(f.text=a),a=this.createElement("text").attr(f),e&&a.css({position:"absolute"}),d||(a.xSetter=function(a,b,c){var e,f,d=c.childNodes;for(f=1;f<d.length;f++)e=d[f],e.getAttribute("x")===c.getAttribute("x")&&e.setAttribute("x",a);c.setAttribute(b,a)}),a)},fontMetrics:function(a){var a=a||this.style.fontSize,a=/px/.test(a)?z(a):/em/.test(a)?12*parseFloat(a):12,a=24>a?a+4:u(1.2*a),b=u(.8*a);return{h:a,b:b}},label:function(a,b,c,d,e,f,g,h,i){function j(){var a,b;a=s.element.style,J=(void 0===Va||void 0===wb||n.styles.textAlign)&&s.textStr&&s.getBBox(),n.width=(Va||J.width||0)+2*x+v,n.height=(wb||J.height||0)+2*x,na=x+o.fontMetrics(a&&a.fontSize).b,z&&(m||(a=u(-L*x),b=h?-na:0,n.box=m=d?o.symbol(d,a,b,n.width,n.height,B):o.rect(a,b,n.width,n.height,0,B[Pb]),m.attr("fill",Q).add(n)),m.isImg||m.attr(q({width:u(n.width),height:u(n.height)},B)),B=null)}function k(){var c,a=n.styles,a=a&&a.textAlign,b=v+x*(1-L);c=h?0:na,r(Va)&&J&&("center"===a||"right"===a)&&(b+={center:.5,right:1}[a]*(Va-J.width)),(b!==s.x||c!==s.y)&&(s.attr("x",b),c!==t&&s.attr("y",c)),s.x=b,s.y=c}function l(a,b){m?m.attr(a,b):B[a]=b}var m,J,Va,wb,xb,yb,na,z,o=this,n=o.g(i),s=o.text("",0,0,g).attr({zIndex:1}),L=0,x=3,v=0,y=0,B={};n.onAdd=function(){s.add(n),n.attr({text:a||"",x:b,y:c}),m&&r(e)&&n.attr({anchorX:e,anchorY:f})},n.widthSetter=function(a){Va=a},n.heightSetter=function(a){wb=a},n.paddingSetter=function(a){r(a)&&a!==x&&(x=a,k())},n.paddingLeftSetter=function(a){r(a)&&a!==v&&(v=a,k())},n.alignSetter=function(a){L={left:0,center:.5,right:1}[a]},n.textSetter=function(a){a!==t&&s.textSetter(a),j(),k()},n["stroke-widthSetter"]=function(a,b){a&&(z=!0),y=a%2/2,l(b,a)},n.strokeSetter=n.fillSetter=n.rSetter=function(a,b){"fill"===b&&a&&(z=!0),l(b,a)},n.anchorXSetter=function(a,b){e=a,l(b,a+y-xb)},n.anchorYSetter=function(a,b){f=a,l(b,a-yb)},n.xSetter=function(a){n.x=a,L&&(a-=L*((Va||J.width)+x)),xb=u(a),n.attr("translateX",xb)},n.ySetter=function(a){yb=n.y=u(a),n.attr("translateY",yb)};var A=n.css;return q(n,{css:function(a){if(a){var b={},a=w(a);p("fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow".split(","),function(c){a[c]!==t&&(b[c]=a[c],delete a[c])}),s.css(b)}return A.call(n,a)},getBBox:function(){return{width:J.width+2*x,height:J.height+2*x,x:J.x-x,y:J.y-x}},shadow:function(a){return m&&m.shadow(a),n},destroy:function(){W(n.element,"mouseenter"),W(n.element,"mouseleave"),s&&(s=s.destroy()),m&&(m=m.destroy()),P.prototype.destroy.call(n),n=o=j=k=l=null}})}},Za=ta,q(P.prototype,{htmlCss:function(a){var b=this.element;return(b=a&&"SPAN"===b.tagName&&a.width)&&(delete a.width,this.textWidth=b,this.updateTransform()),this.styles=q(this.styles,a),G(this.element,a),this},htmlGetBBox:function(){var a=this.element,b=this.bBox;return b||("text"===a.nodeName&&(a.style.position="absolute"),b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}),b},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,c=this.translateX||0,d=this.translateY||0,e=this.x||0,f=this.y||0,g=this.textAlign||"left",h={left:0,center:.5,right:1}[g],i=this.shadows;if(G(b,{marginLeft:c,marginTop:d}),i&&p(i,function(a){G(a,{marginLeft:c+1,marginTop:d+1})}),this.inverted&&p(b.childNodes,function(c){a.invertChild(c,b)}),"SPAN"===b.tagName){var k,j=this.rotation,l=z(this.textWidth),o=[j,g,b.innerHTML,this.textWidth].join(",");o!==this.cTT&&(k=a.fontMetrics(b.style.fontSize).b,r(j)&&this.setSpanRotation(j,h,k),i=m(this.elemWidth,b.offsetWidth),i>l&&/[ \-]/.test(b.textContent||b.innerText)&&(G(b,{width:l+"px",display:"block",whiteSpace:"normal"}),i=l),this.getSpanCorrection(i,k,h,j,g)),G(b,{left:e+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"}),ib&&(k=b.offsetHeight),this.cTT=o}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=Aa?"-ms-transform":ib?"-webkit-transform":Ta?"MozTransform":Ib?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)",d[e+(Ta?"Origin":"-origin")]=d.transformOrigin=100*b+"% "+c+"px",G(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c,this.yCorr=-b}}),q(ta.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,f=d.renderer;return d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox,e.innerHTML=this.textStr=a},d.xSetter=d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){"align"===b&&(b="textAlign"),d[b]=a,d.htmlUpdateTransform()},d.attr({text:a,x:u(b),y:u(c)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),d.css=d.htmlCss,f.isSVG&&(d.add=function(a){var b,c=f.box.parentNode,j=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)j.push(a),a=a.parentGroup;p(j.reverse(),function(a){var d;b=a.div=a.div||Y(Ja,{className:H(a.element,"class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c),d=b.style,q(a,{translateXSetter:function(b,c){d.left=b+"px",a[c]=b,a.doTransform=!0},translateYSetter:function(b,c){d.top=b+"px",a[c]=b,a.doTransform=!0},visibilitySetter:function(a,b){d[b]=a}})})}}else b=c;return b.appendChild(e),d.added=!0,d.alignOnAdd&&d.htmlUpdateTransform(),d}),d}});var X;if(!aa&&!fa){R.VMLElement=X={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",";"],e=b===Ja;("shape"===b||e)&&d.push("left:0;top:0;width:1px;height:1px;"),d.push("visibility: ",e?"hidden":"visible"),c.push(' style="',d.join(""),'"/>'),b&&(c=e||"span"===b||"img"===b?c.join(""):a.prepVML(c),this.element=Y(c)),this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;return a&&a.inverted&&b.invertChild(c,d),d.appendChild(c),this.added=!0,this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform(),this.onAdd&&this.onAdd(),this},updateTransform:P.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=Z(a*Ca),c=ea(a*Ca);G(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):Q})},getSpanCorrection:function(a,b,c,d,e){var i,f=d?Z(d*Ca):1,g=d?ea(d*Ca):0,h=m(this.elemHeight,this.element.offsetHeight);this.xCorr=0>f&&-a,this.yCorr=0>g&&-h,i=0>f*g,this.xCorr+=g*b*(i?1-c:c),this.yCorr-=f*b*(d?i?c:1-c:1),e&&"left"!==e&&(this.xCorr-=a*c*(0>f?-1:1),d&&(this.yCorr-=h*c*(0>g?-1:1)),G(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)ha(a[b])?c[b]=u(10*a[b])-5:"Z"===a[b]?c[b]="x":(c[b]=a[b],!a.isArc||"wa"!==a[b]&&"at"!==a[b]||(c[b+5]===c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1)));return c.join(" ")||"x"},clip:function(a){var c,b=this;return a?(c=a.members,ja(c,b),c.push(b),b.destroyClip=function(){ja(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:hb?"inherit":"rect(auto)"}),b.css(a)},css:P.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Pa(a)},destroy:function(){return this.destroyClip&&this.destroyClip(),P.prototype.destroy.apply(this)},on:function(a,b){return this.element["on"+a]=function(){var a=I.event;a.target=a.srcElement,b(a)},this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);return c=a.length,(9===c||11===c)&&(a[c-4]=a[c-2]=z(a[c-2])-10*b),a.join(" ")},shadow:function(a,b,c){var e,h,j,l,o,n,s,d=[],f=this.element,g=this.renderer,i=f.style,k=f.path;if(k&&"string"!=typeof k.value&&(k="x"),o=k,a){for(n=m(a.width,3),s=(a.opacity||.15)/n,e=1;3>=e;e++)l=2*n+1-2*e,c&&(o=this.cutOffPath(k.value,l+.5)),j=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',o,'" coordsize="10 10" style="',f.style.cssText,'" />'],h=Y(g.prepVML(j),null,{left:z(i.left)+m(a.offsetX,1),top:z(i.top)+m(a.offsetY,1)}),c&&(h.cutOff=l+1),j=['<stroke color="',a.color||"black",'" opacity="',s*e,'"/>'],Y(g.prepVML(j),null,null,h),b?b.element.appendChild(h):f.parentNode.insertBefore(h,f),d.push(h);this.shadows=d}return this},updateShadows:sa,setAttr:function(a,b){hb?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a,b,c){(c.getElementsByTagName("stroke")[0]||Y(this.renderer.prepVML(["<stroke/>"]),null,null,c))[b]=a||"solid",this[b]=a},dSetter:function(a,b,c){var d=this.shadows,a=a||[];if(this.d=a.join(" "),c.path=a=this.pathToVML(a),d)for(c=d.length;c--;)d[c].path=d[c].cutOff?this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;"SPAN"===d?c.style.color=a:"IMG"!==d&&(c.filled=a!==Q,this.setAttr("fillcolor",this.renderer.color(a,c,b,this)))},opacitySetter:sa,rotationSetter:function(a,b,c){c=c.style,this[b]=c[b]=a,c.left=-u(ea(a*Ca)+1)+"px",c.top=u(Z(a*Ca))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a,this[b]=a,ha(a)&&(a+="px"),this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){"inherit"===a&&(a="visible"),this.shadows&&p(this.shadows,function(c){c.style[b]=a}),"DIV"===c.nodeName&&(a="hidden"===a?"-999em":0,hb||(c.style[b]=a?"visible":"hidden"),b="top"),c.style[b]=a},xSetter:function(a,b,c){this[b]=a,"x"===b?b="left":"y"===b&&(b="top"),this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}},X=ka(P,X),X.prototype.ySetter=X.prototype.widthSetter=X.prototype.heightSetter=X.prototype.xSetter;var ga={Element:X,isIE8:wa.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;if(this.alignedObjects=[],d=this.createElement(Ja).css(q(this.getStyle(d),{position:"relative"})),e=d.element,a.appendChild(d.element),this.isVML=!0,this.box=e,this.boxWrapper=d,this.cache={},this.setSize(b,c,!1),!y.namespaces.hcv){y.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{y.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){y.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=ca(a);return q(e,{members:[],left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-("shape"===c?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+u(a?e:d)+"px,"+u(a?f:b)+"px,"+u(a?b:f)+"px,"+u(a?d:e)+"px)"};return!a&&hb&&"DIV"===c&&q(d,{width:b+"px",height:f+"px"}),d},updateClipping:function(){p(e.members,function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var f,h,i,e=this,g=/^rgba/,j=Q;if(a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern"),i){var k,l,n,s,m,J,L,r,o=a.linearGradient||a.radialGradient,x="",a=a.stops,v=[],q=function(){h=['<fill colors="'+v.join(",")+'" opacity="',m,'" o:opacity2="',s,'" type="',i,'" ',x,'focus="100%" method="any" />'],Y(e.prepVML(h),null,null,b)};if(n=a[0],r=a[a.length-1],n[0]>0&&a.unshift([0,n[1]]),r[0]<1&&a.push([1,r[1]]),p(a,function(a,b){g.test(a[1])?(f=ya(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1),v.push(100*a[0]+"% "+k),b?(m=l,J=k):(s=l,L=k)}),"fill"===c)if("gradient"===i)c=o.x1||o[0]||0,a=o.y1||o[1]||0,n=o.x2||o[2]||0,o=o.y2||o[3]||0,x='angle="'+(90-180*U.atan((o-a)/(n-c))/ma)+'"',q();else{var w,j=o.r,t=2*j,u=2*j,y=o.cx,B=o.cy,na=b.radialReference,j=function(){na&&(w=d.getBBox(),y+=(na[0]-w.x)/w.width-.5,B+=(na[1]-w.y)/w.height-.5,t*=na[2]/w.width,u*=na[2]/w.height),x='src="'+E.global.VMLRadialGradientURL+'" size="'+t+","+u+'" origin="0.5,0.5" position="'+y+","+B+'" color2="'+L+'" ',q()};d.added?j():d.onAdd=j,j=J}else j=k}else g.test(a)&&"IMG"!==b.tagName?(f=ya(a),h=["<",c,' opacity="',f.get("a"),'"/>'],Y(this.prepVML(h),null,null,b),j=f.get("rgb")):(j=b.getElementsByTagName(c),j.length&&(j[0].opacity=1,j[0].type="solid"),j=a);return j},prepVML:function(a){var b=this.isIE8,a=a.join("");return b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=-1===a.indexOf('style="')?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:"),a},text:ta.prototype.html,path:function(a){var b={coordsize:"10 10"};return La(a)?b.d=a:ca(a)&&q(b,a),this.createElement("shape").attr(b)},circle:function(a,b,c){var d=this.symbol("circle");return ca(a)&&(c=a.r,b=a.y,a=a.x),d.isCircle=!0,d.r=c,d.attr({x:a,y:b})},g:function(a){var b;return a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a}),this.createElement(Ja).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});return arguments.length>1&&f.attr({x:b,y:c,width:d,height:e}),f},createElement:function(a){return"rect"===a?this.symbol(a):ta.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e="IMG"===a.tagName&&a.style;G(a,{flip:"x",left:z(d.width)-(e?z(e.top):1),top:z(d.height)-(e?z(e.left):1),rotation:-90}),p(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c||d,c=e.innerR,d=Z(f),i=ea(f),j=Z(g),k=ea(g);return g-f===0?["x"]:(f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*j,b+h*k],e.open&&!c&&f.push("e","M",a,b),f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e"),f.isArc=!0,f)},circle:function(a,b,c,d,e){return e&&(c=d=2*e.r),e&&e.isCircle&&(a-=c/2,b-=d/2),["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){return ta.prototype.symbols[r(e)&&e.r?"callout":"square"].call(0,a,b,c,d,e)}}};R.VMLRenderer=X=function(){this.init.apply(this,arguments)},X.prototype=w(ta.prototype,ga),Za=X}ta.prototype.measureSpanWidth=function(a,b){var d,c=y.createElement("span");return d=y.createTextNode(a),c.appendChild(d),G(c,b),this.box.appendChild(c),d=c.offsetWidth,Pa(c),d};var Lb;fa&&(R.CanVGRenderer=X=function(){xa="http://www.w3.org/1999/xhtml"},X.prototype.symbols={},Lb=function(){function a(){var d,a=b.length;for(d=0;a>d;d++)b[d]();b=[]}var b=[];return{push:function(c,d){0===b.length&&Qb(d,a),b.push(c)}}}(),Za=X),Sa.prototype={addLabel:function(){var l,a=this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories,f=a.names,g=this.pos,h=b.labels,i=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/i.length||!d&&(c.margin[3]||.33*c.chartWidth),j=g===i[0],k=g===i[i.length-1],f=e?m(e[g],f[g],g):g,e=this.label,o=i.info;a.isDatetimeAxis&&o&&(l=b.dateTimeLabelFormats[o.higherRanks[g]||o.unitName]),this.isFirst=j,this.isLast=k,b=a.labelFormatter.call({axis:a,chart:c,isFirst:j,isLast:k,dateTimeLabelFormat:l,value:a.isLog?da(ia(f)):f}),g=d&&{width:v(1,u(d-2*(h.padding||10)))+"px"},g=q(g,h.style),r(e)?e&&e.attr({text:b}).css(g):(l={align:a.labelAlign},ha(h.rotation)&&(l.rotation=h.rotation),d&&h.ellipsis&&(l._clipHeight=a.len/i.length),this.label=r(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(l).css(g).add(a.labelGroup):null)},getLabelSize:function(){var a=this.label,b=this.axis;return a?a.getBBox()[b.horiz?"height":"width"]:0},getLabelSides:function(){var a=this.label.getBBox(),b=this.axis,c=b.horiz,d=b.options.labels,a=c?a.width:a.height,b=c?d.x-a*{left:0,center:.5,right:1}[b.labelAlign]:0;return[b,c?a+b:a]},handleOverflow:function(a,b){var l,o,n,c=!0,d=this.axis,e=this.isFirst,f=this.isLast,g=d.horiz?b.x:b.y,h=d.reversed,i=d.tickPositions,j=this.getLabelSides(),k=j[0],j=j[1],s=this.label.line||0;if(l=d.labelEdge,o=d.justifyLabels&&(e||f),l[s]===t||g+k>l[s]?l[s]=g+j:o||(c=!1),o){l=(o=d.justifyToPlot)?d.pos:0,o=o?l+d.len:d.chart.chartWidth;do a+=e?1:-1,n=d.ticks[i[a]];while(i[a]&&(!n||n.label.line!==s));d=n&&n.label.xy&&n.label.xy.x+n.getLabelSides()[e?0:1],e&&!h||f&&h?l>g+k&&(g=l-k,n&&g+j>d&&(c=!1)):g+j>o&&(g=o-j,n&&d>g+k&&(c=!1)),b.x=g}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis,j=i.transA,k=i.reversed,l=i.staggerLines,o=i.chart.renderer.fontMetrics(e.style.fontSize).b,n=e.rotation,a=a+e.x-(f&&d?f*j*(k?-1:1):0),b=b+e.y-(f&&!d?f*j*(k?1:-1):0);return n&&2===i.side&&(b-=o-o*Z(n*Ca)),!r(e.y)&&!n&&(b+=o-c.getBBox().height/2),l&&(c.line=g/(h||1)%l,b+=c.line*(i.labelOffset/l)),{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,l=this.gridLine,o=h?h+"Grid":"grid",n=h?h+"Tick":"tick",s=e[o+"LineWidth"],p=e[o+"LineColor"],J=e[o+"LineDashStyle"],L=e[n+"Length"],o=e[n+"Width"]||0,x=e[n+"Color"],r=e[n+"Position"],n=this.mark,v=k.step,q=!0,u=d.tickmarkOffset,w=this.getPosition(g,j,u,b),y=w.x,w=w.y,B=g&&y===d.pos+d.len||!g&&w===d.pos?-1:1;this.isActive=!0,s&&(j=d.getPlotLinePath(j+u,s*B,b,!0),l===t&&(l={stroke:p,"stroke-width":s},J&&(l.dashstyle=J),h||(l.zIndex=1),b&&(l.opacity=0),this.gridLine=l=s?f.path(j).attr(l).add(d.gridGroup):null),!b&&l&&j&&l[this.isNew?"attr":"animate"]({d:j,opacity:c})),o&&L&&("inside"===r&&(L=-L),d.opposite&&(L=-L),h=this.getMarkPath(y,w,L,o*B,g,f),n?n.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:x,"stroke-width":o,opacity:c}).add(d.axisGroup)),i&&!isNaN(y)&&(i.xy=w=this.getLabelPosition(y,w,i,g,k,u,a,v),this.isFirst&&!this.isLast&&!m(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!m(e.showLastLabel,1)?q=!1:!d.isRadial&&!k.step&&!k.rotation&&!b&&0!==c&&(q=this.handleOverflow(a,w)),v&&a%v&&(q=!1),q&&!isNaN(w.y)?(w.opacity=c,i[this.isNew?"attr":"animate"](w),this.isNew=!1):i.attr("y",-9999))},destroy:function(){Oa(this,this.axis)}},R.PlotLineOrBand=function(a,b){this.axis=a,b&&(this.options=b,this.id=b.id)},R.PlotLineOrBand.prototype={render:function(){var p,a=this,b=a.axis,c=b.horiz,d=(b.pointRange||0)/2,e=a.options,f=e.label,g=a.label,h=e.width,i=e.to,j=e.from,k=r(j)&&r(i),l=e.value,o=e.dashStyle,n=a.svgElem,s=[],J=e.color,L=e.zIndex,x=e.events,q={},t=b.chart.renderer;if(b.isLog&&(j=za(j),i=za(i),l=za(l)),h)s=b.getPlotLinePath(l,h),q={stroke:J,"stroke-width":h},o&&(q.dashstyle=o);else{if(!k)return;j=v(j,b.min-d),i=C(i,b.max+d),s=b.getPlotBandPath(j,i,e),J&&(q.fill=J),e.borderWidth&&(q.stroke=e.borderColor,q["stroke-width"]=e.borderWidth)}if(r(L)&&(q.zIndex=L),n)s?n.animate({d:s},null,n.onGetPath):(n.hide(),n.onGetPath=function(){n.show()},g&&(a.label=g=g.destroy()));else if(s&&s.length&&(a.svgElem=n=t.path(s).attr(q).add(),x))for(p in d=function(b){n.on(b,function(c){x[b].apply(a,[c])})},x)d(p);return f&&r(f.text)&&s&&s.length&&b.width>0&&b.height>0?(f=w({align:c&&k&&"center",x:c?!k&&4:10,verticalAlign:!c&&k&&"middle",y:c?k?16:10:k?6:-4,rotation:c&&!k&&90},f),g||(q={align:f.textAlign||f.align,rotation:f.rotation},r(L)&&(q.zIndex=L),a.label=g=t.text(f.text,0,0,f.useHTML).attr(q).css(f.style).add()),b=[s[1],s[4],m(s[6],s[1])],s=[s[2],s[5],m(s[7],s[2])],c=Na(b),k=Na(s),g.align(f,!1,{x:c,y:k,width:Ba(b)-c,height:Ba(s)-k}),g.show()):g&&g.hide(),a},destroy:function(){ja(this.axis.plotLinesAndBands,this),delete this.axis,Oa(this)}},la.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:N,lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return Ga(this.total,-1)},style:N.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:20},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c,this.coll=(this.isXAxis=c)?"xAxis":"yAxis",this.opposite=b.opposite,this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter,this.userOptions=b,this.minPixelPadding=0,this.chart=a,this.reversed=d.reversed,this.zoomEnabled=d.zoomEnabled!==!1,this.categories=d.categories||"category"===e,this.names=[],this.isLog="logarithmic"===e,this.isDatetimeAxis="datetime"===e,this.isLinked=r(d.linkedTo),this.tickmarkOffset=this.categories&&"between"===d.tickmarkPlacement?.5:0,this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=d.minRange||d.maxZoom,this.range=d.range,this.offset=d.offset||0,this.stacks={},this.oldStacks={},this.min=this.max=null,this.crosshair=m(d.crosshair,qa(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;-1===Da(this,a.axes)&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this)),this.series=this.series||[],a.inverted&&c&&this.reversed===t&&(this.reversed=!0),this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)K(this,f,d[f]);this.isLog&&(this.val2lin=za,this.lin2val=ia)},setOptions:function(a){this.options=w(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],w(E[this.coll],a))},defaultLabelFormatter:function(){var g,a=this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,e=E.lang.numericSymbols,f=e&&e.length,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Ia(h,this);else if(c)g=b;else if(d)g=cb(d,b);else if(f&&a>=1e3)for(;f--&&g===t;)c=Math.pow(1e3,f+1),a>=c&&null!==e[f]&&(g=Ga(b/c,-1)+e[f]);return g===t&&(g=M(b)>=1e4?Ga(b,0):Ga(b,-1,t,"")),g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1,a.dataMin=a.dataMax=null,a.buildStacks&&a.buildStacks(),p(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d;d=c.options.threshold;var e;a.hasVisibleSeries=!0,a.isLog&&0>=d&&(d=null),a.isXAxis?(d=c.xData,d.length&&(a.dataMin=C(m(a.dataMin,d[0]),Na(d)),a.dataMax=v(m(a.dataMax,d[0]),Ba(d)))):(c.getExtremes(),e=c.dataMax,c=c.dataMin,r(c)&&r(e)&&(a.dataMin=C(m(a.dataMin,c),c),a.dataMax=v(m(a.dataMax,e),e)),r(d)&&(a.dataMin>=d?(a.dataMin=d,a.ignoreMinPadding=!0):a.dataMax<d&&(a.dataMax=d,a.ignoreMaxPadding=!0)))}})},translate:function(a,b,c,d,e,f){var g=1,h=0,i=d?this.oldTransA:this.transA,d=d?this.oldMin:this.min,j=this.minPixelPadding,e=(this.options.ordinal||this.isLog&&e)&&this.lin2val;return i||(i=this.transA),c&&(g*=-1,h=this.len),this.reversed&&(g*=-1,h-=g*(this.sector||this.len)),b?(a=a*g+h,a-=j,a=a/i+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),"between"===f&&(f=.5),a=g*(a-d)*i+h+g*j+(ha(f)?i*f*this.pointRange:0)),a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,d,e){var i,j,o,f=this.chart,g=this.left,h=this.top,k=c&&f.oldChartHeight||f.chartHeight,l=c&&f.oldChartWidth||f.chartWidth;return i=this.transB,e=m(e,this.translate(a,null,null,c)),a=c=u(e+i),i=j=u(k-e-i),isNaN(e)?o=!0:this.horiz?(i=h,j=k-this.bottom,(g>a||a>g+this.width)&&(o=!0)):(a=g,c=l-this.right,(h>i||i>h+this.height)&&(o=!0)),o&&!d?null:f.renderer.crispLine(["M",a,i,"L",c,j],b||1)},getLinearTickPositions:function(a,b,c){var d,e=da(T(b/a)*a),f=da(Ka(c/a)*a),g=[];if(b===c&&ha(b))return[b];for(b=e;f>=b&&(g.push(b),b=da(b+a),b!==d);)d=b;return g},getMinorTickPositions:function(){var e,a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[];if(this.isLog)for(e=b.length,a=1;e>a;a++)d=d.concat(this.getLogTickPositions(c,b[a-1],b[a],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)d=d.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&d.shift();else for(b=this.min+(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var d,f,g,h,i,j,a=this.options,b=this.min,c=this.max,e=this.dataMax-this.dataMin>=this.minRange;if(this.isXAxis&&this.minRange===t&&!this.isLog&&(r(a.min)||r(a.max)?this.minRange=null:(p(this.series,function(a){for(i=a.xData,g=j=a.xIncrement?1:i.length-1;g>0;g--)h=i[g]-i[g-1],(f===t||f>h)&&(f=h)}),this.minRange=C(5*f,this.dataMax-this.dataMin))),c-b<this.minRange){var k=this.minRange;d=(k-c+b)/2,d=[b-d,m(a.min,b-d)],e&&(d[2]=this.dataMin),b=Ba(d),c=[b+k,m(a.max,b+k)],e&&(c[2]=this.dataMax),c=Na(c),k>c-b&&(d[0]=c-k,d[1]=m(a.min,c-k),b=Ba(d))}this.min=b,this.max=c},setAxisTranslation:function(a){var e,b=this,c=b.max-b.min,d=b.axisPointRange||0,f=0,g=0,h=b.linkedParent,i=!!b.categories,j=b.transA;(b.isXAxis||i||d)&&(h?(f=h.minPointOffset,g=h.pointRangePadding):p(b.series,function(a){var h=i?1:b.isXAxis?a.pointRange:b.axisPointRange||0,j=a.options.pointPlacement,n=a.closestPointRange;h>c&&(h=0),d=v(d,h),f=v(f,Fa(j)?0:h/2),g=v(g,"on"===j?0:h),!a.noSharedTooltip&&r(n)&&(e=r(e)?C(e,n):n)}),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=C(d,c),b.closestPointRange=e),a&&(b.oldTransA=j),b.translationSlope=b.transA=j=b.len/(c+g||1),b.transB=b.horiz?b.left:b.bottom,b.minPixelPadding=j*f},setTickPositions:function(a){var s,b=this,c=b.chart,d=b.options,e=b.isLog,f=b.isDatetimeAxis,g=b.isXAxis,h=b.isLinked,i=b.options.tickPositioner,j=d.maxPadding,k=d.minPadding,l=d.tickInterval,o=d.minTickInterval,n=d.tickPixelInterval,$=b.categories;h?(b.linkedParent=c[b.coll][d.linkedTo],c=b.linkedParent.getExtremes(),b.min=m(c.min,c.dataMin),b.max=m(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&ra(11,1)):(b.min=m(b.userMin,d.min,b.dataMin),b.max=m(b.userMax,d.max,b.dataMax)),e&&(!a&&C(b.min,m(b.dataMin,b.min))<=0&&ra(10,1),b.min=da(za(b.min)),b.max=da(za(b.max))),b.range&&r(b.max)&&(b.userMin=b.min=v(b.min,b.max-b.range),b.userMax=b.max,b.range=null),b.beforePadding&&b.beforePadding(),b.adjustForMinRange(),$||b.axisPointRange||b.usePercentage||h||!r(b.min)||!r(b.max)||!(c=b.max-b.min)||(r(d.min)||r(b.userMin)||!k||!(b.dataMin<0)&&b.ignoreMinPadding||(b.min-=c*k),r(d.max)||r(b.userMax)||!j||!(b.dataMax>0)&&b.ignoreMaxPadding||(b.max+=c*j)),ha(d.floor)&&(b.min=v(b.min,d.floor)),ha(d.ceiling)&&(b.max=C(b.max,d.ceiling)),b.min===b.max||void 0===b.min||void 0===b.max?b.tickInterval=1:h&&!l&&n===b.linkedParent.options.tickPixelInterval?b.tickInterval=b.linkedParent.tickInterval:(b.tickInterval=m(l,$?1:(b.max-b.min)*n/v(b.len,n)),!r(l)&&b.len<n&&!this.isRadial&&!this.isLog&&!$&&d.startOnTick&&d.endOnTick&&(s=!0,b.tickInterval/=4)),g&&!a&&p(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)}),b.setAxisTranslation(!0),b.beforeSetTickPositions&&b.beforeSetTickPositions(),b.postProcessTickInterval&&(b.tickInterval=b.postProcessTickInterval(b.tickInterval)),b.pointRange&&(b.tickInterval=v(b.pointRange,b.tickInterval)),!l&&b.tickInterval<o&&(b.tickInterval=o),f||e||l||(b.tickInterval=nb(b.tickInterval,null,mb(b.tickInterval),d)),b.minorTickInterval="auto"===d.minorTickInterval&&b.tickInterval?b.tickInterval/5:d.minorTickInterval,b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):i&&i.apply(b,[b.min,b.max]),a||(!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>v(2*b.len,200)&&ra(19,!0),a=f?b.getTimeTicks(b.normalizeTimeTickInterval(b.tickInterval,d.units),b.min,b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,!0):e?b.getLogTickPositions(b.tickInterval,b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),s&&a.splice(1,a.length-2),b.tickPositions=a),h||(e=a[0],f=a[a.length-1],h=b.minPointOffset||0,d.startOnTick?b.min=e:b.min-h>e&&a.shift(),d.endOnTick?b.max=f:b.max+h<f&&a.pop(),1===a.length&&(d=M(b.max)>1e13?1:.001,b.min-=d,b.max+=d))},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,d=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");!this.isLinked&&!this.isDatetimeAxis&&c&&c.length>(b[d]||0)&&this.options.alignTicks!==!1&&(b[d]=c.length),a.maxTicks=b},adjustTickAmount:function(){var a=this._maxTicksKey,b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==t){var d=this.tickAmount,e=b.length;if(this.tickAmount=a=c[a],a>e){for(;b.length<a;)b.push(da(b[b.length-1]+this.tickInterval));this.transA*=(e-1)/(a-1),this.max=b[b.length-1]}r(d)&&a!==d&&(this.isDirty=!0)}},setScale:function(){var b,c,d,e,a=this.stacks;if(this.oldMin=this.min,this.oldMax=this.max,this.oldAxisLength=this.len,this.setAxisSize(),e=this.len!==this.oldAxisLength,p(this.series,function(a){(a.isDirtyData||a.isDirty||a.xAxis.isDirty)&&(d=!0)}),e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)for(c in a[b])a[b][c].total=null,a[b][c].cum=0;this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickPositions(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax)}else if(!this.isXAxis){this.oldStacks&&(a=this.stacks=this.oldStacks);for(b in a)for(c in a[b])a[b][c].cum=a[b][c].total}this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart,c=m(c,!0),e=q(e,{min:a,max:b});D(f,"setExtremes",e,function(){f.userMin=a,f.userMax=b,f.eventArgs=e,f.isDirtyExtremes=!0,c&&g.redraw(d)})},zoom:function(a,b){var c=this.dataMin,d=this.dataMax,e=this.options;return this.allowZoomOutside||(r(c)&&a<=C(c,m(e.min,c))&&(a=t),r(d)&&b>=v(d,m(e.max,d))&&(b=t)),this.displayBtn=a!==t||b!==t,this.setExtremes(a,b,!1,t,{trigger:"zoom"}),!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=m(b.width,a.plotWidth-c+(b.offsetRight||0)),f=m(b.height,a.plotHeight),g=m(b.top,a.plotTop),b=m(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=parseInt(f,10)/100*a.plotHeight),c.test(g)&&(g=parseInt(g,10)/100*a.plotHeight+a.plotTop),this.left=b,this.top=g,this.width=e,this.height=f,this.bottom=a.chartHeight-f-g,this.right=a.chartWidth-e-b,this.len=v(d?e:f,0),this.pos=d?b:g},getExtremes:function(){var a=this.isLog;return{min:a?da(ia(this.min)):this.min,max:a?da(ia(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?ia(this.min):this.min,b=b?ia(this.max):this.max;return c>a||null===a?a=c:a>b&&(a=b),this.translate(a,0,1,0,1)},autoLabelAlign:function(a){return a=(m(a,0)-90*this.side+720)%360,a>15&&165>a?"right":a>195&&345>a?"left":"center"},getOffset:function(){var j,l,q,y,z,A,B,a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,k=0,o=0,n=d.title,s=d.labels,$=0,J=b.axisOffset,L=b.clipOffset,x=[-1,1,1,-1][h],u=1,w=m(s.maxStaggerLines,5),na=2===h?c.fontMetrics(s.style.fontSize).b:0;if(a.hasData=j=a.hasVisibleSeries||r(a.min)&&r(a.max)&&!!e,a.showAxis=b=j||m(d.showEmpty,!0),a.staggerLines=a.horiz&&s.staggerLines,a.axisGroup||(a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:s.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add()),j||a.isLinked){if(a.labelAlign=m(s.align||a.autoLabelAlign(s.rotation)),p(e,function(b){f[b]?f[b].addLabel():f[b]=new Sa(a,b)
3
  }),a.horiz&&!a.staggerLines&&w&&!s.rotation){for(q=a.reversed?[].concat(e).reverse():e;w>u;){for(j=[],y=!1,s=0;s<q.length;s++)z=q[s],A=(A=f[z].label&&f[z].label.getBBox())?A.width:0,B=s%u,A&&(z=a.translate(z),j[B]!==t&&z<j[B]&&(y=!0),j[B]=z+A);if(!y)break;u++}u>1&&(a.staggerLines=u)}p(e,function(b){(0===h||2===h||{1:"left",3:"right"}[h]===a.labelAlign)&&($=v(f[b].getLabelSize(),$))}),a.staggerLines&&($*=a.staggerLines,a.labelOffset=$)}else for(q in f)f[q].destroy(),delete f[q];n&&n.text&&n.enabled!==!1&&(a.axisTitle||(a.axisTitle=c.text(n.text,0,0,n.useHTML).attr({zIndex:7,rotation:n.rotation||0,align:n.textAlign||{low:"left",middle:"center",high:"right"}[n.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(n.style).add(a.axisGroup),a.axisTitle.isNew=!0),b&&(k=a.axisTitle.getBBox()[g?"height":"width"],o=m(n.margin,g?5:10),l=n.offset),a.axisTitle[b?"show":"hide"]()),a.offset=x*m(d.offset,J[h]),a.axisTitleMargin=m(l,$+o+($&&x*d.labels[g?"y":"x"]-na)),J[h]=v(J[h],a.axisTitleMargin+k+x*a.offset),L[i]=v(L[i],2*T(d.lineWidth/2))},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;return c&&(a*=-1),b.renderer.crispLine(["M",e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=z(e.style.fontSize||12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(2===this.side?i:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var j,u,z,a=this,b=a.horiz,c=a.reversed,d=a.chart,e=d.renderer,f=a.options,g=a.isLog,h=a.isLinked,i=a.tickPositions,k=a.axisTitle,l=a.ticks,o=a.minorTicks,n=a.alternateBands,s=f.stackLabels,m=f.alternateGridColor,J=a.tickmarkOffset,L=f.lineWidth,x=d.hasRendered&&r(a.oldMin)&&!isNaN(a.oldMin),q=a.hasData,v=a.showAxis,w=f.labels.overflow,y=a.justifyLabels=b&&w!==!1;a.labelEdge.length=0,a.justifyToPlot="justify"===w,p([l,o,n],function(a){for(var b in a)a[b].isActive=!1}),(q||h)&&(a.minorTickInterval&&!a.categories&&p(a.getMinorTickPositions(),function(b){o[b]||(o[b]=new Sa(a,b,"minor")),x&&o[b].isNew&&o[b].render(null,!0),o[b].render(null,!1,1)}),i.length&&(j=i.slice(),(b&&c||!b&&!c)&&j.reverse(),y&&(j=j.slice(1).concat([j[0]])),p(j,function(b,c){y&&(c=c===j.length-1?0:c+1),(!h||b>=a.min&&b<=a.max)&&(l[b]||(l[b]=new Sa(a,b)),x&&l[b].isNew&&l[b].render(c,!0,.1),l[b].render(c,!1,1))}),J&&0===a.min&&(l[-1]||(l[-1]=new Sa(a,-1,null,!0)),l[-1].render(-1))),m&&p(i,function(b,c){c%2===0&&b<a.max&&(n[b]||(n[b]=new R.PlotLineOrBand(a)),u=b+J,z=i[c+1]!==t?i[c+1]+J:a.max,n[b].options={from:g?ia(u):u,to:g?ia(z):z,color:m},n[b].render(),n[b].isActive=!0)}),a._addedPlotLB||(p((f.plotLines||[]).concat(f.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0)),p([l,o,n],function(a){var b,c,e=[],f=va?va.duration||500:0,g=function(){for(c=e.length;c--;)a[e[c]]&&!a[e[c]].isActive&&(a[e[c]].destroy(),delete a[e[c]])};for(b in a)a[b].isActive||(a[b].render(b,!1,0),a[b].isActive=!1,e.push(b));a!==n&&d.hasRendered&&f?f&&setTimeout(g,f):g()}),L&&(b=a.getLinePath(L),a.axisLine?a.axisLine.animate({d:b}):a.axisLine=e.path(b).attr({stroke:f.lineColor,"stroke-width":L,zIndex:7}).add(a.axisGroup),a.axisLine[v?"show":"hide"]()),k&&v&&(k[k.isNew?"attr":"animate"](a.getTitlePosition()),k.isNew=!1),s&&s.enabled&&a.renderStackTotals(),a.isDirty=!1},redraw:function(){var a=this.chart.pointer;a&&a.reset(!0),this.render(),p(this.plotLinesAndBands,function(a){a.render()}),p(this.series,function(a){a.isDirty=!0})},destroy:function(a){var d,b=this,c=b.stacks,e=b.plotLinesAndBands;a||W(b);for(d in c)Oa(c[d]),c[d]=null;for(p([b.ticks,b.minorTicks,b.alternateBands],function(a){Oa(a)}),a=e.length;a--;)e[a].destroy();p("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(a){b[a]&&(b[a]=b[a].destroy())}),this.cross&&this.cross.destroy()},drawCrosshair:function(a,b){if(this.crosshair)if((r(b)||!m(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var c,d=this.crosshair,e=d.animation;m(d.snap,!0)?r(b)&&(c=this.chart.inverted!=this.horiz?b.plotX:this.len-b.plotY):c=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos,c=this.isRadial?this.getPlotLinePath(this.isXAxis?b.x:m(b.stackY,b.y)):this.getPlotLinePath(null,null,null,null,c),null===c?this.hideCrosshair():this.cross?this.cross.attr({visibility:"visible"})[e?"animate":"attr"]({d:c},e):(e={"stroke-width":d.width||1,stroke:d.color||"#C0C0C0",zIndex:d.zIndex||2},d.dashStyle&&(e.dashstyle=d.dashStyle),this.cross=this.chart.renderer.path(c).attr(e).add())}},hideCrosshair:function(){this.cross&&this.cross.hide()}},q(la.prototype,{getPlotBandPath:function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a);return d&&c?d.push(c[4],c[5],c[1],c[2]):d=null,d},addPlotBand:function(a){this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(a,b){var c=new R.PlotLineOrBand(this,a).render(),d=this.userOptions;return c&&(b&&(d[b]=d[b]||[],d[b].push(a)),this.plotLinesAndBands.push(c)),c},removePlotBandOrLine:function(a){for(var b=this.plotLinesAndBands,c=this.options,d=this.userOptions,e=b.length;e--;)b[e].id===a&&b[e].destroy();p([c.plotLines||[],d.plotLines||[],c.plotBands||[],d.plotBands||[]],function(b){for(e=b.length;e--;)b[e].id===a&&ja(b,b[e])})}}),la.prototype.getTimeTicks=function(a,b,c,d){var h,e=[],f={},g=E.global.useUTC,i=new Date(b-Ra),j=a.unitRange,k=a.count;if(r(b)){j>=A.second&&(i.setMilliseconds(0),i.setSeconds(j>=A.minute?0:k*T(i.getSeconds()/k))),j>=A.minute&&i[Db](j>=A.hour?0:k*T(i[pb]()/k)),j>=A.hour&&i[Eb](j>=A.day?0:k*T(i[qb]()/k)),j>=A.day&&i[sb](j>=A.month?1:k*T(i[Xa]()/k)),j>=A.month&&(i[Fb](j>=A.year?0:k*T(i[fb]()/k)),h=i[gb]()),j>=A.year&&(h-=h%k,i[Gb](h)),j===A.week&&i[sb](i[Xa]()-i[rb]()+m(d,1)),b=1,Ra&&(i=new Date(i.getTime()+Ra)),h=i[gb]();for(var d=i.getTime(),l=i[fb](),o=i[Xa](),n=g?Ra:(864e5+6e4*i.getTimezoneOffset())%864e5;c>d;)e.push(d),j===A.year?d=eb(h+b*k,0):j===A.month?d=eb(h,l+b*k):g||j!==A.day&&j!==A.week?d+=j*k:d=eb(h,l,o+b*k*(j===A.day?1:7)),b++;e.push(d),p(vb(e,function(a){return j<=A.hour&&a%A.day===n}),function(a){f[a]="day"})}return e.info=q(a,{higherRanks:f,totalRange:j*k}),e},la.prototype.normalizeTimeTickInterval=function(a,b){var g,c=b||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],d=c[c.length-1],e=A[d[0]],f=d[1];for(g=0;g<c.length&&(d=c[g],e=A[d[0]],f=d[1],!(c[g+1]&&a<=(e*f[f.length-1]+A[c[g+1][0]])/2));g++);return e===A.year&&5*e>a&&(f=[1,2,5]),c=nb(a/e,f,"year"===d[0]?v(mb(a/e),1):1),{unitRange:e,count:c,unitName:d[0]}},la.prototype.getLogTickPositions=function(a,b,c,d){var e=this.options,f=this.len,g=[];if(d||(this._minorAutoInterval=null),a>=.5)a=u(a),g=this.getLinearTickPositions(a,b,c);else if(a>=.08)for(var h,i,j,k,l,f=T(b),e=a>.3?[1,2,4]:a>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];c+1>f&&!l;f++)for(i=e.length,h=0;i>h&&!l;h++)j=za(ia(f)*e[h]),j>b&&(!d||c>=k)&&g.push(k),k>c&&(l=!0),k=j;else b=ia(b),c=ia(c),a=e[d?"minorTickInterval":"tickInterval"],a=m("auto"===a?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=nb(a,null,mb(a)),g=Ua(this.getLinearTickPositions(a,b,c),za),d||(this._minorAutoInterval=a/5);return d||(this.tickInterval=a),g};var Mb=R.Tooltip=function(){this.init.apply(this,arguments)};Mb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=z(d.padding);this.chart=a,this.options=b,this.crosshairs=[],this.now={x:0,y:0},this.isHidden=!0,this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999}),fa||this.label.shadow(b.shadow),this.shared=b.shared},destroy:function(){this.label&&(this.label=this.label.destroy()),clearTimeout(this.hideTimer),clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden,h=e.followPointer||e.len>1;q(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?t:g?(2*f.anchorX+c)/3:c,anchorY:h?t:g?(f.anchorY+d)/2:d}),e.label.attr(f),g&&(M(a-f.x)>1||M(b-f.y)>1)&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32))},hide:function(){var b,a=this;clearTimeout(this.hideTimer),this.isHidden||(b=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){a.label.fadeOut(),a.isHidden=!0},m(this.options.hideDelay,500)),b&&p(b,function(a){a.setState()}),this.chart.hoverPoints=null)},getAnchor:function(a,b){var c,i,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,a=qa(a);return c=a[0].tooltipPos,this.followPointer&&b&&(b.chartX===t&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]),c||(p(a,function(a){i=a.series.yAxis,g+=a.plotX,h+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-g:h]),Ua(c,u)},getPosition:function(a,b,c){var g,d=this.chart,e=this.distance,f={},h=["y",d.chartHeight,b,c.plotY+d.plotTop],i=["x",d.chartWidth,a,c.plotX+d.plotLeft],j=c.ttBelow||d.inverted&&!c.negative||!d.inverted&&c.negative,k=function(a,b,c,d){var g=d-e>c,b=b>d+e+c,c=d-e-c;if(d+=e,j&&b)f[a]=d;else if(!j&&g)f[a]=c;else if(g)f[a]=c;else{if(!b)return!1;f[a]=d}},l=function(a,b,c,d){return e>d||d>b-e?!1:void(f[a]=c/2>d?1:d>b-c/2?b-c-2:d-c/2)},o=function(a){var b=h;h=i,i=b,g=a},n=function(){k.apply(0,h)!==!1?l.apply(0,i)===!1&&!g&&(o(!0),n()):g?f.x=f.y=0:(o(!0),n())};return(d.inverted||this.len>1)&&o(),n(),f},defaultFormatter:function(a){var d,b=this.points||qa(this),c=b[0].series;return d=[a.tooltipHeaderFormatter(b[0])],p(b,function(a){c=a.series,d.push(c.tooltipFormatter&&c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))}),d.push(a.options.footerFormat||""),d.join("")},refresh:function(a,b){var f,g,i,c=this.chart,d=this.label,e=this.options,h={},j=[];i=e.formatter||this.defaultFormatter;var k,h=c.hoverPoints,l=this.shared;clearTimeout(this.hideTimer),this.followPointer=qa(a)[0].series.tooltipOptions.followPointer,g=this.getAnchor(a,b),f=g[0],g=g[1],!l||a.series&&a.series.noSharedTooltip?h=a.getLabelConfig():(c.hoverPoints=a,h&&p(h,function(a){a.setState()}),p(a,function(a){a.setState("hover"),j.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=j,this.len=j.length,a=a[0]),i=i.call(h,this),h=a.series,this.distance=m(h.tooltipOptions.distance,16),i===!1?this.hide():(this.isHidden&&(bb(d),d.attr("opacity",1).show()),d.attr({text:i}),k=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:k}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow}),this.isHidden=!1),D(c,"tooltipRefresh",{text:i,x:f+c.plotLeft,y:g+c.plotTop,borderColor:k})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(u(c.x),u(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},tooltipHeaderFormatter:function(a){var h,b=a.series,c=b.tooltipOptions,d=c.dateTimeLabelFormats,e=c.xDateFormat,f=b.xAxis,g=f&&"datetime"===f.options.type&&ha(a.key),c=c.headerFormat,f=f&&f.closestPointRange;if(g&&!e){if(f){for(h in A)if(A[h]>=f||A[h]<=A.day&&a.key%A[h]>0){e=d[h];break}}else e=d.day;e=e||d.year}return g&&e&&(c=c.replace("{point.key}","{point.key:"+e+"}")),Ia(c,{point:a,series:b})}};var oa;$a=y.documentElement.ontouchstart!==t;var Wa=R.Pointer=function(a,b){this.init(a,b)};if(Wa.prototype={init:function(a,b){var f,c=b.chart,d=c.events,e=fa?"":c.zoomType,c=a.inverted;this.options=b,this.chart=a,this.zoomX=f=/x/.test(e),this.zoomY=e=/y/.test(e),this.zoomHor=f&&!c||e&&c,this.zoomVert=e&&!c||f&&c,this.hasZoom=f||e,this.runChartClick=d&&!!d.click,this.pinchDown=[],this.lastValidTouch={},R.Tooltip&&b.tooltip.enabled&&(a.tooltip=new Mb(a,b.tooltip),this.followTouchMove=b.tooltip.followTouchMove),this.setDOMEvents()},normalize:function(a,b){var c,d,a=a||window.event,a=Sb(a);return a.target||(a.target=a.srcElement),d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a,b||(this.chartPosition=b=Rb(this.chart.container)),d.pageX===t?(c=v(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top),q(a,{chartX:u(c),chartY:u(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};return p(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})}),b},getIndex:function(a){var b=this.chart;return b.inverted?b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},runPointActions:function(a){var e,f,i,j,b=this.chart,c=b.series,d=b.tooltip,g=b.hoverPoint,h=b.hoverSeries,k=b.chartWidth,l=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!h||!h.noSharedTooltip)){for(f=[],i=c.length,j=0;i>j;j++)c[j].visible&&c[j].options.enableMouseTracking!==!1&&!c[j].noSharedTooltip&&c[j].singularTooltips!==!0&&c[j].tooltipPoints.length&&(e=c[j].tooltipPoints[l])&&e.series&&(e._dist=M(l-e.clientX),k=C(k,e._dist),f.push(e));for(i=f.length;i--;)f[i]._dist>k&&f.splice(i,1);f.length&&f[0].clientX!==this.hoverX&&(d.refresh(f,a),this.hoverX=f[0].clientX)}c=h&&h.tooltipOptions.followPointer,h&&h.tracker&&!c?(e=h.tooltipPoints[l])&&e!==g&&e.onMouseOver(a):d&&c&&!d.isHidden&&(h=d.getAnchor([{}],a),d.updatePosition({plotX:h[0],plotY:h[1]})),d&&!this._onDocumentMouseMove&&(this._onDocumentMouseMove=function(a){V[oa]&&V[oa].pointer.onDocumentMouseMove(a)},K(y,"mousemove",this._onDocumentMouseMove)),p(b.axes,function(b){b.drawCrosshair(a,m(e,g))})},reset:function(a){var b=this.chart,c=b.hoverSeries,d=b.hoverPoint,e=b.tooltip,f=e&&e.shared?b.hoverPoints:d;(a=a&&e&&f)&&qa(f)[0].plotX===t&&(a=!1),a?(e.refresh(f),d&&d.setState(d.state,!0)):(d&&d.onMouseOut(),c&&c.onMouseOut(),e&&e.hide(),this._onDocumentMouseMove&&(W(y,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null),p(b.axes,function(a){a.hideCrosshair()}),this.hoverX=null)},scaleGroups:function(a,b){var d,c=this.chart;p(c.series,function(e){d=a||e.getPlotBox(),e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))}),c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type,b.cancelClick=!1,b.mouseDownX=this.mouseDownX=a.chartX,b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var l,b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,i=b.plotTop,j=b.plotWidth,k=b.plotHeight,o=this.mouseDownX,n=this.mouseDownY;h>d?d=h:d>h+j&&(d=h+j),i>e?e=i:e>i+k&&(e=i+k),this.hasDragged=Math.sqrt(Math.pow(o-d,2)+Math.pow(n-e,2)),this.hasDragged>10&&(l=b.isInsidePlot(o-h,n-i),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!this.selectionMarker&&(this.selectionMarker=b.renderer.rect(h,i,f?1:j,g?1:k,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add()),this.selectionMarker&&f&&(d-=o,this.selectionMarker.attr({width:M(d),x:(d>0?0:d)+o})),this.selectionMarker&&g&&(d=e-n,this.selectionMarker.attr({height:M(d),y:(d>0?0:d)+n})),l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning))},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var i,d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},a=this.selectionMarker,e=a.attr?a.attr("x"):a.x,f=a.attr?a.attr("y"):a.y,g=a.attr?a.attr("width"):a.width,h=a.attr?a.attr("height"):a.height;(this.hasDragged||c)&&(p(b.axes,function(a){if(a.zoomEnabled){var b=a.horiz,c=a.toValue(b?e:f),b=a.toValue(b?e+g:f+h);!isNaN(c)&&!isNaN(b)&&(d[a.coll].push({axis:a,min:C(c,b),max:v(c,b)}),i=!0)}}),i&&D(b,"selection",d,function(a){b.zoom(q(a,c?{animation:!1}:null))})),this.selectionMarker=this.selectionMarker.destroy(),c&&this.scaleGroups()}b&&(G(b.container,{cursor:b._cursor}),b.cancelClick=this.hasDragged>10,b.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a),a.preventDefault&&a.preventDefault(),this.dragStart(a)},onDocumentMouseUp:function(a){V[oa]&&V[oa].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){var a=V[oa];a&&(a.pointer.reset(),a.pointer.chartPosition=null)},onContainerMouseMove:function(a){var b=this.chart;oa=b.index,a=this.normalize(a),"mousedown"===b.mouseIsDown&&this.drag(a),(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=H(a,"class")){if(-1!==c.indexOf(b))return!0;if(-1!==c.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries,c=(a=a.relatedTarget||a.toElement)&&a.point&&a.point.series;!b||b.options.stickyTracking||this.inClass(a,"highcharts-tooltip")||c===b||b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);a.cancelBubble=!0,b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(D(c.series,"click",q(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(q(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&D(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)},b.onmousemove=function(b){a.onContainerMouseMove(b)},b.onclick=function(b){a.onContainerClick(b)},K(b,"mouseleave",a.onContainerMouseLeave),1===ab&&K(y,"mouseup",a.onDocumentMouseUp),$a&&(b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},1===ab&&K(y,"touchend",a.onDocumentTouchEnd))},destroy:function(){var a;W(this.chart.container,"mouseleave",this.onContainerMouseLeave),ab||(W(y,"mouseup",this.onDocumentMouseUp),W(y,"touchend",this.onDocumentTouchEnd)),clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}},q(R.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f),(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,b,c,d,e,f,g,h){var s,m,y,i=this.chart,j=a?"x":"y",k=a?"X":"Y",l="chart"+k,o=a?"width":"height",n=i["plot"+(a?"Left":"Top")],p=h||1,q=i.inverted,x=i.bounds[a?"h":"v"],r=1===b.length,v=b[0][l],u=c[0][l],t=!r&&b[1][l],w=!r&&c[1][l],c=function(){!r&&M(v-t)>20&&(p=h||M(u-w)/M(v-t)),m=(n-u)/p+v,s=i["plot"+(a?"Width":"Height")]/p};c(),b=m,b<x.min?(b=x.min,y=!0):b+s>x.max&&(b=x.max-s,y=!0),y?(u-=.8*(u-g[j][0]),r||(w-=.8*(w-g[j][1])),c()):g[j]=[u,w],q||(f[j]=m-n,f[o]=s),f=q?1/p:p,e[o]=s,e[j]=b,d[q?a?"scaleY":"scaleX":"scale"+k]=p,d["translate"+k]=f*n+(u-f*v)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,e=b.followTouchMove,f=a.touches,g=f.length,h=b.lastValidTouch,i=b.hasZoom,j=b.selectionMarker,k={},l=1===g&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||c.runChartClick),o={};(i||e)&&!l&&a.preventDefault(),Ua(f,function(a){return b.normalize(a)}),"touchstart"===a.type?(p(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,d[1]&&d[1].chartY],p(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,e=a.toPixels(a.dataMin),f=a.toPixels(a.dataMax),g=C(e,f),e=v(e,f);b.min=C(a.pos,g-d),b.max=v(a.pos+a.len,e+d)}})):d.length&&(j||(b.selectionMarker=j=q({destroy:sa},c.plotBox)),b.pinchTranslate(d,f,k,j,o,h),b.hasPinched=i,b.scaleGroups(k,o),!i&&e&&1===g&&this.runPointActions(b.normalize(a)))},onContainerTouchStart:function(a){var b=this.chart;oa=b.index,1===a.touches.length?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):2===a.touches.length&&this.pinch(a)},onContainerTouchMove:function(a){(1===a.touches.length||2===a.touches.length)&&this.pinch(a)},onDocumentTouchEnd:function(a){V[oa]&&V[oa].pointer.drop(a)}}),I.PointerEvent||I.MSPointerEvent){var ua={},zb=!!I.PointerEvent,Wb=function(){var a,b=[];b.item=function(a){return this[a]};for(a in ua)ua.hasOwnProperty(a)&&b.push({pageX:ua[a].pageX,pageY:ua[a].pageY,target:ua[a].target});return b},Ab=function(a,b,c,d){a=a.originalEvent||a,"touch"!==a.pointerType&&a.pointerType!==a.MSPOINTER_TYPE_TOUCH||!V[oa]||(d(a),d=V[oa].pointer,d[b]({type:c,target:a.currentTarget,preventDefault:sa,touches:Wb()}))};q(Wa.prototype,{onContainerPointerDown:function(a){Ab(a,"onContainerTouchStart","touchstart",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){Ab(a,"onContainerTouchMove","touchmove",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY},ua[a.pointerId].target||(ua[a.pointerId].target=a.currentTarget)})},onDocumentPointerUp:function(a){Ab(a,"onContainerTouchEnd","touchend",function(a){delete ua[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,zb?"pointerdown":"MSPointerDown",this.onContainerPointerDown),a(this.chart.container,zb?"pointermove":"MSPointerMove",this.onContainerPointerMove),a(y,zb?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}}),Ma(Wa.prototype,"init",function(a,b,c){a.call(this,b,c),(this.hasZoom||this.followTouchMove)&&G(b.container,{"-ms-touch-action":Q,"touch-action":Q})}),Ma(Wa.prototype,"setDOMEvents",function(a){a.apply(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(K)}),Ma(Wa.prototype,"destroy",function(a){this.batchMSEvents(W),a.call(this)})}var lb=R.Legend=function(a,b){this.init(a,b)};lb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=m(b.padding,8),f=b.itemMarginTop||0;this.options=b,b.enabled&&(c.baseline=z(d.fontSize)+3+f,c.itemStyle=d,c.itemHiddenStyle=w(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.symbolWidth=m(b.symbolWidth,16),c.pages=[],c.render(),K(c.chart,"endResize",function(){c.positionCheckboxes()}))},colorizeItem:function(a,b){var j,c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h};if(d&&d.css({fill:c,color:c}),e&&e.attr({stroke:h}),f){if(g&&f.isMarker)for(j in i.stroke=h,g=a.convertAttribs(g))d=g[j],d!==t&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d),f&&(f.x=e,f.y=d)},destroyItem:function(a){var b=a.checkbox;p(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())}),b&&Pa(a.checkbox)},destroy:function(){var a=this.group,b=this.box;b&&(this.box=b.destroy()),a&&(this.group=a.destroy())},positionCheckboxes:function(a){var c,b=this.group.alignAttr,d=this.clipHeight||this.legendHeight;b&&(c=b.translateY,p(this.allItems,function(e){var g,f=e.checkbox;f&&(g=c+f.y+(a||0)+3,G(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",top:g+"px",display:g>c-6&&c+d-6>g?"":Q}))}))},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;b.text&&(this.title||(this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group)),a=this.title.getBBox(),c=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:c})),this.titleHeight=c},renderItem:function(a){var b=this.chart,c=b.renderer,d=this.options,e="horizontal"===d.layout,f=this.symbolWidth,g=d.symbolPadding,h=this.itemStyle,i=this.itemHiddenStyle,j=this.padding,k=e?m(d.itemDistance,20):0,l=!d.rtl,o=d.width,n=d.itemMarginBottom||0,s=this.itemMarginTop,p=this.initialItemX,q=a.legendItem,r=a.series&&a.series.drawLegendSymbol?a.series:a,x=r.options,x=this.createCheckboxForItem&&x&&x.showCheckbox,t=d.useHTML;q||(a.legendGroup=c.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),r.drawLegendSymbol(this,a),a.legendItem=q=c.text(d.labelFormat?Ia(d.labelFormat,a):d.labelFormatter.call(a),l?f+g:-g,this.baseline,t).css(w(a.visible?h:i)).attr({align:l?"left":"right",zIndex:2}).add(a.legendGroup),this.setItemEvents&&this.setItemEvents(a,q,t,h,i),this.colorizeItem(a,a.visible),x&&this.createCheckboxForItem(a)),c=q.getBBox(),f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||f+g+c.width+k+(x?20:0),this.itemHeight=g=u(a.legendItemHeight||c.height),e&&this.itemX-p+f>(o||b.chartWidth-2*j-p-d.x)&&(this.itemX=p,this.itemY+=s+this.lastLineHeight+n,this.lastLineHeight=0),this.maxItemWidth=v(this.maxItemWidth,f),this.lastItemY=s+this.itemY+n,this.lastLineHeight=v(g,this.lastLineHeight),a._legendItemPos=[this.itemX,this.itemY],e?this.itemX+=f:(this.itemY+=s+g+n,this.lastLineHeight=g),this.offsetWidth=o||v((e?this.itemX-p-k:f)+j,this.offsetWidth)},getAllItems:function(){var a=[];return p(this.chart.series,function(b){var c=b.options;m(c.showInLegend,r(c.linkedTo)?!1:t,!0)&&(a=a.concat(b.legendItems||("point"===c.legendType?b.data:b)))}),a},render:function(){var e,f,g,h,a=this,b=a.chart,c=b.renderer,d=a.group,i=a.box,j=a.options,k=a.padding,l=j.borderWidth,o=j.backgroundColor;a.itemX=a.initialItemX,a.itemY=a.initialItemY,a.offsetWidth=0,a.lastItemY=0,d||(a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup)),a.renderTitle(),e=a.getAllItems(),ob(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)}),j.reversed&&e.reverse(),a.allItems=e,a.display=f=!!e.length,p(e,function(b){a.renderItem(b)}),g=j.width||a.offsetWidth,h=a.lastItemY+a.lastLineHeight+a.titleHeight,h=a.handleOverflow(h),(l||o)&&(g+=k,h+=k,i?g>0&&h>0&&(i[i.isNew?"attr":"animate"](i.crisp({width:g,height:h})),i.isNew=!1):(a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor,"stroke-width":l||0,fill:o||Q}).add(d).shadow(j.shadow),i.isNew=!0),i[f?"show":"hide"]()),a.legendWidth=g,a.legendHeight=h,p(e,function(b){a.positionItem(b)}),f&&d.align(q({width:g,height:h},j),!0,"spacingBox"),b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var h,s,b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+("top"===e.verticalAlign?-f:f)-this.padding,g=e.maxHeight,i=this.clipRect,j=e.navigation,k=m(j.animation,!0),l=j.arrowSize||12,o=this.nav,n=this.pages,q=this.allItems;return"horizontal"===e.layout&&(f/=2),g&&(f=C(f,g)),n.length=0,a>f&&!e.useHTML?(this.clipHeight=h=f-20-this.titleHeight-this.padding,this.currentPage=m(this.currentPage,1),this.fullHeight=a,p(q,function(a,b){var c=a._legendItemPos[1],d=u(a.legendItem.getBBox().height),e=n.length;(!e||c-n[e-1]>h&&(s||c)!==n[e-1])&&(n.push(s||c),e++),b===q.length-1&&c+d-n[e-1]>h&&n.push(c),c!==s&&(s=c)}),i||(i=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(i)),i.attr({height:h}),o||(this.nav=o=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,k)}).add(o),this.pager=d.text("",15,10).css(j.style).add(o),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,k)}).add(o)),b.scroll(0),a=f):o&&(i.attr({height:c.chartHeight}),o.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,h=g.activeColor,g=g.inactiveColor,i=this.pager,j=this.padding;e>d&&(e=d),e>0&&(b!==t&&Qa(b,this.chart),this.nav.attr({translateX:j,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:1===e?g:h}).css({cursor:1===e?"default":"pointer"}),i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c))}},N=R.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||12;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-5-c/2,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var d,b=this.options,c=b.marker;d=a.symbolWidth;var g,e=this.chart.renderer,f=this.legendGroup,a=a.baseline-u(.3*e.fontMetrics(a.options.itemStyle.fontSize).b);b.lineWidth&&(g={"stroke-width":b.lineWidth},b.dashStyle&&(g.dashstyle=b.dashStyle),this.legendLine=e.path(["M",0,a,"L",d,a]).attr(g).add(f)),c&&c.enabled!==!1&&(b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,d/2-b,a-b,2*b,2*b).add(f),d.isMarker=!0)}},(/Trident\/7\.0/.test(wa)||Ta)&&Ma(lb.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d(),setTimeout(d)}),Ya.prototype={init:function(a,b){var c,d=a.series;a.series=null,c=w(E,a),c.series=a.series=d,this.userOptions=a,d=c.chart,this.margin=this.splashArray("margin",d),this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}},this.callback=b,this.isResizing=0,this.options=c,this.axes=[],this.series=[],this.hasCartesianSeries=d.showAxes;var g,f=this;if(f.index=V.length,V.push(f),ab++,d.reflow!==!1&&K(f,"load",function(){f.initReflow()}),e)for(g in e)K(f,g,e[g]);f.xAxis=[],f.yAxis=[],f.animation=fa?!1:m(d.animation,!0),f.pointCount=0,f.counters=new Bb,f.firstRender()},initSeries:function(a){var b=this.options.chart;return(b=F[a.type||b.type||b.defaultSeriesType])||ra(17,!0),b=new b,b.init(this,a),b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&p(this.axes,function(a){a.adjustTickAmount()}),this.maxTicks=null},redraw:function(a){var g,h,b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,i=this.isDirtyBox,j=c.length,k=j,l=this.renderer,o=l.isHidden(),n=[];for(Qa(a,this),o&&this.cloneRenderTo(),this.layOutTitles();k--;)if(a=c[k],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(k=j;k--;)a=c[k],a.options.stacking&&(a.isDirty=!0);p(c,function(a){a.isDirty&&"point"===a.options.legendType&&(f=!0)}),f&&e.options.enabled&&(e.render(),this.isDirtyLegend=!1),g&&this.getStacks(),this.hasCartesianSeries&&(this.isResizing||(this.maxTicks=null,p(b,function(a){a.setScale()})),this.adjustTickAmounts(),this.getMargins(),p(b,function(a){a.isDirty&&(i=!0)}),p(b,function(a){a.isDirtyExtremes&&(a.isDirtyExtremes=!1,n.push(function(){D(a,"afterSetExtremes",q(a.eventArgs,a.getExtremes())),delete a.eventArgs})),(i||g)&&a.redraw()})),i&&this.drawChartBox(),p(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()}),d&&d.reset(!0),l.draw(),D(this,"redraw"),o&&this.cloneRenderTo(!0),p(n,function(a){a.call()})},get:function(a){var d,e,b=this.axes,c=this.series;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++)for(e=c[d].points||[],b=0;b<e.length;b++)if(e[b].id===a)return e[b];return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=qa(b.xAxis||{}),b=b.yAxis=qa(b.yAxis||{});p(c,function(a,b){a.index=b,a.isX=!0}),p(b,function(a,b){a.index=b}),c=c.concat(b),p(c,function(b){new la(a,b)}),a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];return p(this.series,function(b){a=a.concat(vb(b.points||[],function(a){return a.selected}))
4
  }),a},getSelectedSeries:function(){return vb(this.series,function(a){return a.selected})},getStacks:function(){var a=this;p(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&&(a.oldStacks=a.stacks)}),p(a.series,function(b){!b.options.stacking||b.visible!==!0&&a.options.chart.ignoreHiddenSeries!==!1||(b.stackKey=b.type+m(b.options.stack,""))})},setTitle:function(a,b,c){var g,f,d=this,e=d.options;f=e.title=w(e.title,a),g=e.subtitle=w(e.subtitle,b),e=g,p([["title",a,f],["subtitle",b,e]],function(a){var b=a[0],c=d[b],e=a[1],a=a[2];c&&e&&(d[b]=c=c.destroy()),a&&a.text&&!c&&(d[b]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())}),d.layOutTitles(c)},layOutTitles:function(a){var b=0,c=this.title,d=this.subtitle,e=this.options,f=e.title,e=e.subtitle,g=this.spacingBox.width-44;!c||(c.css({width:(f.width||g)+"px"}).align(q({y:15},f),!1,"spacingBox"),f.floating||f.verticalAlign)||(b=c.getBBox().height),d&&(d.css({width:(e.width||g)+"px"}).align(q({y:b+f.margin},e),!1,"spacingBox"),!e.floating&&!e.verticalAlign&&(b=Ka(b+d.getBBox().height))),c=this.titleOffset!==b,this.titleOffset=b,!this.isDirtyBox&&c&&(this.isDirtyBox=c,this.hasRendered&&m(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,c=this.renderToClone||this.renderTo;r(b)||(this.containerWidth=jb(c,"width")),r(a)||(this.containerHeight=jb(c,"height")),this.chartWidth=v(0,b||this.containerWidth||600),this.chartHeight=v(0,m(a,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;a?b&&(this.renderTo.appendChild(c),Pa(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),G(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),y.body.appendChild(b),c&&b.appendChild(c))},getContainer:function(){var a,c,d,e,b=this.options.chart;this.renderTo=a=b.renderTo,e="highcharts-"+tb++,Fa(a)&&(this.renderTo=a=y.getElementById(a)),a||ra(13,!0),c=z(H(a,"data-highcharts-chart")),!isNaN(c)&&V[c]&&V[c].hasRendered&&V[c].destroy(),H(a,"data-highcharts-chart",this.index),a.innerHTML="",!b.skipClone&&!a.offsetWidth&&this.cloneRenderTo(),this.getChartSize(),c=this.chartWidth,d=this.chartHeight,this.container=a=Y(Ja,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},q({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},b.style),this.renderToClone||a),this._cursor=a.style.cursor,this.renderer=b.forExport?new ta(a,c,d,b.style,!0):new Za(a,c,d,b.style),fa&&this.renderer.create(this,a,c,d)},getMargins:function(){var b,a=this.spacing,c=this.legend,d=this.margin,e=this.options.legend,f=m(e.margin,20),g=e.x,h=e.y,i=e.align,j=e.verticalAlign,k=this.titleOffset;this.resetMargins(),b=this.axisOffset,k&&!r(d[0])&&(this.plotTop=v(this.plotTop,k+this.options.title.margin+a[0])),c.display&&!e.floating&&("right"===i?r(d[1])||(this.marginRight=v(this.marginRight,c.legendWidth-g+f+a[1])):"left"===i?r(d[3])||(this.plotLeft=v(this.plotLeft,c.legendWidth+g+f+a[3])):"top"===j?r(d[0])||(this.plotTop=v(this.plotTop,c.legendHeight+h+f+a[0])):"bottom"!==j||r(d[2])||(this.marginBottom=v(this.marginBottom,c.legendHeight-h+f+a[2]))),this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin),this.extraTopMargin&&(this.plotTop+=this.extraTopMargin),this.hasCartesianSeries&&p(this.axes,function(a){a.getOffset()}),r(d[3])||(this.plotLeft+=b[3]),r(d[0])||(this.plotTop+=b[0]),r(d[2])||(this.marginBottom+=b[2]),r(d[1])||(this.marginRight+=b[1]),this.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||jb(d,"width"),f=c.height||jb(d,"height"),c=a?a.target:I,d=function(){b.container&&(b.setSize(e,f,!1),b.hasUserSize=null)};b.hasUserSize||!e||!f||c!==I&&c!==y||((e!==b.containerWidth||f!==b.containerHeight)&&(clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d()),b.containerWidth=e,b.containerHeight=f)},initReflow:function(){var a=this,b=function(b){a.reflow(b)};K(I,"resize",b),K(a,"destroy",function(){W(I,"resize",b)})},setSize:function(a,b,c){var e,f,g,d=this;d.isResizing+=1,g=function(){d&&D(d,"endResize",null,function(){d.isResizing-=1})},Qa(c,d),d.oldChartHeight=d.chartHeight,d.oldChartWidth=d.chartWidth,r(a)&&(d.chartWidth=e=v(0,u(a)),d.hasUserSize=!!e),r(b)&&(d.chartHeight=f=v(0,u(b))),(va?kb:G)(d.container,{width:e+"px",height:f+"px"},va),d.setChartSize(!0),d.renderer.setSize(e,f,c),d.maxTicks=null,p(d.axes,function(a){a.isDirty=!0,a.setScale()}),p(d.series,function(a){a.isDirty=!0}),d.isDirtyLegend=!0,d.isDirtyBox=!0,d.layOutTitles(),d.getMargins(),d.redraw(c),d.oldChartHeight=null,D(d,"resize"),va===!1?g():setTimeout(g,va&&va.duration||500)},setChartSize:function(a){var i,j,k,l,b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset;this.plotLeft=i=u(this.plotLeft),this.plotTop=j=u(this.plotTop),this.plotWidth=k=v(0,u(d-i-this.marginRight)),this.plotHeight=l=v(0,u(e-j-this.marginBottom)),this.plotSizeX=b?l:k,this.plotSizeY=b?k:l,this.plotBorderWidth=f.plotBorderWidth||0,this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]},this.plotBox=c.plotBox={x:i,y:j,width:k,height:l},d=2*T(this.plotBorderWidth/2),b=Ka(v(d,h[3])/2),c=Ka(v(d,h[0])/2),this.clipBox={x:b,y:c,width:T(this.plotSizeX-v(d,h[1])/2-b),height:T(this.plotSizeY-v(d,h[2])/2-c)},a||p(this.axes,function(a){a.setAxisSize(),a.setAxisTranslation()})},resetMargins:function(){var a=this.spacing,b=this.margin;this.plotTop=m(b[0],a[0]),this.marginRight=m(b[1],a[1]),this.marginBottom=m(b[2],a[2]),this.plotLeft=m(b[3],a[3]),this.axisOffset=[0,0,0,0],this.clipOffset=[0,0,0,0]},drawChartBox:function(){var n,a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,o=a.plotBorderWidth||0,s=this.plotLeft,m=this.plotTop,p=this.plotWidth,q=this.plotHeight,r=this.plotBox,v=this.clipRect,u=this.clipBox;n=i+(a.shadow?8:0),(i||j)&&(e?e.animate(e.crisp({width:c-n,height:d-n})):(e={fill:j||Q},i&&(e.stroke=a.borderColor,e["stroke-width"]=i),this.chartBackground=b.rect(n/2,n/2,c-n,d-n,a.borderRadius,i).attr(e).addClass("highcharts-background").add().shadow(a.shadow))),k&&(f?f.animate(r):this.plotBackground=b.rect(s,m,p,q,0).attr({fill:k}).add().shadow(a.plotShadow)),l&&(h?h.animate(r):this.plotBGImage=b.image(l,s,m,p,q).add()),v?v.animate({width:u.width,height:u.height}):this.clipRect=b.clipRect(u),o&&(g?g.animate(g.crisp({x:s,y:m,width:p,height:q})):this.plotBorder=b.rect(s,m,p,q,0,-o).attr({stroke:a.plotBorderColor,"stroke-width":o,fill:Q,zIndex:1}).add()),this.isDirtyBox=!1},propFromSeries:function(){var c,e,f,a=this,b=a.options.chart,d=a.options.series;p(["inverted","angular","polar"],function(g){for(c=F[b.type||b.defaultSeriesType],f=a[g]||b[g]||c&&c.prototype[g],e=d&&d.length;!f&&e--;)(c=F[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;p(b,function(a){a.linkedSeries.length=0}),p(b,function(b){var d=b.options.linkedTo;Fa(d)&&(d=":previous"===d?a.series[b.index-1]:a.get(d))&&(d.linkedSeries.push(b),b.linkedParent=d)})},renderSeries:function(){p(this.series,function(a){a.translate(),a.setTooltipPoints&&a.setTooltipPoints(),a.render()})},render:function(){var g,a=this,b=a.axes,c=a.renderer,d=a.options,e=d.labels,f=d.credits;a.setTitle(),a.legend=new lb(a,d.legend),a.getStacks(),p(b,function(a){a.setScale()}),a.getMargins(),a.maxTicks=null,p(b,function(a){a.setTickPositions(!0),a.setMaxTicks()}),a.adjustTickAmounts(),a.getMargins(),a.drawChartBox(),a.hasCartesianSeries&&p(b,function(a){a.render()}),a.seriesGroup||(a.seriesGroup=c.g("series-group").attr({zIndex:3}).add()),a.renderSeries(),e.items&&p(e.items,function(b){var d=q(e.style,b.style),f=z(d.left)+a.plotLeft,g=z(d.top)+a.plotTop+12;delete d.left,delete d.top,c.text(b.html,f,g).attr({zIndex:2}).css(d).add()}),f.enabled&&!a.credits&&(g=f.href,a.credits=c.text(f.text,0,0).on("click",function(){g&&(location.href=g)}).attr({align:f.position.align,zIndex:8}).css(f.style).add().align(f.position)),a.hasRendered=!0},destroy:function(){var e,a=this,b=a.axes,c=a.series,d=a.container,f=d&&d.parentNode;for(D(a,"destroy"),V[a.index]=t,ab--,a.renderTo.removeAttribute("data-highcharts-chart"),W(a),e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();p("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())}),d&&(d.innerHTML="",W(d),f&&Pa(d));for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!aa&&I==I.top&&"complete"!==y.readyState||fa&&!I.canvg?(fa?Lb.push(function(){a.firstRender()},a.options.global.canvasToolsURL):y.attachEvent("onreadystatechange",function(){y.detachEvent("onreadystatechange",a.firstRender),"complete"===y.readyState&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;a.isReadyToRender()&&(a.getContainer(),D(a,"init"),a.resetMargins(),a.setChartSize(),a.propFromSeries(),a.getAxes(),p(b.series||[],function(b){a.initSeries(b)}),a.linkSeries(),D(a,"beforeRender"),R.Pointer&&(a.pointer=new Wa(a,b)),a.render(),a.renderer.draw(),c&&c.apply(a,[a]),p(a.callbacks,function(b){b.apply(a,[a])}),a.cloneRenderTo(!0),D(a,"load"))},splashArray:function(a,b){var c=b[a],c=ca(c)?c:[c,c,c,c];return[m(b[a+"Top"],c[0]),m(b[a+"Right"],c[1]),m(b[a+"Bottom"],c[2]),m(b[a+"Left"],c[3])]}},Ya.prototype.callbacks=[],X=R.CenteredSeriesMixin={getCenter:function(){var d,h,a=this.options,b=this.chart,c=2*(a.slicedOffset||0),e=b.plotWidth-2*c,f=b.plotHeight-2*c,b=a.center,a=[m(b[0],"50%"),m(b[1],"50%"),a.size||"100%",a.innerSize||0],g=C(e,f);return Ua(a,function(a,b){return h=/%$/.test(a),d=2>b||2===b&&h,(h?[e,f,g,g][b]*z(a)/100:a)+(d?c:0)})}};var Ea=function(){};Ea.prototype={init:function(a,b,c){return this.series=a,this.applyOptions(b,c),this.pointAttr={},a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length)&&(a.colorCounter=0),a.chart.pointCount++,this},applyOptions:function(a,b){var c=this.series,d=c.pointValKey,a=Ea.prototype.optionsToObject.call(this,a);return q(this,a),this.options=this.options?q(this.options,a):a,d&&(this.y=this[d]),this.x===t&&c&&(this.x=b===t?c.autoIncrement():b),this},optionsToObject:function(a){var b={},c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if("number"==typeof a||null===a)b[d[0]]=a;else if(La(a))for(a.length>e&&(c=typeof a[0],"string"===c?b.name=a[0]:"number"===c&&(b.x=a[0]),f++);e>g;)b[d[g++]]=a[f++];else"object"==typeof a&&(b=a,a.dataLabels&&(c._hasPointLabels=!0),a.marker&&(c._hasPointMarkers=!0));return b},destroy:function(){var c,a=this.series.chart,b=a.hoverPoints;a.pointCount--,b&&(this.setState(),ja(b,this),!b.length)&&(a.hoverPoints=null),this===a.hoverPoint&&this.onMouseOut(),(this.graphic||this.dataLabel)&&(W(this),this.destroyElements()),this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=null},destroyElements:function(){for(var b,a="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=this.series,c=b.tooltipOptions,d=m(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||"";return p(b.pointArrayMap||["y"],function(b){b="{point."+b,(e||f)&&(a=a.replace(b+"}",e+b+"}"+f)),a=a.replace(b+"}",b+":,."+d+"f}")}),Ia(a,{point:this,series:this.series})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&this.importEvents(),"click"===a&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)}),D(this,a,b,c)}};var O=function(){};O.prototype={isCartesian:!0,type:"line",pointClass:Ea,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(a,b){var d,e,c=this,f=a.series,g=function(a,b){return m(a.options.index,a._i)-m(b.options.index,b._i)};c.chart=a,c.options=b=c.setOptions(b),c.linkedSeries=[],c.bindAxes(),q(c,{name:b.name,state:"",pointAttr:{},visible:b.visible!==!1,selected:b.selected===!0}),fa&&(b.animation=!1),e=b.events;for(d in e)K(c,d,e[d]);(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)&&(a.runTrackerClick=!0),c.getColor(),c.getSymbol(),p(c.parallelArrays,function(a){c[a+"Data"]=[]}),c.setData(b.data,!1),c.isCartesian&&(a.hasCartesianSeries=!0),f.push(c),c._i=f.length-1,ob(f,g),this.yAxis&&ob(this.yAxis.series,g),p(f,function(a,b){a.index=b,a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var d,a=this,b=a.options,c=a.chart;p(a.axisTypes||[],function(e){p(c[e],function(c){d=c.options,(b[e]===d.index||b[e]!==t&&b[e]===d.id||b[e]===t&&0===d.index)&&(c.series.push(a),a[e]=c,c.isDirty=!0)}),!a[e]&&a.optionalAxis!==e&&ra(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments;p(c.parallelArrays,"number"==typeof b?function(d){var f="y"===d&&c.toYData?c.toYData(a):a[d];c[d+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))})},autoIncrement:function(){var a=this.options,b=this.xIncrement,b=m(b,a.pointStart,0);return this.pointInterval=m(this.pointInterval,a.pointInterval,1),this.xIncrement=b+this.pointInterval,b},getSegments:function(){var c,a=-1,b=[],d=this.points,e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)null===d[c].y&&d.splice(c,1);d.length&&(b=[d])}else p(d,function(c,g){null===c.y?(g>a+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];return this.userOptions=a,c=w(e,c.series,a),this.tooltipOptions=w(E.tooltip,E.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&d[this.type].tooltip,a.tooltip),null===e.marker&&delete c.marker,c},getColor:function(){var e,a=this.options,b=this.userOptions,c=this.chart.options.colors,d=this.chart.counters;e=a.color||ba[this.type].color,e||a.colorByPoint||(r(b._colorIndex)?a=b._colorIndex:(b._colorIndex=d.color,a=d.color++),e=c[a]),this.color=e,d.wrapColor(c.length)},getSymbol:function(){var a=this.userOptions,b=this.options.marker,c=this.chart,d=c.options.symbols,c=c.counters;this.symbol=b.symbol,this.symbol||(r(a._symbolIndex)?a=a._symbolIndex:(a._symbolIndex=c.symbol,a=c.symbol++),this.symbol=d[a]),/^url/.test(this.symbol)&&(b.radius=0),c.wrapSymbol(d.length)},drawLegendSymbol:N.drawLineMarker,setData:function(a,b,c,d){var h,e=this,f=e.points,g=f&&f.length||0,i=e.options,j=e.chart,k=null,l=e.xAxis,o=l&&!!l.categories,n=e.tooltipPoints,s=i.turboThreshold,q=this.xData,r=this.yData,v=(h=e.pointArrayMap)&&h.length,a=a||[];if(h=a.length,b=m(b,!0),d===!1||!h||g!==h||e.cropped||e.hasGroupedData){if(e.xIncrement=null,e.pointRange=o?1:i.pointRange,e.colorCounter=0,p(this.parallelArrays,function(a){e[a+"Data"].length=0}),s&&h>s){for(c=0;null===k&&h>c;)k=a[c],c++;if(ha(k)){for(o=m(i.pointStart,0),i=m(i.pointInterval,1),c=0;h>c;c++)q[c]=o,r[c]=a[c],o+=i;e.xIncrement=o}else if(La(k))if(v)for(c=0;h>c;c++)i=a[c],q[c]=i[0],r[c]=i.slice(1,v+1);else for(c=0;h>c;c++)i=a[c],q[c]=i[0],r[c]=i[1];else ra(12)}else for(c=0;h>c;c++)a[c]!==t&&(i={series:e},e.pointClass.prototype.applyOptions.apply(i,[a[c]]),e.updateParallelArrays(i,c),o&&i.name)&&(l.names[i.x]=i.name);for(Fa(r[0])&&ra(14,!0),e.data=[],e.options.data=a,c=g;c--;)f[c]&&f[c].destroy&&f[c].destroy();n&&(n.length=0),l&&(l.minRange=l.userMinRange),e.isDirty=e.isDirtyData=j.isDirtyBox=!0,c=!1}else p(a,function(a,b){f[b].update(a,!1)});b&&j.redraw(c)},processData:function(a){var e,b=this.xData,c=this.yData,d=b.length;e=0;var f,g,o,n,h=this.xAxis,i=this.options,j=i.cropThreshold,k=0,l=this.isCartesian;if(l&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;for(l&&this.sorted&&(!j||d>j||this.forceCrop)&&(o=h.min,n=h.max,b[d-1]<o||b[0]>n?(b=[],c=[]):(b[0]<o||b[d-1]>n)&&(e=this.cropData(this.xData,this.yData,o,n),b=e.xData,c=e.yData,e=e.start,f=!0,k=b.length)),d=b.length-1;d>=0;d--)a=b[d]-b[d-1],!f&&b[d]>o&&b[d]<n&&k++,a>0&&(g===t||g>a)?g=a:0>a&&this.requireSorting&&ra(15);this.cropped=f,this.cropStart=e,this.processedXData=b,this.processedYData=c,this.activePointCount=k,null===i.pointRange&&(this.pointRange=g||1),this.closestPointRange=g},cropData:function(a,b,c,d){var i,e=a.length,f=0,g=e,h=m(this.cropShoulder,1);for(i=0;e>i;i++)if(a[i]>=c){f=v(0,i-h);break}for(;e>i;i++)if(a[i]>d){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var c,i,k,o,a=this.options.data,b=this.data,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,j=this.hasGroupedData,l=[];for(b||j||(b=[],b.length=a.length,b=this.data=b),o=0;g>o;o++)i=h+o,j?l[o]=(new f).init(this,[d[o]].concat(qa(e[o]))):(b[i]?k=b[i]:a[i]!==t&&(b[i]=k=(new f).init(this,a[i],d[o])),l[o]=k);if(b&&(g!==(c=b.length)||j))for(o=0;c>o;o++)o===h&&!j&&(o+=g),b[o]&&(b[o].destroyElements(),b[o].plotX=t);this.data=b,this.points=l},getExtremes:function(a){var d,b=this.yAxis,c=this.processedXData,e=[],f=0;d=this.xAxis.getExtremes();var i,j,k,l,g=d.min,h=d.max,a=a||this.stackedYData||this.processedYData;for(d=a.length,l=0;d>l;l++)if(j=c[l],k=a[l],i=null!==k&&k!==t&&(!b.isLog||k.length||k>0),j=this.getExtremesFromAll||this.cropped||(c[l+1]||j)>=g&&(c[l-1]||j)<=h,i&&j)if(i=k.length)for(;i--;)null!==k[i]&&(e[f++]=k[i]);else e[f++]=k;this.dataMin=m(void 0,Na(e)),this.dataMax=m(void 0,Ba(e))},translate:function(){this.processedXData||this.processData(),this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j="between"===i||ha(i),k=a.threshold,a=0;g>a;a++){var l=f[a],o=l.x,n=l.y,s=l.low,p=b&&e.stacks[(this.negStacks&&k>n?"-":"")+this.stackKey];e.isLog&&0>=n&&(l.y=n=null),l.plotX=c.translate(o,0,0,0,1,i,"flags"===this.type),b&&this.visible&&p&&p[o]&&(p=p[o],n=p.points[this.index+","+a],s=n[0],n=n[1],0===s&&(s=m(k,e.min)),e.isLog&&0>=s&&(s=null),l.total=l.stackTotal=p.total,l.percentage=p.total&&l.y/p.total*100,l.stackY=n,p.setOffset(this.pointXOffset||0,this.barW||0)),l.yBottom=r(s)?e.translate(s,0,1,0,1):null,h&&(n=this.modifyValue(n,l)),l.plotY="number"==typeof n&&1/0!==n?e.translate(n,0,1,0,1):t,l.clientX=j?c.translate(o,0,0,0,1):l.plotX,l.negative=l.y<(k||0),l.category=d&&d[l.x]!==t?d[l.x]:l.x}this.getSegments()},animate:function(a){var d,b=this.chart,c=b.renderer;d=this.options.animation;var g,e=this.clipBox||b.clipBox,f=b.inverted;d&&!ca(d)&&(d=ba[this.type].animation),g=["_sharedClip",d.duration,d.easing,e.height].join(","),a?(a=b[g],d=b[g+"m"],a||(b[g]=a=c.clipRect(q(e,{width:0})),b[g+"m"]=d=c.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),this.group.clip(a),this.markerGroup.clip(d),this.sharedClipKey=g):((a=b[g])&&a.animate({width:b.plotSizeX},d),b[g+"m"]&&b[g+"m"].animate({width:b.plotSizeX+99},d),this.animate=null)},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,c=this.group,d=this.clipBox;c&&this.options.clip!==!1&&(b&&d||c.clip(d?a.renderer.clipRect(d):a.clipRect),this.markerGroup.clip()),D(this,"afterAnimate"),setTimeout(function(){b&&a[b]&&(d||(a[b]=a[b].destroy()),a[b+"m"]&&(a[b+"m"]=a[b+"m"].destroy()))},100)},drawPoints:function(){var a,d,e,f,g,h,i,j,k,b=this.points,c=this.chart;d=this.options.marker;var o,l=this.pointAttr[""],n=this.markerGroup,s=m(d.enabled,this.activePointCount<.5*this.xAxis.len/d.radius);if(d.enabled!==!1||this._hasPointMarkers)for(f=b.length;f--;)g=b[f],d=T(g.plotX),e=g.plotY,k=g.graphic,i=g.marker||{},a=s&&i.enabled===t||i.enabled,o=c.isInsidePlot(u(d),e,c.inverted),a&&e!==t&&!isNaN(e)&&null!==g.y?(a=g.pointAttr[g.selected?"select":""]||l,h=a.r,i=m(i.symbol,this.symbol),j=0===i.indexOf("url"),k?k[o?"show":"hide"](!0).animate(q({x:d-h,y:e-h},k.symbolName?{width:2*h,height:2*h}:{})):o&&(h>0||j)&&(g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h).attr(a).add(n))):k&&(g.graphic=k.destroy())},convertAttribs:function(a,b,c,d){var f,g,e=this.pointAttrToOptions,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=m(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var f,a=this,b=a.options,c=ba[a.type].marker?b.marker:b,d=c.states,e=d.hover,g=a.color;f={stroke:g,fill:g};var i,k,h=a.points||[],j=[],l=a.pointAttrToOptions;k=a.hasPointSpecificOptions;var o=b.negativeColor,n=c.lineColor,s=c.fillColor;i=b.turboThreshold;var m;if(b.marker?(e.radius=e.radius||c.radius+2,e.lineWidth=e.lineWidth||c.lineWidth+1):e.color=e.color||ya(e.color||g).brighten(e.brightness).get(),j[""]=a.convertAttribs(c,f),p(["hover","select"],function(b){j[b]=a.convertAttribs(d[b],j[""])}),a.pointAttr=j,g=h.length,!i||i>g||k)for(;g--;){if(i=h[g],(c=i.options&&i.options.marker||i.options)&&c.enabled===!1&&(c.radius=0),i.negative&&o&&(i.color=i.fillColor=o),k=b.colorByPoint||i.color,i.options)for(m in l)r(c[l[m]])&&(k=!0);k?(c=c||{},k=[],d=c.states||{},f=d.hover=d.hover||{},b.marker||(f.color=f.color||!i.options.color&&e.color||ya(i.color).brighten(f.brightness||e.brightness).get()),f={color:i.color},s||(f.fillColor=i.color),n||(f.lineColor=i.color),k[""]=a.convertAttribs(q(f,c),j[""]),k.hover=a.convertAttribs(d.hover,j.hover,k[""]),k.select=a.convertAttribs(d.select,j.select,k[""])):k=j,i.pointAttr=k}},destroy:function(){var d,e,g,h,i,a=this,b=a.chart,c=/AppleWebKit\/533/.test(wa),f=a.data||[];for(D(a,"destroy"),W(a),p(a.axisTypes||[],function(b){(i=a[b])&&(ja(i.series,a),i.isDirty=i.forceRedraw=!0)}),a.legendItem&&a.chart.legend.destroyItem(a),e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null,clearTimeout(a.animationTimeout),p("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(b){a[b]&&(d=c&&"group"===b?"hide":"destroy",a[b][d]())}),b.hoverSeries===a&&(b.hoverSeries=null),ja(b.series,a);for(h in a)delete a[h]},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;return p(a,function(e,f){var i,g=e.plotX,h=e.plotY;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],"right"===d?c.push(i.plotX,h):"center"===d?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))}),c},getGraphPath:function(){var c,a=this,b=[],d=[];return p(a.segments,function(e){c=a.getSegmentPath(e),e.length>1?b=b.concat(c):d.push(e[0])}),a.singlePoints=d,a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f="square"!==b.linecap,g=this.getGraphPath(),h=b.negativeColor;h&&c.push(["graphNeg",h]),p(c,function(c,h){var k=c[0],l=a[k];l?(bb(l),l.animate({d:g})):d&&g.length&&(l={stroke:c[1],"stroke-width":d,fill:Q,zIndex:1},e?l.dashstyle=e:f&&(l["stroke-linecap"]=l["stroke-linejoin"]="round"),a[k]=a.chart.renderer.path(g).attr(l).add(a.group).shadow(!h&&b.shadow))})},clipNeg:function(){var e,a=this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,f=this.graph,g=this.area,h=this.posClip,i=this.negClip;e=b.chartWidth;var j=b.chartHeight,k=v(e,j),l=this.yAxis;d&&(f||g)&&(d=u(l.toPixels(a.threshold||0,!0)),0>d&&(k-=d),a={x:0,y:0,width:k,height:d},k={x:0,y:d,width:k,height:k},b.inverted&&(a.height=k.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth-d-b.plotLeft,y:0,width:e,height:j},k={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e})),l.reversed?(b=k,e=a):(b=a,e=k),h?(h.animate(b),i.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=i=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(i)),g&&(g.clip(h),this.areaNeg.clip(i))))},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};p(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;b.xAxis&&(K(c,"resize",a),K(b,"destroy",function(){W(c,"resize",a)}),a(),b.invertGroups=a)},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;return g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||.1}).add(e)),f[g?"attr":"animate"](this.getPlotBox()),f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;return a.inverted&&(b=c,c=this.xAxis),{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var c,a=this,b=a.chart,d=a.options,e=(c=d.animation)&&!!a.animate&&b.renderer.isSVG&&m(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,h=a.hasRendered,i=b.seriesGroup;c=a.plotGroup("group","series",f,g,i),a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i),e&&a.animate(!0),a.getAttribs(),c.inverted=a.isCartesian?b.inverted:!1,a.drawGraph&&(a.drawGraph(),a.clipNeg()),a.drawDataLabels&&a.drawDataLabels(),a.visible&&a.drawPoints(),a.drawTracker&&a.options.enableMouseTracking!==!1&&a.drawTracker(),b.inverted&&a.invertGroups(),d.clip!==!1&&!a.sharedClipKey&&!h&&c.clip(b.clipRect),e&&a.animate(),h||(e?a.animationTimeout=setTimeout(function(){a.afterAnimate()},e):a.afterAnimate()),a.isDirty=a.isDirtyData=!1,a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:m(d&&d.left,a.plotLeft),translateY:m(e&&e.top,a.plotTop)})),this.translate(),this.setTooltipPoints&&this.setTooltipPoints(!0),this.render(),b&&D(this,"updatedData")}},Hb.prototype={destroy:function(){Oa(this,this.axis)},render:function(a){var b=this.options,c=b.format,c=c?Ia(c,this):b.formatter.call(this);this.label?this.label.attr({text:c,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(c,null,null,b.useHTML).css(b.style).attr({align:this.textAlign,rotation:b.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,b){var c=this.axis,d=c.chart,e=d.inverted,f=this.isNegative,g=c.translate(c.usePercentage?100:this.total,0,0,0,1),c=c.translate(0),c=M(g-c),h=d.xAxis[0].translate(this.x)+a,i=d.plotHeight,f={x:e?f?g:g-c:h,y:e?i-h-b:f?i-g-c:i-g,width:e?c:b,height:e?b:c};(e=this.label)&&(e.align(this.alignOptions,null,f),f=e.alignAttr,e[this.options.crop===!1||d.isInsidePlot(f.x,f.y)?"show":"hide"](!0))}},la.prototype.buildStacks=function(){var a=this.series,b=m(this.options.reversedStacks,!0),c=a.length;if(!this.isXAxis){for(this.usePercentage=!1;c--;)a[b?c:a.length-c-1].setStackedPoints();if(this.usePercentage)for(c=0;c<a.length;c++)a[c].setPercentStacks()}},la.prototype.renderStackTotals=function(){var d,e,a=this.chart,b=a.renderer,c=this.stacks,f=this.stackTotalGroup;f||(this.stackTotalGroup=f=b.g("stack-labels").attr({visibility:"visible",zIndex:6}).add()),f.translate(a.plotLeft,a.plotTop);for(d in c)for(e in a=c[d])a[e].render(f)},O.prototype.setStackedPoints=function(){if(this.options.stacking&&(this.visible===!0||this.chart.options.chart.ignoreHiddenSeries===!1)){var n,m,p,q,r,u,a=this.processedXData,b=this.processedYData,c=[],d=b.length,e=this.options,f=e.threshold,g=e.stack,e=e.stacking,h=this.stackKey,i="-"+h,j=this.negStacks,k=this.yAxis,l=k.stacks,o=k.oldStacks;for(q=0;d>q;q++)r=a[q],u=b[q],p=this.index+","+q,m=(n=j&&f>u)?i:h,l[m]||(l[m]={}),l[m][r]||(o[m]&&o[m][r]?(l[m][r]=o[m][r],l[m][r].total=null):l[m][r]=new Hb(k,k.options.stackLabels,n,r,g)),m=l[m][r],m.points[p]=[m.cum||0],"percent"===e?(n=n?h:i,j&&l[n]&&l[n][r]?(n=l[n][r],m.total=n.total=v(n.total,m.total)+M(u)||0):m.total=da(m.total+(M(u)||0))):m.total=da(m.total+(u||0)),m.cum=(m.cum||0)+(u||0),m.points[p].push(m.cum),c[q]=m.cum;"percent"===e&&(k.usePercentage=!0),this.stackedYData=c,k.oldStacks={}}},O.prototype.setPercentStacks=function(){var a=this,b=a.stackKey,c=a.yAxis.stacks,d=a.processedXData;p([b,"-"+b],function(b){for(var e,g,h,f=d.length;f--;)g=d[f],e=(h=c[b]&&c[b][g])&&h.points[a.index+","+f],(g=e)&&(h=h.total?100/h.total:0,g[0]=da(g[0]*h),g[1]=da(g[1]*h),a.stackedYData[f]=g[1])})},q(Ya.prototype,{addSeries:function(a,b,c){var d,e=this;return a&&(b=m(b,!0),D(e,"addSeries",{options:a},function(){d=e.initSeries(a),e.isDirtyLegend=!0,e.linkSeries(),b&&e.redraw(c)})),d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new la(this,w(a,{index:this[e].length,isX:b})),f[e]=qa(f[e]||{}),f[e].push(a),m(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this.options,c=this.loadingDiv,d=b.loading;c||(this.loadingDiv=c=Y(Ja,{className:"highcharts-loading"},q(d.style,{zIndex:10,display:Q}),this.container),this.loadingSpan=Y("span",null,d.labelStyle,c)),this.loadingSpan.innerHTML=a||b.lang.loading,this.loadingShown||(G(c,{opacity:0,display:"",left:this.plotLeft+"px",top:this.plotTop+"px",width:this.plotWidth+"px",height:this.plotHeight+"px"}),kb(c,{opacity:d.style.opacity},{duration:d.showDuration||0}),this.loadingShown=!0)},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&kb(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){G(b,{display:Q})}}),this.loadingShown=!1}}),q(Ea.prototype,{update:function(a,b,c){var g,d=this,e=d.series,f=d.graphic,h=e.data,i=e.chart,j=e.options,b=m(b,!0);d.firePointEvent("update",{options:a},function(){d.applyOptions(a),ca(a)&&(e.getAttribs(),f&&(a&&a.marker&&a.marker.symbol?d.graphic=f.destroy():f.attr(d.pointAttr[d.state||""])),a&&a.dataLabels&&d.dataLabel&&(d.dataLabel=d.dataLabel.destroy())),g=Da(d,h),e.updateParallelArrays(d,g),j.data[g]=d.options,e.isDirty=e.isDirtyData=!0,!e.fixedBox&&e.hasCartesianSeries&&(i.isDirtyBox=!0),"point"===j.legendType&&i.legend.destroyItem(d),b&&i.redraw(c)})},remove:function(a,b){var g,c=this,d=c.series,e=d.points,f=d.chart,h=d.data;Qa(b,f),a=m(a,!0),c.firePointEvent("remove",null,function(){g=Da(c,h),h.length===e.length&&e.splice(g,1),h.splice(g,1),d.options.data.splice(g,1),d.updateParallelArrays(c,"splice",g,1),c.destroy(),d.isDirty=!0,d.isDirtyData=!0,a&&f.redraw()})}}),q(O.prototype,{addPoint:function(a,b,c,d){var o,e=this.options,f=this.data,g=this.graph,h=this.area,i=this.chart,j=this.xAxis&&this.xAxis.names,k=g&&g.shift||0,l=e.data,n=this.xData;if(Qa(d,i),c&&p([g,h,this.graphNeg,this.areaNeg],function(a){a&&(a.shift=k+1)}),h&&(h.isArea=!0),b=m(b,!0),d={series:this},this.pointClass.prototype.applyOptions.apply(d,[a]),g=d.x,h=n.length,this.requireSorting&&g<n[h-1])for(o=!0;h&&n[h-1]>g;)h--;this.updateParallelArrays(d,"splice",h,0,0),this.updateParallelArrays(d,h),j&&(j[g]=d.name),l.splice(h,0,a),o&&(this.data.splice(h,0,null),this.processData()),"point"===e.legendType&&this.generatePoints(),c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(d,"shift"),l.shift())),this.isDirtyData=this.isDirty=!0,b&&(this.getAttribs(),i.redraw())},remove:function(a,b){var c=this,d=c.chart,a=m(a,!0);c.isRemoving||(c.isRemoving=!0,D(c,"remove",null,function(){c.destroy(),d.isDirtyLegend=d.isDirtyBox=!0,d.linkSeries(),a&&d.redraw(b)})),c.isRemoving=!1},update:function(a,b){var f,c=this.chart,d=this.type,e=F[d].prototype,a=w(this.userOptions,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1);for(f in e)e.hasOwnProperty(f)&&(this[f]=t);q(this,F[a.type||d].prototype),this.init(c,a),m(b,!0)&&c.redraw(!1)}}),q(la.prototype,{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=w(this.userOptions,a);
5
- this.destroy(!0),this._addedPlotLB=t,this.init(c,q(a,{events:t})),c.isDirtyBox=!0,m(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);ja(b.axes,this),ja(b[c],this),b.options[c].splice(this.options.index,1),p(b[c],function(a,b){a.options.index=b}),this.destroy(),b.isDirtyBox=!0,m(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}}),ga=ka(O),F.line=ga,ba.area=w(S,{threshold:0});var pa=ka(O,{type:"area",getSegments:function(){var h,i,l,o,n,a=[],b=[],c=[],d=this.xAxis,e=this.yAxis,f=e.stacks[this.stackKey],g={},j=this.points,k=this.options.connectNulls;if(this.options.stacking&&!this.cropped){for(o=0;o<j.length;o++)g[j[o].x]=j[o];for(n in f)null!==f[n].total&&c.push(+n);c.sort(function(a,b){return a-b}),p(c,function(a){(!k||g[a]&&null!==g[a].y)&&(g[a]?b.push(g[a]):(h=d.translate(a),l=f[a].percent?f[a].total?100*f[a].cum/f[a].total:0:f[a].cum,i=e.toPixels(l,!0),b.push({y:null,plotX:h,clientX:h,plotY:i,yBottom:i,onMouseOver:sa})))}),b.length&&a.push(b)}else O.prototype.getSegments.call(this),a=this.segments;this.segments=a},getSegmentPath:function(a){var d,b=O.prototype.getSegmentPath.call(this,a),c=[].concat(b),e=this.options;d=b.length;var g,f=this.yAxis.getThreshold(e.threshold);if(3===d&&c.push("L",b[1],b[2]),e.stacking&&!this.closedStacks)for(d=a.length-1;d>=0;d--)g=m(a[d].yBottom,f),d<a.length-1&&e.step&&c.push(a[d+1].plotX,g),c.push(a[d].plotX,g);else this.closeSegment(c,a,f);return this.areaPath=this.areaPath.concat(c),b},closeSegment:function(a,b,c){a.push("L",b[b.length-1].plotX,c,"L",b[0].plotX,c)},drawGraph:function(){this.areaPath=[],O.prototype.drawGraph.apply(this);var a=this,b=this.areaPath,c=this.options,d=c.negativeColor,e=c.negativeFillColor,f=[["area",this.color,c.fillColor]];(d||e)&&f.push(["areaNeg",d,e]),p(f,function(d){var e=d[0],f=a[e];f?f.animate({d:b}):a[e]=a.chart.renderer.path(b).attr({fill:m(d[2],ya(d[1]).setOpacity(m(c.fillOpacity,.75)).get()),zIndex:0}).add(a.group)})},drawLegendSymbol:N.drawRectangle});F.area=pa,ba.spline=w(S),ga=ka(O,{type:"spline",getPointSpline:function(a,b,c){var h,i,j,k,d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1];if(f&&g){a=f.plotY,j=g.plotX;var l,g=g.plotY;h=(1.5*d+f.plotX)/2.5,i=(1.5*e+a)/2.5,j=(1.5*d+j)/2.5,k=(1.5*e+g)/2.5,l=(k-i)*(j-d)/(j-h)+e-k,i+=l,k+=l,i>a&&i>e?(i=v(a,e),k=2*e-i):a>i&&e>i&&(i=C(a,e),k=2*e-i),k>g&&k>e?(k=v(g,e),i=2*e-k):g>k&&e>k&&(k=C(g,e),i=2*e-k),b.rightContX=j,b.rightContY=k}return c?(b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e],f.rightContX=f.rightContY=null):b=["M",d,e],b}}),F.spline=ga,ba.areaspline=w(ba.area),pa=pa.prototype,ga=ka(ga,{type:"areaspline",closedStacks:!0,getSegmentPath:pa.getSegmentPath,closeSegment:pa.closeSegment,drawGraph:pa.drawGraph,drawLegendSymbol:N.drawRectangle}),F.areaspline=ga,ba.column=w(S,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},threshold:0}),ga=ka(O,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){O.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){b.type===a.type&&(b.isDirty=!0)})},getColumnMetrics:function(){var f,h,a=this,b=a.options,c=a.xAxis,d=a.yAxis,e=c.reversed,g={},i=0;b.grouping===!1?i=1:p(a.chart.series,function(b){var c=b.options,e=b.yAxis;b.type===a.type&&b.visible&&d.len===e.len&&d.pos===e.pos&&(c.stacking?(f=b.stackKey,g[f]===t&&(g[f]=i++),h=g[f]):c.grouping!==!1&&(h=i++),b.columnIndex=h)});var c=C(M(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||c.tickInterval||1),c.len),j=c*b.groupPadding,k=(c-2*j)/i,l=b.pointWidth,b=r(l)?(k-l)/2:k*b.pointPadding,l=m(l,k-2*b);return a.columnMetrics={width:l,offset:b+(j+((e?i-(a.columnIndex||0):a.columnIndex)||0)*k-c/2)*(e?-1:1)}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.borderWidth=m(c.borderWidth,a.activePointCount>.5*a.xAxis.len?0:1),e=a.yAxis,f=a.translatedThreshold=e.getThreshold(c.threshold),g=m(c.minPointLength,5),c=a.getColumnMetrics(),h=c.width,i=a.barW=Ka(v(h,1+2*d)),j=a.pointXOffset=c.offset,k=-(d%2?.5:0),l=d%2?.5:1;b.renderer.isVML&&b.inverted&&(l+=1),O.prototype.translate.apply(a),p(a.points,function(c){var x,d=m(c.yBottom,f),p=C(v(-999-d,c.plotY),e.len+999+d),q=c.plotX+j,r=i,t=C(p,d);x=v(p,d)-t,M(x)<g&&g&&(x=g,t=u(M(t-f)>g?d-g:f-(e.translate(c.y,0,1,0,1)<=f?g:0))),c.barX=q,c.pointWidth=h,c.tooltipPos=b.inverted?[e.len-p,a.xAxis.len-q-r/2]:[q+r/2,p],d=M(q)<.5,r=u(q+r)+k,q=u(q)+k,r-=q,p=M(t)<.5,x=u(t+x)+l,t=u(t)+l,x-=t,d&&(q+=1,r-=1),p&&(t-=1,x+=1),c.shapeType="rect",c.shapeArgs={x:q,y:t,width:r,height:x}})},getSymbol:sa,drawLegendSymbol:N.drawRectangle,drawGraph:sa,drawPoints:function(){var f,g,h,a=this,b=this.chart,c=a.options,d=b.renderer,e=c.animationLimit||250;p(a.points,function(i){var j=i.plotY,k=i.graphic;j===t||isNaN(j)||null===i.y?k&&(i.graphic=k.destroy()):(f=i.shapeArgs,h=r(a.borderWidth)?{"stroke-width":a.borderWidth}:{},g=i.pointAttr[i.selected?"select":""]||a.pointAttr[""],k?(bb(k),k.attr(h)[b.pointCount<e?"animate":"attr"](w(f))):i.graphic=d[i.shapeType](f).attr(g).attr(h).add(a.group).shadow(c.shadow,null,c.stacking&&!c.borderRadius))})},animate:function(a){var b=this.yAxis,c=this.options,d=this.chart.inverted,e={};aa&&(a?(e.scaleY=.001,a=C(b.pos+b.len,v(b.pos,b.toPixels(c.threshold))),d?e.translateX=a-b.len:e.translateY=a,this.group.attr(e)):(e.scaleY=1,e[d?"translateX":"translateY"]=b.pos,this.group.animate(e,this.options.animation),this.animate=null))},remove:function(){var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){b.type===a.type&&(b.isDirty=!0)}),O.prototype.remove.apply(a,arguments)}}),F.column=ga,ba.bar=w(ba.column),pa=ka(ga,{type:"bar",inverted:!0}),F.bar=pa,ba.scatter=w(S,{lineWidth:0,tooltip:{headerFormat:'<span style="color:{series.color}">●</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"},stickyTracking:!1}),pa=ka(O,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&O.prototype.drawGraph.call(this)}}),F.scatter=pa,ba.pie=w(S,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}}),S={type:"pie",isCartesian:!1,pointClass:ka(Ea,{init:function(){Ea.prototype.init.apply(this,arguments);var b,a=this;return a.y<0&&(a.y=null),q(a,{visible:a.visible!==!1,name:m(a.name,"Slice")}),b=function(b){a.slice("select"===b.type)},K(a,"select",b),K(a,"unselect",b),a},setVisible:function(a){var b=this,c=b.series,d=c.chart;b.visible=b.options.visible=a=a===t?!b.visible:a,c.options.data[Da(b,c.data)]=b.options,p(["graphic","dataLabel","connector","shadowGroup"],function(c){b[c]&&b[c][a?"show":"hide"](!0)}),b.legendItem&&d.legend.colorizeItem(b,a),!c.isDirty&&c.options.ignoreHiddenPoint&&(c.isDirty=!0,d.redraw())},slice:function(a,b,c){var d=this.series;Qa(c,d.chart),m(b,!0),this.sliced=this.options.sliced=a=r(a)?a:!this.sliced,d.options.data[Da(this,d.data)]=this.options,a=a?this.slicedTranslation:{translateX:0,translateY:0},this.graphic.animate(a),this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=this.shapeArgs,c=this.series.chart;return this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:sa,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;a||(p(c,function(a){var c=a.graphic,a=a.shapeArgs;c&&(c.attr({r:b.center[3]/2,start:d,end:d}),c.animate({r:a.r,start:a.start,end:a.end},b.options.animation))}),b.animate=null)},setData:function(a,b,c,d){O.prototype.setData.call(this,a,!1,c,d),this.processData(),this.generatePoints(),m(b,!0)&&this.chart.redraw(c)},generatePoints:function(){var a,c,d,e,b=0,f=this.options.ignoreHiddenPoint;for(O.prototype.generatePoints.call(this),c=this.points,d=c.length,a=0;d>a;a++)e=c[a],b+=f&&!e.visible?0:e.y;for(this.total=b,a=0;d>a;a++)e=c[a],e.percentage=b>0?e.y/b*100:0,e.total=b},translate:function(a){this.generatePoints();var f,g,h,o,p,b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,i=c.startAngle||0,j=this.startAngleRad=ma/180*(i-90),i=(this.endAngleRad=ma/180*(m(c.endAngle,i+360)-90))-j,k=this.points,l=c.dataLabels.distance,c=c.ignoreHiddenPoint,n=k.length;for(a||(this.center=a=this.getCenter()),this.getX=function(b,c){return h=U.asin(C((b-a[1])/(a[2]/2+l),1)),a[0]+(c?-1:1)*Z(h)*(a[2]/2+l)},o=0;n>o;o++)p=k[o],f=j+b*i,(!c||p.visible)&&(b+=p.percentage/100),g=j+b*i,p.shapeType="arc",p.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:u(1e3*f)/1e3,end:u(1e3*g)/1e3},h=(g+f)/2,h>1.5*ma?h-=2*ma:-ma/2>h&&(h+=2*ma),p.slicedTranslation={translateX:u(Z(h)*d),translateY:u(ea(h)*d)},f=Z(h)*a[2]/2,g=ea(h)*a[2]/2,p.tooltipPos=[a[0]+.7*f,a[1]+.7*g],p.half=-ma/2>h||h>ma/2?1:0,p.angle=h,e=C(e,l/2),p.labelPos=[a[0]+f+Z(h)*l,a[1]+g+ea(h)*l,a[0]+f+Z(h)*e,a[1]+g+ea(h)*e,a[0]+f,a[1]+g,0>l?"center":p.half?"right":"left",h]},drawGraph:null,drawPoints:function(){var c,d,f,g,a=this,b=a.chart.renderer,e=a.options.shadow;e&&!a.shadowGroup&&(a.shadowGroup=b.g("shadow").add(a.group)),p(a.points,function(h){d=h.graphic,g=h.shapeArgs,f=h.shadowGroup,e&&!f&&(f=h.shadowGroup=b.g("shadow").add(a.shadowGroup)),c=h.sliced?h.slicedTranslation:{translateX:0,translateY:0},f&&f.attr(c),d?d.animate(q(g,c)):h.graphic=d=b[h.shapeType](g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,f),void 0!==h.visible&&h.setVisible(h.visible)})},sortByAngle:function(a,b){a.sort(function(a,d){return void 0!==a.angle&&(d.angle-a.angle)*b})},drawLegendSymbol:N.drawRectangle,getCenter:X.getCenter,getSymbol:sa},S=ka(O,S),F.pie=S,O.prototype.drawDataLabels=function(){var f,g,h,i,a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points;(d.enabled||a._hasPointLabels)&&(a.dlProcessOptions&&a.dlProcessOptions(d),i=a.plotGroup("dataLabelsGroup","data-labels","hidden",d.zIndex||6),!a.hasRendered&&m(d.defer,!0)&&(i.attr({opacity:0}),K(a,"afterAnimate",function(){a.dataLabelsGroup.show()[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),g=d,p(e,function(b){var e,o,n,l=b.dataLabel,p=b.connector,u=!0;if(f=b.options&&b.options.dataLabels,e=m(f&&f.enabled,g.enabled),l&&!e)b.dataLabel=l.destroy();else if(e){if(d=w(g,f),e=d.rotation,o=b.getLabelConfig(),h=d.format?Ia(d.format,o):d.formatter.call(o,d),d.style.color=m(d.color,d.style.color,a.color,"black"),l)r(h)?(l.attr({text:h}),u=!1):(b.dataLabel=l=l.destroy(),p&&(b.connector=p.destroy()));else if(r(h)){l={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(n in l)l[n]===t&&delete l[n];l=b.dataLabel=a.chart.renderer[e?"text":"label"](h,0,-999,null,null,null,d.useHTML).attr(l).css(q(d.style,c&&{cursor:c})).add(i).shadow(d.shadow)}l&&a.alignDataLabel(b,l,d,null,u)}}))},O.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=m(a.plotX,-999),i=m(a.plotY,-999),j=b.getBBox();(a=this.visible&&(a.series.forceDL||f.isInsidePlot(h,u(i),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height-1,g)))&&(d=q({x:g?f.plotWidth-i:h,y:u(g?f.plotHeight-h:i),width:0,height:0},d),q(c,{width:j.width,height:j.height}),c.rotation?(g={align:c.align,x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2},b[e?"attr":"animate"](g)):(b.align(c,null,d),g=b.alignAttr,"justify"===m(c.overflow,"justify")?this.justifyDataLabel(b,c,g,j,d,e):m(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+j.width,g.y+j.height)))),a||(b.attr({y:-999}),b.placed=!1)},O.prototype.justifyDataLabel=function(a,b,c,d,e,f){var j,k,g=this.chart,h=b.align,i=b.verticalAlign;j=c.x,0>j&&("right"===h?b.align="left":b.x=-j,k=!0),j=c.x+d.width,j>g.plotWidth&&("left"===h?b.align="right":b.x=g.plotWidth-j,k=!0),j=c.y,0>j&&("bottom"===i?b.verticalAlign="top":b.y=-j,k=!0),j=c.y+d.height,j>g.plotHeight&&("top"===i?b.verticalAlign="bottom":b.y=g.plotHeight-j,k=!0),k&&(a.placed=!f,a.align(b,null,e))},F.pie&&(F.pie.prototype.drawDataLabels=function(){var c,i,j,t,w,x,y,A,C,G,D,B,a=this,b=a.data,d=a.chart,e=a.options.dataLabels,f=m(e.connectorPadding,10),g=m(e.connectorWidth,1),h=d.plotWidth,d=d.plotHeight,k=m(e.softConnector,!0),l=e.distance,o=a.center,n=o[2]/2,q=o[1],r=l>0,z=[[],[]],F=[0,0,0,0],N=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){for(O.prototype.drawDataLabels.apply(a),p(b,function(a){a.dataLabel&&a.visible&&z[a.half].push(a)}),D=0;!y&&b[D];)y=b[D]&&b[D].dataLabel&&(b[D].dataLabel.getBBox().height||21),D++;for(D=2;D--;){var E,b=[],K=[],H=z[D],I=H.length;if(a.sortByAngle(H,D-.5),l>0){for(B=q-n-l;q+n+l>=B;B+=y)b.push(B);if(w=b.length,I>w){for(c=[].concat(H),c.sort(N),B=I;B--;)c[B].rank=B;for(B=I;B--;)H[B].rank>=w&&H.splice(B,1);I=H.length}for(B=0;I>B;B++){c=H[B],x=c.labelPos,c=9999;var Q,P;for(P=0;w>P;P++)Q=M(b[P]-x[1]),c>Q&&(c=Q,E=P);if(B>E&&null!==b[B])E=B;else for(I-B+E>w&&null!==b[B]&&(E=w-I+B);null===b[E];)E++;K.push({i:E,y:b[E]}),b[E]=null}K.sort(N)}for(B=0;I>B;B++)c=H[B],x=c.labelPos,t=c.dataLabel,G=c.visible===!1?"hidden":"visible",c=x[1],l>0?(w=K.pop(),E=w.i,C=w.y,(c>C&&null!==b[E+1]||C>c&&null!==b[E-1])&&(C=c)):C=c,A=e.justify?o[0]+(D?-1:1)*(n+l):a.getX(0===E||E===b.length-1?c:C,D),t._attr={visibility:G,align:x[6]},t._pos={x:A+e.x+({left:f,right:-f}[x[6]]||0),y:C+e.y-10},t.connX=A,t.connY=C,null===this.options.size&&(w=t.width,f>A-w?F[3]=v(u(w-A+f),F[3]):A+w>h-f&&(F[1]=v(u(A+w-h+f),F[1])),0>C-y/2?F[0]=v(u(-C+y/2),F[0]):C+y/2>d&&(F[2]=v(u(C+y/2-d),F[2])))}(0===Ba(F)||this.verifyDataLabelOverflow(F))&&(this.placeDataLabels(),r&&g&&p(this.points,function(b){i=b.connector,x=b.labelPos,(t=b.dataLabel)&&t._pos?(G=t._attr.visibility,A=t.connX,C=t.connY,j=k?["M",A+("left"===x[6]?5:-5),C,"C",A,C,2*x[2]-x[4],2*x[3]-x[5],x[2],x[3],"L",x[4],x[5]]:["M",A+("left"===x[6]?5:-5),C,"L",x[2],x[3],"L",x[4],x[5]],i?(i.animate({d:j}),i.attr("visibility",G)):b.connector=i=a.chart.renderer.path(j).attr({"stroke-width":g,stroke:e.connectorColor||b.color||"#606060",visibility:G}).add(a.dataLabelsGroup)):i&&(b.connector=i.destroy())}))}},F.pie.prototype.placeDataLabels=function(){p(this.points,function(a){var b,a=a.dataLabel;a&&((b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999}))})},F.pie.prototype.alignDataLabel=sa,F.pie.prototype.verifyDataLabelOverflow=function(a){var f,b=this.center,c=this.options,d=c.center,e=c=c.minSize||80;return null!==d[0]?e=v(b[2]-v(a[1],a[3]),c):(e=v(b[2]-a[1]-a[3],c),b[0]+=(a[3]-a[1])/2),null!==d[1]?e=v(C(e,b[2]-v(a[0],a[2])),c):(e=v(C(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2),e<b[2]?(b[2]=e,this.translate(b),p(this.points,function(a){a.dataLabel&&(a.dataLabel._pos=null)}),this.drawDataLabels&&this.drawDataLabels()):f=!0,f}),F.column&&(F.column.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,i=a.below||a.plotY>m(this.translatedThreshold,f.plotSizeY),j=m(c.inside,!!this.options.stacking);h&&(d=w(h),g&&(d={x:f.plotWidth-d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),!j)&&(g?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0)),c.align=m(c.align,!g||j?"center":i?"right":"left"),c.verticalAlign=m(c.verticalAlign,g||j?"middle":i?"top":"bottom"),O.prototype.alignDataLabel.call(this,a,b,c,d,e)}),S=R.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var e,d=c.target;for(b.hoverSeries!==a&&a.onMouseOver();d&&!e;)e=d.point,d=d.parentNode;e!==t&&e!==b.hoverPoint&&e.onMouseOver(c)};p(a.points,function(a){a.graphic&&(a.graphic.element.point=a),a.dataLabel&&(a.dataLabel.element.point=a)}),a._hasTracking||(p(a.trackerGroups,function(b){a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),$a)&&a[b].on("touchstart",f)}),a._hasTracking=!0)},drawTrackerGraph:function(){var m,a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,f=a.chart,g=f.pointer,h=f.renderer,i=f.options.tooltip.snap,j=a.tracker,k=b.cursor,l=k&&{cursor:k},k=a.singlePoints,n=function(){f.hoverSeries!==a&&a.onMouseOver()},q="rgba(192,192,192,"+(aa?1e-4:.002)+")";if(e&&!c)for(m=e+1;m--;)"M"===d[m]&&d.splice(m+1,0,d[m+1]-i,d[m+2],"L"),(m&&"M"===d[m]||m===e)&&d.splice(m,0,"L",d[m-2]+i,d[m-1]);for(m=0;m<k.length;m++)e=k[m],d.push("M",e.plotX-i,e.plotY,"L",e.plotX+i,e.plotY);j?j.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:q,fill:c?q:Q,"stroke-width":b.lineWidth+(c?0:2*i),zIndex:2}).add(a.group),p([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",n).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(l),$a&&a.on("touchstart",n)}))}},F.column&&(ga.prototype.drawTracker=S.drawTrackerPoint),F.pie&&(F.pie.prototype.drawTracker=S.drawTrackerPoint),F.scatter&&(pa.prototype.drawTracker=S.drawTrackerPoint),q(lb.prototype,{setItemEvents:function(a,b,c,d,e){var f=this;(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover"),b.css(f.options.itemHoverStyle)}).on("mouseout",function(){b.css(a.visible?d:e),a.setState()}).on("click",function(b){var c=function(){a.setVisible()},b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):D(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=Y("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container),K(a.checkbox,"click",function(b){D(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})})}}),E.legend.itemStyle.cursor="pointer",q(Ya.prototype,{showResetZoom:function(){var a=this,b=E.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f="chart"===c.relativeTo?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=this;D(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,e,c=this.pointer,d=!1;!a||a.resetSelection?p(this.axes,function(a){b=a.zoom()}):p(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;(c[h?"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])&&(b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0))}),e=this.resetZoomButton,d&&!e?this.showResetZoom():!d&&ca(e)&&(this.resetZoomButton=e.destroy()),b&&this.redraw(m(this.options.chart.animation,a&&a.animation,this.pointCount<100))},pan:function(a,b){var e,c=this,d=c.hoverPoints;d&&p(d,function(a){a.setState()}),p("xy"===b?[1,0]:[1],function(b){var d=a[b?"chartX":"chartY"],h=c[b?"xAxis":"yAxis"][0],i=c[b?"mouseDownX":"mouseDownY"],j=(h.pointRange||0)/2,k=h.getExtremes(),l=h.toValue(i-d,!0)+j,i=h.toValue(i+c[b?"plotWidth":"plotHeight"]-d,!0)-j;h.series.length&&l>C(k.dataMin,k.min)&&i<v(k.dataMax,k.max)&&(h.setExtremes(l,i,!1,!1,{trigger:"pan"}),e=!0),c[b?"mouseDownX":"mouseDownY"]=d}),e&&c.redraw(!1),G(c.container,{cursor:"move"})}}),q(Ea.prototype,{select:function(a,b){var c=this,d=c.series,e=d.chart,a=m(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a,d.options.data[Da(c,d.data)]=c.options,c.setState(a&&"select"),b||p(e.getSelectedPoints(),function(a){a.selected&&a!==c&&(a.selected=a.options.selected=!1,d.options.data[Da(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;e&&e!==this&&e.onMouseOut(),this.firePointEvent("mouseOver"),d&&(!d.shared||b.noSharedTooltip)&&d.refresh(this,a),this.setState("hover"),c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;b&&-1!==Da(this,b)||(this.firePointEvent("mouseOut"),this.setState(),a.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var b,a=w(this.series.options.point,this.options).events;this.events=a;for(b in a)K(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var p,c=this.plotX,d=this.plotY,e=this.series,f=e.options.states,g=ba[e.type].marker&&e.options.marker,h=g&&!g.enabled,i=g&&g.states[a],j=i&&i.enabled===!1,k=e.stateMarkerGraphic,l=this.marker||{},m=e.chart,n=e.halo,a=a||"";p=this.pointAttr[a]||e.pointAttr[a],a===this.state&&!b||this.selected&&"select"!==a||f[a]&&f[a].enabled===!1||a&&(j||h&&i.enabled===!1)||a&&l.states&&l.states[a]&&l.states[a].enabled===!1||(this.graphic?(g=g&&this.graphic.symbolName&&p.r,this.graphic.attr(w(p,g?{x:c-g,y:d-g,width:2*g,height:2*g}:{})),k&&k.hide()):(a&&i&&(g=i.radius,l=l.symbol||e.symbol,k&&k.currentSymbol!==l&&(k=k.destroy()),k?k[b?"animate":"attr"]({x:c-g,y:d-g}):l&&(e.stateMarkerGraphic=k=m.renderer.symbol(l,c-g,d-g,2*g,2*g).attr(p).add(e.markerGroup),k.currentSymbol=l)),k&&k[a&&m.isInsidePlot(c,d,m.inverted)?"show":"hide"]()),(c=f[a]&&f[a].halo)&&c.size?(n||(e.halo=n=m.renderer.path().add(e.seriesGroup)),n.attr(q({fill:ya(this.color||e.color).setOpacity(c.opacity).get()},c.attributes))[b?"animate":"attr"]({d:this.haloPath(c.size)})):n&&n.attr({d:[]}),this.state=a)},haloPath:function(a){var b=this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted;return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:this.plotX)-a,d.translateY+(e?b.xAxis.len-this.plotX:this.plotY)-a,2*a,2*a)}}),q(O.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;b&&b!==this&&b.onMouseOut(),this.options.events.mouseOver&&D(this,"mouseOver"),this.setState("hover"),a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut(),this&&a.events.mouseOut&&D(this,"mouseOut"),c&&!a.stickyTracking&&(!c.shared||this.noSharedTooltip)&&c.hide(),this.setState(),b.hoverSeries=null},setState:function(a){var b=this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth,a=a||"";this.state!==a&&(this.state=a,e[a]&&e[a].enabled===!1||(a&&(b=e[a].lineWidth||b+1),c&&!c.dashstyle&&(a={"stroke-width":b},c.attr(a),d&&d.attr(a))))},setVisible:function(a,b){var f,c=this,d=c.chart,e=c.legendItem,g=d.options.chart.ignoreHiddenSeries,h=c.visible;f=(c.visible=a=c.userOptions.visible=a===t?!h:a)?"show":"hide",p(["group","dataLabelsGroup","markerGroup","tracker"],function(a){c[a]&&c[a][f]()}),d.hoverSeries===c&&c.onMouseOut(),e&&d.legend.colorizeItem(c,a),c.isDirty=!0,c.options.stacking&&p(d.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)}),p(c.linkedSeries,function(b){b.setVisible(a,!1)}),g&&(d.isDirtyBox=!0),b!==!1&&d.redraw(),D(c,f)},setTooltipPoints:function(a){var c,d,h,i,b=[],e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||e.len:this.chart.plotSizeX,j=[];if(this.options.enableMouseTracking!==!1&&!this.singularTooltips){for(a&&(this.tooltipPoints=null),p(this.segments||this.points,function(a){b=b.concat(a)}),e&&e.reversed&&(b=b.reverse()),this.orderTooltipPoints&&this.orderTooltipPoints(b),a=b.length,i=0;a>i;i++)if(e=b[i],c=e.x,c>=f.min&&c<=f.max)for(h=b[i+1],c=d===t?0:d+1,d=b[i+1]?C(v(0,T((e.clientX+(h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&d>=c;)j[c++]=e;this.tooltipPoints=j}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===t?!this.selected:a,this.checkbox&&(this.checkbox.checked=a),D(this,a?"select":"unselect")},drawTracker:S.drawTrackerGraph}),q(R,{Axis:la,Chart:Ya,Color:ya,Point:Ea,Tick:Sa,Renderer:Za,Series:O,SVGElement:P,SVGRenderer:ta,arrayMin:Na,arrayMax:Ba,charts:V,dateFormat:cb,format:Ia,pathAnim:ub,getOptions:function(){return E},hasBidiBug:Nb,isTouchDevice:Jb,numberFormat:Ga,seriesTypes:F,setOptions:function(a){return E=w(!0,E,a),Cb(),E},addEvent:K,removeEvent:W,createElement:Y,discardElement:Pa,css:G,each:p,extend:q,map:Ua,merge:w,pick:m,splat:qa,extendClass:ka,pInt:z,wrap:Ma,svg:aa,canvas:fa,vml:!aa&&!fa,product:"Highcharts",version:"4.0.1"})}(),jQuery(document).ready(function($){$("#close-share").click(function(){$.cookie("ignore_social_share",1,{expires:30})}),$(".big-button--share").click(function(){$.cookie("ignore_social_share",1)}),$.cookie("ignore_social_share")||leadin_check_social_share_popup(),$("#filter_action").select2(),$("#filter_action").change(function(){var $this=$(this);"submitted"==$this.val()?$("#form-filter-input").show():($("#form-filter-input").hide(),$("#filter_form").select2("val","any form"))}),$("#view-all-do-not-track-selectors").click(function(){$(".form-do-not-track, #view-less-do-not-track-selectors").not(".do-not-track-always-show").show(),$("#view-all-do-not-track-selectors").hide()}),$("#view-less-do-not-track-selectors").click(function(){$(".form-do-not-track, #view-less-do-not-track-selectors").not(".do-not-track-always-show").hide(),$("#view-all-do-not-track-selectors").show()}),$("#filter_content").select2({query:function(query){var key=query.term;$.ajax({type:"POST",url:li_admin_ajax.ajax_url,data:{action:"leadin_get_posts_and_pages",search_term:key},success:function(data){var i,json_data=jQuery.parseJSON(data),data_test={results:[]};for(i=0;i<json_data.length;i++)data_test.results.push({id:json_data[i].post_title,text:json_data[i].post_title});query.callback(data_test)}})},initSelection:function(){$("#filter_content").val()?$("#filter_content").select2("data",{id:$("#filter_content").val(),text:$("#filter_content").val()}):$("#filter_content").select2("data",{id:"any page",text:"any page"})}}),$("#filter_form").select2({query:function(query){var key=query.term;$.ajax({type:"POST",url:li_admin_ajax.ajax_url,data:{action:"leadin_get_form_selectors",search_term:key},success:function(data){var i,json_data=jQuery.parseJSON(data),data_test={results:[]};for(i=0;i<json_data.length;i++)data_test.results.push({id:json_data[i],text:json_data[i]});query.callback(data_test)}})},initSelection:function(){$("#filter_form").val()?$("#filter_form").select2("data",{id:$("#filter_form").val(),text:$("#filter_form").val()}):$("#filter_form").select2("data",{id:"any form",text:"any form"})}}),$("#leadin-contact-status").change(function(){$("#leadin-contact-status-button").addClass("button-primary")}),$("input[name=popup-position]:radio").change(function(){$("#btn-activate-subscribe").attr("href",window.location.href+"&leadin_action=activate&power_up=subscribe_widget&redirect_to="+encodeURIComponent(window.location.href+"&activate_popup=true&popup_position="+$("input:radio[name='popup-position']:checked").val()))}),$("#li_subscribe_vex_class, #li_subscribe_heading, #li_subscribe_text, #li_subscribe_btn_label, #li_subscribe_btn_color, #li_subscribe_name_fields:checkbox, #li_subscribe_phone_field:checkbox").change(function(){var preview_link=$("#wp-admin-bar-view-site a.ab-item").attr("href")+"?preview-subscribe=1";preview_link+="&lis_heading="+$("#li_subscribe_heading").val(),preview_link+="&lis_desc="+$("#li_subscribe_text").val(),preview_link+="&lis_show_names="+($("#li_subscribe_name_fields").is(":checked")?1:0),preview_link+="&lis_show_phone="+($("#li_subscribe_phone_field").is(":checked")?1:0),preview_link+="&lis_btn_label="+$("#li_subscribe_btn_label").val(),preview_link+="&lis_btn_color="+$("#li_subscribe_btn_color").val(),preview_link+="&lis_vex_class="+$("#li_subscribe_vex_class option:selected").val(),$("#preview-popup-link").attr("href",preview_link)}),$("#pro-upgrade-button").click(function(e){return e.preventDefault(),$("#agree-pp").is(":checked")?($("#agree-pp-error").hide(),$(this).addClass("btn-submitting").text("Upgrading..."),void $.ajax({type:"POST",url:li_admin_ajax.ajax_url,data:{action:"leadin_upgrade_to_pro"},success:function(redirect_to){redirect_to&&(window.location.href=redirect_to+"&pro_upgrade=1")}})):($("#agree-pp-error").show(),!1)})}),jQuery(document).ready(function($){var $bulk_opt_selected=$('.bulkactions select option[value="add_tag_to_selected"], .bulkactions select option[value="remove_tag_from_selected"], .bulkactions select option[value="delete_selected"]');$("#leadin-contacts input:checkbox").not("thead input:checkbox, tfoot input:checkbox").bind("change",function(){var cb_count=0,selected_vals="",$btn_selected=$("#leadin-export-selected-leads"),$input_selected_vals=$(".leadin-selected-contacts"),$cb_selected=$("#leadin-contacts input:checkbox:checked").not("thead input:checkbox, tfoot input:checkbox");$cb_selected.length>0?($btn_selected.attr("disabled",!1),$bulk_opt_selected.attr("disabled",!1)):($btn_selected.attr("disabled",!0),$bulk_opt_selected.attr("disabled",!0)),$cb_selected.each(function(){selected_vals+=$(this).val(),cb_count!=$cb_selected.length-1&&(selected_vals+=","),cb_count++}),$input_selected_vals.val(selected_vals),$(".selected-contacts-count").text(cb_count)}),$("#cb-select-all-1, #cb-select-all-2").bind("change",function(){var cb_count=0,selected_vals="",$this=$(this),$btn_selected=$("#leadin-export-selected-leads"),$cb_selected=$("#leadin-contacts input:checkbox").not("thead input:checkbox, tfoot input:checkbox"),$input_selected_vals=$(".leadin-selected-contacts");$cb_selected.each(function(){selected_vals+=$(this).val(),cb_count!=$cb_selected.length-1&&(selected_vals+=","),cb_count++}),$input_selected_vals.val(selected_vals),$this.is(":checked")?($btn_selected.attr("disabled",!1),$bulk_opt_selected.attr("disabled",!1)):($btn_selected.attr("disabled",!0),$bulk_opt_selected.attr("disabled",!0),$(".selected-contacts-count").text($("#contact-count").text())),$(".selected-contacts-count").text(cb_count)}),$(".postbox .handlediv").bind("click",function(){var $postbox=$(this).parent();$postbox.hasClass("closed")?$postbox.removeClass("closed"):$postbox.addClass("closed")}),$(".selected-contacts-count").text($("#contact-count").text()),$bulk_opt_selected.attr("disabled",!0),$(".bulkactions select").change(function(){{var $this=$(this);$("#contact-count").text()}"add_tag_to_all"==$this.val()||"add_tag_to_selected"==$this.val()?($("#bulk-edit-tags h2").html($("#bulk-edit-tags h2").html().replace("remove from","add to")),$("#bulk-edit-button").val("Add Tag"),$("#bulk-edit-tag-action").val("add_tag"),tb_show("","#TB_inline?width=400&height=175&inlineId=bulk-edit-tags"),$(".bulkactions select").val("-1")):("remove_tag_from_all"==$this.val()||"remove_tag_from_selected"==$this.val())&&($("#bulk-edit-tags h2").html($("#bulk-edit-tags h2").html().replace("add to","remove from")),$("#bulk-edit-button").val("Remove Tag"),$("#bulk-edit-tag-action").val("remove_tag"),tb_show("","#TB_inline?width=400&height=175&inlineId=bulk-edit-tags"),$(".bulkactions select").val("-1"))}),$("#contact-detail-read-more").click(function(){$("#company-detail-overview-short").hide(),$("#company-detail-overview-full").show()}),$("#contact-detail-read-less").click(function(){$("#company-detail-overview-full").hide(),$("#company-detail-overview-short").show()})}),function($){"undefined"==typeof $.fn.each2&&$.extend($.fn,{each2:function(c){for(var j=$([0]),i=-1,l=this.length;++i<l&&(j.context=j[0]=this[i])&&c.call(j[0],i,j)!==!1;);return this}})}(jQuery),function($,undefined){"use strict";function reinsertElement(element){var placeholder=$(document.createTextNode(""));
6
- element.before(placeholder),placeholder.before(element),placeholder.remove()}function stripDiacritics(str){function match(a){return DIACRITICS[a]||a}return str.replace(/[^\u0000-\u007E]/g,match)}function indexOf(value,array){for(var i=0,l=array.length;l>i;i+=1)if(equal(value,array[i]))return i;return-1}function measureScrollbar(){var $template=$(MEASURE_SCROLLBAR_TEMPLATE);$template.appendTo("body");var dim={width:$template.width()-$template[0].clientWidth,height:$template.height()-$template[0].clientHeight};return $template.remove(),dim}function equal(a,b){return a===b?!0:a===undefined||b===undefined?!1:null===a||null===b?!1:a.constructor===String?a+""==b+"":b.constructor===String?b+""==a+"":!1}function splitVal(string,separator){var val,i,l;if(null===string||string.length<1)return[];for(val=string.split(separator),i=0,l=val.length;l>i;i+=1)val[i]=$.trim(val[i]);return val}function getSideBorderPadding(element){return element.outerWidth(!1)-element.width()}function installKeyUpChangeEvent(element){var key="keyup-change-value";element.on("keydown",function(){$.data(element,key)===undefined&&$.data(element,key,element.val())}),element.on("keyup",function(){var val=$.data(element,key);val!==undefined&&element.val()!==val&&($.removeData(element,key),element.trigger("keyup-change"))})}function installFilteredMouseMove(element){element.on("mousemove",function(e){var lastpos=lastMousePosition;(lastpos===undefined||lastpos.x!==e.pageX||lastpos.y!==e.pageY)&&$(e.target).trigger("mousemove-filtered",e)})}function debounce(quietMillis,fn,ctx){ctx=ctx||undefined;var timeout;return function(){var args=arguments;window.clearTimeout(timeout),timeout=window.setTimeout(function(){fn.apply(ctx,args)},quietMillis)}}function installDebouncedScroll(threshold,element){var notify=debounce(threshold,function(e){element.trigger("scroll-debounced",e)});element.on("scroll",function(e){indexOf(e.target,element.get())>=0&&notify(e)})}function focus($el){$el[0]!==document.activeElement&&window.setTimeout(function(){var range,el=$el[0],pos=$el.val().length;$el.focus();var isVisible=el.offsetWidth>0||el.offsetHeight>0;isVisible&&el===document.activeElement&&(el.setSelectionRange?el.setSelectionRange(pos,pos):el.createTextRange&&(range=el.createTextRange(),range.collapse(!1),range.select()))},0)}function getCursorInfo(el){el=$(el)[0];var offset=0,length=0;if("selectionStart"in el)offset=el.selectionStart,length=el.selectionEnd-offset;else if("selection"in document){el.focus();var sel=document.selection.createRange();length=document.selection.createRange().text.length,sel.moveStart("character",-el.value.length),offset=sel.text.length-length}return{offset:offset,length:length}}function killEvent(event){event.preventDefault(),event.stopPropagation()}function killEventImmediately(event){event.preventDefault(),event.stopImmediatePropagation()}function measureTextWidth(e){if(!sizer){var style=e[0].currentStyle||window.getComputedStyle(e[0],null);sizer=$(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:style.fontSize,fontFamily:style.fontFamily,fontStyle:style.fontStyle,fontWeight:style.fontWeight,letterSpacing:style.letterSpacing,textTransform:style.textTransform,whiteSpace:"nowrap"}),sizer.attr("class","select2-sizer"),$("body").append(sizer)}return sizer.text(e.val()),sizer.width()}function syncCssClasses(dest,src,adapter){var classes,adapted,replacements=[];classes=dest.attr("class"),classes&&(classes=""+classes,$(classes.split(" ")).each2(function(){0===this.indexOf("select2-")&&replacements.push(this)})),classes=src.attr("class"),classes&&(classes=""+classes,$(classes.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(adapted=adapter(this),adapted&&replacements.push(adapted))})),dest.attr("class",replacements.join(" "))}function markMatch(text,term,markup,escapeMarkup){var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),tl=term.length;return 0>match?void markup.push(escapeMarkup(text)):(markup.push(escapeMarkup(text.substring(0,match))),markup.push("<span class='select2-match'>"),markup.push(escapeMarkup(text.substring(match,match+tl))),markup.push("</span>"),void markup.push(escapeMarkup(text.substring(match+tl,text.length))))}function defaultEscapeMarkup(markup){var replace_map={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(markup).replace(/[&<>"'\/\\]/g,function(match){return replace_map[match]})}function ajax(options){var timeout,handler=null,quietMillis=options.quietMillis||100,ajaxUrl=options.url,self=this;return function(query){window.clearTimeout(timeout),timeout=window.setTimeout(function(){var data=options.data,url=ajaxUrl,transport=options.transport||$.fn.select2.ajaxDefaults.transport,deprecated={type:options.type||"GET",cache:options.cache||!1,jsonpCallback:options.jsonpCallback||undefined,dataType:options.dataType||"json"},params=$.extend({},$.fn.select2.ajaxDefaults.params,deprecated);data=data?data.call(self,query.term,query.page,query.context):null,url="function"==typeof url?url.call(self,query.term,query.page,query.context):url,handler&&"function"==typeof handler.abort&&handler.abort(),options.params&&($.isFunction(options.params)?$.extend(params,options.params.call(self)):$.extend(params,options.params)),$.extend(params,{url:url,dataType:options.dataType,data:data,success:function(data){var results=options.results(data,query.page);query.callback(results)}}),handler=transport.call(self,params)},quietMillis)}}function local(options){var dataText,tmp,data=options,text=function(item){return""+item.text};$.isArray(data)&&(tmp=data,data={results:tmp}),$.isFunction(data)===!1&&(tmp=data,data=function(){return tmp});var dataItem=data();return dataItem.text&&(text=dataItem.text,$.isFunction(text)||(dataText=dataItem.text,text=function(item){return item[dataText]})),function(query){var process,t=query.term,filtered={results:[]};return""===t?void query.callback(data()):(process=function(datum,collection){var group,attr;if(datum=datum[0],datum.children){group={};for(attr in datum)datum.hasOwnProperty(attr)&&(group[attr]=datum[attr]);group.children=[],$(datum.children).each2(function(i,childDatum){process(childDatum,group.children)}),(group.children.length||query.matcher(t,text(group),datum))&&collection.push(group)}else query.matcher(t,text(datum),datum)&&collection.push(datum)},$(data().results).each2(function(i,datum){process(datum,filtered.results)}),void query.callback(filtered))}}function tags(data){var isFunc=$.isFunction(data);return function(query){var t=query.term,filtered={results:[]},result=isFunc?data(query):data;$.isArray(result)&&($(result).each(function(){var isObject=this.text!==undefined,text=isObject?this.text:this;(""===t||query.matcher(t,text))&&filtered.results.push(isObject?this:{id:this,text:this})}),query.callback(filtered))}}function checkFormatter(formatter,formatterName){if($.isFunction(formatter))return!0;if(!formatter)return!1;if("string"==typeof formatter)return!0;throw new Error(formatterName+" must be a string, function, or falsy value")}function evaluate(val){if($.isFunction(val)){var args=Array.prototype.slice.call(arguments,1);return val.apply(null,args)}return val}function countResults(results){var count=0;return $.each(results,function(i,item){item.children?count+=countResults(item.children):count++}),count}function defaultTokenizer(input,selection,selectCallback,opts){var token,index,i,l,separator,original=input,dupe=!1;if(!opts.createSearchChoice||!opts.tokenSeparators||opts.tokenSeparators.length<1)return undefined;for(;;){for(index=-1,i=0,l=opts.tokenSeparators.length;l>i&&(separator=opts.tokenSeparators[i],index=input.indexOf(separator),!(index>=0));i++);if(0>index)break;if(token=input.substring(0,index),input=input.substring(index+separator.length),token.length>0&&(token=opts.createSearchChoice.call(this,token,selection),token!==undefined&&null!==token&&opts.id(token)!==undefined&&null!==opts.id(token))){for(dupe=!1,i=0,l=selection.length;l>i;i++)if(equal(opts.id(token),opts.id(selection[i]))){dupe=!0;break}dupe||selectCallback(token)}}return original!==input?input:void 0}function cleanupJQueryElements(){var self=this;Array.prototype.forEach.call(arguments,function(element){self[element].remove(),self[element]=null})}function clazz(SuperClass,methods){var constructor=function(){};return constructor.prototype=new SuperClass,constructor.prototype.constructor=constructor,constructor.prototype.parent=SuperClass.prototype,constructor.prototype=$.extend(constructor.prototype,methods),constructor}if(window.Select2===undefined){var KEY,AbstractSelect2,SingleSelect2,MultiSelect2,nextUid,sizer,$document,scrollBarDimensions,lastMousePosition={x:0,y:0},KEY={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(k){switch(k=k.which?k.which:k){case KEY.LEFT:case KEY.RIGHT:case KEY.UP:case KEY.DOWN:return!0}return!1},isControl:function(e){var k=e.which;switch(k){case KEY.SHIFT:case KEY.CTRL:case KEY.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(k){return k=k.which?k.which:k,k>=112&&123>=k}},MEASURE_SCROLLBAR_TEMPLATE="<div class='select2-measure-scrollbar'></div>",DIACRITICS={"Ⓐ":"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"};$document=$(document),nextUid=function(){var counter=1;return function(){return counter++}}(),$document.on("mousemove",function(e){lastMousePosition.x=e.pageX,lastMousePosition.y=e.pageY}),AbstractSelect2=clazz(Object,{bind:function(func){var self=this;return function(){func.apply(self,arguments)}},init:function(opts){var results,search,resultsSelector=".select2-results";this.opts=opts=this.prepareOpts(opts),this.id=opts.id,opts.element.data("select2")!==undefined&&null!==opts.element.data("select2")&&opts.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=$("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(opts.element.attr("id")||"autogen"+nextUid()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",opts.element.attr("title")),this.body=$("body"),syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",opts.element.attr("style")),this.container.css(evaluate(opts.containerCss)),this.container.addClass(evaluate(opts.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",killEvent),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(evaluate(opts.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",killEvent),this.results=results=this.container.find(resultsSelector),this.search=search=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",killEvent),installFilteredMouseMove(this.results),this.dropdown.on("mousemove-filtered",resultsSelector,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",resultsSelector,this.bind(function(event){this._touchEvent=!0,this.highlightUnderEvent(event)})),this.dropdown.on("touchmove",resultsSelector,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",resultsSelector,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),installDebouncedScroll(80,this.results),this.dropdown.on("scroll-debounced",resultsSelector,this.bind(this.loadMoreIfNeeded)),$(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),$(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),$.fn.mousewheel&&results.mousewheel(function(e,delta,deltaX,deltaY){var top=results.scrollTop();deltaY>0&&0>=top-deltaY?(results.scrollTop(0),killEvent(e)):0>deltaY&&results.get(0).scrollHeight-results.scrollTop()+deltaY<=results.height()&&(results.scrollTop(results.get(0).scrollHeight-results.height()),killEvent(e))}),installKeyUpChangeEvent(search),search.on("keyup-change input paste",this.bind(this.updateResults)),search.on("focus",function(){search.addClass("select2-focused")}),search.on("blur",function(){search.removeClass("select2-focused")}),this.dropdown.on("mouseup",resultsSelector,this.bind(function(e){$(e.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(e),this.selectHighlighted(e))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=undefined,$.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==opts.maximumInputLength&&this.search.attr("maxlength",opts.maximumInputLength);var disabled=opts.element.prop("disabled");disabled===undefined&&(disabled=!1),this.enable(!disabled);var readonly=opts.element.prop("readonly");readonly===undefined&&(readonly=!1),this.readonly(readonly),scrollBarDimensions=scrollBarDimensions||measureScrollbar(),this.autofocus=opts.element.prop("autofocus"),opts.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",opts.searchInputPlaceholder)},destroy:function(){var element=this.opts.element,select2=element.data("select2");this.close(),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),select2!==undefined&&(select2.container.remove(),select2.liveRegion.remove(),select2.dropdown.remove(),element.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?element.attr({tabindex:this.elementTabIndex}):element.removeAttr("tabindex"),element.show()),cleanupJQueryElements.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(element){return element.is("option")?{id:element.prop("value"),text:element.text(),element:element.get(),css:element.attr("class"),disabled:element.prop("disabled"),locked:equal(element.attr("locked"),"locked")||equal(element.data("locked"),!0)}:element.is("optgroup")?{text:element.attr("label"),children:[],element:element.get(),css:element.attr("class")}:void 0},prepareOpts:function(opts){var element,select,idKey,ajaxUrl,self=this;if(element=opts.element,"select"===element.get(0).tagName.toLowerCase()&&(this.select=select=opts.element),select&&$.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in opts)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),opts=$.extend({},{populateResults:function(container,results,query){var populate,id=this.opts.id,liveRegion=this.liveRegion;(populate=function(results,container,depth){var i,l,result,selectable,disabled,compound,node,label,innerContainer,formatted;for(results=opts.sortResults(results,container,query),i=0,l=results.length;l>i;i+=1)result=results[i],disabled=result.disabled===!0,selectable=!disabled&&id(result)!==undefined,compound=result.children&&result.children.length>0,node=$("<li></li>"),node.addClass("select2-results-dept-"+depth),node.addClass("select2-result"),node.addClass(selectable?"select2-result-selectable":"select2-result-unselectable"),disabled&&node.addClass("select2-disabled"),compound&&node.addClass("select2-result-with-children"),node.addClass(self.opts.formatResultCssClass(result)),node.attr("role","presentation"),label=$(document.createElement("div")),label.addClass("select2-result-label"),label.attr("id","select2-result-label-"+nextUid()),label.attr("role","option"),formatted=opts.formatResult(result,label,query,self.opts.escapeMarkup),formatted!==undefined&&(label.html(formatted),node.append(label)),compound&&(innerContainer=$("<ul></ul>"),innerContainer.addClass("select2-result-sub"),populate(result.children,innerContainer,depth+1),node.append(innerContainer)),node.data("select2-data",result),container.append(node);liveRegion.text(opts.formatMatches(results.length))})(results,container,0)}},$.fn.select2.defaults,opts),"function"!=typeof opts.id&&(idKey=opts.id,opts.id=function(e){return e[idKey]}),$.isArray(opts.element.data("select2Tags"))){if("tags"in opts)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+opts.element.attr("id");opts.tags=opts.element.data("select2Tags")}if(select?(opts.query=this.bind(function(query){var children,placeholderOption,process,data={results:[],more:!1},term=query.term;process=function(element,collection){var group;element.is("option")?query.matcher(term,element.text(),element)&&collection.push(self.optionToData(element)):element.is("optgroup")&&(group=self.optionToData(element),element.children().each2(function(i,elm){process(elm,group.children)}),group.children.length>0&&collection.push(group))},children=element.children(),this.getPlaceholder()!==undefined&&children.length>0&&(placeholderOption=this.getPlaceholderOption(),placeholderOption&&(children=children.not(placeholderOption))),children.each2(function(i,elm){process(elm,data.results)}),query.callback(data)}),opts.id=function(e){return e.id}):"query"in opts||("ajax"in opts?(ajaxUrl=opts.element.data("ajax-url"),ajaxUrl&&ajaxUrl.length>0&&(opts.ajax.url=ajaxUrl),opts.query=ajax.call(opts.element,opts.ajax)):"data"in opts?opts.query=local(opts.data):"tags"in opts&&(opts.query=tags(opts.tags),opts.createSearchChoice===undefined&&(opts.createSearchChoice=function(term){return{id:$.trim(term),text:$.trim(term)}}),opts.initSelection===undefined&&(opts.initSelection=function(element,callback){var data=[];$(splitVal(element.val(),opts.separator)).each(function(){var obj={id:this,text:this},tags=opts.tags;$.isFunction(tags)&&(tags=tags()),$(tags).each(function(){return equal(this.id,obj.id)?(obj=this,!1):void 0}),data.push(obj)}),callback(data)}))),"function"!=typeof opts.query)throw"query function not defined for Select2 "+opts.element.attr("id");if("top"===opts.createSearchChoicePosition)opts.createSearchChoicePosition=function(list,item){list.unshift(item)};else if("bottom"===opts.createSearchChoicePosition)opts.createSearchChoicePosition=function(list,item){list.push(item)};else if("function"!=typeof opts.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return opts},monitorSource:function(){var sync,observer,el=this.opts.element;el.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),sync=this.bind(function(){var disabled=el.prop("disabled");disabled===undefined&&(disabled=!1),this.enable(!disabled);var readonly=el.prop("readonly");readonly===undefined&&(readonly=!1),this.readonly(readonly),syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(evaluate(this.opts.containerCssClass)),syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(evaluate(this.opts.dropdownCssClass))}),el.length&&el[0].attachEvent&&el.each(function(){this.attachEvent("onpropertychange",sync)}),observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,observer!==undefined&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new observer(function(mutations){mutations.forEach(sync)}),this.propertyObserver.observe(el.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(data){var evt=$.Event("select2-selecting",{val:this.id(data),object:data});return this.opts.element.trigger(evt),!evt.isDefaultPrevented()},triggerChange:function(details){details=details||{},details=$.extend({},details,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(details),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var enabled=this._enabled&&!this._readonly,disabled=!enabled;return enabled===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",disabled),this.close(),this.enabledInterface=enabled,!0)},enable:function(enabled){enabled===undefined&&(enabled=!0),this._enabled!==enabled&&(this._enabled=enabled,this.opts.element.prop("disabled",!enabled),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(enabled){enabled===undefined&&(enabled=!1),this._readonly!==enabled&&(this._readonly=enabled,this.opts.element.prop("readonly",enabled),this.enableInterface())},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var bodyOffset,above,changeDirection,css,resultsListNode,$dropdown=this.dropdown,offset=this.container.offset(),height=this.container.outerHeight(!1),width=this.container.outerWidth(!1),dropHeight=$dropdown.outerHeight(!1),$window=$(window),windowWidth=$window.width(),windowHeight=$window.height(),viewPortRight=$window.scrollLeft()+windowWidth,viewportBottom=$window.scrollTop()+windowHeight,dropTop=offset.top+height,dropLeft=offset.left,enoughRoomBelow=viewportBottom>=dropTop+dropHeight,enoughRoomAbove=offset.top-dropHeight>=$window.scrollTop(),dropWidth=$dropdown.outerWidth(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth,aboveNow=$dropdown.hasClass("select2-drop-above");aboveNow?(above=!0,!enoughRoomAbove&&enoughRoomBelow&&(changeDirection=!0,above=!1)):(above=!1,!enoughRoomBelow&&enoughRoomAbove&&(changeDirection=!0,above=!0)),changeDirection&&($dropdown.hide(),offset=this.container.offset(),height=this.container.outerHeight(!1),width=this.container.outerWidth(!1),dropHeight=$dropdown.outerHeight(!1),viewPortRight=$window.scrollLeft()+windowWidth,viewportBottom=$window.scrollTop()+windowHeight,dropTop=offset.top+height,dropLeft=offset.left,dropWidth=$dropdown.outerWidth(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth,$dropdown.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(resultsListNode=$(".select2-results",$dropdown)[0],$dropdown.addClass("select2-drop-auto-width"),$dropdown.css("width",""),dropWidth=$dropdown.outerWidth(!1)+(resultsListNode.scrollHeight===resultsListNode.clientHeight?0:scrollBarDimensions.width),dropWidth>width?width=dropWidth:dropWidth=width,dropHeight=$dropdown.outerHeight(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(bodyOffset=this.body.offset(),dropTop-=bodyOffset.top,dropLeft-=bodyOffset.left),enoughRoomOnRight||(dropLeft=offset.left+this.container.outerWidth(!1)-dropWidth),css={left:dropLeft,width:width},above?(css.top=offset.top-dropHeight,css.bottom="auto",this.container.addClass("select2-drop-above"),$dropdown.addClass("select2-drop-above")):(css.top=dropTop,css.bottom="auto",this.container.removeClass("select2-drop-above"),$dropdown.removeClass("select2-drop-above")),css=$.extend(css,evaluate(this.opts.dropdownCss)),$dropdown.css(css)},shouldOpen:function(){var event;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(event=$.Event("select2-opening"),this.opts.element.trigger(event),!event.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){var mask,cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),mask=$("#select2-drop-mask"),0==mask.length&&(mask=$(document.createElement("div")),mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),mask.hide(),mask.appendTo(this.body),mask.on("mousedown touchstart click",function(e){reinsertElement(mask);var self,dropdown=$("#select2-drop");dropdown.length>0&&(self=dropdown.data("select2"),self.opts.selectOnBlur&&self.selectHighlighted({noFocus:!0}),self.close(),e.preventDefault(),e.stopPropagation())})),this.dropdown.prev()[0]!==mask[0]&&this.dropdown.before(mask),$("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),mask.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var that=this;this.container.parents().add(window).each(function(){$(this).on(resize+" "+scroll+" "+orient,function(){that.opened()&&that.positionDropdown()})})},close:function(){if(this.opened()){var cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid;this.container.parents().add(window).each(function(){$(this).off(scroll).off(resize).off(orient)}),this.clearDropdownAlignmentPreference(),$("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger($.Event("select2-close"))
7
- }},externalSearch:function(term){this.open(),this.search.val(term),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return evaluate(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var children,index,child,hb,rb,y,more,results=this.results;if(index=this.highlight(),!(0>index)){if(0==index)return void results.scrollTop(0);children=this.findHighlightableChoices().find(".select2-result-label"),child=$(children[index]),hb=child.offset().top+child.outerHeight(!0),index===children.length-1&&(more=results.find("li.select2-more-results"),more.length>0&&(hb=more.offset().top+more.outerHeight(!0))),rb=results.offset().top+results.outerHeight(!0),hb>rb&&results.scrollTop(results.scrollTop()+(hb-rb)),y=child.offset().top-results.offset().top,0>y&&"none"!=child.css("display")&&results.scrollTop(results.scrollTop()+y)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(delta){for(var choices=this.findHighlightableChoices(),index=this.highlight();index>-1&&index<choices.length;){index+=delta;var choice=$(choices[index]);if(choice.hasClass("select2-result-selectable")&&!choice.hasClass("select2-disabled")&&!choice.hasClass("select2-selected")){this.highlight(index);break}}},highlight:function(index){var choice,data,choices=this.findHighlightableChoices();return 0===arguments.length?indexOf(choices.filter(".select2-highlighted")[0],choices.get()):(index>=choices.length&&(index=choices.length-1),0>index&&(index=0),this.removeHighlight(),choice=$(choices[index]),choice.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",choice.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(choice.text()),data=choice.data("select2-data"),void(data&&this.opts.element.trigger({type:"select2-highlight",val:this.id(data),choice:data})))},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(event){var el=$(event.target).closest(".select2-result-selectable");if(el.length>0&&!el.is(".select2-highlighted")){var choices=this.findHighlightableChoices();this.highlight(choices.index(el))}else 0==el.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var below,results=this.results,more=results.find("li.select2-more-results"),page=this.resultsPage+1,self=this,term=this.search.val(),context=this.context;0!==more.length&&(below=more.offset().top-results.offset().top-results.height(),below<=this.opts.loadMorePadding&&(more.addClass("select2-active"),this.opts.query({element:this.opts.element,term:term,page:page,context:context,matcher:this.opts.matcher,callback:this.bind(function(data){self.opened()&&(self.opts.populateResults.call(this,results,data.results,{term:term,page:page,context:context}),self.postprocessResults(data,!1,!1),data.more===!0?(more.detach().appendTo(results).text(evaluate(self.opts.formatLoadMore,page+1)),window.setTimeout(function(){self.loadMoreIfNeeded()},10)):more.remove(),self.positionDropdown(),self.resultsPage=page,self.context=data.context,this.opts.element.trigger({type:"select2-loaded",items:data}))})})))},tokenize:function(){},updateResults:function(initial){function postRender(){search.removeClass("select2-active"),self.positionDropdown(),self.liveRegion.text(results.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?results.text():self.opts.formatMatches(results.find(".select2-result-selectable").length))}function render(html){results.html(html),postRender()}var data,input,queryNumber,search=this.search,results=this.results,opts=this.opts,self=this,term=search.val(),lastTerm=$.data(this.container,"select2-last-term");if((initial===!0||!lastTerm||!equal(term,lastTerm))&&($.data(this.container,"select2-last-term",term),initial===!0||this.showSearchInput!==!1&&this.opened())){queryNumber=++this.queryCount;var maxSelSize=this.getMaximumSelectionSize();if(maxSelSize>=1&&(data=this.data(),$.isArray(data)&&data.length>=maxSelSize&&checkFormatter(opts.formatSelectionTooBig,"formatSelectionTooBig")))return void render("<li class='select2-selection-limit'>"+evaluate(opts.formatSelectionTooBig,maxSelSize)+"</li>");if(search.val().length<opts.minimumInputLength)return render(checkFormatter(opts.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+evaluate(opts.formatInputTooShort,search.val(),opts.minimumInputLength)+"</li>":""),void(initial&&this.showSearch&&this.showSearch(!0));if(opts.maximumInputLength&&search.val().length>opts.maximumInputLength)return void render(checkFormatter(opts.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+evaluate(opts.formatInputTooLong,search.val(),opts.maximumInputLength)+"</li>":"");opts.formatSearching&&0===this.findHighlightableChoices().length&&render("<li class='select2-searching'>"+evaluate(opts.formatSearching)+"</li>"),search.addClass("select2-active"),this.removeHighlight(),input=this.tokenize(),input!=undefined&&null!=input&&search.val(input),this.resultsPage=1,opts.query({element:opts.element,term:search.val(),page:this.resultsPage,context:null,matcher:opts.matcher,callback:this.bind(function(data){var def;if(queryNumber==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(this.context=data.context===undefined?null:data.context,this.opts.createSearchChoice&&""!==search.val()&&(def=this.opts.createSearchChoice.call(self,search.val(),data.results),def!==undefined&&null!==def&&self.id(def)!==undefined&&null!==self.id(def)&&0===$(data.results).filter(function(){return equal(self.id(this),self.id(def))}).length&&this.opts.createSearchChoicePosition(data.results,def)),0===data.results.length&&checkFormatter(opts.formatNoMatches,"formatNoMatches"))return void render("<li class='select2-no-results'>"+evaluate(opts.formatNoMatches,search.val())+"</li>");results.empty(),self.opts.populateResults.call(this,results,data.results,{term:search.val(),page:this.resultsPage,context:null}),data.more===!0&&checkFormatter(opts.formatLoadMore,"formatLoadMore")&&(results.append("<li class='select2-more-results'>"+self.opts.escapeMarkup(evaluate(opts.formatLoadMore,this.resultsPage))+"</li>"),window.setTimeout(function(){self.loadMoreIfNeeded()},10)),this.postprocessResults(data,initial),postRender(),this.opts.element.trigger({type:"select2-loaded",items:data})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){focus(this.search)},selectHighlighted:function(options){if(this._touchMoved)return void this.clearTouchMoved();var index=this.highlight(),highlighted=this.results.find(".select2-highlighted"),data=highlighted.closest(".select2-result").data("select2-data");data?(this.highlight(index),this.onSelect(data,options)):options&&options.noFocus&&this.close()},getPlaceholder:function(){var placeholderOption;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((placeholderOption=this.getPlaceholderOption())!==undefined?placeholderOption.text():undefined)},getPlaceholderOption:function(){if(this.select){var firstOption=this.select.children("option").first();if(this.opts.placeholderOption!==undefined)return"first"===this.opts.placeholderOption&&firstOption||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===$.trim(firstOption.text())&&""===firstOption.val())return firstOption}},initContainerWidth:function(){function resolveContainerWidth(){var style,attrs,matches,i,l,attr;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(style=this.opts.element.attr("style"),style!==undefined)for(attrs=style.split(";"),i=0,l=attrs.length;l>i;i+=1)if(attr=attrs[i].replace(/\s/g,""),matches=attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==matches&&matches.length>=1)return matches[1];return"resolve"===this.opts.width?(style=this.opts.element.css("width"),style.indexOf("%")>0?style:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return $.isFunction(this.opts.width)?this.opts.width():this.opts.width}var width=resolveContainerWidth.call(this);null!==width&&this.container.css("width",width)}}),SingleSelect2=clazz(AbstractSelect2,{createContainer:function(){var container=$(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return container},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var el,range,len;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),el=this.search.get(0),el.createTextRange?(range=el.createTextRange(),range.collapse(!1),range.select()):el.setSelectionRange&&(len=this.search.val().length,el.setSelectionRange(len,len))),""===this.search.val()&&this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger($.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){$("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),cleanupJQueryElements.call(this,"selection","focusser")},initContainer:function(){var selection,elementLabel,container=this.container,dropdown=this.dropdown,idSuffix=nextUid();this.showSearch(this.opts.minimumResultsForSearch<0?!1:!0),this.selection=selection=container.find(".select2-choice"),this.focusser=container.find(".select2-focusser"),selection.find(".select2-chosen").attr("id","select2-chosen-"+idSuffix),this.focusser.attr("aria-labelledby","select2-chosen-"+idSuffix),this.results.attr("id","select2-results-"+idSuffix),this.search.attr("aria-owns","select2-results-"+idSuffix),this.focusser.attr("id","s2id_autogen"+idSuffix),elementLabel=$("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(elementLabel.text()).attr("for",this.focusser.attr("id"));var originalTitle=this.opts.element.attr("title");this.opts.element.attr("title",originalTitle||elementLabel.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text($("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){if(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN)return void killEvent(e);switch(e.which){case KEY.UP:case KEY.DOWN:return this.moveHighlight(e.which===KEY.UP?-1:1),void killEvent(e);case KEY.ENTER:return this.selectHighlighted(),void killEvent(e);case KEY.TAB:return void this.selectHighlighted({noFocus:!0});case KEY.ESC:return this.cancel(e),void killEvent(e)}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==KEY.TAB&&!KEY.isControl(e)&&!KEY.isFunctionKey(e)&&e.which!==KEY.ESC){if(this.opts.openOnEnter===!1&&e.which===KEY.ENTER)return void killEvent(e);if(e.which==KEY.DOWN||e.which==KEY.UP||e.which==KEY.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void killEvent(e)}return e.which==KEY.DELETE||e.which==KEY.BACKSPACE?(this.opts.allowClear&&this.clear(),void killEvent(e)):void 0}})),installKeyUpChangeEvent(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),selection.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),killEventImmediately(e),this.close(),this.selection.focus())})),selection.on("mousedown touchstart",this.bind(function(e){reinsertElement(selection),this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),killEvent(e)})),dropdown.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),selection.on("focus",this.bind(function(e){killEvent(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger($.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(triggerChange){var data=this.selection.data("select2-data");if(data){var evt=$.Event("select2-clearing");if(this.opts.element.trigger(evt),evt.isDefaultPrevented())return;var placeholderOption=this.getPlaceholderOption();this.opts.element.val(placeholderOption?placeholderOption.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),triggerChange!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data}),this.triggerChange({removed:data}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var self=this;this.opts.initSelection.call(null,this.opts.element,function(selected){selected!==undefined&&null!==selected&&(self.updateSelection(selected),self.close(),self.setPlaceholder(),self.nextSearchTerm=self.opts.nextSearchTerm(selected,self.search.val()))})}},isPlaceholderOptionSelected:function(){var placeholderOption;return this.getPlaceholder()===undefined?!1:(placeholderOption=this.getPlaceholderOption())!==undefined&&placeholderOption.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===undefined||null===this.opts.element.val()},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;return"select"===opts.element.get(0).tagName.toLowerCase()?opts.initSelection=function(element,callback){var selected=element.find("option").filter(function(){return this.selected&&!this.disabled});callback(self.optionToData(selected))}:"data"in opts&&(opts.initSelection=opts.initSelection||function(element,callback){var id=element.val(),match=null;opts.query({matcher:function(term,text,el){var is_match=equal(id,opts.id(el));return is_match&&(match=el),is_match},callback:$.isFunction(callback)?function(){callback(match)}:$.noop})}),opts},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===undefined?undefined:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var placeholder=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&placeholder!==undefined){if(this.select&&this.getPlaceholderOption()===undefined)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(data,initial,noHighlightUpdate){var selected=0,self=this;if(this.findHighlightableChoices().each2(function(i,elm){return equal(self.id(elm.data("select2-data")),self.opts.element.val())?(selected=i,!1):void 0}),noHighlightUpdate!==!1&&this.highlight(initial===!0&&selected>=0?selected:0),initial===!0){var min=this.opts.minimumResultsForSearch;min>=0&&this.showSearch(countResults(data.results)>=min)}},showSearch:function(showSearchInput){this.showSearchInput!==showSearchInput&&(this.showSearchInput=showSearchInput,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!showSearchInput),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!showSearchInput),$(this.dropdown,this.container).toggleClass("select2-with-searchbox",showSearchInput))},onSelect:function(data,options){if(this.triggerSelect(data)){var old=this.opts.element.val(),oldData=this.data();this.opts.element.val(this.id(data)),this.updateSelection(data),this.opts.element.trigger({type:"select2-selected",val:this.id(data),choice:data}),this.nextSearchTerm=this.opts.nextSearchTerm(data,this.search.val()),this.close(),options&&options.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),equal(old,this.id(data))||this.triggerChange({added:data,removed:oldData})}},updateSelection:function(data){var formatted,cssClass,container=this.selection.find(".select2-chosen");this.selection.data("select2-data",data),container.empty(),null!==data&&(formatted=this.opts.formatSelection(data,container,this.opts.escapeMarkup)),formatted!==undefined&&container.append(formatted),cssClass=this.opts.formatSelectionCssClass(data,container),cssClass!==undefined&&container.addClass(cssClass),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==undefined&&this.container.addClass("select2-allowclear")},val:function(){var val,triggerChange=!1,data=null,self=this,oldData=this.data();if(0===arguments.length)return this.opts.element.val();if(val=arguments[0],arguments.length>1&&(triggerChange=arguments[1]),this.select)this.select.val(val).find("option").filter(function(){return this.selected}).each2(function(i,elm){return data=self.optionToData(elm),!1}),this.updateSelection(data),this.setPlaceholder(),triggerChange&&this.triggerChange({added:data,removed:oldData});else{if(!val&&0!==val)return void this.clear(triggerChange);if(this.opts.initSelection===undefined)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(val),this.opts.initSelection(this.opts.element,function(data){self.opts.element.val(data?self.id(data):""),self.updateSelection(data),self.setPlaceholder(),triggerChange&&self.triggerChange({added:data,removed:oldData})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(value){var data,triggerChange=!1;return 0===arguments.length?(data=this.selection.data("select2-data"),data==undefined&&(data=null),data):(arguments.length>1&&(triggerChange=arguments[1]),void(value?(data=this.data(),this.opts.element.val(value?this.id(value):""),this.updateSelection(value),triggerChange&&this.triggerChange({added:value,removed:data})):this.clear(triggerChange)))}}),MultiSelect2=clazz(AbstractSelect2,{createContainer:function(){var container=$(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return container},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;return"select"===opts.element.get(0).tagName.toLowerCase()?opts.initSelection=function(element,callback){var data=[];element.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(i,elm){data.push(self.optionToData(elm))}),callback(data)}:"data"in opts&&(opts.initSelection=opts.initSelection||function(element,callback){var ids=splitVal(element.val(),opts.separator),matches=[];opts.query({matcher:function(term,text,el){var is_match=$.grep(ids,function(id){return equal(id,opts.id(el))}).length;return is_match&&matches.push(el),is_match},callback:$.isFunction(callback)?function(){for(var ordered=[],i=0;i<ids.length;i++)for(var id=ids[i],j=0;j<matches.length;j++){var match=matches[j];if(equal(id,opts.id(match))){ordered.push(match),matches.splice(j,1);break}}callback(ordered)}:$.noop})}),opts},selectChoice:function(choice){var selected=this.container.find(".select2-search-choice-focus");selected.length&&choice&&choice[0]==selected[0]||(selected.length&&this.opts.element.trigger("choice-deselected",selected),selected.removeClass("select2-search-choice-focus"),choice&&choice.length&&(this.close(),choice.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",choice)))},destroy:function(){$("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),cleanupJQueryElements.call(this,"searchContainer","selection")},initContainer:function(){var selection,selector=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=selection=this.container.find(selector);var _this=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){_this.search[0].focus(),_this.selectChoice($(this))}),this.search.attr("id","s2id_autogen"+nextUid()),this.search.prev().text($("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var selected=selection.find(".select2-search-choice-focus"),prev=selected.prev(".select2-search-choice:not(.select2-locked)"),next=selected.next(".select2-search-choice:not(.select2-locked)"),pos=getCursorInfo(this.search);if(selected.length&&(e.which==KEY.LEFT||e.which==KEY.RIGHT||e.which==KEY.BACKSPACE||e.which==KEY.DELETE||e.which==KEY.ENTER)){var selectedChoice=selected;return e.which==KEY.LEFT&&prev.length?selectedChoice=prev:e.which==KEY.RIGHT?selectedChoice=next.length?next:null:e.which===KEY.BACKSPACE?this.unselect(selected.first())&&(this.search.width(10),selectedChoice=prev.length?prev:next):e.which==KEY.DELETE?this.unselect(selected.first())&&(this.search.width(10),selectedChoice=next.length?next:null):e.which==KEY.ENTER&&(selectedChoice=null),this.selectChoice(selectedChoice),killEvent(e),void(selectedChoice&&selectedChoice.length||this.open())}if((e.which===KEY.BACKSPACE&&1==this.keydowns||e.which==KEY.LEFT)&&0==pos.offset&&!pos.length)return this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last()),void killEvent(e);if(this.selectChoice(null),this.opened())switch(e.which){case KEY.UP:case KEY.DOWN:return this.moveHighlight(e.which===KEY.UP?-1:1),void killEvent(e);case KEY.ENTER:return this.selectHighlighted(),void killEvent(e);case KEY.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case KEY.ESC:return this.cancel(e),void killEvent(e)}if(e.which!==KEY.TAB&&!KEY.isControl(e)&&!KEY.isFunctionKey(e)&&e.which!==KEY.BACKSPACE&&e.which!==KEY.ESC){if(e.which===KEY.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN)&&killEvent(e),e.which===KEY.ENTER&&killEvent(e)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),e.stopImmediatePropagation(),this.opts.element.trigger($.Event("select2-blur"))})),this.container.on("click",selector,this.bind(function(e){this.isInterfaceEnabled()&&($(e.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.open(),this.focusSearch(),e.preventDefault()))})),this.container.on("focus",selector,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var self=this;this.opts.initSelection.call(null,this.opts.element,function(data){data!==undefined&&null!==data&&(self.updateSelection(data),self.close(),self.clearSearch())})}},clearSearch:function(){var placeholder=this.getPlaceholder(),maxWidth=this.getMaxSearchWidth();placeholder!==undefined&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(placeholder).addClass("select2-default"),this.search.width(maxWidth>0?maxWidth:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger($.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(data){var ids=[],filtered=[],self=this;$(data).each(function(){indexOf(self.id(this),ids)<0&&(ids.push(self.id(this)),filtered.push(this))}),data=filtered,this.selection.find(".select2-search-choice").remove(),$(data).each(function(){self.addSelectedChoice(this)}),self.postprocessResults()},tokenize:function(){var input=this.search.val();input=this.opts.tokenizer.call(this,input,this.data(),this.bind(this.onSelect),this.opts),null!=input&&input!=undefined&&(this.search.val(input),input.length>0&&this.open())},onSelect:function(data,options){this.triggerSelect(data)&&(this.addSelectedChoice(data),this.opts.element.trigger({type:"selected",val:this.id(data),choice:data}),this.nextSearchTerm=this.opts.nextSearchTerm(data,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(data,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:data}),options&&options.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(data){var formatted,cssClass,enableChoice=!data.locked,enabledItem=$("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),disabledItem=$("<li class='select2-search-choice select2-locked'><div></div></li>"),choice=enableChoice?enabledItem:disabledItem,id=this.id(data),val=this.getVal();formatted=this.opts.formatSelection(data,choice.find("div"),this.opts.escapeMarkup),formatted!=undefined&&choice.find("div").replaceWith("<div>"+formatted+"</div>"),cssClass=this.opts.formatSelectionCssClass(data,choice.find("div")),cssClass!=undefined&&choice.addClass(cssClass),enableChoice&&choice.find(".select2-search-choice-close").on("mousedown",killEvent).on("click dblclick",this.bind(function(e){this.isInterfaceEnabled()&&(this.unselect($(e.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),killEvent(e),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),choice.data("select2-data",data),choice.insertBefore(this.searchContainer),val.push(id),this.setVal(val)},unselect:function(selected){var data,index,val=this.getVal();if(selected=selected.closest(".select2-search-choice"),0===selected.length)throw"Invalid argument: "+selected+". Must be .select2-search-choice";if(data=selected.data("select2-data")){var evt=$.Event("select2-removing");if(evt.val=this.id(data),evt.choice=data,this.opts.element.trigger(evt),evt.isDefaultPrevented())return!1;for(;(index=indexOf(this.id(data),val))>=0;)val.splice(index,1),this.setVal(val),this.select&&this.postprocessResults();return selected.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data}),this.triggerChange({removed:data}),!0}},postprocessResults:function(data,initial,noHighlightUpdate){var val=this.getVal(),choices=this.results.find(".select2-result"),compound=this.results.find(".select2-result-with-children"),self=this;choices.each2(function(i,choice){var id=self.id(choice.data("select2-data"));indexOf(id,val)>=0&&(choice.addClass("select2-selected"),choice.find(".select2-result-selectable").addClass("select2-selected"))
8
- }),compound.each2(function(i,choice){choice.is(".select2-result-selectable")||0!==choice.find(".select2-result-selectable:not(.select2-selected)").length||choice.addClass("select2-selected")}),-1==this.highlight()&&noHighlightUpdate!==!1&&self.highlight(0),!this.opts.createSearchChoice&&!choices.filter(".select2-result:not(.select2-selected)").length>0&&(!data||data&&!data.more&&0===this.results.find(".select2-no-results").length)&&checkFormatter(self.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+evaluate(self.opts.formatNoMatches,self.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-getSideBorderPadding(this.search)},resizeSearch:function(){var minimumWidth,left,maxWidth,containerLeft,searchWidth,sideBorderPadding=getSideBorderPadding(this.search);minimumWidth=measureTextWidth(this.search)+10,left=this.search.offset().left,maxWidth=this.selection.width(),containerLeft=this.selection.offset().left,searchWidth=maxWidth-(left-containerLeft)-sideBorderPadding,minimumWidth>searchWidth&&(searchWidth=maxWidth-sideBorderPadding),40>searchWidth&&(searchWidth=maxWidth-sideBorderPadding),0>=searchWidth&&(searchWidth=minimumWidth),this.search.width(Math.floor(searchWidth))},getVal:function(){var val;return this.select?(val=this.select.val(),null===val?[]:val):(val=this.opts.element.val(),splitVal(val,this.opts.separator))},setVal:function(val){var unique;this.select?this.select.val(val):(unique=[],$(val).each(function(){indexOf(this,unique)<0&&unique.push(this)}),this.opts.element.val(0===unique.length?"":unique.join(this.opts.separator)))},buildChangeDetails:function(old,current){for(var current=current.slice(0),old=old.slice(0),i=0;i<current.length;i++)for(var j=0;j<old.length;j++)equal(this.opts.id(current[i]),this.opts.id(old[j]))&&(current.splice(i,1),i>0&&i--,old.splice(j,1),j--);return{added:current,removed:old}},val:function(val,triggerChange){var oldData,self=this;if(0===arguments.length)return this.getVal();if(oldData=this.data(),oldData.length||(oldData=[]),!val&&0!==val)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(triggerChange&&this.triggerChange({added:this.data(),removed:oldData}));if(this.setVal(val),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),triggerChange&&this.triggerChange(this.buildChangeDetails(oldData,this.data()));else{if(this.opts.initSelection===undefined)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(data){var ids=$.map(data,self.id);self.setVal(ids),self.updateSelection(data),self.clearSearch(),triggerChange&&self.triggerChange(self.buildChangeDetails(oldData,self.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var val=[],self=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){val.push(self.opts.id($(this).data("select2-data")))}),this.setVal(val),this.triggerChange()},data:function(values,triggerChange){var ids,old,self=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return $(this).data("select2-data")}).get():(old=this.data(),values||(values=[]),ids=$.map(values,function(e){return self.opts.id(e)}),this.setVal(ids),this.updateSelection(values),this.clearSearch(),triggerChange&&this.triggerChange(this.buildChangeDetails(old,this.data())),void 0)}}),$.fn.select2=function(){var opts,select2,method,value,multiple,args=Array.prototype.slice.call(arguments,0),allowedMethods=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],valueMethods=["opened","isFocused","container","dropdown"],propertyMethods=["val","data"],methodsMap={search:"externalSearch"};return this.each(function(){if(0===args.length||"object"==typeof args[0])opts=0===args.length?{}:$.extend({},args[0]),opts.element=$(this),"select"===opts.element.get(0).tagName.toLowerCase()?multiple=opts.element.prop("multiple"):(multiple=opts.multiple||!1,"tags"in opts&&(opts.multiple=multiple=!0)),select2=multiple?new window.Select2["class"].multi:new window.Select2["class"].single,select2.init(opts);else{if("string"!=typeof args[0])throw"Invalid arguments to select2 plugin: "+args;if(indexOf(args[0],allowedMethods)<0)throw"Unknown method: "+args[0];if(value=undefined,select2=$(this).data("select2"),select2===undefined)return;if(method=args[0],"container"===method?value=select2.container:"dropdown"===method?value=select2.dropdown:(methodsMap[method]&&(method=methodsMap[method]),value=select2[method].apply(select2,args.slice(1))),indexOf(args[0],valueMethods)>=0||indexOf(args[0],propertyMethods)>=0&&1==args.length)return!1}}),value===undefined?this:value},$.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(result,container,query,escapeMarkup){var markup=[];return markMatch(result.text,query.term,markup,escapeMarkup),markup.join("")},formatSelection:function(data,container,escapeMarkup){return data?escapeMarkup(data.text):undefined},sortResults:function(results){return results},formatResultCssClass:function(data){return data.css},formatSelectionCssClass:function(){return undefined},formatMatches:function(matches){return matches+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(input,min){var n=min-input.length;return"Please enter "+n+" or more character"+(1==n?"":"s")},formatInputTooLong:function(input,max){var n=input.length-max;return"Please delete "+n+" character"+(1==n?"":"s")},formatSelectionTooBig:function(limit){return"You can only select "+limit+" item"+(1==limit?"":"s")},formatLoadMore:function(){return"Loading more results…"},formatSearching:function(){return"Searching…"},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==undefined?null:e.id},matcher:function(term,text){return stripDiacritics(""+text).toUpperCase().indexOf(stripDiacritics(""+term).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:defaultTokenizer,escapeMarkup:defaultEscapeMarkup,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(c){return c},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return undefined},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(instance){var supportsTouchEvents="ontouchstart"in window||navigator.msMaxTouchPoints>0;return supportsTouchEvents&&instance.opts.minimumResultsForSearch<0?!1:!0}},$.fn.select2.ajaxDefaults={transport:$.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:ajax,local:local,tags:tags},util:{debounce:debounce,markMatch:markMatch,escapeMarkup:defaultEscapeMarkup,stripDiacritics:stripDiacritics},"class":{"abstract":AbstractSelect2,single:SingleSelect2,multi:MultiSelect2}}}}(jQuery),jQuery(document).ready(function($){$("#filter_action, #filter_content, #filter_form").change(function(){$("#leadin-contacts-filter-button").addClass("button-primary")})});
2
  },text:function(a,b,c,d){var e=fa||!aa&&this.forExport,f={};return d&&!this.forExport?this.html(a,b,c):(f.x=Math.round(b||0),c&&(f.y=Math.round(c)),(a||0===a)&&(f.text=a),a=this.createElement("text").attr(f),e&&a.css({position:"absolute"}),d||(a.xSetter=function(a,b,c){var e,f,d=c.childNodes;for(f=1;f<d.length;f++)e=d[f],e.getAttribute("x")===c.getAttribute("x")&&e.setAttribute("x",a);c.setAttribute(b,a)}),a)},fontMetrics:function(a){var a=a||this.style.fontSize,a=/px/.test(a)?z(a):/em/.test(a)?12*parseFloat(a):12,a=24>a?a+4:u(1.2*a),b=u(.8*a);return{h:a,b:b}},label:function(a,b,c,d,e,f,g,h,i){function j(){var a,b;a=s.element.style,J=(void 0===Va||void 0===wb||n.styles.textAlign)&&s.textStr&&s.getBBox(),n.width=(Va||J.width||0)+2*x+v,n.height=(wb||J.height||0)+2*x,na=x+o.fontMetrics(a&&a.fontSize).b,z&&(m||(a=u(-L*x),b=h?-na:0,n.box=m=d?o.symbol(d,a,b,n.width,n.height,B):o.rect(a,b,n.width,n.height,0,B[Pb]),m.attr("fill",Q).add(n)),m.isImg||m.attr(q({width:u(n.width),height:u(n.height)},B)),B=null)}function k(){var c,a=n.styles,a=a&&a.textAlign,b=v+x*(1-L);c=h?0:na,r(Va)&&J&&("center"===a||"right"===a)&&(b+={center:.5,right:1}[a]*(Va-J.width)),(b!==s.x||c!==s.y)&&(s.attr("x",b),c!==t&&s.attr("y",c)),s.x=b,s.y=c}function l(a,b){m?m.attr(a,b):B[a]=b}var m,J,Va,wb,xb,yb,na,z,o=this,n=o.g(i),s=o.text("",0,0,g).attr({zIndex:1}),L=0,x=3,v=0,y=0,B={};n.onAdd=function(){s.add(n),n.attr({text:a||"",x:b,y:c}),m&&r(e)&&n.attr({anchorX:e,anchorY:f})},n.widthSetter=function(a){Va=a},n.heightSetter=function(a){wb=a},n.paddingSetter=function(a){r(a)&&a!==x&&(x=a,k())},n.paddingLeftSetter=function(a){r(a)&&a!==v&&(v=a,k())},n.alignSetter=function(a){L={left:0,center:.5,right:1}[a]},n.textSetter=function(a){a!==t&&s.textSetter(a),j(),k()},n["stroke-widthSetter"]=function(a,b){a&&(z=!0),y=a%2/2,l(b,a)},n.strokeSetter=n.fillSetter=n.rSetter=function(a,b){"fill"===b&&a&&(z=!0),l(b,a)},n.anchorXSetter=function(a,b){e=a,l(b,a+y-xb)},n.anchorYSetter=function(a,b){f=a,l(b,a-yb)},n.xSetter=function(a){n.x=a,L&&(a-=L*((Va||J.width)+x)),xb=u(a),n.attr("translateX",xb)},n.ySetter=function(a){yb=n.y=u(a),n.attr("translateY",yb)};var A=n.css;return q(n,{css:function(a){if(a){var b={},a=w(a);p("fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow".split(","),function(c){a[c]!==t&&(b[c]=a[c],delete a[c])}),s.css(b)}return A.call(n,a)},getBBox:function(){return{width:J.width+2*x,height:J.height+2*x,x:J.x-x,y:J.y-x}},shadow:function(a){return m&&m.shadow(a),n},destroy:function(){W(n.element,"mouseenter"),W(n.element,"mouseleave"),s&&(s=s.destroy()),m&&(m=m.destroy()),P.prototype.destroy.call(n),n=o=j=k=l=null}})}},Za=ta,q(P.prototype,{htmlCss:function(a){var b=this.element;return(b=a&&"SPAN"===b.tagName&&a.width)&&(delete a.width,this.textWidth=b,this.updateTransform()),this.styles=q(this.styles,a),G(this.element,a),this},htmlGetBBox:function(){var a=this.element,b=this.bBox;return b||("text"===a.nodeName&&(a.style.position="absolute"),b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}),b},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,c=this.translateX||0,d=this.translateY||0,e=this.x||0,f=this.y||0,g=this.textAlign||"left",h={left:0,center:.5,right:1}[g],i=this.shadows;if(G(b,{marginLeft:c,marginTop:d}),i&&p(i,function(a){G(a,{marginLeft:c+1,marginTop:d+1})}),this.inverted&&p(b.childNodes,function(c){a.invertChild(c,b)}),"SPAN"===b.tagName){var k,j=this.rotation,l=z(this.textWidth),o=[j,g,b.innerHTML,this.textWidth].join(",");o!==this.cTT&&(k=a.fontMetrics(b.style.fontSize).b,r(j)&&this.setSpanRotation(j,h,k),i=m(this.elemWidth,b.offsetWidth),i>l&&/[ \-]/.test(b.textContent||b.innerText)&&(G(b,{width:l+"px",display:"block",whiteSpace:"normal"}),i=l),this.getSpanCorrection(i,k,h,j,g)),G(b,{left:e+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"}),ib&&(k=b.offsetHeight),this.cTT=o}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=Aa?"-ms-transform":ib?"-webkit-transform":Ta?"MozTransform":Ib?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)",d[e+(Ta?"Origin":"-origin")]=d.transformOrigin=100*b+"% "+c+"px",G(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c,this.yCorr=-b}}),q(ta.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,f=d.renderer;return d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox,e.innerHTML=this.textStr=a},d.xSetter=d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){"align"===b&&(b="textAlign"),d[b]=a,d.htmlUpdateTransform()},d.attr({text:a,x:u(b),y:u(c)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),d.css=d.htmlCss,f.isSVG&&(d.add=function(a){var b,c=f.box.parentNode,j=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)j.push(a),a=a.parentGroup;p(j.reverse(),function(a){var d;b=a.div=a.div||Y(Ja,{className:H(a.element,"class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c),d=b.style,q(a,{translateXSetter:function(b,c){d.left=b+"px",a[c]=b,a.doTransform=!0},translateYSetter:function(b,c){d.top=b+"px",a[c]=b,a.doTransform=!0},visibilitySetter:function(a,b){d[b]=a}})})}}else b=c;return b.appendChild(e),d.added=!0,d.alignOnAdd&&d.htmlUpdateTransform(),d}),d}});var X;if(!aa&&!fa){R.VMLElement=X={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",";"],e=b===Ja;("shape"===b||e)&&d.push("left:0;top:0;width:1px;height:1px;"),d.push("visibility: ",e?"hidden":"visible"),c.push(' style="',d.join(""),'"/>'),b&&(c=e||"span"===b||"img"===b?c.join(""):a.prepVML(c),this.element=Y(c)),this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;return a&&a.inverted&&b.invertChild(c,d),d.appendChild(c),this.added=!0,this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform(),this.onAdd&&this.onAdd(),this},updateTransform:P.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=Z(a*Ca),c=ea(a*Ca);G(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):Q})},getSpanCorrection:function(a,b,c,d,e){var i,f=d?Z(d*Ca):1,g=d?ea(d*Ca):0,h=m(this.elemHeight,this.element.offsetHeight);this.xCorr=0>f&&-a,this.yCorr=0>g&&-h,i=0>f*g,this.xCorr+=g*b*(i?1-c:c),this.yCorr-=f*b*(d?i?c:1-c:1),e&&"left"!==e&&(this.xCorr-=a*c*(0>f?-1:1),d&&(this.yCorr-=h*c*(0>g?-1:1)),G(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)ha(a[b])?c[b]=u(10*a[b])-5:"Z"===a[b]?c[b]="x":(c[b]=a[b],!a.isArc||"wa"!==a[b]&&"at"!==a[b]||(c[b+5]===c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1)));return c.join(" ")||"x"},clip:function(a){var c,b=this;return a?(c=a.members,ja(c,b),c.push(b),b.destroyClip=function(){ja(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:hb?"inherit":"rect(auto)"}),b.css(a)},css:P.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Pa(a)},destroy:function(){return this.destroyClip&&this.destroyClip(),P.prototype.destroy.apply(this)},on:function(a,b){return this.element["on"+a]=function(){var a=I.event;a.target=a.srcElement,b(a)},this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);return c=a.length,(9===c||11===c)&&(a[c-4]=a[c-2]=z(a[c-2])-10*b),a.join(" ")},shadow:function(a,b,c){var e,h,j,l,o,n,s,d=[],f=this.element,g=this.renderer,i=f.style,k=f.path;if(k&&"string"!=typeof k.value&&(k="x"),o=k,a){for(n=m(a.width,3),s=(a.opacity||.15)/n,e=1;3>=e;e++)l=2*n+1-2*e,c&&(o=this.cutOffPath(k.value,l+.5)),j=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',o,'" coordsize="10 10" style="',f.style.cssText,'" />'],h=Y(g.prepVML(j),null,{left:z(i.left)+m(a.offsetX,1),top:z(i.top)+m(a.offsetY,1)}),c&&(h.cutOff=l+1),j=['<stroke color="',a.color||"black",'" opacity="',s*e,'"/>'],Y(g.prepVML(j),null,null,h),b?b.element.appendChild(h):f.parentNode.insertBefore(h,f),d.push(h);this.shadows=d}return this},updateShadows:sa,setAttr:function(a,b){hb?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a,b,c){(c.getElementsByTagName("stroke")[0]||Y(this.renderer.prepVML(["<stroke/>"]),null,null,c))[b]=a||"solid",this[b]=a},dSetter:function(a,b,c){var d=this.shadows,a=a||[];if(this.d=a.join(" "),c.path=a=this.pathToVML(a),d)for(c=d.length;c--;)d[c].path=d[c].cutOff?this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;"SPAN"===d?c.style.color=a:"IMG"!==d&&(c.filled=a!==Q,this.setAttr("fillcolor",this.renderer.color(a,c,b,this)))},opacitySetter:sa,rotationSetter:function(a,b,c){c=c.style,this[b]=c[b]=a,c.left=-u(ea(a*Ca)+1)+"px",c.top=u(Z(a*Ca))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a,this[b]=a,ha(a)&&(a+="px"),this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){"inherit"===a&&(a="visible"),this.shadows&&p(this.shadows,function(c){c.style[b]=a}),"DIV"===c.nodeName&&(a="hidden"===a?"-999em":0,hb||(c.style[b]=a?"visible":"hidden"),b="top"),c.style[b]=a},xSetter:function(a,b,c){this[b]=a,"x"===b?b="left":"y"===b&&(b="top"),this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}},X=ka(P,X),X.prototype.ySetter=X.prototype.widthSetter=X.prototype.heightSetter=X.prototype.xSetter;var ga={Element:X,isIE8:wa.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;if(this.alignedObjects=[],d=this.createElement(Ja).css(q(this.getStyle(d),{position:"relative"})),e=d.element,a.appendChild(d.element),this.isVML=!0,this.box=e,this.boxWrapper=d,this.cache={},this.setSize(b,c,!1),!y.namespaces.hcv){y.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{y.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){y.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=ca(a);return q(e,{members:[],left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-("shape"===c?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+u(a?e:d)+"px,"+u(a?f:b)+"px,"+u(a?b:f)+"px,"+u(a?d:e)+"px)"};return!a&&hb&&"DIV"===c&&q(d,{width:b+"px",height:f+"px"}),d},updateClipping:function(){p(e.members,function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var f,h,i,e=this,g=/^rgba/,j=Q;if(a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern"),i){var k,l,n,s,m,J,L,r,o=a.linearGradient||a.radialGradient,x="",a=a.stops,v=[],q=function(){h=['<fill colors="'+v.join(",")+'" opacity="',m,'" o:opacity2="',s,'" type="',i,'" ',x,'focus="100%" method="any" />'],Y(e.prepVML(h),null,null,b)};if(n=a[0],r=a[a.length-1],n[0]>0&&a.unshift([0,n[1]]),r[0]<1&&a.push([1,r[1]]),p(a,function(a,b){g.test(a[1])?(f=ya(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1),v.push(100*a[0]+"% "+k),b?(m=l,J=k):(s=l,L=k)}),"fill"===c)if("gradient"===i)c=o.x1||o[0]||0,a=o.y1||o[1]||0,n=o.x2||o[2]||0,o=o.y2||o[3]||0,x='angle="'+(90-180*U.atan((o-a)/(n-c))/ma)+'"',q();else{var w,j=o.r,t=2*j,u=2*j,y=o.cx,B=o.cy,na=b.radialReference,j=function(){na&&(w=d.getBBox(),y+=(na[0]-w.x)/w.width-.5,B+=(na[1]-w.y)/w.height-.5,t*=na[2]/w.width,u*=na[2]/w.height),x='src="'+E.global.VMLRadialGradientURL+'" size="'+t+","+u+'" origin="0.5,0.5" position="'+y+","+B+'" color2="'+L+'" ',q()};d.added?j():d.onAdd=j,j=J}else j=k}else g.test(a)&&"IMG"!==b.tagName?(f=ya(a),h=["<",c,' opacity="',f.get("a"),'"/>'],Y(this.prepVML(h),null,null,b),j=f.get("rgb")):(j=b.getElementsByTagName(c),j.length&&(j[0].opacity=1,j[0].type="solid"),j=a);return j},prepVML:function(a){var b=this.isIE8,a=a.join("");return b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=-1===a.indexOf('style="')?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:"),a},text:ta.prototype.html,path:function(a){var b={coordsize:"10 10"};return La(a)?b.d=a:ca(a)&&q(b,a),this.createElement("shape").attr(b)},circle:function(a,b,c){var d=this.symbol("circle");return ca(a)&&(c=a.r,b=a.y,a=a.x),d.isCircle=!0,d.r=c,d.attr({x:a,y:b})},g:function(a){var b;return a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a}),this.createElement(Ja).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});return arguments.length>1&&f.attr({x:b,y:c,width:d,height:e}),f},createElement:function(a){return"rect"===a?this.symbol(a):ta.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e="IMG"===a.tagName&&a.style;G(a,{flip:"x",left:z(d.width)-(e?z(e.top):1),top:z(d.height)-(e?z(e.left):1),rotation:-90}),p(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c||d,c=e.innerR,d=Z(f),i=ea(f),j=Z(g),k=ea(g);return g-f===0?["x"]:(f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*j,b+h*k],e.open&&!c&&f.push("e","M",a,b),f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e"),f.isArc=!0,f)},circle:function(a,b,c,d,e){return e&&(c=d=2*e.r),e&&e.isCircle&&(a-=c/2,b-=d/2),["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){return ta.prototype.symbols[r(e)&&e.r?"callout":"square"].call(0,a,b,c,d,e)}}};R.VMLRenderer=X=function(){this.init.apply(this,arguments)},X.prototype=w(ta.prototype,ga),Za=X}ta.prototype.measureSpanWidth=function(a,b){var d,c=y.createElement("span");return d=y.createTextNode(a),c.appendChild(d),G(c,b),this.box.appendChild(c),d=c.offsetWidth,Pa(c),d};var Lb;fa&&(R.CanVGRenderer=X=function(){xa="http://www.w3.org/1999/xhtml"},X.prototype.symbols={},Lb=function(){function a(){var d,a=b.length;for(d=0;a>d;d++)b[d]();b=[]}var b=[];return{push:function(c,d){0===b.length&&Qb(d,a),b.push(c)}}}(),Za=X),Sa.prototype={addLabel:function(){var l,a=this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories,f=a.names,g=this.pos,h=b.labels,i=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/i.length||!d&&(c.margin[3]||.33*c.chartWidth),j=g===i[0],k=g===i[i.length-1],f=e?m(e[g],f[g],g):g,e=this.label,o=i.info;a.isDatetimeAxis&&o&&(l=b.dateTimeLabelFormats[o.higherRanks[g]||o.unitName]),this.isFirst=j,this.isLast=k,b=a.labelFormatter.call({axis:a,chart:c,isFirst:j,isLast:k,dateTimeLabelFormat:l,value:a.isLog?da(ia(f)):f}),g=d&&{width:v(1,u(d-2*(h.padding||10)))+"px"},g=q(g,h.style),r(e)?e&&e.attr({text:b}).css(g):(l={align:a.labelAlign},ha(h.rotation)&&(l.rotation=h.rotation),d&&h.ellipsis&&(l._clipHeight=a.len/i.length),this.label=r(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(l).css(g).add(a.labelGroup):null)},getLabelSize:function(){var a=this.label,b=this.axis;return a?a.getBBox()[b.horiz?"height":"width"]:0},getLabelSides:function(){var a=this.label.getBBox(),b=this.axis,c=b.horiz,d=b.options.labels,a=c?a.width:a.height,b=c?d.x-a*{left:0,center:.5,right:1}[b.labelAlign]:0;return[b,c?a+b:a]},handleOverflow:function(a,b){var l,o,n,c=!0,d=this.axis,e=this.isFirst,f=this.isLast,g=d.horiz?b.x:b.y,h=d.reversed,i=d.tickPositions,j=this.getLabelSides(),k=j[0],j=j[1],s=this.label.line||0;if(l=d.labelEdge,o=d.justifyLabels&&(e||f),l[s]===t||g+k>l[s]?l[s]=g+j:o||(c=!1),o){l=(o=d.justifyToPlot)?d.pos:0,o=o?l+d.len:d.chart.chartWidth;do a+=e?1:-1,n=d.ticks[i[a]];while(i[a]&&(!n||n.label.line!==s));d=n&&n.label.xy&&n.label.xy.x+n.getLabelSides()[e?0:1],e&&!h||f&&h?l>g+k&&(g=l-k,n&&g+j>d&&(c=!1)):g+j>o&&(g=o-j,n&&d>g+k&&(c=!1)),b.x=g}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis,j=i.transA,k=i.reversed,l=i.staggerLines,o=i.chart.renderer.fontMetrics(e.style.fontSize).b,n=e.rotation,a=a+e.x-(f&&d?f*j*(k?-1:1):0),b=b+e.y-(f&&!d?f*j*(k?1:-1):0);return n&&2===i.side&&(b-=o-o*Z(n*Ca)),!r(e.y)&&!n&&(b+=o-c.getBBox().height/2),l&&(c.line=g/(h||1)%l,b+=c.line*(i.labelOffset/l)),{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,l=this.gridLine,o=h?h+"Grid":"grid",n=h?h+"Tick":"tick",s=e[o+"LineWidth"],p=e[o+"LineColor"],J=e[o+"LineDashStyle"],L=e[n+"Length"],o=e[n+"Width"]||0,x=e[n+"Color"],r=e[n+"Position"],n=this.mark,v=k.step,q=!0,u=d.tickmarkOffset,w=this.getPosition(g,j,u,b),y=w.x,w=w.y,B=g&&y===d.pos+d.len||!g&&w===d.pos?-1:1;this.isActive=!0,s&&(j=d.getPlotLinePath(j+u,s*B,b,!0),l===t&&(l={stroke:p,"stroke-width":s},J&&(l.dashstyle=J),h||(l.zIndex=1),b&&(l.opacity=0),this.gridLine=l=s?f.path(j).attr(l).add(d.gridGroup):null),!b&&l&&j&&l[this.isNew?"attr":"animate"]({d:j,opacity:c})),o&&L&&("inside"===r&&(L=-L),d.opposite&&(L=-L),h=this.getMarkPath(y,w,L,o*B,g,f),n?n.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:x,"stroke-width":o,opacity:c}).add(d.axisGroup)),i&&!isNaN(y)&&(i.xy=w=this.getLabelPosition(y,w,i,g,k,u,a,v),this.isFirst&&!this.isLast&&!m(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!m(e.showLastLabel,1)?q=!1:!d.isRadial&&!k.step&&!k.rotation&&!b&&0!==c&&(q=this.handleOverflow(a,w)),v&&a%v&&(q=!1),q&&!isNaN(w.y)?(w.opacity=c,i[this.isNew?"attr":"animate"](w),this.isNew=!1):i.attr("y",-9999))},destroy:function(){Oa(this,this.axis)}},R.PlotLineOrBand=function(a,b){this.axis=a,b&&(this.options=b,this.id=b.id)},R.PlotLineOrBand.prototype={render:function(){var p,a=this,b=a.axis,c=b.horiz,d=(b.pointRange||0)/2,e=a.options,f=e.label,g=a.label,h=e.width,i=e.to,j=e.from,k=r(j)&&r(i),l=e.value,o=e.dashStyle,n=a.svgElem,s=[],J=e.color,L=e.zIndex,x=e.events,q={},t=b.chart.renderer;if(b.isLog&&(j=za(j),i=za(i),l=za(l)),h)s=b.getPlotLinePath(l,h),q={stroke:J,"stroke-width":h},o&&(q.dashstyle=o);else{if(!k)return;j=v(j,b.min-d),i=C(i,b.max+d),s=b.getPlotBandPath(j,i,e),J&&(q.fill=J),e.borderWidth&&(q.stroke=e.borderColor,q["stroke-width"]=e.borderWidth)}if(r(L)&&(q.zIndex=L),n)s?n.animate({d:s},null,n.onGetPath):(n.hide(),n.onGetPath=function(){n.show()},g&&(a.label=g=g.destroy()));else if(s&&s.length&&(a.svgElem=n=t.path(s).attr(q).add(),x))for(p in d=function(b){n.on(b,function(c){x[b].apply(a,[c])})},x)d(p);return f&&r(f.text)&&s&&s.length&&b.width>0&&b.height>0?(f=w({align:c&&k&&"center",x:c?!k&&4:10,verticalAlign:!c&&k&&"middle",y:c?k?16:10:k?6:-4,rotation:c&&!k&&90},f),g||(q={align:f.textAlign||f.align,rotation:f.rotation},r(L)&&(q.zIndex=L),a.label=g=t.text(f.text,0,0,f.useHTML).attr(q).css(f.style).add()),b=[s[1],s[4],m(s[6],s[1])],s=[s[2],s[5],m(s[7],s[2])],c=Na(b),k=Na(s),g.align(f,!1,{x:c,y:k,width:Ba(b)-c,height:Ba(s)-k}),g.show()):g&&g.hide(),a},destroy:function(){ja(this.axis.plotLinesAndBands,this),delete this.axis,Oa(this)}},la.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:N,lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return Ga(this.total,-1)},style:N.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:20},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c,this.coll=(this.isXAxis=c)?"xAxis":"yAxis",this.opposite=b.opposite,this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter,this.userOptions=b,this.minPixelPadding=0,this.chart=a,this.reversed=d.reversed,this.zoomEnabled=d.zoomEnabled!==!1,this.categories=d.categories||"category"===e,this.names=[],this.isLog="logarithmic"===e,this.isDatetimeAxis="datetime"===e,this.isLinked=r(d.linkedTo),this.tickmarkOffset=this.categories&&"between"===d.tickmarkPlacement?.5:0,this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=d.minRange||d.maxZoom,this.range=d.range,this.offset=d.offset||0,this.stacks={},this.oldStacks={},this.min=this.max=null,this.crosshair=m(d.crosshair,qa(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;-1===Da(this,a.axes)&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this)),this.series=this.series||[],a.inverted&&c&&this.reversed===t&&(this.reversed=!0),this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)K(this,f,d[f]);this.isLog&&(this.val2lin=za,this.lin2val=ia)},setOptions:function(a){this.options=w(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],w(E[this.coll],a))},defaultLabelFormatter:function(){var g,a=this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,e=E.lang.numericSymbols,f=e&&e.length,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Ia(h,this);else if(c)g=b;else if(d)g=cb(d,b);else if(f&&a>=1e3)for(;f--&&g===t;)c=Math.pow(1e3,f+1),a>=c&&null!==e[f]&&(g=Ga(b/c,-1)+e[f]);return g===t&&(g=M(b)>=1e4?Ga(b,0):Ga(b,-1,t,"")),g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1,a.dataMin=a.dataMax=null,a.buildStacks&&a.buildStacks(),p(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d;d=c.options.threshold;var e;a.hasVisibleSeries=!0,a.isLog&&0>=d&&(d=null),a.isXAxis?(d=c.xData,d.length&&(a.dataMin=C(m(a.dataMin,d[0]),Na(d)),a.dataMax=v(m(a.dataMax,d[0]),Ba(d)))):(c.getExtremes(),e=c.dataMax,c=c.dataMin,r(c)&&r(e)&&(a.dataMin=C(m(a.dataMin,c),c),a.dataMax=v(m(a.dataMax,e),e)),r(d)&&(a.dataMin>=d?(a.dataMin=d,a.ignoreMinPadding=!0):a.dataMax<d&&(a.dataMax=d,a.ignoreMaxPadding=!0)))}})},translate:function(a,b,c,d,e,f){var g=1,h=0,i=d?this.oldTransA:this.transA,d=d?this.oldMin:this.min,j=this.minPixelPadding,e=(this.options.ordinal||this.isLog&&e)&&this.lin2val;return i||(i=this.transA),c&&(g*=-1,h=this.len),this.reversed&&(g*=-1,h-=g*(this.sector||this.len)),b?(a=a*g+h,a-=j,a=a/i+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),"between"===f&&(f=.5),a=g*(a-d)*i+h+g*j+(ha(f)?i*f*this.pointRange:0)),a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,d,e){var i,j,o,f=this.chart,g=this.left,h=this.top,k=c&&f.oldChartHeight||f.chartHeight,l=c&&f.oldChartWidth||f.chartWidth;return i=this.transB,e=m(e,this.translate(a,null,null,c)),a=c=u(e+i),i=j=u(k-e-i),isNaN(e)?o=!0:this.horiz?(i=h,j=k-this.bottom,(g>a||a>g+this.width)&&(o=!0)):(a=g,c=l-this.right,(h>i||i>h+this.height)&&(o=!0)),o&&!d?null:f.renderer.crispLine(["M",a,i,"L",c,j],b||1)},getLinearTickPositions:function(a,b,c){var d,e=da(T(b/a)*a),f=da(Ka(c/a)*a),g=[];if(b===c&&ha(b))return[b];for(b=e;f>=b&&(g.push(b),b=da(b+a),b!==d);)d=b;return g},getMinorTickPositions:function(){var e,a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[];if(this.isLog)for(e=b.length,a=1;e>a;a++)d=d.concat(this.getLogTickPositions(c,b[a-1],b[a],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)d=d.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&d.shift();else for(b=this.min+(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var d,f,g,h,i,j,a=this.options,b=this.min,c=this.max,e=this.dataMax-this.dataMin>=this.minRange;if(this.isXAxis&&this.minRange===t&&!this.isLog&&(r(a.min)||r(a.max)?this.minRange=null:(p(this.series,function(a){for(i=a.xData,g=j=a.xIncrement?1:i.length-1;g>0;g--)h=i[g]-i[g-1],(f===t||f>h)&&(f=h)}),this.minRange=C(5*f,this.dataMax-this.dataMin))),c-b<this.minRange){var k=this.minRange;d=(k-c+b)/2,d=[b-d,m(a.min,b-d)],e&&(d[2]=this.dataMin),b=Ba(d),c=[b+k,m(a.max,b+k)],e&&(c[2]=this.dataMax),c=Na(c),k>c-b&&(d[0]=c-k,d[1]=m(a.min,c-k),b=Ba(d))}this.min=b,this.max=c},setAxisTranslation:function(a){var e,b=this,c=b.max-b.min,d=b.axisPointRange||0,f=0,g=0,h=b.linkedParent,i=!!b.categories,j=b.transA;(b.isXAxis||i||d)&&(h?(f=h.minPointOffset,g=h.pointRangePadding):p(b.series,function(a){var h=i?1:b.isXAxis?a.pointRange:b.axisPointRange||0,j=a.options.pointPlacement,n=a.closestPointRange;h>c&&(h=0),d=v(d,h),f=v(f,Fa(j)?0:h/2),g=v(g,"on"===j?0:h),!a.noSharedTooltip&&r(n)&&(e=r(e)?C(e,n):n)}),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=C(d,c),b.closestPointRange=e),a&&(b.oldTransA=j),b.translationSlope=b.transA=j=b.len/(c+g||1),b.transB=b.horiz?b.left:b.bottom,b.minPixelPadding=j*f},setTickPositions:function(a){var s,b=this,c=b.chart,d=b.options,e=b.isLog,f=b.isDatetimeAxis,g=b.isXAxis,h=b.isLinked,i=b.options.tickPositioner,j=d.maxPadding,k=d.minPadding,l=d.tickInterval,o=d.minTickInterval,n=d.tickPixelInterval,$=b.categories;h?(b.linkedParent=c[b.coll][d.linkedTo],c=b.linkedParent.getExtremes(),b.min=m(c.min,c.dataMin),b.max=m(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&ra(11,1)):(b.min=m(b.userMin,d.min,b.dataMin),b.max=m(b.userMax,d.max,b.dataMax)),e&&(!a&&C(b.min,m(b.dataMin,b.min))<=0&&ra(10,1),b.min=da(za(b.min)),b.max=da(za(b.max))),b.range&&r(b.max)&&(b.userMin=b.min=v(b.min,b.max-b.range),b.userMax=b.max,b.range=null),b.beforePadding&&b.beforePadding(),b.adjustForMinRange(),$||b.axisPointRange||b.usePercentage||h||!r(b.min)||!r(b.max)||!(c=b.max-b.min)||(r(d.min)||r(b.userMin)||!k||!(b.dataMin<0)&&b.ignoreMinPadding||(b.min-=c*k),r(d.max)||r(b.userMax)||!j||!(b.dataMax>0)&&b.ignoreMaxPadding||(b.max+=c*j)),ha(d.floor)&&(b.min=v(b.min,d.floor)),ha(d.ceiling)&&(b.max=C(b.max,d.ceiling)),b.min===b.max||void 0===b.min||void 0===b.max?b.tickInterval=1:h&&!l&&n===b.linkedParent.options.tickPixelInterval?b.tickInterval=b.linkedParent.tickInterval:(b.tickInterval=m(l,$?1:(b.max-b.min)*n/v(b.len,n)),!r(l)&&b.len<n&&!this.isRadial&&!this.isLog&&!$&&d.startOnTick&&d.endOnTick&&(s=!0,b.tickInterval/=4)),g&&!a&&p(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)}),b.setAxisTranslation(!0),b.beforeSetTickPositions&&b.beforeSetTickPositions(),b.postProcessTickInterval&&(b.tickInterval=b.postProcessTickInterval(b.tickInterval)),b.pointRange&&(b.tickInterval=v(b.pointRange,b.tickInterval)),!l&&b.tickInterval<o&&(b.tickInterval=o),f||e||l||(b.tickInterval=nb(b.tickInterval,null,mb(b.tickInterval),d)),b.minorTickInterval="auto"===d.minorTickInterval&&b.tickInterval?b.tickInterval/5:d.minorTickInterval,b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):i&&i.apply(b,[b.min,b.max]),a||(!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>v(2*b.len,200)&&ra(19,!0),a=f?b.getTimeTicks(b.normalizeTimeTickInterval(b.tickInterval,d.units),b.min,b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,!0):e?b.getLogTickPositions(b.tickInterval,b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),s&&a.splice(1,a.length-2),b.tickPositions=a),h||(e=a[0],f=a[a.length-1],h=b.minPointOffset||0,d.startOnTick?b.min=e:b.min-h>e&&a.shift(),d.endOnTick?b.max=f:b.max+h<f&&a.pop(),1===a.length&&(d=M(b.max)>1e13?1:.001,b.min-=d,b.max+=d))},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,d=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");!this.isLinked&&!this.isDatetimeAxis&&c&&c.length>(b[d]||0)&&this.options.alignTicks!==!1&&(b[d]=c.length),a.maxTicks=b},adjustTickAmount:function(){var a=this._maxTicksKey,b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==t){var d=this.tickAmount,e=b.length;if(this.tickAmount=a=c[a],a>e){for(;b.length<a;)b.push(da(b[b.length-1]+this.tickInterval));this.transA*=(e-1)/(a-1),this.max=b[b.length-1]}r(d)&&a!==d&&(this.isDirty=!0)}},setScale:function(){var b,c,d,e,a=this.stacks;if(this.oldMin=this.min,this.oldMax=this.max,this.oldAxisLength=this.len,this.setAxisSize(),e=this.len!==this.oldAxisLength,p(this.series,function(a){(a.isDirtyData||a.isDirty||a.xAxis.isDirty)&&(d=!0)}),e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)for(c in a[b])a[b][c].total=null,a[b][c].cum=0;this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickPositions(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax)}else if(!this.isXAxis){this.oldStacks&&(a=this.stacks=this.oldStacks);for(b in a)for(c in a[b])a[b][c].cum=a[b][c].total}this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart,c=m(c,!0),e=q(e,{min:a,max:b});D(f,"setExtremes",e,function(){f.userMin=a,f.userMax=b,f.eventArgs=e,f.isDirtyExtremes=!0,c&&g.redraw(d)})},zoom:function(a,b){var c=this.dataMin,d=this.dataMax,e=this.options;return this.allowZoomOutside||(r(c)&&a<=C(c,m(e.min,c))&&(a=t),r(d)&&b>=v(d,m(e.max,d))&&(b=t)),this.displayBtn=a!==t||b!==t,this.setExtremes(a,b,!1,t,{trigger:"zoom"}),!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=m(b.width,a.plotWidth-c+(b.offsetRight||0)),f=m(b.height,a.plotHeight),g=m(b.top,a.plotTop),b=m(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=parseInt(f,10)/100*a.plotHeight),c.test(g)&&(g=parseInt(g,10)/100*a.plotHeight+a.plotTop),this.left=b,this.top=g,this.width=e,this.height=f,this.bottom=a.chartHeight-f-g,this.right=a.chartWidth-e-b,this.len=v(d?e:f,0),this.pos=d?b:g},getExtremes:function(){var a=this.isLog;return{min:a?da(ia(this.min)):this.min,max:a?da(ia(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?ia(this.min):this.min,b=b?ia(this.max):this.max;return c>a||null===a?a=c:a>b&&(a=b),this.translate(a,0,1,0,1)},autoLabelAlign:function(a){return a=(m(a,0)-90*this.side+720)%360,a>15&&165>a?"right":a>195&&345>a?"left":"center"},getOffset:function(){var j,l,q,y,z,A,B,a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,k=0,o=0,n=d.title,s=d.labels,$=0,J=b.axisOffset,L=b.clipOffset,x=[-1,1,1,-1][h],u=1,w=m(s.maxStaggerLines,5),na=2===h?c.fontMetrics(s.style.fontSize).b:0;if(a.hasData=j=a.hasVisibleSeries||r(a.min)&&r(a.max)&&!!e,a.showAxis=b=j||m(d.showEmpty,!0),a.staggerLines=a.horiz&&s.staggerLines,a.axisGroup||(a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:s.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add()),j||a.isLinked){if(a.labelAlign=m(s.align||a.autoLabelAlign(s.rotation)),p(e,function(b){f[b]?f[b].addLabel():f[b]=new Sa(a,b)
3
  }),a.horiz&&!a.staggerLines&&w&&!s.rotation){for(q=a.reversed?[].concat(e).reverse():e;w>u;){for(j=[],y=!1,s=0;s<q.length;s++)z=q[s],A=(A=f[z].label&&f[z].label.getBBox())?A.width:0,B=s%u,A&&(z=a.translate(z),j[B]!==t&&z<j[B]&&(y=!0),j[B]=z+A);if(!y)break;u++}u>1&&(a.staggerLines=u)}p(e,function(b){(0===h||2===h||{1:"left",3:"right"}[h]===a.labelAlign)&&($=v(f[b].getLabelSize(),$))}),a.staggerLines&&($*=a.staggerLines,a.labelOffset=$)}else for(q in f)f[q].destroy(),delete f[q];n&&n.text&&n.enabled!==!1&&(a.axisTitle||(a.axisTitle=c.text(n.text,0,0,n.useHTML).attr({zIndex:7,rotation:n.rotation||0,align:n.textAlign||{low:"left",middle:"center",high:"right"}[n.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(n.style).add(a.axisGroup),a.axisTitle.isNew=!0),b&&(k=a.axisTitle.getBBox()[g?"height":"width"],o=m(n.margin,g?5:10),l=n.offset),a.axisTitle[b?"show":"hide"]()),a.offset=x*m(d.offset,J[h]),a.axisTitleMargin=m(l,$+o+($&&x*d.labels[g?"y":"x"]-na)),J[h]=v(J[h],a.axisTitleMargin+k+x*a.offset),L[i]=v(L[i],2*T(d.lineWidth/2))},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;return c&&(a*=-1),b.renderer.crispLine(["M",e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=z(e.style.fontSize||12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(2===this.side?i:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var j,u,z,a=this,b=a.horiz,c=a.reversed,d=a.chart,e=d.renderer,f=a.options,g=a.isLog,h=a.isLinked,i=a.tickPositions,k=a.axisTitle,l=a.ticks,o=a.minorTicks,n=a.alternateBands,s=f.stackLabels,m=f.alternateGridColor,J=a.tickmarkOffset,L=f.lineWidth,x=d.hasRendered&&r(a.oldMin)&&!isNaN(a.oldMin),q=a.hasData,v=a.showAxis,w=f.labels.overflow,y=a.justifyLabels=b&&w!==!1;a.labelEdge.length=0,a.justifyToPlot="justify"===w,p([l,o,n],function(a){for(var b in a)a[b].isActive=!1}),(q||h)&&(a.minorTickInterval&&!a.categories&&p(a.getMinorTickPositions(),function(b){o[b]||(o[b]=new Sa(a,b,"minor")),x&&o[b].isNew&&o[b].render(null,!0),o[b].render(null,!1,1)}),i.length&&(j=i.slice(),(b&&c||!b&&!c)&&j.reverse(),y&&(j=j.slice(1).concat([j[0]])),p(j,function(b,c){y&&(c=c===j.length-1?0:c+1),(!h||b>=a.min&&b<=a.max)&&(l[b]||(l[b]=new Sa(a,b)),x&&l[b].isNew&&l[b].render(c,!0,.1),l[b].render(c,!1,1))}),J&&0===a.min&&(l[-1]||(l[-1]=new Sa(a,-1,null,!0)),l[-1].render(-1))),m&&p(i,function(b,c){c%2===0&&b<a.max&&(n[b]||(n[b]=new R.PlotLineOrBand(a)),u=b+J,z=i[c+1]!==t?i[c+1]+J:a.max,n[b].options={from:g?ia(u):u,to:g?ia(z):z,color:m},n[b].render(),n[b].isActive=!0)}),a._addedPlotLB||(p((f.plotLines||[]).concat(f.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0)),p([l,o,n],function(a){var b,c,e=[],f=va?va.duration||500:0,g=function(){for(c=e.length;c--;)a[e[c]]&&!a[e[c]].isActive&&(a[e[c]].destroy(),delete a[e[c]])};for(b in a)a[b].isActive||(a[b].render(b,!1,0),a[b].isActive=!1,e.push(b));a!==n&&d.hasRendered&&f?f&&setTimeout(g,f):g()}),L&&(b=a.getLinePath(L),a.axisLine?a.axisLine.animate({d:b}):a.axisLine=e.path(b).attr({stroke:f.lineColor,"stroke-width":L,zIndex:7}).add(a.axisGroup),a.axisLine[v?"show":"hide"]()),k&&v&&(k[k.isNew?"attr":"animate"](a.getTitlePosition()),k.isNew=!1),s&&s.enabled&&a.renderStackTotals(),a.isDirty=!1},redraw:function(){var a=this.chart.pointer;a&&a.reset(!0),this.render(),p(this.plotLinesAndBands,function(a){a.render()}),p(this.series,function(a){a.isDirty=!0})},destroy:function(a){var d,b=this,c=b.stacks,e=b.plotLinesAndBands;a||W(b);for(d in c)Oa(c[d]),c[d]=null;for(p([b.ticks,b.minorTicks,b.alternateBands],function(a){Oa(a)}),a=e.length;a--;)e[a].destroy();p("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(a){b[a]&&(b[a]=b[a].destroy())}),this.cross&&this.cross.destroy()},drawCrosshair:function(a,b){if(this.crosshair)if((r(b)||!m(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var c,d=this.crosshair,e=d.animation;m(d.snap,!0)?r(b)&&(c=this.chart.inverted!=this.horiz?b.plotX:this.len-b.plotY):c=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos,c=this.isRadial?this.getPlotLinePath(this.isXAxis?b.x:m(b.stackY,b.y)):this.getPlotLinePath(null,null,null,null,c),null===c?this.hideCrosshair():this.cross?this.cross.attr({visibility:"visible"})[e?"animate":"attr"]({d:c},e):(e={"stroke-width":d.width||1,stroke:d.color||"#C0C0C0",zIndex:d.zIndex||2},d.dashStyle&&(e.dashstyle=d.dashStyle),this.cross=this.chart.renderer.path(c).attr(e).add())}},hideCrosshair:function(){this.cross&&this.cross.hide()}},q(la.prototype,{getPlotBandPath:function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a);return d&&c?d.push(c[4],c[5],c[1],c[2]):d=null,d},addPlotBand:function(a){this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(a,b){var c=new R.PlotLineOrBand(this,a).render(),d=this.userOptions;return c&&(b&&(d[b]=d[b]||[],d[b].push(a)),this.plotLinesAndBands.push(c)),c},removePlotBandOrLine:function(a){for(var b=this.plotLinesAndBands,c=this.options,d=this.userOptions,e=b.length;e--;)b[e].id===a&&b[e].destroy();p([c.plotLines||[],d.plotLines||[],c.plotBands||[],d.plotBands||[]],function(b){for(e=b.length;e--;)b[e].id===a&&ja(b,b[e])})}}),la.prototype.getTimeTicks=function(a,b,c,d){var h,e=[],f={},g=E.global.useUTC,i=new Date(b-Ra),j=a.unitRange,k=a.count;if(r(b)){j>=A.second&&(i.setMilliseconds(0),i.setSeconds(j>=A.minute?0:k*T(i.getSeconds()/k))),j>=A.minute&&i[Db](j>=A.hour?0:k*T(i[pb]()/k)),j>=A.hour&&i[Eb](j>=A.day?0:k*T(i[qb]()/k)),j>=A.day&&i[sb](j>=A.month?1:k*T(i[Xa]()/k)),j>=A.month&&(i[Fb](j>=A.year?0:k*T(i[fb]()/k)),h=i[gb]()),j>=A.year&&(h-=h%k,i[Gb](h)),j===A.week&&i[sb](i[Xa]()-i[rb]()+m(d,1)),b=1,Ra&&(i=new Date(i.getTime()+Ra)),h=i[gb]();for(var d=i.getTime(),l=i[fb](),o=i[Xa](),n=g?Ra:(864e5+6e4*i.getTimezoneOffset())%864e5;c>d;)e.push(d),j===A.year?d=eb(h+b*k,0):j===A.month?d=eb(h,l+b*k):g||j!==A.day&&j!==A.week?d+=j*k:d=eb(h,l,o+b*k*(j===A.day?1:7)),b++;e.push(d),p(vb(e,function(a){return j<=A.hour&&a%A.day===n}),function(a){f[a]="day"})}return e.info=q(a,{higherRanks:f,totalRange:j*k}),e},la.prototype.normalizeTimeTickInterval=function(a,b){var g,c=b||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],d=c[c.length-1],e=A[d[0]],f=d[1];for(g=0;g<c.length&&(d=c[g],e=A[d[0]],f=d[1],!(c[g+1]&&a<=(e*f[f.length-1]+A[c[g+1][0]])/2));g++);return e===A.year&&5*e>a&&(f=[1,2,5]),c=nb(a/e,f,"year"===d[0]?v(mb(a/e),1):1),{unitRange:e,count:c,unitName:d[0]}},la.prototype.getLogTickPositions=function(a,b,c,d){var e=this.options,f=this.len,g=[];if(d||(this._minorAutoInterval=null),a>=.5)a=u(a),g=this.getLinearTickPositions(a,b,c);else if(a>=.08)for(var h,i,j,k,l,f=T(b),e=a>.3?[1,2,4]:a>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];c+1>f&&!l;f++)for(i=e.length,h=0;i>h&&!l;h++)j=za(ia(f)*e[h]),j>b&&(!d||c>=k)&&g.push(k),k>c&&(l=!0),k=j;else b=ia(b),c=ia(c),a=e[d?"minorTickInterval":"tickInterval"],a=m("auto"===a?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=nb(a,null,mb(a)),g=Ua(this.getLinearTickPositions(a,b,c),za),d||(this._minorAutoInterval=a/5);return d||(this.tickInterval=a),g};var Mb=R.Tooltip=function(){this.init.apply(this,arguments)};Mb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=z(d.padding);this.chart=a,this.options=b,this.crosshairs=[],this.now={x:0,y:0},this.isHidden=!0,this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999}),fa||this.label.shadow(b.shadow),this.shared=b.shared},destroy:function(){this.label&&(this.label=this.label.destroy()),clearTimeout(this.hideTimer),clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden,h=e.followPointer||e.len>1;q(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?t:g?(2*f.anchorX+c)/3:c,anchorY:h?t:g?(f.anchorY+d)/2:d}),e.label.attr(f),g&&(M(a-f.x)>1||M(b-f.y)>1)&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32))},hide:function(){var b,a=this;clearTimeout(this.hideTimer),this.isHidden||(b=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){a.label.fadeOut(),a.isHidden=!0},m(this.options.hideDelay,500)),b&&p(b,function(a){a.setState()}),this.chart.hoverPoints=null)},getAnchor:function(a,b){var c,i,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,a=qa(a);return c=a[0].tooltipPos,this.followPointer&&b&&(b.chartX===t&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]),c||(p(a,function(a){i=a.series.yAxis,g+=a.plotX,h+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-g:h]),Ua(c,u)},getPosition:function(a,b,c){var g,d=this.chart,e=this.distance,f={},h=["y",d.chartHeight,b,c.plotY+d.plotTop],i=["x",d.chartWidth,a,c.plotX+d.plotLeft],j=c.ttBelow||d.inverted&&!c.negative||!d.inverted&&c.negative,k=function(a,b,c,d){var g=d-e>c,b=b>d+e+c,c=d-e-c;if(d+=e,j&&b)f[a]=d;else if(!j&&g)f[a]=c;else if(g)f[a]=c;else{if(!b)return!1;f[a]=d}},l=function(a,b,c,d){return e>d||d>b-e?!1:void(f[a]=c/2>d?1:d>b-c/2?b-c-2:d-c/2)},o=function(a){var b=h;h=i,i=b,g=a},n=function(){k.apply(0,h)!==!1?l.apply(0,i)===!1&&!g&&(o(!0),n()):g?f.x=f.y=0:(o(!0),n())};return(d.inverted||this.len>1)&&o(),n(),f},defaultFormatter:function(a){var d,b=this.points||qa(this),c=b[0].series;return d=[a.tooltipHeaderFormatter(b[0])],p(b,function(a){c=a.series,d.push(c.tooltipFormatter&&c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))}),d.push(a.options.footerFormat||""),d.join("")},refresh:function(a,b){var f,g,i,c=this.chart,d=this.label,e=this.options,h={},j=[];i=e.formatter||this.defaultFormatter;var k,h=c.hoverPoints,l=this.shared;clearTimeout(this.hideTimer),this.followPointer=qa(a)[0].series.tooltipOptions.followPointer,g=this.getAnchor(a,b),f=g[0],g=g[1],!l||a.series&&a.series.noSharedTooltip?h=a.getLabelConfig():(c.hoverPoints=a,h&&p(h,function(a){a.setState()}),p(a,function(a){a.setState("hover"),j.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=j,this.len=j.length,a=a[0]),i=i.call(h,this),h=a.series,this.distance=m(h.tooltipOptions.distance,16),i===!1?this.hide():(this.isHidden&&(bb(d),d.attr("opacity",1).show()),d.attr({text:i}),k=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:k}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow}),this.isHidden=!1),D(c,"tooltipRefresh",{text:i,x:f+c.plotLeft,y:g+c.plotTop,borderColor:k})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(u(c.x),u(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},tooltipHeaderFormatter:function(a){var h,b=a.series,c=b.tooltipOptions,d=c.dateTimeLabelFormats,e=c.xDateFormat,f=b.xAxis,g=f&&"datetime"===f.options.type&&ha(a.key),c=c.headerFormat,f=f&&f.closestPointRange;if(g&&!e){if(f){for(h in A)if(A[h]>=f||A[h]<=A.day&&a.key%A[h]>0){e=d[h];break}}else e=d.day;e=e||d.year}return g&&e&&(c=c.replace("{point.key}","{point.key:"+e+"}")),Ia(c,{point:a,series:b})}};var oa;$a=y.documentElement.ontouchstart!==t;var Wa=R.Pointer=function(a,b){this.init(a,b)};if(Wa.prototype={init:function(a,b){var f,c=b.chart,d=c.events,e=fa?"":c.zoomType,c=a.inverted;this.options=b,this.chart=a,this.zoomX=f=/x/.test(e),this.zoomY=e=/y/.test(e),this.zoomHor=f&&!c||e&&c,this.zoomVert=e&&!c||f&&c,this.hasZoom=f||e,this.runChartClick=d&&!!d.click,this.pinchDown=[],this.lastValidTouch={},R.Tooltip&&b.tooltip.enabled&&(a.tooltip=new Mb(a,b.tooltip),this.followTouchMove=b.tooltip.followTouchMove),this.setDOMEvents()},normalize:function(a,b){var c,d,a=a||window.event,a=Sb(a);return a.target||(a.target=a.srcElement),d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a,b||(this.chartPosition=b=Rb(this.chart.container)),d.pageX===t?(c=v(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top),q(a,{chartX:u(c),chartY:u(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};return p(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})}),b},getIndex:function(a){var b=this.chart;return b.inverted?b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},runPointActions:function(a){var e,f,i,j,b=this.chart,c=b.series,d=b.tooltip,g=b.hoverPoint,h=b.hoverSeries,k=b.chartWidth,l=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!h||!h.noSharedTooltip)){for(f=[],i=c.length,j=0;i>j;j++)c[j].visible&&c[j].options.enableMouseTracking!==!1&&!c[j].noSharedTooltip&&c[j].singularTooltips!==!0&&c[j].tooltipPoints.length&&(e=c[j].tooltipPoints[l])&&e.series&&(e._dist=M(l-e.clientX),k=C(k,e._dist),f.push(e));for(i=f.length;i--;)f[i]._dist>k&&f.splice(i,1);f.length&&f[0].clientX!==this.hoverX&&(d.refresh(f,a),this.hoverX=f[0].clientX)}c=h&&h.tooltipOptions.followPointer,h&&h.tracker&&!c?(e=h.tooltipPoints[l])&&e!==g&&e.onMouseOver(a):d&&c&&!d.isHidden&&(h=d.getAnchor([{}],a),d.updatePosition({plotX:h[0],plotY:h[1]})),d&&!this._onDocumentMouseMove&&(this._onDocumentMouseMove=function(a){V[oa]&&V[oa].pointer.onDocumentMouseMove(a)},K(y,"mousemove",this._onDocumentMouseMove)),p(b.axes,function(b){b.drawCrosshair(a,m(e,g))})},reset:function(a){var b=this.chart,c=b.hoverSeries,d=b.hoverPoint,e=b.tooltip,f=e&&e.shared?b.hoverPoints:d;(a=a&&e&&f)&&qa(f)[0].plotX===t&&(a=!1),a?(e.refresh(f),d&&d.setState(d.state,!0)):(d&&d.onMouseOut(),c&&c.onMouseOut(),e&&e.hide(),this._onDocumentMouseMove&&(W(y,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null),p(b.axes,function(a){a.hideCrosshair()}),this.hoverX=null)},scaleGroups:function(a,b){var d,c=this.chart;p(c.series,function(e){d=a||e.getPlotBox(),e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))}),c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type,b.cancelClick=!1,b.mouseDownX=this.mouseDownX=a.chartX,b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var l,b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,i=b.plotTop,j=b.plotWidth,k=b.plotHeight,o=this.mouseDownX,n=this.mouseDownY;h>d?d=h:d>h+j&&(d=h+j),i>e?e=i:e>i+k&&(e=i+k),this.hasDragged=Math.sqrt(Math.pow(o-d,2)+Math.pow(n-e,2)),this.hasDragged>10&&(l=b.isInsidePlot(o-h,n-i),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!this.selectionMarker&&(this.selectionMarker=b.renderer.rect(h,i,f?1:j,g?1:k,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add()),this.selectionMarker&&f&&(d-=o,this.selectionMarker.attr({width:M(d),x:(d>0?0:d)+o})),this.selectionMarker&&g&&(d=e-n,this.selectionMarker.attr({height:M(d),y:(d>0?0:d)+n})),l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning))},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var i,d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},a=this.selectionMarker,e=a.attr?a.attr("x"):a.x,f=a.attr?a.attr("y"):a.y,g=a.attr?a.attr("width"):a.width,h=a.attr?a.attr("height"):a.height;(this.hasDragged||c)&&(p(b.axes,function(a){if(a.zoomEnabled){var b=a.horiz,c=a.toValue(b?e:f),b=a.toValue(b?e+g:f+h);!isNaN(c)&&!isNaN(b)&&(d[a.coll].push({axis:a,min:C(c,b),max:v(c,b)}),i=!0)}}),i&&D(b,"selection",d,function(a){b.zoom(q(a,c?{animation:!1}:null))})),this.selectionMarker=this.selectionMarker.destroy(),c&&this.scaleGroups()}b&&(G(b.container,{cursor:b._cursor}),b.cancelClick=this.hasDragged>10,b.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a),a.preventDefault&&a.preventDefault(),this.dragStart(a)},onDocumentMouseUp:function(a){V[oa]&&V[oa].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){var a=V[oa];a&&(a.pointer.reset(),a.pointer.chartPosition=null)},onContainerMouseMove:function(a){var b=this.chart;oa=b.index,a=this.normalize(a),"mousedown"===b.mouseIsDown&&this.drag(a),(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=H(a,"class")){if(-1!==c.indexOf(b))return!0;if(-1!==c.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries,c=(a=a.relatedTarget||a.toElement)&&a.point&&a.point.series;!b||b.options.stickyTracking||this.inClass(a,"highcharts-tooltip")||c===b||b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);a.cancelBubble=!0,b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(D(c.series,"click",q(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(q(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&D(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)},b.onmousemove=function(b){a.onContainerMouseMove(b)},b.onclick=function(b){a.onContainerClick(b)},K(b,"mouseleave",a.onContainerMouseLeave),1===ab&&K(y,"mouseup",a.onDocumentMouseUp),$a&&(b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},1===ab&&K(y,"touchend",a.onDocumentTouchEnd))},destroy:function(){var a;W(this.chart.container,"mouseleave",this.onContainerMouseLeave),ab||(W(y,"mouseup",this.onDocumentMouseUp),W(y,"touchend",this.onDocumentTouchEnd)),clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}},q(R.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f),(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,b,c,d,e,f,g,h){var s,m,y,i=this.chart,j=a?"x":"y",k=a?"X":"Y",l="chart"+k,o=a?"width":"height",n=i["plot"+(a?"Left":"Top")],p=h||1,q=i.inverted,x=i.bounds[a?"h":"v"],r=1===b.length,v=b[0][l],u=c[0][l],t=!r&&b[1][l],w=!r&&c[1][l],c=function(){!r&&M(v-t)>20&&(p=h||M(u-w)/M(v-t)),m=(n-u)/p+v,s=i["plot"+(a?"Width":"Height")]/p};c(),b=m,b<x.min?(b=x.min,y=!0):b+s>x.max&&(b=x.max-s,y=!0),y?(u-=.8*(u-g[j][0]),r||(w-=.8*(w-g[j][1])),c()):g[j]=[u,w],q||(f[j]=m-n,f[o]=s),f=q?1/p:p,e[o]=s,e[j]=b,d[q?a?"scaleY":"scaleX":"scale"+k]=p,d["translate"+k]=f*n+(u-f*v)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,e=b.followTouchMove,f=a.touches,g=f.length,h=b.lastValidTouch,i=b.hasZoom,j=b.selectionMarker,k={},l=1===g&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||c.runChartClick),o={};(i||e)&&!l&&a.preventDefault(),Ua(f,function(a){return b.normalize(a)}),"touchstart"===a.type?(p(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,d[1]&&d[1].chartY],p(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,e=a.toPixels(a.dataMin),f=a.toPixels(a.dataMax),g=C(e,f),e=v(e,f);b.min=C(a.pos,g-d),b.max=v(a.pos+a.len,e+d)}})):d.length&&(j||(b.selectionMarker=j=q({destroy:sa},c.plotBox)),b.pinchTranslate(d,f,k,j,o,h),b.hasPinched=i,b.scaleGroups(k,o),!i&&e&&1===g&&this.runPointActions(b.normalize(a)))},onContainerTouchStart:function(a){var b=this.chart;oa=b.index,1===a.touches.length?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):2===a.touches.length&&this.pinch(a)},onContainerTouchMove:function(a){(1===a.touches.length||2===a.touches.length)&&this.pinch(a)},onDocumentTouchEnd:function(a){V[oa]&&V[oa].pointer.drop(a)}}),I.PointerEvent||I.MSPointerEvent){var ua={},zb=!!I.PointerEvent,Wb=function(){var a,b=[];b.item=function(a){return this[a]};for(a in ua)ua.hasOwnProperty(a)&&b.push({pageX:ua[a].pageX,pageY:ua[a].pageY,target:ua[a].target});return b},Ab=function(a,b,c,d){a=a.originalEvent||a,"touch"!==a.pointerType&&a.pointerType!==a.MSPOINTER_TYPE_TOUCH||!V[oa]||(d(a),d=V[oa].pointer,d[b]({type:c,target:a.currentTarget,preventDefault:sa,touches:Wb()}))};q(Wa.prototype,{onContainerPointerDown:function(a){Ab(a,"onContainerTouchStart","touchstart",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){Ab(a,"onContainerTouchMove","touchmove",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY},ua[a.pointerId].target||(ua[a.pointerId].target=a.currentTarget)})},onDocumentPointerUp:function(a){Ab(a,"onContainerTouchEnd","touchend",function(a){delete ua[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,zb?"pointerdown":"MSPointerDown",this.onContainerPointerDown),a(this.chart.container,zb?"pointermove":"MSPointerMove",this.onContainerPointerMove),a(y,zb?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}}),Ma(Wa.prototype,"init",function(a,b,c){a.call(this,b,c),(this.hasZoom||this.followTouchMove)&&G(b.container,{"-ms-touch-action":Q,"touch-action":Q})}),Ma(Wa.prototype,"setDOMEvents",function(a){a.apply(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(K)}),Ma(Wa.prototype,"destroy",function(a){this.batchMSEvents(W),a.call(this)})}var lb=R.Legend=function(a,b){this.init(a,b)};lb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=m(b.padding,8),f=b.itemMarginTop||0;this.options=b,b.enabled&&(c.baseline=z(d.fontSize)+3+f,c.itemStyle=d,c.itemHiddenStyle=w(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.symbolWidth=m(b.symbolWidth,16),c.pages=[],c.render(),K(c.chart,"endResize",function(){c.positionCheckboxes()}))},colorizeItem:function(a,b){var j,c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h};if(d&&d.css({fill:c,color:c}),e&&e.attr({stroke:h}),f){if(g&&f.isMarker)for(j in i.stroke=h,g=a.convertAttribs(g))d=g[j],d!==t&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d),f&&(f.x=e,f.y=d)},destroyItem:function(a){var b=a.checkbox;p(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())}),b&&Pa(a.checkbox)},destroy:function(){var a=this.group,b=this.box;b&&(this.box=b.destroy()),a&&(this.group=a.destroy())},positionCheckboxes:function(a){var c,b=this.group.alignAttr,d=this.clipHeight||this.legendHeight;b&&(c=b.translateY,p(this.allItems,function(e){var g,f=e.checkbox;f&&(g=c+f.y+(a||0)+3,G(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",top:g+"px",display:g>c-6&&c+d-6>g?"":Q}))}))},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;b.text&&(this.title||(this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group)),a=this.title.getBBox(),c=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:c})),this.titleHeight=c},renderItem:function(a){var b=this.chart,c=b.renderer,d=this.options,e="horizontal"===d.layout,f=this.symbolWidth,g=d.symbolPadding,h=this.itemStyle,i=this.itemHiddenStyle,j=this.padding,k=e?m(d.itemDistance,20):0,l=!d.rtl,o=d.width,n=d.itemMarginBottom||0,s=this.itemMarginTop,p=this.initialItemX,q=a.legendItem,r=a.series&&a.series.drawLegendSymbol?a.series:a,x=r.options,x=this.createCheckboxForItem&&x&&x.showCheckbox,t=d.useHTML;q||(a.legendGroup=c.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),r.drawLegendSymbol(this,a),a.legendItem=q=c.text(d.labelFormat?Ia(d.labelFormat,a):d.labelFormatter.call(a),l?f+g:-g,this.baseline,t).css(w(a.visible?h:i)).attr({align:l?"left":"right",zIndex:2}).add(a.legendGroup),this.setItemEvents&&this.setItemEvents(a,q,t,h,i),this.colorizeItem(a,a.visible),x&&this.createCheckboxForItem(a)),c=q.getBBox(),f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||f+g+c.width+k+(x?20:0),this.itemHeight=g=u(a.legendItemHeight||c.height),e&&this.itemX-p+f>(o||b.chartWidth-2*j-p-d.x)&&(this.itemX=p,this.itemY+=s+this.lastLineHeight+n,this.lastLineHeight=0),this.maxItemWidth=v(this.maxItemWidth,f),this.lastItemY=s+this.itemY+n,this.lastLineHeight=v(g,this.lastLineHeight),a._legendItemPos=[this.itemX,this.itemY],e?this.itemX+=f:(this.itemY+=s+g+n,this.lastLineHeight=g),this.offsetWidth=o||v((e?this.itemX-p-k:f)+j,this.offsetWidth)},getAllItems:function(){var a=[];return p(this.chart.series,function(b){var c=b.options;m(c.showInLegend,r(c.linkedTo)?!1:t,!0)&&(a=a.concat(b.legendItems||("point"===c.legendType?b.data:b)))}),a},render:function(){var e,f,g,h,a=this,b=a.chart,c=b.renderer,d=a.group,i=a.box,j=a.options,k=a.padding,l=j.borderWidth,o=j.backgroundColor;a.itemX=a.initialItemX,a.itemY=a.initialItemY,a.offsetWidth=0,a.lastItemY=0,d||(a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup)),a.renderTitle(),e=a.getAllItems(),ob(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)}),j.reversed&&e.reverse(),a.allItems=e,a.display=f=!!e.length,p(e,function(b){a.renderItem(b)}),g=j.width||a.offsetWidth,h=a.lastItemY+a.lastLineHeight+a.titleHeight,h=a.handleOverflow(h),(l||o)&&(g+=k,h+=k,i?g>0&&h>0&&(i[i.isNew?"attr":"animate"](i.crisp({width:g,height:h})),i.isNew=!1):(a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor,"stroke-width":l||0,fill:o||Q}).add(d).shadow(j.shadow),i.isNew=!0),i[f?"show":"hide"]()),a.legendWidth=g,a.legendHeight=h,p(e,function(b){a.positionItem(b)}),f&&d.align(q({width:g,height:h},j),!0,"spacingBox"),b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var h,s,b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+("top"===e.verticalAlign?-f:f)-this.padding,g=e.maxHeight,i=this.clipRect,j=e.navigation,k=m(j.animation,!0),l=j.arrowSize||12,o=this.nav,n=this.pages,q=this.allItems;return"horizontal"===e.layout&&(f/=2),g&&(f=C(f,g)),n.length=0,a>f&&!e.useHTML?(this.clipHeight=h=f-20-this.titleHeight-this.padding,this.currentPage=m(this.currentPage,1),this.fullHeight=a,p(q,function(a,b){var c=a._legendItemPos[1],d=u(a.legendItem.getBBox().height),e=n.length;(!e||c-n[e-1]>h&&(s||c)!==n[e-1])&&(n.push(s||c),e++),b===q.length-1&&c+d-n[e-1]>h&&n.push(c),c!==s&&(s=c)}),i||(i=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(i)),i.attr({height:h}),o||(this.nav=o=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,k)}).add(o),this.pager=d.text("",15,10).css(j.style).add(o),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,k)}).add(o)),b.scroll(0),a=f):o&&(i.attr({height:c.chartHeight}),o.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,h=g.activeColor,g=g.inactiveColor,i=this.pager,j=this.padding;e>d&&(e=d),e>0&&(b!==t&&Qa(b,this.chart),this.nav.attr({translateX:j,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:1===e?g:h}).css({cursor:1===e?"default":"pointer"}),i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c))}},N=R.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||12;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-5-c/2,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var d,b=this.options,c=b.marker;d=a.symbolWidth;var g,e=this.chart.renderer,f=this.legendGroup,a=a.baseline-u(.3*e.fontMetrics(a.options.itemStyle.fontSize).b);b.lineWidth&&(g={"stroke-width":b.lineWidth},b.dashStyle&&(g.dashstyle=b.dashStyle),this.legendLine=e.path(["M",0,a,"L",d,a]).attr(g).add(f)),c&&c.enabled!==!1&&(b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,d/2-b,a-b,2*b,2*b).add(f),d.isMarker=!0)}},(/Trident\/7\.0/.test(wa)||Ta)&&Ma(lb.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d(),setTimeout(d)}),Ya.prototype={init:function(a,b){var c,d=a.series;a.series=null,c=w(E,a),c.series=a.series=d,this.userOptions=a,d=c.chart,this.margin=this.splashArray("margin",d),this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}},this.callback=b,this.isResizing=0,this.options=c,this.axes=[],this.series=[],this.hasCartesianSeries=d.showAxes;var g,f=this;if(f.index=V.length,V.push(f),ab++,d.reflow!==!1&&K(f,"load",function(){f.initReflow()}),e)for(g in e)K(f,g,e[g]);f.xAxis=[],f.yAxis=[],f.animation=fa?!1:m(d.animation,!0),f.pointCount=0,f.counters=new Bb,f.firstRender()},initSeries:function(a){var b=this.options.chart;return(b=F[a.type||b.type||b.defaultSeriesType])||ra(17,!0),b=new b,b.init(this,a),b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&p(this.axes,function(a){a.adjustTickAmount()}),this.maxTicks=null},redraw:function(a){var g,h,b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,i=this.isDirtyBox,j=c.length,k=j,l=this.renderer,o=l.isHidden(),n=[];for(Qa(a,this),o&&this.cloneRenderTo(),this.layOutTitles();k--;)if(a=c[k],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(k=j;k--;)a=c[k],a.options.stacking&&(a.isDirty=!0);p(c,function(a){a.isDirty&&"point"===a.options.legendType&&(f=!0)}),f&&e.options.enabled&&(e.render(),this.isDirtyLegend=!1),g&&this.getStacks(),this.hasCartesianSeries&&(this.isResizing||(this.maxTicks=null,p(b,function(a){a.setScale()})),this.adjustTickAmounts(),this.getMargins(),p(b,function(a){a.isDirty&&(i=!0)}),p(b,function(a){a.isDirtyExtremes&&(a.isDirtyExtremes=!1,n.push(function(){D(a,"afterSetExtremes",q(a.eventArgs,a.getExtremes())),delete a.eventArgs})),(i||g)&&a.redraw()})),i&&this.drawChartBox(),p(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()}),d&&d.reset(!0),l.draw(),D(this,"redraw"),o&&this.cloneRenderTo(!0),p(n,function(a){a.call()})},get:function(a){var d,e,b=this.axes,c=this.series;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++)for(e=c[d].points||[],b=0;b<e.length;b++)if(e[b].id===a)return e[b];return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=qa(b.xAxis||{}),b=b.yAxis=qa(b.yAxis||{});p(c,function(a,b){a.index=b,a.isX=!0}),p(b,function(a,b){a.index=b}),c=c.concat(b),p(c,function(b){new la(a,b)}),a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];return p(this.series,function(b){a=a.concat(vb(b.points||[],function(a){return a.selected}))
4
  }),a},getSelectedSeries:function(){return vb(this.series,function(a){return a.selected})},getStacks:function(){var a=this;p(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&&(a.oldStacks=a.stacks)}),p(a.series,function(b){!b.options.stacking||b.visible!==!0&&a.options.chart.ignoreHiddenSeries!==!1||(b.stackKey=b.type+m(b.options.stack,""))})},setTitle:function(a,b,c){var g,f,d=this,e=d.options;f=e.title=w(e.title,a),g=e.subtitle=w(e.subtitle,b),e=g,p([["title",a,f],["subtitle",b,e]],function(a){var b=a[0],c=d[b],e=a[1],a=a[2];c&&e&&(d[b]=c=c.destroy()),a&&a.text&&!c&&(d[b]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())}),d.layOutTitles(c)},layOutTitles:function(a){var b=0,c=this.title,d=this.subtitle,e=this.options,f=e.title,e=e.subtitle,g=this.spacingBox.width-44;!c||(c.css({width:(f.width||g)+"px"}).align(q({y:15},f),!1,"spacingBox"),f.floating||f.verticalAlign)||(b=c.getBBox().height),d&&(d.css({width:(e.width||g)+"px"}).align(q({y:b+f.margin},e),!1,"spacingBox"),!e.floating&&!e.verticalAlign&&(b=Ka(b+d.getBBox().height))),c=this.titleOffset!==b,this.titleOffset=b,!this.isDirtyBox&&c&&(this.isDirtyBox=c,this.hasRendered&&m(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,c=this.renderToClone||this.renderTo;r(b)||(this.containerWidth=jb(c,"width")),r(a)||(this.containerHeight=jb(c,"height")),this.chartWidth=v(0,b||this.containerWidth||600),this.chartHeight=v(0,m(a,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;a?b&&(this.renderTo.appendChild(c),Pa(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),G(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),y.body.appendChild(b),c&&b.appendChild(c))},getContainer:function(){var a,c,d,e,b=this.options.chart;this.renderTo=a=b.renderTo,e="highcharts-"+tb++,Fa(a)&&(this.renderTo=a=y.getElementById(a)),a||ra(13,!0),c=z(H(a,"data-highcharts-chart")),!isNaN(c)&&V[c]&&V[c].hasRendered&&V[c].destroy(),H(a,"data-highcharts-chart",this.index),a.innerHTML="",!b.skipClone&&!a.offsetWidth&&this.cloneRenderTo(),this.getChartSize(),c=this.chartWidth,d=this.chartHeight,this.container=a=Y(Ja,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},q({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},b.style),this.renderToClone||a),this._cursor=a.style.cursor,this.renderer=b.forExport?new ta(a,c,d,b.style,!0):new Za(a,c,d,b.style),fa&&this.renderer.create(this,a,c,d)},getMargins:function(){var b,a=this.spacing,c=this.legend,d=this.margin,e=this.options.legend,f=m(e.margin,20),g=e.x,h=e.y,i=e.align,j=e.verticalAlign,k=this.titleOffset;this.resetMargins(),b=this.axisOffset,k&&!r(d[0])&&(this.plotTop=v(this.plotTop,k+this.options.title.margin+a[0])),c.display&&!e.floating&&("right"===i?r(d[1])||(this.marginRight=v(this.marginRight,c.legendWidth-g+f+a[1])):"left"===i?r(d[3])||(this.plotLeft=v(this.plotLeft,c.legendWidth+g+f+a[3])):"top"===j?r(d[0])||(this.plotTop=v(this.plotTop,c.legendHeight+h+f+a[0])):"bottom"!==j||r(d[2])||(this.marginBottom=v(this.marginBottom,c.legendHeight-h+f+a[2]))),this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin),this.extraTopMargin&&(this.plotTop+=this.extraTopMargin),this.hasCartesianSeries&&p(this.axes,function(a){a.getOffset()}),r(d[3])||(this.plotLeft+=b[3]),r(d[0])||(this.plotTop+=b[0]),r(d[2])||(this.marginBottom+=b[2]),r(d[1])||(this.marginRight+=b[1]),this.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||jb(d,"width"),f=c.height||jb(d,"height"),c=a?a.target:I,d=function(){b.container&&(b.setSize(e,f,!1),b.hasUserSize=null)};b.hasUserSize||!e||!f||c!==I&&c!==y||((e!==b.containerWidth||f!==b.containerHeight)&&(clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d()),b.containerWidth=e,b.containerHeight=f)},initReflow:function(){var a=this,b=function(b){a.reflow(b)};K(I,"resize",b),K(a,"destroy",function(){W(I,"resize",b)})},setSize:function(a,b,c){var e,f,g,d=this;d.isResizing+=1,g=function(){d&&D(d,"endResize",null,function(){d.isResizing-=1})},Qa(c,d),d.oldChartHeight=d.chartHeight,d.oldChartWidth=d.chartWidth,r(a)&&(d.chartWidth=e=v(0,u(a)),d.hasUserSize=!!e),r(b)&&(d.chartHeight=f=v(0,u(b))),(va?kb:G)(d.container,{width:e+"px",height:f+"px"},va),d.setChartSize(!0),d.renderer.setSize(e,f,c),d.maxTicks=null,p(d.axes,function(a){a.isDirty=!0,a.setScale()}),p(d.series,function(a){a.isDirty=!0}),d.isDirtyLegend=!0,d.isDirtyBox=!0,d.layOutTitles(),d.getMargins(),d.redraw(c),d.oldChartHeight=null,D(d,"resize"),va===!1?g():setTimeout(g,va&&va.duration||500)},setChartSize:function(a){var i,j,k,l,b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset;this.plotLeft=i=u(this.plotLeft),this.plotTop=j=u(this.plotTop),this.plotWidth=k=v(0,u(d-i-this.marginRight)),this.plotHeight=l=v(0,u(e-j-this.marginBottom)),this.plotSizeX=b?l:k,this.plotSizeY=b?k:l,this.plotBorderWidth=f.plotBorderWidth||0,this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]},this.plotBox=c.plotBox={x:i,y:j,width:k,height:l},d=2*T(this.plotBorderWidth/2),b=Ka(v(d,h[3])/2),c=Ka(v(d,h[0])/2),this.clipBox={x:b,y:c,width:T(this.plotSizeX-v(d,h[1])/2-b),height:T(this.plotSizeY-v(d,h[2])/2-c)},a||p(this.axes,function(a){a.setAxisSize(),a.setAxisTranslation()})},resetMargins:function(){var a=this.spacing,b=this.margin;this.plotTop=m(b[0],a[0]),this.marginRight=m(b[1],a[1]),this.marginBottom=m(b[2],a[2]),this.plotLeft=m(b[3],a[3]),this.axisOffset=[0,0,0,0],this.clipOffset=[0,0,0,0]},drawChartBox:function(){var n,a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,o=a.plotBorderWidth||0,s=this.plotLeft,m=this.plotTop,p=this.plotWidth,q=this.plotHeight,r=this.plotBox,v=this.clipRect,u=this.clipBox;n=i+(a.shadow?8:0),(i||j)&&(e?e.animate(e.crisp({width:c-n,height:d-n})):(e={fill:j||Q},i&&(e.stroke=a.borderColor,e["stroke-width"]=i),this.chartBackground=b.rect(n/2,n/2,c-n,d-n,a.borderRadius,i).attr(e).addClass("highcharts-background").add().shadow(a.shadow))),k&&(f?f.animate(r):this.plotBackground=b.rect(s,m,p,q,0).attr({fill:k}).add().shadow(a.plotShadow)),l&&(h?h.animate(r):this.plotBGImage=b.image(l,s,m,p,q).add()),v?v.animate({width:u.width,height:u.height}):this.clipRect=b.clipRect(u),o&&(g?g.animate(g.crisp({x:s,y:m,width:p,height:q})):this.plotBorder=b.rect(s,m,p,q,0,-o).attr({stroke:a.plotBorderColor,"stroke-width":o,fill:Q,zIndex:1}).add()),this.isDirtyBox=!1},propFromSeries:function(){var c,e,f,a=this,b=a.options.chart,d=a.options.series;p(["inverted","angular","polar"],function(g){for(c=F[b.type||b.defaultSeriesType],f=a[g]||b[g]||c&&c.prototype[g],e=d&&d.length;!f&&e--;)(c=F[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;p(b,function(a){a.linkedSeries.length=0}),p(b,function(b){var d=b.options.linkedTo;Fa(d)&&(d=":previous"===d?a.series[b.index-1]:a.get(d))&&(d.linkedSeries.push(b),b.linkedParent=d)})},renderSeries:function(){p(this.series,function(a){a.translate(),a.setTooltipPoints&&a.setTooltipPoints(),a.render()})},render:function(){var g,a=this,b=a.axes,c=a.renderer,d=a.options,e=d.labels,f=d.credits;a.setTitle(),a.legend=new lb(a,d.legend),a.getStacks(),p(b,function(a){a.setScale()}),a.getMargins(),a.maxTicks=null,p(b,function(a){a.setTickPositions(!0),a.setMaxTicks()}),a.adjustTickAmounts(),a.getMargins(),a.drawChartBox(),a.hasCartesianSeries&&p(b,function(a){a.render()}),a.seriesGroup||(a.seriesGroup=c.g("series-group").attr({zIndex:3}).add()),a.renderSeries(),e.items&&p(e.items,function(b){var d=q(e.style,b.style),f=z(d.left)+a.plotLeft,g=z(d.top)+a.plotTop+12;delete d.left,delete d.top,c.text(b.html,f,g).attr({zIndex:2}).css(d).add()}),f.enabled&&!a.credits&&(g=f.href,a.credits=c.text(f.text,0,0).on("click",function(){g&&(location.href=g)}).attr({align:f.position.align,zIndex:8}).css(f.style).add().align(f.position)),a.hasRendered=!0},destroy:function(){var e,a=this,b=a.axes,c=a.series,d=a.container,f=d&&d.parentNode;for(D(a,"destroy"),V[a.index]=t,ab--,a.renderTo.removeAttribute("data-highcharts-chart"),W(a),e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();p("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())}),d&&(d.innerHTML="",W(d),f&&Pa(d));for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!aa&&I==I.top&&"complete"!==y.readyState||fa&&!I.canvg?(fa?Lb.push(function(){a.firstRender()},a.options.global.canvasToolsURL):y.attachEvent("onreadystatechange",function(){y.detachEvent("onreadystatechange",a.firstRender),"complete"===y.readyState&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;a.isReadyToRender()&&(a.getContainer(),D(a,"init"),a.resetMargins(),a.setChartSize(),a.propFromSeries(),a.getAxes(),p(b.series||[],function(b){a.initSeries(b)}),a.linkSeries(),D(a,"beforeRender"),R.Pointer&&(a.pointer=new Wa(a,b)),a.render(),a.renderer.draw(),c&&c.apply(a,[a]),p(a.callbacks,function(b){b.apply(a,[a])}),a.cloneRenderTo(!0),D(a,"load"))},splashArray:function(a,b){var c=b[a],c=ca(c)?c:[c,c,c,c];return[m(b[a+"Top"],c[0]),m(b[a+"Right"],c[1]),m(b[a+"Bottom"],c[2]),m(b[a+"Left"],c[3])]}},Ya.prototype.callbacks=[],X=R.CenteredSeriesMixin={getCenter:function(){var d,h,a=this.options,b=this.chart,c=2*(a.slicedOffset||0),e=b.plotWidth-2*c,f=b.plotHeight-2*c,b=a.center,a=[m(b[0],"50%"),m(b[1],"50%"),a.size||"100%",a.innerSize||0],g=C(e,f);return Ua(a,function(a,b){return h=/%$/.test(a),d=2>b||2===b&&h,(h?[e,f,g,g][b]*z(a)/100:a)+(d?c:0)})}};var Ea=function(){};Ea.prototype={init:function(a,b,c){return this.series=a,this.applyOptions(b,c),this.pointAttr={},a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length)&&(a.colorCounter=0),a.chart.pointCount++,this},applyOptions:function(a,b){var c=this.series,d=c.pointValKey,a=Ea.prototype.optionsToObject.call(this,a);return q(this,a),this.options=this.options?q(this.options,a):a,d&&(this.y=this[d]),this.x===t&&c&&(this.x=b===t?c.autoIncrement():b),this},optionsToObject:function(a){var b={},c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if("number"==typeof a||null===a)b[d[0]]=a;else if(La(a))for(a.length>e&&(c=typeof a[0],"string"===c?b.name=a[0]:"number"===c&&(b.x=a[0]),f++);e>g;)b[d[g++]]=a[f++];else"object"==typeof a&&(b=a,a.dataLabels&&(c._hasPointLabels=!0),a.marker&&(c._hasPointMarkers=!0));return b},destroy:function(){var c,a=this.series.chart,b=a.hoverPoints;a.pointCount--,b&&(this.setState(),ja(b,this),!b.length)&&(a.hoverPoints=null),this===a.hoverPoint&&this.onMouseOut(),(this.graphic||this.dataLabel)&&(W(this),this.destroyElements()),this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=null},destroyElements:function(){for(var b,a="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=this.series,c=b.tooltipOptions,d=m(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||"";return p(b.pointArrayMap||["y"],function(b){b="{point."+b,(e||f)&&(a=a.replace(b+"}",e+b+"}"+f)),a=a.replace(b+"}",b+":,."+d+"f}")}),Ia(a,{point:this,series:this.series})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&this.importEvents(),"click"===a&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)}),D(this,a,b,c)}};var O=function(){};O.prototype={isCartesian:!0,type:"line",pointClass:Ea,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(a,b){var d,e,c=this,f=a.series,g=function(a,b){return m(a.options.index,a._i)-m(b.options.index,b._i)};c.chart=a,c.options=b=c.setOptions(b),c.linkedSeries=[],c.bindAxes(),q(c,{name:b.name,state:"",pointAttr:{},visible:b.visible!==!1,selected:b.selected===!0}),fa&&(b.animation=!1),e=b.events;for(d in e)K(c,d,e[d]);(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)&&(a.runTrackerClick=!0),c.getColor(),c.getSymbol(),p(c.parallelArrays,function(a){c[a+"Data"]=[]}),c.setData(b.data,!1),c.isCartesian&&(a.hasCartesianSeries=!0),f.push(c),c._i=f.length-1,ob(f,g),this.yAxis&&ob(this.yAxis.series,g),p(f,function(a,b){a.index=b,a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var d,a=this,b=a.options,c=a.chart;p(a.axisTypes||[],function(e){p(c[e],function(c){d=c.options,(b[e]===d.index||b[e]!==t&&b[e]===d.id||b[e]===t&&0===d.index)&&(c.series.push(a),a[e]=c,c.isDirty=!0)}),!a[e]&&a.optionalAxis!==e&&ra(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments;p(c.parallelArrays,"number"==typeof b?function(d){var f="y"===d&&c.toYData?c.toYData(a):a[d];c[d+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))})},autoIncrement:function(){var a=this.options,b=this.xIncrement,b=m(b,a.pointStart,0);return this.pointInterval=m(this.pointInterval,a.pointInterval,1),this.xIncrement=b+this.pointInterval,b},getSegments:function(){var c,a=-1,b=[],d=this.points,e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)null===d[c].y&&d.splice(c,1);d.length&&(b=[d])}else p(d,function(c,g){null===c.y?(g>a+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];return this.userOptions=a,c=w(e,c.series,a),this.tooltipOptions=w(E.tooltip,E.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&d[this.type].tooltip,a.tooltip),null===e.marker&&delete c.marker,c},getColor:function(){var e,a=this.options,b=this.userOptions,c=this.chart.options.colors,d=this.chart.counters;e=a.color||ba[this.type].color,e||a.colorByPoint||(r(b._colorIndex)?a=b._colorIndex:(b._colorIndex=d.color,a=d.color++),e=c[a]),this.color=e,d.wrapColor(c.length)},getSymbol:function(){var a=this.userOptions,b=this.options.marker,c=this.chart,d=c.options.symbols,c=c.counters;this.symbol=b.symbol,this.symbol||(r(a._symbolIndex)?a=a._symbolIndex:(a._symbolIndex=c.symbol,a=c.symbol++),this.symbol=d[a]),/^url/.test(this.symbol)&&(b.radius=0),c.wrapSymbol(d.length)},drawLegendSymbol:N.drawLineMarker,setData:function(a,b,c,d){var h,e=this,f=e.points,g=f&&f.length||0,i=e.options,j=e.chart,k=null,l=e.xAxis,o=l&&!!l.categories,n=e.tooltipPoints,s=i.turboThreshold,q=this.xData,r=this.yData,v=(h=e.pointArrayMap)&&h.length,a=a||[];if(h=a.length,b=m(b,!0),d===!1||!h||g!==h||e.cropped||e.hasGroupedData){if(e.xIncrement=null,e.pointRange=o?1:i.pointRange,e.colorCounter=0,p(this.parallelArrays,function(a){e[a+"Data"].length=0}),s&&h>s){for(c=0;null===k&&h>c;)k=a[c],c++;if(ha(k)){for(o=m(i.pointStart,0),i=m(i.pointInterval,1),c=0;h>c;c++)q[c]=o,r[c]=a[c],o+=i;e.xIncrement=o}else if(La(k))if(v)for(c=0;h>c;c++)i=a[c],q[c]=i[0],r[c]=i.slice(1,v+1);else for(c=0;h>c;c++)i=a[c],q[c]=i[0],r[c]=i[1];else ra(12)}else for(c=0;h>c;c++)a[c]!==t&&(i={series:e},e.pointClass.prototype.applyOptions.apply(i,[a[c]]),e.updateParallelArrays(i,c),o&&i.name)&&(l.names[i.x]=i.name);for(Fa(r[0])&&ra(14,!0),e.data=[],e.options.data=a,c=g;c--;)f[c]&&f[c].destroy&&f[c].destroy();n&&(n.length=0),l&&(l.minRange=l.userMinRange),e.isDirty=e.isDirtyData=j.isDirtyBox=!0,c=!1}else p(a,function(a,b){f[b].update(a,!1)});b&&j.redraw(c)},processData:function(a){var e,b=this.xData,c=this.yData,d=b.length;e=0;var f,g,o,n,h=this.xAxis,i=this.options,j=i.cropThreshold,k=0,l=this.isCartesian;if(l&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;for(l&&this.sorted&&(!j||d>j||this.forceCrop)&&(o=h.min,n=h.max,b[d-1]<o||b[0]>n?(b=[],c=[]):(b[0]<o||b[d-1]>n)&&(e=this.cropData(this.xData,this.yData,o,n),b=e.xData,c=e.yData,e=e.start,f=!0,k=b.length)),d=b.length-1;d>=0;d--)a=b[d]-b[d-1],!f&&b[d]>o&&b[d]<n&&k++,a>0&&(g===t||g>a)?g=a:0>a&&this.requireSorting&&ra(15);this.cropped=f,this.cropStart=e,this.processedXData=b,this.processedYData=c,this.activePointCount=k,null===i.pointRange&&(this.pointRange=g||1),this.closestPointRange=g},cropData:function(a,b,c,d){var i,e=a.length,f=0,g=e,h=m(this.cropShoulder,1);for(i=0;e>i;i++)if(a[i]>=c){f=v(0,i-h);break}for(;e>i;i++)if(a[i]>d){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var c,i,k,o,a=this.options.data,b=this.data,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,j=this.hasGroupedData,l=[];for(b||j||(b=[],b.length=a.length,b=this.data=b),o=0;g>o;o++)i=h+o,j?l[o]=(new f).init(this,[d[o]].concat(qa(e[o]))):(b[i]?k=b[i]:a[i]!==t&&(b[i]=k=(new f).init(this,a[i],d[o])),l[o]=k);if(b&&(g!==(c=b.length)||j))for(o=0;c>o;o++)o===h&&!j&&(o+=g),b[o]&&(b[o].destroyElements(),b[o].plotX=t);this.data=b,this.points=l},getExtremes:function(a){var d,b=this.yAxis,c=this.processedXData,e=[],f=0;d=this.xAxis.getExtremes();var i,j,k,l,g=d.min,h=d.max,a=a||this.stackedYData||this.processedYData;for(d=a.length,l=0;d>l;l++)if(j=c[l],k=a[l],i=null!==k&&k!==t&&(!b.isLog||k.length||k>0),j=this.getExtremesFromAll||this.cropped||(c[l+1]||j)>=g&&(c[l-1]||j)<=h,i&&j)if(i=k.length)for(;i--;)null!==k[i]&&(e[f++]=k[i]);else e[f++]=k;this.dataMin=m(void 0,Na(e)),this.dataMax=m(void 0,Ba(e))},translate:function(){this.processedXData||this.processData(),this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j="between"===i||ha(i),k=a.threshold,a=0;g>a;a++){var l=f[a],o=l.x,n=l.y,s=l.low,p=b&&e.stacks[(this.negStacks&&k>n?"-":"")+this.stackKey];e.isLog&&0>=n&&(l.y=n=null),l.plotX=c.translate(o,0,0,0,1,i,"flags"===this.type),b&&this.visible&&p&&p[o]&&(p=p[o],n=p.points[this.index+","+a],s=n[0],n=n[1],0===s&&(s=m(k,e.min)),e.isLog&&0>=s&&(s=null),l.total=l.stackTotal=p.total,l.percentage=p.total&&l.y/p.total*100,l.stackY=n,p.setOffset(this.pointXOffset||0,this.barW||0)),l.yBottom=r(s)?e.translate(s,0,1,0,1):null,h&&(n=this.modifyValue(n,l)),l.plotY="number"==typeof n&&1/0!==n?e.translate(n,0,1,0,1):t,l.clientX=j?c.translate(o,0,0,0,1):l.plotX,l.negative=l.y<(k||0),l.category=d&&d[l.x]!==t?d[l.x]:l.x}this.getSegments()},animate:function(a){var d,b=this.chart,c=b.renderer;d=this.options.animation;var g,e=this.clipBox||b.clipBox,f=b.inverted;d&&!ca(d)&&(d=ba[this.type].animation),g=["_sharedClip",d.duration,d.easing,e.height].join(","),a?(a=b[g],d=b[g+"m"],a||(b[g]=a=c.clipRect(q(e,{width:0})),b[g+"m"]=d=c.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),this.group.clip(a),this.markerGroup.clip(d),this.sharedClipKey=g):((a=b[g])&&a.animate({width:b.plotSizeX},d),b[g+"m"]&&b[g+"m"].animate({width:b.plotSizeX+99},d),this.animate=null)},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,c=this.group,d=this.clipBox;c&&this.options.clip!==!1&&(b&&d||c.clip(d?a.renderer.clipRect(d):a.clipRect),this.markerGroup.clip()),D(this,"afterAnimate"),setTimeout(function(){b&&a[b]&&(d||(a[b]=a[b].destroy()),a[b+"m"]&&(a[b+"m"]=a[b+"m"].destroy()))},100)},drawPoints:function(){var a,d,e,f,g,h,i,j,k,b=this.points,c=this.chart;d=this.options.marker;var o,l=this.pointAttr[""],n=this.markerGroup,s=m(d.enabled,this.activePointCount<.5*this.xAxis.len/d.radius);if(d.enabled!==!1||this._hasPointMarkers)for(f=b.length;f--;)g=b[f],d=T(g.plotX),e=g.plotY,k=g.graphic,i=g.marker||{},a=s&&i.enabled===t||i.enabled,o=c.isInsidePlot(u(d),e,c.inverted),a&&e!==t&&!isNaN(e)&&null!==g.y?(a=g.pointAttr[g.selected?"select":""]||l,h=a.r,i=m(i.symbol,this.symbol),j=0===i.indexOf("url"),k?k[o?"show":"hide"](!0).animate(q({x:d-h,y:e-h},k.symbolName?{width:2*h,height:2*h}:{})):o&&(h>0||j)&&(g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h).attr(a).add(n))):k&&(g.graphic=k.destroy())},convertAttribs:function(a,b,c,d){var f,g,e=this.pointAttrToOptions,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=m(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var f,a=this,b=a.options,c=ba[a.type].marker?b.marker:b,d=c.states,e=d.hover,g=a.color;f={stroke:g,fill:g};var i,k,h=a.points||[],j=[],l=a.pointAttrToOptions;k=a.hasPointSpecificOptions;var o=b.negativeColor,n=c.lineColor,s=c.fillColor;i=b.turboThreshold;var m;if(b.marker?(e.radius=e.radius||c.radius+2,e.lineWidth=e.lineWidth||c.lineWidth+1):e.color=e.color||ya(e.color||g).brighten(e.brightness).get(),j[""]=a.convertAttribs(c,f),p(["hover","select"],function(b){j[b]=a.convertAttribs(d[b],j[""])}),a.pointAttr=j,g=h.length,!i||i>g||k)for(;g--;){if(i=h[g],(c=i.options&&i.options.marker||i.options)&&c.enabled===!1&&(c.radius=0),i.negative&&o&&(i.color=i.fillColor=o),k=b.colorByPoint||i.color,i.options)for(m in l)r(c[l[m]])&&(k=!0);k?(c=c||{},k=[],d=c.states||{},f=d.hover=d.hover||{},b.marker||(f.color=f.color||!i.options.color&&e.color||ya(i.color).brighten(f.brightness||e.brightness).get()),f={color:i.color},s||(f.fillColor=i.color),n||(f.lineColor=i.color),k[""]=a.convertAttribs(q(f,c),j[""]),k.hover=a.convertAttribs(d.hover,j.hover,k[""]),k.select=a.convertAttribs(d.select,j.select,k[""])):k=j,i.pointAttr=k}},destroy:function(){var d,e,g,h,i,a=this,b=a.chart,c=/AppleWebKit\/533/.test(wa),f=a.data||[];for(D(a,"destroy"),W(a),p(a.axisTypes||[],function(b){(i=a[b])&&(ja(i.series,a),i.isDirty=i.forceRedraw=!0)}),a.legendItem&&a.chart.legend.destroyItem(a),e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null,clearTimeout(a.animationTimeout),p("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(b){a[b]&&(d=c&&"group"===b?"hide":"destroy",a[b][d]())}),b.hoverSeries===a&&(b.hoverSeries=null),ja(b.series,a);for(h in a)delete a[h]},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;return p(a,function(e,f){var i,g=e.plotX,h=e.plotY;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],"right"===d?c.push(i.plotX,h):"center"===d?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))}),c},getGraphPath:function(){var c,a=this,b=[],d=[];return p(a.segments,function(e){c=a.getSegmentPath(e),e.length>1?b=b.concat(c):d.push(e[0])}),a.singlePoints=d,a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f="square"!==b.linecap,g=this.getGraphPath(),h=b.negativeColor;h&&c.push(["graphNeg",h]),p(c,function(c,h){var k=c[0],l=a[k];l?(bb(l),l.animate({d:g})):d&&g.length&&(l={stroke:c[1],"stroke-width":d,fill:Q,zIndex:1},e?l.dashstyle=e:f&&(l["stroke-linecap"]=l["stroke-linejoin"]="round"),a[k]=a.chart.renderer.path(g).attr(l).add(a.group).shadow(!h&&b.shadow))})},clipNeg:function(){var e,a=this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,f=this.graph,g=this.area,h=this.posClip,i=this.negClip;e=b.chartWidth;var j=b.chartHeight,k=v(e,j),l=this.yAxis;d&&(f||g)&&(d=u(l.toPixels(a.threshold||0,!0)),0>d&&(k-=d),a={x:0,y:0,width:k,height:d},k={x:0,y:d,width:k,height:k},b.inverted&&(a.height=k.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth-d-b.plotLeft,y:0,width:e,height:j},k={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e})),l.reversed?(b=k,e=a):(b=a,e=k),h?(h.animate(b),i.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=i=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(i)),g&&(g.clip(h),this.areaNeg.clip(i))))},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};p(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;b.xAxis&&(K(c,"resize",a),K(b,"destroy",function(){W(c,"resize",a)}),a(),b.invertGroups=a)},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;return g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||.1}).add(e)),f[g?"attr":"animate"](this.getPlotBox()),f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;return a.inverted&&(b=c,c=this.xAxis),{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var c,a=this,b=a.chart,d=a.options,e=(c=d.animation)&&!!a.animate&&b.renderer.isSVG&&m(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,h=a.hasRendered,i=b.seriesGroup;c=a.plotGroup("group","series",f,g,i),a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i),e&&a.animate(!0),a.getAttribs(),c.inverted=a.isCartesian?b.inverted:!1,a.drawGraph&&(a.drawGraph(),a.clipNeg()),a.drawDataLabels&&a.drawDataLabels(),a.visible&&a.drawPoints(),a.drawTracker&&a.options.enableMouseTracking!==!1&&a.drawTracker(),b.inverted&&a.invertGroups(),d.clip!==!1&&!a.sharedClipKey&&!h&&c.clip(b.clipRect),e&&a.animate(),h||(e?a.animationTimeout=setTimeout(function(){a.afterAnimate()},e):a.afterAnimate()),a.isDirty=a.isDirtyData=!1,a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:m(d&&d.left,a.plotLeft),translateY:m(e&&e.top,a.plotTop)})),this.translate(),this.setTooltipPoints&&this.setTooltipPoints(!0),this.render(),b&&D(this,"updatedData")}},Hb.prototype={destroy:function(){Oa(this,this.axis)},render:function(a){var b=this.options,c=b.format,c=c?Ia(c,this):b.formatter.call(this);this.label?this.label.attr({text:c,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(c,null,null,b.useHTML).css(b.style).attr({align:this.textAlign,rotation:b.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,b){var c=this.axis,d=c.chart,e=d.inverted,f=this.isNegative,g=c.translate(c.usePercentage?100:this.total,0,0,0,1),c=c.translate(0),c=M(g-c),h=d.xAxis[0].translate(this.x)+a,i=d.plotHeight,f={x:e?f?g:g-c:h,y:e?i-h-b:f?i-g-c:i-g,width:e?c:b,height:e?b:c};(e=this.label)&&(e.align(this.alignOptions,null,f),f=e.alignAttr,e[this.options.crop===!1||d.isInsidePlot(f.x,f.y)?"show":"hide"](!0))}},la.prototype.buildStacks=function(){var a=this.series,b=m(this.options.reversedStacks,!0),c=a.length;if(!this.isXAxis){for(this.usePercentage=!1;c--;)a[b?c:a.length-c-1].setStackedPoints();if(this.usePercentage)for(c=0;c<a.length;c++)a[c].setPercentStacks()}},la.prototype.renderStackTotals=function(){var d,e,a=this.chart,b=a.renderer,c=this.stacks,f=this.stackTotalGroup;f||(this.stackTotalGroup=f=b.g("stack-labels").attr({visibility:"visible",zIndex:6}).add()),f.translate(a.plotLeft,a.plotTop);for(d in c)for(e in a=c[d])a[e].render(f)},O.prototype.setStackedPoints=function(){if(this.options.stacking&&(this.visible===!0||this.chart.options.chart.ignoreHiddenSeries===!1)){var n,m,p,q,r,u,a=this.processedXData,b=this.processedYData,c=[],d=b.length,e=this.options,f=e.threshold,g=e.stack,e=e.stacking,h=this.stackKey,i="-"+h,j=this.negStacks,k=this.yAxis,l=k.stacks,o=k.oldStacks;for(q=0;d>q;q++)r=a[q],u=b[q],p=this.index+","+q,m=(n=j&&f>u)?i:h,l[m]||(l[m]={}),l[m][r]||(o[m]&&o[m][r]?(l[m][r]=o[m][r],l[m][r].total=null):l[m][r]=new Hb(k,k.options.stackLabels,n,r,g)),m=l[m][r],m.points[p]=[m.cum||0],"percent"===e?(n=n?h:i,j&&l[n]&&l[n][r]?(n=l[n][r],m.total=n.total=v(n.total,m.total)+M(u)||0):m.total=da(m.total+(M(u)||0))):m.total=da(m.total+(u||0)),m.cum=(m.cum||0)+(u||0),m.points[p].push(m.cum),c[q]=m.cum;"percent"===e&&(k.usePercentage=!0),this.stackedYData=c,k.oldStacks={}}},O.prototype.setPercentStacks=function(){var a=this,b=a.stackKey,c=a.yAxis.stacks,d=a.processedXData;p([b,"-"+b],function(b){for(var e,g,h,f=d.length;f--;)g=d[f],e=(h=c[b]&&c[b][g])&&h.points[a.index+","+f],(g=e)&&(h=h.total?100/h.total:0,g[0]=da(g[0]*h),g[1]=da(g[1]*h),a.stackedYData[f]=g[1])})},q(Ya.prototype,{addSeries:function(a,b,c){var d,e=this;return a&&(b=m(b,!0),D(e,"addSeries",{options:a},function(){d=e.initSeries(a),e.isDirtyLegend=!0,e.linkSeries(),b&&e.redraw(c)})),d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new la(this,w(a,{index:this[e].length,isX:b})),f[e]=qa(f[e]||{}),f[e].push(a),m(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this.options,c=this.loadingDiv,d=b.loading;c||(this.loadingDiv=c=Y(Ja,{className:"highcharts-loading"},q(d.style,{zIndex:10,display:Q}),this.container),this.loadingSpan=Y("span",null,d.labelStyle,c)),this.loadingSpan.innerHTML=a||b.lang.loading,this.loadingShown||(G(c,{opacity:0,display:"",left:this.plotLeft+"px",top:this.plotTop+"px",width:this.plotWidth+"px",height:this.plotHeight+"px"}),kb(c,{opacity:d.style.opacity},{duration:d.showDuration||0}),this.loadingShown=!0)},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&kb(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){G(b,{display:Q})}}),this.loadingShown=!1}}),q(Ea.prototype,{update:function(a,b,c){var g,d=this,e=d.series,f=d.graphic,h=e.data,i=e.chart,j=e.options,b=m(b,!0);d.firePointEvent("update",{options:a},function(){d.applyOptions(a),ca(a)&&(e.getAttribs(),f&&(a&&a.marker&&a.marker.symbol?d.graphic=f.destroy():f.attr(d.pointAttr[d.state||""])),a&&a.dataLabels&&d.dataLabel&&(d.dataLabel=d.dataLabel.destroy())),g=Da(d,h),e.updateParallelArrays(d,g),j.data[g]=d.options,e.isDirty=e.isDirtyData=!0,!e.fixedBox&&e.hasCartesianSeries&&(i.isDirtyBox=!0),"point"===j.legendType&&i.legend.destroyItem(d),b&&i.redraw(c)})},remove:function(a,b){var g,c=this,d=c.series,e=d.points,f=d.chart,h=d.data;Qa(b,f),a=m(a,!0),c.firePointEvent("remove",null,function(){g=Da(c,h),h.length===e.length&&e.splice(g,1),h.splice(g,1),d.options.data.splice(g,1),d.updateParallelArrays(c,"splice",g,1),c.destroy(),d.isDirty=!0,d.isDirtyData=!0,a&&f.redraw()})}}),q(O.prototype,{addPoint:function(a,b,c,d){var o,e=this.options,f=this.data,g=this.graph,h=this.area,i=this.chart,j=this.xAxis&&this.xAxis.names,k=g&&g.shift||0,l=e.data,n=this.xData;if(Qa(d,i),c&&p([g,h,this.graphNeg,this.areaNeg],function(a){a&&(a.shift=k+1)}),h&&(h.isArea=!0),b=m(b,!0),d={series:this},this.pointClass.prototype.applyOptions.apply(d,[a]),g=d.x,h=n.length,this.requireSorting&&g<n[h-1])for(o=!0;h&&n[h-1]>g;)h--;this.updateParallelArrays(d,"splice",h,0,0),this.updateParallelArrays(d,h),j&&(j[g]=d.name),l.splice(h,0,a),o&&(this.data.splice(h,0,null),this.processData()),"point"===e.legendType&&this.generatePoints(),c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(d,"shift"),l.shift())),this.isDirtyData=this.isDirty=!0,b&&(this.getAttribs(),i.redraw())},remove:function(a,b){var c=this,d=c.chart,a=m(a,!0);c.isRemoving||(c.isRemoving=!0,D(c,"remove",null,function(){c.destroy(),d.isDirtyLegend=d.isDirtyBox=!0,d.linkSeries(),a&&d.redraw(b)})),c.isRemoving=!1},update:function(a,b){var f,c=this.chart,d=this.type,e=F[d].prototype,a=w(this.userOptions,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1);for(f in e)e.hasOwnProperty(f)&&(this[f]=t);q(this,F[a.type||d].prototype),this.init(c,a),m(b,!0)&&c.redraw(!1)}}),q(la.prototype,{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=w(this.userOptions,a);
5
+ this.destroy(!0),this._addedPlotLB=t,this.init(c,q(a,{events:t})),c.isDirtyBox=!0,m(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);ja(b.axes,this),ja(b[c],this),b.options[c].splice(this.options.index,1),p(b[c],function(a,b){a.options.index=b}),this.destroy(),b.isDirtyBox=!0,m(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}}),ga=ka(O),F.line=ga,ba.area=w(S,{threshold:0});var pa=ka(O,{type:"area",getSegments:function(){var h,i,l,o,n,a=[],b=[],c=[],d=this.xAxis,e=this.yAxis,f=e.stacks[this.stackKey],g={},j=this.points,k=this.options.connectNulls;if(this.options.stacking&&!this.cropped){for(o=0;o<j.length;o++)g[j[o].x]=j[o];for(n in f)null!==f[n].total&&c.push(+n);c.sort(function(a,b){return a-b}),p(c,function(a){(!k||g[a]&&null!==g[a].y)&&(g[a]?b.push(g[a]):(h=d.translate(a),l=f[a].percent?f[a].total?100*f[a].cum/f[a].total:0:f[a].cum,i=e.toPixels(l,!0),b.push({y:null,plotX:h,clientX:h,plotY:i,yBottom:i,onMouseOver:sa})))}),b.length&&a.push(b)}else O.prototype.getSegments.call(this),a=this.segments;this.segments=a},getSegmentPath:function(a){var d,b=O.prototype.getSegmentPath.call(this,a),c=[].concat(b),e=this.options;d=b.length;var g,f=this.yAxis.getThreshold(e.threshold);if(3===d&&c.push("L",b[1],b[2]),e.stacking&&!this.closedStacks)for(d=a.length-1;d>=0;d--)g=m(a[d].yBottom,f),d<a.length-1&&e.step&&c.push(a[d+1].plotX,g),c.push(a[d].plotX,g);else this.closeSegment(c,a,f);return this.areaPath=this.areaPath.concat(c),b},closeSegment:function(a,b,c){a.push("L",b[b.length-1].plotX,c,"L",b[0].plotX,c)},drawGraph:function(){this.areaPath=[],O.prototype.drawGraph.apply(this);var a=this,b=this.areaPath,c=this.options,d=c.negativeColor,e=c.negativeFillColor,f=[["area",this.color,c.fillColor]];(d||e)&&f.push(["areaNeg",d,e]),p(f,function(d){var e=d[0],f=a[e];f?f.animate({d:b}):a[e]=a.chart.renderer.path(b).attr({fill:m(d[2],ya(d[1]).setOpacity(m(c.fillOpacity,.75)).get()),zIndex:0}).add(a.group)})},drawLegendSymbol:N.drawRectangle});F.area=pa,ba.spline=w(S),ga=ka(O,{type:"spline",getPointSpline:function(a,b,c){var h,i,j,k,d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1];if(f&&g){a=f.plotY,j=g.plotX;var l,g=g.plotY;h=(1.5*d+f.plotX)/2.5,i=(1.5*e+a)/2.5,j=(1.5*d+j)/2.5,k=(1.5*e+g)/2.5,l=(k-i)*(j-d)/(j-h)+e-k,i+=l,k+=l,i>a&&i>e?(i=v(a,e),k=2*e-i):a>i&&e>i&&(i=C(a,e),k=2*e-i),k>g&&k>e?(k=v(g,e),i=2*e-k):g>k&&e>k&&(k=C(g,e),i=2*e-k),b.rightContX=j,b.rightContY=k}return c?(b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e],f.rightContX=f.rightContY=null):b=["M",d,e],b}}),F.spline=ga,ba.areaspline=w(ba.area),pa=pa.prototype,ga=ka(ga,{type:"areaspline",closedStacks:!0,getSegmentPath:pa.getSegmentPath,closeSegment:pa.closeSegment,drawGraph:pa.drawGraph,drawLegendSymbol:N.drawRectangle}),F.areaspline=ga,ba.column=w(S,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},threshold:0}),ga=ka(O,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){O.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){b.type===a.type&&(b.isDirty=!0)})},getColumnMetrics:function(){var f,h,a=this,b=a.options,c=a.xAxis,d=a.yAxis,e=c.reversed,g={},i=0;b.grouping===!1?i=1:p(a.chart.series,function(b){var c=b.options,e=b.yAxis;b.type===a.type&&b.visible&&d.len===e.len&&d.pos===e.pos&&(c.stacking?(f=b.stackKey,g[f]===t&&(g[f]=i++),h=g[f]):c.grouping!==!1&&(h=i++),b.columnIndex=h)});var c=C(M(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||c.tickInterval||1),c.len),j=c*b.groupPadding,k=(c-2*j)/i,l=b.pointWidth,b=r(l)?(k-l)/2:k*b.pointPadding,l=m(l,k-2*b);return a.columnMetrics={width:l,offset:b+(j+((e?i-(a.columnIndex||0):a.columnIndex)||0)*k-c/2)*(e?-1:1)}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.borderWidth=m(c.borderWidth,a.activePointCount>.5*a.xAxis.len?0:1),e=a.yAxis,f=a.translatedThreshold=e.getThreshold(c.threshold),g=m(c.minPointLength,5),c=a.getColumnMetrics(),h=c.width,i=a.barW=Ka(v(h,1+2*d)),j=a.pointXOffset=c.offset,k=-(d%2?.5:0),l=d%2?.5:1;b.renderer.isVML&&b.inverted&&(l+=1),O.prototype.translate.apply(a),p(a.points,function(c){var x,d=m(c.yBottom,f),p=C(v(-999-d,c.plotY),e.len+999+d),q=c.plotX+j,r=i,t=C(p,d);x=v(p,d)-t,M(x)<g&&g&&(x=g,t=u(M(t-f)>g?d-g:f-(e.translate(c.y,0,1,0,1)<=f?g:0))),c.barX=q,c.pointWidth=h,c.tooltipPos=b.inverted?[e.len-p,a.xAxis.len-q-r/2]:[q+r/2,p],d=M(q)<.5,r=u(q+r)+k,q=u(q)+k,r-=q,p=M(t)<.5,x=u(t+x)+l,t=u(t)+l,x-=t,d&&(q+=1,r-=1),p&&(t-=1,x+=1),c.shapeType="rect",c.shapeArgs={x:q,y:t,width:r,height:x}})},getSymbol:sa,drawLegendSymbol:N.drawRectangle,drawGraph:sa,drawPoints:function(){var f,g,h,a=this,b=this.chart,c=a.options,d=b.renderer,e=c.animationLimit||250;p(a.points,function(i){var j=i.plotY,k=i.graphic;j===t||isNaN(j)||null===i.y?k&&(i.graphic=k.destroy()):(f=i.shapeArgs,h=r(a.borderWidth)?{"stroke-width":a.borderWidth}:{},g=i.pointAttr[i.selected?"select":""]||a.pointAttr[""],k?(bb(k),k.attr(h)[b.pointCount<e?"animate":"attr"](w(f))):i.graphic=d[i.shapeType](f).attr(g).attr(h).add(a.group).shadow(c.shadow,null,c.stacking&&!c.borderRadius))})},animate:function(a){var b=this.yAxis,c=this.options,d=this.chart.inverted,e={};aa&&(a?(e.scaleY=.001,a=C(b.pos+b.len,v(b.pos,b.toPixels(c.threshold))),d?e.translateX=a-b.len:e.translateY=a,this.group.attr(e)):(e.scaleY=1,e[d?"translateX":"translateY"]=b.pos,this.group.animate(e,this.options.animation),this.animate=null))},remove:function(){var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){b.type===a.type&&(b.isDirty=!0)}),O.prototype.remove.apply(a,arguments)}}),F.column=ga,ba.bar=w(ba.column),pa=ka(ga,{type:"bar",inverted:!0}),F.bar=pa,ba.scatter=w(S,{lineWidth:0,tooltip:{headerFormat:'<span style="color:{series.color}">●</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"},stickyTracking:!1}),pa=ka(O,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&O.prototype.drawGraph.call(this)}}),F.scatter=pa,ba.pie=w(S,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}}),S={type:"pie",isCartesian:!1,pointClass:ka(Ea,{init:function(){Ea.prototype.init.apply(this,arguments);var b,a=this;return a.y<0&&(a.y=null),q(a,{visible:a.visible!==!1,name:m(a.name,"Slice")}),b=function(b){a.slice("select"===b.type)},K(a,"select",b),K(a,"unselect",b),a},setVisible:function(a){var b=this,c=b.series,d=c.chart;b.visible=b.options.visible=a=a===t?!b.visible:a,c.options.data[Da(b,c.data)]=b.options,p(["graphic","dataLabel","connector","shadowGroup"],function(c){b[c]&&b[c][a?"show":"hide"](!0)}),b.legendItem&&d.legend.colorizeItem(b,a),!c.isDirty&&c.options.ignoreHiddenPoint&&(c.isDirty=!0,d.redraw())},slice:function(a,b,c){var d=this.series;Qa(c,d.chart),m(b,!0),this.sliced=this.options.sliced=a=r(a)?a:!this.sliced,d.options.data[Da(this,d.data)]=this.options,a=a?this.slicedTranslation:{translateX:0,translateY:0},this.graphic.animate(a),this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=this.shapeArgs,c=this.series.chart;return this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:sa,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;a||(p(c,function(a){var c=a.graphic,a=a.shapeArgs;c&&(c.attr({r:b.center[3]/2,start:d,end:d}),c.animate({r:a.r,start:a.start,end:a.end},b.options.animation))}),b.animate=null)},setData:function(a,b,c,d){O.prototype.setData.call(this,a,!1,c,d),this.processData(),this.generatePoints(),m(b,!0)&&this.chart.redraw(c)},generatePoints:function(){var a,c,d,e,b=0,f=this.options.ignoreHiddenPoint;for(O.prototype.generatePoints.call(this),c=this.points,d=c.length,a=0;d>a;a++)e=c[a],b+=f&&!e.visible?0:e.y;for(this.total=b,a=0;d>a;a++)e=c[a],e.percentage=b>0?e.y/b*100:0,e.total=b},translate:function(a){this.generatePoints();var f,g,h,o,p,b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,i=c.startAngle||0,j=this.startAngleRad=ma/180*(i-90),i=(this.endAngleRad=ma/180*(m(c.endAngle,i+360)-90))-j,k=this.points,l=c.dataLabels.distance,c=c.ignoreHiddenPoint,n=k.length;for(a||(this.center=a=this.getCenter()),this.getX=function(b,c){return h=U.asin(C((b-a[1])/(a[2]/2+l),1)),a[0]+(c?-1:1)*Z(h)*(a[2]/2+l)},o=0;n>o;o++)p=k[o],f=j+b*i,(!c||p.visible)&&(b+=p.percentage/100),g=j+b*i,p.shapeType="arc",p.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:u(1e3*f)/1e3,end:u(1e3*g)/1e3},h=(g+f)/2,h>1.5*ma?h-=2*ma:-ma/2>h&&(h+=2*ma),p.slicedTranslation={translateX:u(Z(h)*d),translateY:u(ea(h)*d)},f=Z(h)*a[2]/2,g=ea(h)*a[2]/2,p.tooltipPos=[a[0]+.7*f,a[1]+.7*g],p.half=-ma/2>h||h>ma/2?1:0,p.angle=h,e=C(e,l/2),p.labelPos=[a[0]+f+Z(h)*l,a[1]+g+ea(h)*l,a[0]+f+Z(h)*e,a[1]+g+ea(h)*e,a[0]+f,a[1]+g,0>l?"center":p.half?"right":"left",h]},drawGraph:null,drawPoints:function(){var c,d,f,g,a=this,b=a.chart.renderer,e=a.options.shadow;e&&!a.shadowGroup&&(a.shadowGroup=b.g("shadow").add(a.group)),p(a.points,function(h){d=h.graphic,g=h.shapeArgs,f=h.shadowGroup,e&&!f&&(f=h.shadowGroup=b.g("shadow").add(a.shadowGroup)),c=h.sliced?h.slicedTranslation:{translateX:0,translateY:0},f&&f.attr(c),d?d.animate(q(g,c)):h.graphic=d=b[h.shapeType](g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,f),void 0!==h.visible&&h.setVisible(h.visible)})},sortByAngle:function(a,b){a.sort(function(a,d){return void 0!==a.angle&&(d.angle-a.angle)*b})},drawLegendSymbol:N.drawRectangle,getCenter:X.getCenter,getSymbol:sa},S=ka(O,S),F.pie=S,O.prototype.drawDataLabels=function(){var f,g,h,i,a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points;(d.enabled||a._hasPointLabels)&&(a.dlProcessOptions&&a.dlProcessOptions(d),i=a.plotGroup("dataLabelsGroup","data-labels","hidden",d.zIndex||6),!a.hasRendered&&m(d.defer,!0)&&(i.attr({opacity:0}),K(a,"afterAnimate",function(){a.dataLabelsGroup.show()[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),g=d,p(e,function(b){var e,o,n,l=b.dataLabel,p=b.connector,u=!0;if(f=b.options&&b.options.dataLabels,e=m(f&&f.enabled,g.enabled),l&&!e)b.dataLabel=l.destroy();else if(e){if(d=w(g,f),e=d.rotation,o=b.getLabelConfig(),h=d.format?Ia(d.format,o):d.formatter.call(o,d),d.style.color=m(d.color,d.style.color,a.color,"black"),l)r(h)?(l.attr({text:h}),u=!1):(b.dataLabel=l=l.destroy(),p&&(b.connector=p.destroy()));else if(r(h)){l={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(n in l)l[n]===t&&delete l[n];l=b.dataLabel=a.chart.renderer[e?"text":"label"](h,0,-999,null,null,null,d.useHTML).attr(l).css(q(d.style,c&&{cursor:c})).add(i).shadow(d.shadow)}l&&a.alignDataLabel(b,l,d,null,u)}}))},O.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=m(a.plotX,-999),i=m(a.plotY,-999),j=b.getBBox();(a=this.visible&&(a.series.forceDL||f.isInsidePlot(h,u(i),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height-1,g)))&&(d=q({x:g?f.plotWidth-i:h,y:u(g?f.plotHeight-h:i),width:0,height:0},d),q(c,{width:j.width,height:j.height}),c.rotation?(g={align:c.align,x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2},b[e?"attr":"animate"](g)):(b.align(c,null,d),g=b.alignAttr,"justify"===m(c.overflow,"justify")?this.justifyDataLabel(b,c,g,j,d,e):m(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+j.width,g.y+j.height)))),a||(b.attr({y:-999}),b.placed=!1)},O.prototype.justifyDataLabel=function(a,b,c,d,e,f){var j,k,g=this.chart,h=b.align,i=b.verticalAlign;j=c.x,0>j&&("right"===h?b.align="left":b.x=-j,k=!0),j=c.x+d.width,j>g.plotWidth&&("left"===h?b.align="right":b.x=g.plotWidth-j,k=!0),j=c.y,0>j&&("bottom"===i?b.verticalAlign="top":b.y=-j,k=!0),j=c.y+d.height,j>g.plotHeight&&("top"===i?b.verticalAlign="bottom":b.y=g.plotHeight-j,k=!0),k&&(a.placed=!f,a.align(b,null,e))},F.pie&&(F.pie.prototype.drawDataLabels=function(){var c,i,j,t,w,x,y,A,C,G,D,B,a=this,b=a.data,d=a.chart,e=a.options.dataLabels,f=m(e.connectorPadding,10),g=m(e.connectorWidth,1),h=d.plotWidth,d=d.plotHeight,k=m(e.softConnector,!0),l=e.distance,o=a.center,n=o[2]/2,q=o[1],r=l>0,z=[[],[]],F=[0,0,0,0],N=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){for(O.prototype.drawDataLabels.apply(a),p(b,function(a){a.dataLabel&&a.visible&&z[a.half].push(a)}),D=0;!y&&b[D];)y=b[D]&&b[D].dataLabel&&(b[D].dataLabel.getBBox().height||21),D++;for(D=2;D--;){var E,b=[],K=[],H=z[D],I=H.length;if(a.sortByAngle(H,D-.5),l>0){for(B=q-n-l;q+n+l>=B;B+=y)b.push(B);if(w=b.length,I>w){for(c=[].concat(H),c.sort(N),B=I;B--;)c[B].rank=B;for(B=I;B--;)H[B].rank>=w&&H.splice(B,1);I=H.length}for(B=0;I>B;B++){c=H[B],x=c.labelPos,c=9999;var Q,P;for(P=0;w>P;P++)Q=M(b[P]-x[1]),c>Q&&(c=Q,E=P);if(B>E&&null!==b[B])E=B;else for(I-B+E>w&&null!==b[B]&&(E=w-I+B);null===b[E];)E++;K.push({i:E,y:b[E]}),b[E]=null}K.sort(N)}for(B=0;I>B;B++)c=H[B],x=c.labelPos,t=c.dataLabel,G=c.visible===!1?"hidden":"visible",c=x[1],l>0?(w=K.pop(),E=w.i,C=w.y,(c>C&&null!==b[E+1]||C>c&&null!==b[E-1])&&(C=c)):C=c,A=e.justify?o[0]+(D?-1:1)*(n+l):a.getX(0===E||E===b.length-1?c:C,D),t._attr={visibility:G,align:x[6]},t._pos={x:A+e.x+({left:f,right:-f}[x[6]]||0),y:C+e.y-10},t.connX=A,t.connY=C,null===this.options.size&&(w=t.width,f>A-w?F[3]=v(u(w-A+f),F[3]):A+w>h-f&&(F[1]=v(u(A+w-h+f),F[1])),0>C-y/2?F[0]=v(u(-C+y/2),F[0]):C+y/2>d&&(F[2]=v(u(C+y/2-d),F[2])))}(0===Ba(F)||this.verifyDataLabelOverflow(F))&&(this.placeDataLabels(),r&&g&&p(this.points,function(b){i=b.connector,x=b.labelPos,(t=b.dataLabel)&&t._pos?(G=t._attr.visibility,A=t.connX,C=t.connY,j=k?["M",A+("left"===x[6]?5:-5),C,"C",A,C,2*x[2]-x[4],2*x[3]-x[5],x[2],x[3],"L",x[4],x[5]]:["M",A+("left"===x[6]?5:-5),C,"L",x[2],x[3],"L",x[4],x[5]],i?(i.animate({d:j}),i.attr("visibility",G)):b.connector=i=a.chart.renderer.path(j).attr({"stroke-width":g,stroke:e.connectorColor||b.color||"#606060",visibility:G}).add(a.dataLabelsGroup)):i&&(b.connector=i.destroy())}))}},F.pie.prototype.placeDataLabels=function(){p(this.points,function(a){var b,a=a.dataLabel;a&&((b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999}))})},F.pie.prototype.alignDataLabel=sa,F.pie.prototype.verifyDataLabelOverflow=function(a){var f,b=this.center,c=this.options,d=c.center,e=c=c.minSize||80;return null!==d[0]?e=v(b[2]-v(a[1],a[3]),c):(e=v(b[2]-a[1]-a[3],c),b[0]+=(a[3]-a[1])/2),null!==d[1]?e=v(C(e,b[2]-v(a[0],a[2])),c):(e=v(C(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2),e<b[2]?(b[2]=e,this.translate(b),p(this.points,function(a){a.dataLabel&&(a.dataLabel._pos=null)}),this.drawDataLabels&&this.drawDataLabels()):f=!0,f}),F.column&&(F.column.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,i=a.below||a.plotY>m(this.translatedThreshold,f.plotSizeY),j=m(c.inside,!!this.options.stacking);h&&(d=w(h),g&&(d={x:f.plotWidth-d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),!j)&&(g?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0)),c.align=m(c.align,!g||j?"center":i?"right":"left"),c.verticalAlign=m(c.verticalAlign,g||j?"middle":i?"top":"bottom"),O.prototype.alignDataLabel.call(this,a,b,c,d,e)}),S=R.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var e,d=c.target;for(b.hoverSeries!==a&&a.onMouseOver();d&&!e;)e=d.point,d=d.parentNode;e!==t&&e!==b.hoverPoint&&e.onMouseOver(c)};p(a.points,function(a){a.graphic&&(a.graphic.element.point=a),a.dataLabel&&(a.dataLabel.element.point=a)}),a._hasTracking||(p(a.trackerGroups,function(b){a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),$a)&&a[b].on("touchstart",f)}),a._hasTracking=!0)},drawTrackerGraph:function(){var m,a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,f=a.chart,g=f.pointer,h=f.renderer,i=f.options.tooltip.snap,j=a.tracker,k=b.cursor,l=k&&{cursor:k},k=a.singlePoints,n=function(){f.hoverSeries!==a&&a.onMouseOver()},q="rgba(192,192,192,"+(aa?1e-4:.002)+")";if(e&&!c)for(m=e+1;m--;)"M"===d[m]&&d.splice(m+1,0,d[m+1]-i,d[m+2],"L"),(m&&"M"===d[m]||m===e)&&d.splice(m,0,"L",d[m-2]+i,d[m-1]);for(m=0;m<k.length;m++)e=k[m],d.push("M",e.plotX-i,e.plotY,"L",e.plotX+i,e.plotY);j?j.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:q,fill:c?q:Q,"stroke-width":b.lineWidth+(c?0:2*i),zIndex:2}).add(a.group),p([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",n).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(l),$a&&a.on("touchstart",n)}))}},F.column&&(ga.prototype.drawTracker=S.drawTrackerPoint),F.pie&&(F.pie.prototype.drawTracker=S.drawTrackerPoint),F.scatter&&(pa.prototype.drawTracker=S.drawTrackerPoint),q(lb.prototype,{setItemEvents:function(a,b,c,d,e){var f=this;(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover"),b.css(f.options.itemHoverStyle)}).on("mouseout",function(){b.css(a.visible?d:e),a.setState()}).on("click",function(b){var c=function(){a.setVisible()},b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):D(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=Y("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container),K(a.checkbox,"click",function(b){D(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})})}}),E.legend.itemStyle.cursor="pointer",q(Ya.prototype,{showResetZoom:function(){var a=this,b=E.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f="chart"===c.relativeTo?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=this;D(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,e,c=this.pointer,d=!1;!a||a.resetSelection?p(this.axes,function(a){b=a.zoom()}):p(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;(c[h?"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])&&(b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0))}),e=this.resetZoomButton,d&&!e?this.showResetZoom():!d&&ca(e)&&(this.resetZoomButton=e.destroy()),b&&this.redraw(m(this.options.chart.animation,a&&a.animation,this.pointCount<100))},pan:function(a,b){var e,c=this,d=c.hoverPoints;d&&p(d,function(a){a.setState()}),p("xy"===b?[1,0]:[1],function(b){var d=a[b?"chartX":"chartY"],h=c[b?"xAxis":"yAxis"][0],i=c[b?"mouseDownX":"mouseDownY"],j=(h.pointRange||0)/2,k=h.getExtremes(),l=h.toValue(i-d,!0)+j,i=h.toValue(i+c[b?"plotWidth":"plotHeight"]-d,!0)-j;h.series.length&&l>C(k.dataMin,k.min)&&i<v(k.dataMax,k.max)&&(h.setExtremes(l,i,!1,!1,{trigger:"pan"}),e=!0),c[b?"mouseDownX":"mouseDownY"]=d}),e&&c.redraw(!1),G(c.container,{cursor:"move"})}}),q(Ea.prototype,{select:function(a,b){var c=this,d=c.series,e=d.chart,a=m(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a,d.options.data[Da(c,d.data)]=c.options,c.setState(a&&"select"),b||p(e.getSelectedPoints(),function(a){a.selected&&a!==c&&(a.selected=a.options.selected=!1,d.options.data[Da(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;e&&e!==this&&e.onMouseOut(),this.firePointEvent("mouseOver"),d&&(!d.shared||b.noSharedTooltip)&&d.refresh(this,a),this.setState("hover"),c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;b&&-1!==Da(this,b)||(this.firePointEvent("mouseOut"),this.setState(),a.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var b,a=w(this.series.options.point,this.options).events;this.events=a;for(b in a)K(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var p,c=this.plotX,d=this.plotY,e=this.series,f=e.options.states,g=ba[e.type].marker&&e.options.marker,h=g&&!g.enabled,i=g&&g.states[a],j=i&&i.enabled===!1,k=e.stateMarkerGraphic,l=this.marker||{},m=e.chart,n=e.halo,a=a||"";p=this.pointAttr[a]||e.pointAttr[a],a===this.state&&!b||this.selected&&"select"!==a||f[a]&&f[a].enabled===!1||a&&(j||h&&i.enabled===!1)||a&&l.states&&l.states[a]&&l.states[a].enabled===!1||(this.graphic?(g=g&&this.graphic.symbolName&&p.r,this.graphic.attr(w(p,g?{x:c-g,y:d-g,width:2*g,height:2*g}:{})),k&&k.hide()):(a&&i&&(g=i.radius,l=l.symbol||e.symbol,k&&k.currentSymbol!==l&&(k=k.destroy()),k?k[b?"animate":"attr"]({x:c-g,y:d-g}):l&&(e.stateMarkerGraphic=k=m.renderer.symbol(l,c-g,d-g,2*g,2*g).attr(p).add(e.markerGroup),k.currentSymbol=l)),k&&k[a&&m.isInsidePlot(c,d,m.inverted)?"show":"hide"]()),(c=f[a]&&f[a].halo)&&c.size?(n||(e.halo=n=m.renderer.path().add(e.seriesGroup)),n.attr(q({fill:ya(this.color||e.color).setOpacity(c.opacity).get()},c.attributes))[b?"animate":"attr"]({d:this.haloPath(c.size)})):n&&n.attr({d:[]}),this.state=a)},haloPath:function(a){var b=this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted;return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:this.plotX)-a,d.translateY+(e?b.xAxis.len-this.plotX:this.plotY)-a,2*a,2*a)}}),q(O.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;b&&b!==this&&b.onMouseOut(),this.options.events.mouseOver&&D(this,"mouseOver"),this.setState("hover"),a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut(),this&&a.events.mouseOut&&D(this,"mouseOut"),c&&!a.stickyTracking&&(!c.shared||this.noSharedTooltip)&&c.hide(),this.setState(),b.hoverSeries=null},setState:function(a){var b=this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth,a=a||"";this.state!==a&&(this.state=a,e[a]&&e[a].enabled===!1||(a&&(b=e[a].lineWidth||b+1),c&&!c.dashstyle&&(a={"stroke-width":b},c.attr(a),d&&d.attr(a))))},setVisible:function(a,b){var f,c=this,d=c.chart,e=c.legendItem,g=d.options.chart.ignoreHiddenSeries,h=c.visible;f=(c.visible=a=c.userOptions.visible=a===t?!h:a)?"show":"hide",p(["group","dataLabelsGroup","markerGroup","tracker"],function(a){c[a]&&c[a][f]()}),d.hoverSeries===c&&c.onMouseOut(),e&&d.legend.colorizeItem(c,a),c.isDirty=!0,c.options.stacking&&p(d.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)}),p(c.linkedSeries,function(b){b.setVisible(a,!1)}),g&&(d.isDirtyBox=!0),b!==!1&&d.redraw(),D(c,f)},setTooltipPoints:function(a){var c,d,h,i,b=[],e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||e.len:this.chart.plotSizeX,j=[];if(this.options.enableMouseTracking!==!1&&!this.singularTooltips){for(a&&(this.tooltipPoints=null),p(this.segments||this.points,function(a){b=b.concat(a)}),e&&e.reversed&&(b=b.reverse()),this.orderTooltipPoints&&this.orderTooltipPoints(b),a=b.length,i=0;a>i;i++)if(e=b[i],c=e.x,c>=f.min&&c<=f.max)for(h=b[i+1],c=d===t?0:d+1,d=b[i+1]?C(v(0,T((e.clientX+(h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&d>=c;)j[c++]=e;this.tooltipPoints=j}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===t?!this.selected:a,this.checkbox&&(this.checkbox.checked=a),D(this,a?"select":"unselect")},drawTracker:S.drawTrackerGraph}),q(R,{Axis:la,Chart:Ya,Color:ya,Point:Ea,Tick:Sa,Renderer:Za,Series:O,SVGElement:P,SVGRenderer:ta,arrayMin:Na,arrayMax:Ba,charts:V,dateFormat:cb,format:Ia,pathAnim:ub,getOptions:function(){return E},hasBidiBug:Nb,isTouchDevice:Jb,numberFormat:Ga,seriesTypes:F,setOptions:function(a){return E=w(!0,E,a),Cb(),E},addEvent:K,removeEvent:W,createElement:Y,discardElement:Pa,css:G,each:p,extend:q,map:Ua,merge:w,pick:m,splat:qa,extendClass:ka,pInt:z,wrap:Ma,svg:aa,canvas:fa,vml:!aa&&!fa,product:"Highcharts",version:"4.0.1"})}(),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):factory(jQuery)}(function($){function args(elem){var newAttrs={},rinlinejQuery=/^jQuery\d+$/;return $.each(elem.attributes,function(i,attr){attr.specified&&!rinlinejQuery.test(attr.name)&&(newAttrs[attr.name]=attr.value)}),newAttrs}function clearPlaceholder(event,value){var input=this,$input=$(input);if(input.value==$input.attr("placeholder")&&$input.hasClass(settings.customClass))if($input.data("placeholder-password")){if($input=$input.hide().nextAll('input[type="password"]:first').show().attr("id",$input.removeAttr("id").data("placeholder-id")),event===!0)return $input[0].value=value;$input.focus()}else input.value="",$input.removeClass(settings.customClass),input==safeActiveElement()&&input.select()}function setPlaceholder(){var $replacement,input=this,$input=$(input),id=this.id;if(""===input.value){if("password"===input.type){if(!$input.data("placeholder-textinput")){try{$replacement=$input.clone().attr({type:"text"})}catch(e){$replacement=$("<input>").attr($.extend(args(this),{type:"text"}))}$replacement.removeAttr("name").data({"placeholder-password":$input,"placeholder-id":id}).bind("focus.placeholder",clearPlaceholder),$input.data({"placeholder-textinput":$replacement,"placeholder-id":id}).before($replacement)}$input=$input.removeAttr("id").hide().prevAll('input[type="text"]:first').attr("id",id).show()}$input.addClass(settings.customClass),$input[0].value=$input.attr("placeholder")}else $input.removeClass(settings.customClass)}function safeActiveElement(){try{return document.activeElement}catch(exception){}}var hooks,placeholder,isOperaMini="[object OperaMini]"==Object.prototype.toString.call(window.operamini),isInputSupported="placeholder"in document.createElement("input")&&!isOperaMini,isTextareaSupported="placeholder"in document.createElement("textarea")&&!isOperaMini,valHooks=$.valHooks,propHooks=$.propHooks;if(isInputSupported&&isTextareaSupported)placeholder=$.fn.placeholder=function(){return this},placeholder.input=placeholder.textarea=!0;else{var settings={};placeholder=$.fn.placeholder=function(options){var defaults={customClass:"placeholder"};settings=$.extend({},defaults,options);var $this=this;return $this.filter((isInputSupported?"textarea":":input")+"[placeholder]").not("."+settings.customClass).bind({"focus.placeholder":clearPlaceholder,"blur.placeholder":setPlaceholder}).data("placeholder-enabled",!0).trigger("blur.placeholder"),$this},placeholder.input=isInputSupported,placeholder.textarea=isTextareaSupported,hooks={get:function(element){var $element=$(element),$passwordInput=$element.data("placeholder-password");return $passwordInput?$passwordInput[0].value:$element.data("placeholder-enabled")&&$element.hasClass(settings.customClass)?"":element.value},set:function(element,value){var $element=$(element),$passwordInput=$element.data("placeholder-password");return $passwordInput?$passwordInput[0].value=value:$element.data("placeholder-enabled")?(""===value?(element.value=value,element!=safeActiveElement()&&setPlaceholder.call(element)):$element.hasClass(settings.customClass)?clearPlaceholder.call(element,!0,value)||(element.value=value):element.value=value,$element):element.value=value}},isInputSupported||(valHooks.input=hooks,propHooks.value=hooks),isTextareaSupported||(valHooks.textarea=hooks,propHooks.value=hooks),$(function(){$(document).delegate("form","submit.placeholder",function(){var $inputs=$("."+settings.customClass,this).each(clearPlaceholder);setTimeout(function(){$inputs.each(setPlaceholder)},10)})}),$(window).bind("beforeunload.placeholder",function(){$("."+settings.customClass).each(function(){this.value=""})})}}),jQuery(document).ready(function($){$("#close-share").click(function(){$.cookie("ignore_social_share",1,{expires:30})}),$(".big-button--share").click(function(){$.cookie("ignore_social_share",1)}),$.cookie("ignore_social_share")||leadin_check_social_share_popup(),$("#filter_action").select2(),$("#filter_action").change(function(){var $this=$(this);"submitted"==$this.val()?$("#form-filter-input").show():($("#form-filter-input").hide(),$("#filter_form").select2("val","any form"))}),$("#view-all-do-not-track-selectors").click(function(){$(".form-do-not-track, #view-less-do-not-track-selectors").not(".do-not-track-always-show").show(),$("#view-all-do-not-track-selectors").hide()}),$("#view-less-do-not-track-selectors").click(function(){$(".form-do-not-track, #view-less-do-not-track-selectors").not(".do-not-track-always-show").hide(),$("#view-all-do-not-track-selectors").show()}),$("#filter_content").select2({query:function(query){var key=query.term;$.ajax({type:"POST",url:li_admin_ajax.ajax_url,data:{action:"leadin_get_posts_and_pages",search_term:key},success:function(data){var i,json_data=jQuery.parseJSON(data),data_test={results:[]};for(i=0;i<json_data.length;i++)data_test.results.push({id:json_data[i].post_title,text:json_data[i].post_title});query.callback(data_test)}})},initSelection:function(){$("#filter_content").val()?$("#filter_content").select2("data",{id:$("#filter_content").val(),text:$("#filter_content").val()}):$("#filter_content").select2("data",{id:"any page",text:"any page"})}}),$("#filter_form").select2({query:function(query){var key=query.term;$.ajax({type:"POST",url:li_admin_ajax.ajax_url,data:{action:"leadin_get_form_selectors",search_term:key},success:function(data){var i,json_data=jQuery.parseJSON(data),data_test={results:[]};for(i=0;i<json_data.length;i++)data_test.results.push({id:json_data[i],text:json_data[i]});query.callback(data_test)}})},initSelection:function(){$("#filter_form").val()?$("#filter_form").select2("data",{id:$("#filter_form").val(),text:$("#filter_form").val()}):$("#filter_form").select2("data",{id:"any form",text:"any form"})}}),$("#leadin-contact-status").change(function(){$("#leadin-contact-status-button").addClass("button-primary")}),$("input[name=popup-position]:radio").change(function(){$("#btn-activate-subscribe").attr("href",window.location.href+"&leadin_action=activate&power_up=subscribe_widget&redirect_to="+encodeURIComponent(window.location.href+"&activate_popup=true&popup_position="+$("input:radio[name='popup-position']:checked").val()))}),$("input[name=esp]:radio").change(function(){$("#btn-activate-esp").attr("href",window.location.href+"&leadin_action=activate&power_up="+$("input:radio[name='esp']:checked").val()+"&redirect_to="+encodeURIComponent(window.location.href+"&activate_esp=true"))}),$("#pro-upgrade-button").click(function(e){return e.preventDefault(),$("#agree-pp").is(":checked")?($("#agree-pp-error").hide(),$(this).addClass("btn-submitting").text("Upgrading..."),void $.ajax({type:"POST",url:li_admin_ajax.ajax_url,data:{action:"leadin_upgrade_to_pro_ajax_call"},success:function(redirect_to){redirect_to&&(window.location.href=redirect_to+"&pro_upgrade=1")}})):($("#agree-pp-error").show(),!1)}),$("#onboarding-step-1-button").click(function(e){return $("#agree-pp").is(":checked")?void 0:(e.preventDefault(),$("#agree-pp-error").show(),!1)}),$("input, textarea").placeholder()}),jQuery(document).ready(function($){var $bulk_opt_selected=$('.bulkactions select option[value="add_tag_to_selected"], .bulkactions select option[value="remove_tag_from_selected"], .bulkactions select option[value="delete_selected"]');
6
+ $("#leadin-contacts input:checkbox").not("thead input:checkbox, tfoot input:checkbox").bind("change",function(){var cb_count=0,selected_vals="",$btn_selected=$("#leadin-export-selected-leads"),$input_selected_vals=$(".leadin-selected-contacts"),$cb_selected=$("#leadin-contacts input:checkbox:checked").not("thead input:checkbox, tfoot input:checkbox");$cb_selected.length>0?($btn_selected.attr("disabled",!1),$bulk_opt_selected.attr("disabled",!1)):($btn_selected.attr("disabled",!0),$bulk_opt_selected.attr("disabled",!0)),$cb_selected.each(function(){selected_vals+=$(this).val(),cb_count!=$cb_selected.length-1&&(selected_vals+=","),cb_count++}),$input_selected_vals.val(selected_vals),$(".selected-contacts-count").text(cb_count)}),$("#cb-select-all-1, #cb-select-all-2").bind("change",function(){var cb_count=0,selected_vals="",$this=$(this),$btn_selected=$("#leadin-export-selected-leads"),$cb_selected=$("#leadin-contacts input:checkbox").not("thead input:checkbox, tfoot input:checkbox"),$input_selected_vals=$(".leadin-selected-contacts");$cb_selected.each(function(){selected_vals+=$(this).val(),cb_count!=$cb_selected.length-1&&(selected_vals+=","),cb_count++}),$input_selected_vals.val(selected_vals),$this.is(":checked")?($btn_selected.attr("disabled",!1),$bulk_opt_selected.attr("disabled",!1)):($btn_selected.attr("disabled",!0),$bulk_opt_selected.attr("disabled",!0),$(".selected-contacts-count").text($("#contact-count").text())),$(".selected-contacts-count").text(cb_count)}),$(".postbox .handlediv").bind("click",function(){var $postbox=$(this).parent();$postbox.hasClass("closed")?$postbox.removeClass("closed"):$postbox.addClass("closed")}),$(".selected-contacts-count").text($("#contact-count").text()),$bulk_opt_selected.attr("disabled",!0),$(".bulkactions select").change(function(){{var $this=$(this);$("#contact-count").text()}"add_tag_to_all"==$this.val()||"add_tag_to_selected"==$this.val()?($("#bulk-edit-tags h2").html($("#bulk-edit-tags h2").html().replace("remove from","add to")),$("#bulk-edit-button").val("Add Tag"),$("#bulk-edit-tag-action").val("add_tag"),tb_show("","#TB_inline?width=400&height=175&inlineId=bulk-edit-tags"),$(".bulkactions select").val("-1")):("remove_tag_from_all"==$this.val()||"remove_tag_from_selected"==$this.val())&&($("#bulk-edit-tags h2").html($("#bulk-edit-tags h2").html().replace("add to","remove from")),$("#bulk-edit-button").val("Remove Tag"),$("#bulk-edit-tag-action").val("remove_tag"),tb_show("","#TB_inline?width=400&height=175&inlineId=bulk-edit-tags"),$(".bulkactions select").val("-1"))}),$("#contact-detail-read-more").click(function(){$("#company-detail-overview-short").hide(),$("#company-detail-overview-full").show()}),$("#contact-detail-read-less").click(function(){$("#company-detail-overview-full").hide(),$("#company-detail-overview-short").show()})}),function($){"undefined"==typeof $.fn.each2&&$.extend($.fn,{each2:function(c){for(var j=$([0]),i=-1,l=this.length;++i<l&&(j.context=j[0]=this[i])&&c.call(j[0],i,j)!==!1;);return this}})}(jQuery),function($,undefined){"use strict";function reinsertElement(element){var placeholder=$(document.createTextNode(""));element.before(placeholder),placeholder.before(element),placeholder.remove()}function stripDiacritics(str){function match(a){return DIACRITICS[a]||a}return str.replace(/[^\u0000-\u007E]/g,match)}function indexOf(value,array){for(var i=0,l=array.length;l>i;i+=1)if(equal(value,array[i]))return i;return-1}function measureScrollbar(){var $template=$(MEASURE_SCROLLBAR_TEMPLATE);$template.appendTo("body");var dim={width:$template.width()-$template[0].clientWidth,height:$template.height()-$template[0].clientHeight};return $template.remove(),dim}function equal(a,b){return a===b?!0:a===undefined||b===undefined?!1:null===a||null===b?!1:a.constructor===String?a+""==b+"":b.constructor===String?b+""==a+"":!1}function splitVal(string,separator){var val,i,l;if(null===string||string.length<1)return[];for(val=string.split(separator),i=0,l=val.length;l>i;i+=1)val[i]=$.trim(val[i]);return val}function getSideBorderPadding(element){return element.outerWidth(!1)-element.width()}function installKeyUpChangeEvent(element){var key="keyup-change-value";element.on("keydown",function(){$.data(element,key)===undefined&&$.data(element,key,element.val())}),element.on("keyup",function(){var val=$.data(element,key);val!==undefined&&element.val()!==val&&($.removeData(element,key),element.trigger("keyup-change"))})}function installFilteredMouseMove(element){element.on("mousemove",function(e){var lastpos=lastMousePosition;(lastpos===undefined||lastpos.x!==e.pageX||lastpos.y!==e.pageY)&&$(e.target).trigger("mousemove-filtered",e)})}function debounce(quietMillis,fn,ctx){ctx=ctx||undefined;var timeout;return function(){var args=arguments;window.clearTimeout(timeout),timeout=window.setTimeout(function(){fn.apply(ctx,args)},quietMillis)}}function installDebouncedScroll(threshold,element){var notify=debounce(threshold,function(e){element.trigger("scroll-debounced",e)});element.on("scroll",function(e){indexOf(e.target,element.get())>=0&&notify(e)})}function focus($el){$el[0]!==document.activeElement&&window.setTimeout(function(){var range,el=$el[0],pos=$el.val().length;$el.focus();var isVisible=el.offsetWidth>0||el.offsetHeight>0;isVisible&&el===document.activeElement&&(el.setSelectionRange?el.setSelectionRange(pos,pos):el.createTextRange&&(range=el.createTextRange(),range.collapse(!1),range.select()))},0)}function getCursorInfo(el){el=$(el)[0];var offset=0,length=0;if("selectionStart"in el)offset=el.selectionStart,length=el.selectionEnd-offset;else if("selection"in document){el.focus();var sel=document.selection.createRange();length=document.selection.createRange().text.length,sel.moveStart("character",-el.value.length),offset=sel.text.length-length}return{offset:offset,length:length}}function killEvent(event){event.preventDefault(),event.stopPropagation()}function killEventImmediately(event){event.preventDefault(),event.stopImmediatePropagation()}function measureTextWidth(e){if(!sizer){var style=e[0].currentStyle||window.getComputedStyle(e[0],null);sizer=$(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:style.fontSize,fontFamily:style.fontFamily,fontStyle:style.fontStyle,fontWeight:style.fontWeight,letterSpacing:style.letterSpacing,textTransform:style.textTransform,whiteSpace:"nowrap"}),sizer.attr("class","select2-sizer"),$("body").append(sizer)}return sizer.text(e.val()),sizer.width()}function syncCssClasses(dest,src,adapter){var classes,adapted,replacements=[];classes=dest.attr("class"),classes&&(classes=""+classes,$(classes.split(" ")).each2(function(){0===this.indexOf("select2-")&&replacements.push(this)})),classes=src.attr("class"),classes&&(classes=""+classes,$(classes.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(adapted=adapter(this),adapted&&replacements.push(adapted))})),dest.attr("class",replacements.join(" "))}function markMatch(text,term,markup,escapeMarkup){var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),tl=term.length;return 0>match?void markup.push(escapeMarkup(text)):(markup.push(escapeMarkup(text.substring(0,match))),markup.push("<span class='select2-match'>"),markup.push(escapeMarkup(text.substring(match,match+tl))),markup.push("</span>"),void markup.push(escapeMarkup(text.substring(match+tl,text.length))))}function defaultEscapeMarkup(markup){var replace_map={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(markup).replace(/[&<>"'\/\\]/g,function(match){return replace_map[match]})}function ajax(options){var timeout,handler=null,quietMillis=options.quietMillis||100,ajaxUrl=options.url,self=this;return function(query){window.clearTimeout(timeout),timeout=window.setTimeout(function(){var data=options.data,url=ajaxUrl,transport=options.transport||$.fn.select2.ajaxDefaults.transport,deprecated={type:options.type||"GET",cache:options.cache||!1,jsonpCallback:options.jsonpCallback||undefined,dataType:options.dataType||"json"},params=$.extend({},$.fn.select2.ajaxDefaults.params,deprecated);data=data?data.call(self,query.term,query.page,query.context):null,url="function"==typeof url?url.call(self,query.term,query.page,query.context):url,handler&&"function"==typeof handler.abort&&handler.abort(),options.params&&($.isFunction(options.params)?$.extend(params,options.params.call(self)):$.extend(params,options.params)),$.extend(params,{url:url,dataType:options.dataType,data:data,success:function(data){var results=options.results(data,query.page);query.callback(results)}}),handler=transport.call(self,params)},quietMillis)}}function local(options){var dataText,tmp,data=options,text=function(item){return""+item.text};$.isArray(data)&&(tmp=data,data={results:tmp}),$.isFunction(data)===!1&&(tmp=data,data=function(){return tmp});var dataItem=data();return dataItem.text&&(text=dataItem.text,$.isFunction(text)||(dataText=dataItem.text,text=function(item){return item[dataText]})),function(query){var process,t=query.term,filtered={results:[]};return""===t?void query.callback(data()):(process=function(datum,collection){var group,attr;if(datum=datum[0],datum.children){group={};for(attr in datum)datum.hasOwnProperty(attr)&&(group[attr]=datum[attr]);group.children=[],$(datum.children).each2(function(i,childDatum){process(childDatum,group.children)}),(group.children.length||query.matcher(t,text(group),datum))&&collection.push(group)}else query.matcher(t,text(datum),datum)&&collection.push(datum)},$(data().results).each2(function(i,datum){process(datum,filtered.results)}),void query.callback(filtered))}}function tags(data){var isFunc=$.isFunction(data);return function(query){var t=query.term,filtered={results:[]},result=isFunc?data(query):data;$.isArray(result)&&($(result).each(function(){var isObject=this.text!==undefined,text=isObject?this.text:this;(""===t||query.matcher(t,text))&&filtered.results.push(isObject?this:{id:this,text:this})}),query.callback(filtered))}}function checkFormatter(formatter,formatterName){if($.isFunction(formatter))return!0;if(!formatter)return!1;if("string"==typeof formatter)return!0;throw new Error(formatterName+" must be a string, function, or falsy value")}function evaluate(val){if($.isFunction(val)){var args=Array.prototype.slice.call(arguments,1);return val.apply(null,args)}return val}function countResults(results){var count=0;return $.each(results,function(i,item){item.children?count+=countResults(item.children):count++}),count}function defaultTokenizer(input,selection,selectCallback,opts){var token,index,i,l,separator,original=input,dupe=!1;if(!opts.createSearchChoice||!opts.tokenSeparators||opts.tokenSeparators.length<1)return undefined;for(;;){for(index=-1,i=0,l=opts.tokenSeparators.length;l>i&&(separator=opts.tokenSeparators[i],index=input.indexOf(separator),!(index>=0));i++);if(0>index)break;if(token=input.substring(0,index),input=input.substring(index+separator.length),token.length>0&&(token=opts.createSearchChoice.call(this,token,selection),token!==undefined&&null!==token&&opts.id(token)!==undefined&&null!==opts.id(token))){for(dupe=!1,i=0,l=selection.length;l>i;i++)if(equal(opts.id(token),opts.id(selection[i]))){dupe=!0;break}dupe||selectCallback(token)}}return original!==input?input:void 0}function cleanupJQueryElements(){var self=this;Array.prototype.forEach.call(arguments,function(element){self[element].remove(),self[element]=null})}function clazz(SuperClass,methods){var constructor=function(){};return constructor.prototype=new SuperClass,constructor.prototype.constructor=constructor,constructor.prototype.parent=SuperClass.prototype,constructor.prototype=$.extend(constructor.prototype,methods),constructor}if(window.Select2===undefined){var KEY,AbstractSelect2,SingleSelect2,MultiSelect2,nextUid,sizer,$document,scrollBarDimensions,lastMousePosition={x:0,y:0},KEY={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(k){switch(k=k.which?k.which:k){case KEY.LEFT:case KEY.RIGHT:case KEY.UP:case KEY.DOWN:return!0}return!1},isControl:function(e){var k=e.which;switch(k){case KEY.SHIFT:case KEY.CTRL:case KEY.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(k){return k=k.which?k.which:k,k>=112&&123>=k}},MEASURE_SCROLLBAR_TEMPLATE="<div class='select2-measure-scrollbar'></div>",DIACRITICS={"Ⓐ":"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"};$document=$(document),nextUid=function(){var counter=1;return function(){return counter++}}(),$document.on("mousemove",function(e){lastMousePosition.x=e.pageX,lastMousePosition.y=e.pageY}),AbstractSelect2=clazz(Object,{bind:function(func){var self=this;return function(){func.apply(self,arguments)}},init:function(opts){var results,search,resultsSelector=".select2-results";this.opts=opts=this.prepareOpts(opts),this.id=opts.id,opts.element.data("select2")!==undefined&&null!==opts.element.data("select2")&&opts.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=$("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(opts.element.attr("id")||"autogen"+nextUid()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",opts.element.attr("title")),this.body=$("body"),syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",opts.element.attr("style")),this.container.css(evaluate(opts.containerCss)),this.container.addClass(evaluate(opts.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",killEvent),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(evaluate(opts.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",killEvent),this.results=results=this.container.find(resultsSelector),this.search=search=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",killEvent),installFilteredMouseMove(this.results),this.dropdown.on("mousemove-filtered",resultsSelector,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",resultsSelector,this.bind(function(event){this._touchEvent=!0,this.highlightUnderEvent(event)})),this.dropdown.on("touchmove",resultsSelector,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",resultsSelector,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),installDebouncedScroll(80,this.results),this.dropdown.on("scroll-debounced",resultsSelector,this.bind(this.loadMoreIfNeeded)),$(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),$(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),$.fn.mousewheel&&results.mousewheel(function(e,delta,deltaX,deltaY){var top=results.scrollTop();deltaY>0&&0>=top-deltaY?(results.scrollTop(0),killEvent(e)):0>deltaY&&results.get(0).scrollHeight-results.scrollTop()+deltaY<=results.height()&&(results.scrollTop(results.get(0).scrollHeight-results.height()),killEvent(e))}),installKeyUpChangeEvent(search),search.on("keyup-change input paste",this.bind(this.updateResults)),search.on("focus",function(){search.addClass("select2-focused")}),search.on("blur",function(){search.removeClass("select2-focused")}),this.dropdown.on("mouseup",resultsSelector,this.bind(function(e){$(e.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(e),this.selectHighlighted(e))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=undefined,$.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==opts.maximumInputLength&&this.search.attr("maxlength",opts.maximumInputLength);var disabled=opts.element.prop("disabled");disabled===undefined&&(disabled=!1),this.enable(!disabled);var readonly=opts.element.prop("readonly");readonly===undefined&&(readonly=!1),this.readonly(readonly),scrollBarDimensions=scrollBarDimensions||measureScrollbar(),this.autofocus=opts.element.prop("autofocus"),opts.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",opts.searchInputPlaceholder)},destroy:function(){var element=this.opts.element,select2=element.data("select2");this.close(),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),select2!==undefined&&(select2.container.remove(),select2.liveRegion.remove(),select2.dropdown.remove(),element.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?element.attr({tabindex:this.elementTabIndex}):element.removeAttr("tabindex"),element.show()),cleanupJQueryElements.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(element){return element.is("option")?{id:element.prop("value"),text:element.text(),element:element.get(),css:element.attr("class"),disabled:element.prop("disabled"),locked:equal(element.attr("locked"),"locked")||equal(element.data("locked"),!0)}:element.is("optgroup")?{text:element.attr("label"),children:[],element:element.get(),css:element.attr("class")}:void 0},prepareOpts:function(opts){var element,select,idKey,ajaxUrl,self=this;if(element=opts.element,"select"===element.get(0).tagName.toLowerCase()&&(this.select=select=opts.element),select&&$.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in opts)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),opts=$.extend({},{populateResults:function(container,results,query){var populate,id=this.opts.id,liveRegion=this.liveRegion;(populate=function(results,container,depth){var i,l,result,selectable,disabled,compound,node,label,innerContainer,formatted;for(results=opts.sortResults(results,container,query),i=0,l=results.length;l>i;i+=1)result=results[i],disabled=result.disabled===!0,selectable=!disabled&&id(result)!==undefined,compound=result.children&&result.children.length>0,node=$("<li></li>"),node.addClass("select2-results-dept-"+depth),node.addClass("select2-result"),node.addClass(selectable?"select2-result-selectable":"select2-result-unselectable"),disabled&&node.addClass("select2-disabled"),compound&&node.addClass("select2-result-with-children"),node.addClass(self.opts.formatResultCssClass(result)),node.attr("role","presentation"),label=$(document.createElement("div")),label.addClass("select2-result-label"),label.attr("id","select2-result-label-"+nextUid()),label.attr("role","option"),formatted=opts.formatResult(result,label,query,self.opts.escapeMarkup),formatted!==undefined&&(label.html(formatted),node.append(label)),compound&&(innerContainer=$("<ul></ul>"),innerContainer.addClass("select2-result-sub"),populate(result.children,innerContainer,depth+1),node.append(innerContainer)),node.data("select2-data",result),container.append(node);liveRegion.text(opts.formatMatches(results.length))})(results,container,0)}},$.fn.select2.defaults,opts),"function"!=typeof opts.id&&(idKey=opts.id,opts.id=function(e){return e[idKey]}),$.isArray(opts.element.data("select2Tags"))){if("tags"in opts)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+opts.element.attr("id");opts.tags=opts.element.data("select2Tags")}if(select?(opts.query=this.bind(function(query){var children,placeholderOption,process,data={results:[],more:!1},term=query.term;process=function(element,collection){var group;element.is("option")?query.matcher(term,element.text(),element)&&collection.push(self.optionToData(element)):element.is("optgroup")&&(group=self.optionToData(element),element.children().each2(function(i,elm){process(elm,group.children)}),group.children.length>0&&collection.push(group))},children=element.children(),this.getPlaceholder()!==undefined&&children.length>0&&(placeholderOption=this.getPlaceholderOption(),placeholderOption&&(children=children.not(placeholderOption))),children.each2(function(i,elm){process(elm,data.results)}),query.callback(data)}),opts.id=function(e){return e.id}):"query"in opts||("ajax"in opts?(ajaxUrl=opts.element.data("ajax-url"),ajaxUrl&&ajaxUrl.length>0&&(opts.ajax.url=ajaxUrl),opts.query=ajax.call(opts.element,opts.ajax)):"data"in opts?opts.query=local(opts.data):"tags"in opts&&(opts.query=tags(opts.tags),opts.createSearchChoice===undefined&&(opts.createSearchChoice=function(term){return{id:$.trim(term),text:$.trim(term)}}),opts.initSelection===undefined&&(opts.initSelection=function(element,callback){var data=[];$(splitVal(element.val(),opts.separator)).each(function(){var obj={id:this,text:this},tags=opts.tags;$.isFunction(tags)&&(tags=tags()),$(tags).each(function(){return equal(this.id,obj.id)?(obj=this,!1):void 0}),data.push(obj)}),callback(data)}))),"function"!=typeof opts.query)throw"query function not defined for Select2 "+opts.element.attr("id");if("top"===opts.createSearchChoicePosition)opts.createSearchChoicePosition=function(list,item){list.unshift(item)};else if("bottom"===opts.createSearchChoicePosition)opts.createSearchChoicePosition=function(list,item){list.push(item)};else if("function"!=typeof opts.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return opts},monitorSource:function(){var sync,observer,el=this.opts.element;el.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),sync=this.bind(function(){var disabled=el.prop("disabled");disabled===undefined&&(disabled=!1),this.enable(!disabled);var readonly=el.prop("readonly");readonly===undefined&&(readonly=!1),this.readonly(readonly),syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(evaluate(this.opts.containerCssClass)),syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(evaluate(this.opts.dropdownCssClass))}),el.length&&el[0].attachEvent&&el.each(function(){this.attachEvent("onpropertychange",sync)}),observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,observer!==undefined&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new observer(function(mutations){mutations.forEach(sync)}),this.propertyObserver.observe(el.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(data){var evt=$.Event("select2-selecting",{val:this.id(data),object:data});return this.opts.element.trigger(evt),!evt.isDefaultPrevented()},triggerChange:function(details){details=details||{},details=$.extend({},details,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(details),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var enabled=this._enabled&&!this._readonly,disabled=!enabled;return enabled===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",disabled),this.close(),this.enabledInterface=enabled,!0)},enable:function(enabled){enabled===undefined&&(enabled=!0),this._enabled!==enabled&&(this._enabled=enabled,this.opts.element.prop("disabled",!enabled),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(enabled){enabled===undefined&&(enabled=!1),this._readonly!==enabled&&(this._readonly=enabled,this.opts.element.prop("readonly",enabled),this.enableInterface())},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var bodyOffset,above,changeDirection,css,resultsListNode,$dropdown=this.dropdown,offset=this.container.offset(),height=this.container.outerHeight(!1),width=this.container.outerWidth(!1),dropHeight=$dropdown.outerHeight(!1),$window=$(window),windowWidth=$window.width(),windowHeight=$window.height(),viewPortRight=$window.scrollLeft()+windowWidth,viewportBottom=$window.scrollTop()+windowHeight,dropTop=offset.top+height,dropLeft=offset.left,enoughRoomBelow=viewportBottom>=dropTop+dropHeight,enoughRoomAbove=offset.top-dropHeight>=$window.scrollTop(),dropWidth=$dropdown.outerWidth(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth,aboveNow=$dropdown.hasClass("select2-drop-above");aboveNow?(above=!0,!enoughRoomAbove&&enoughRoomBelow&&(changeDirection=!0,above=!1)):(above=!1,!enoughRoomBelow&&enoughRoomAbove&&(changeDirection=!0,above=!0)),changeDirection&&($dropdown.hide(),offset=this.container.offset(),height=this.container.outerHeight(!1),width=this.container.outerWidth(!1),dropHeight=$dropdown.outerHeight(!1),viewPortRight=$window.scrollLeft()+windowWidth,viewportBottom=$window.scrollTop()+windowHeight,dropTop=offset.top+height,dropLeft=offset.left,dropWidth=$dropdown.outerWidth(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth,$dropdown.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(resultsListNode=$(".select2-results",$dropdown)[0],$dropdown.addClass("select2-drop-auto-width"),$dropdown.css("width",""),dropWidth=$dropdown.outerWidth(!1)+(resultsListNode.scrollHeight===resultsListNode.clientHeight?0:scrollBarDimensions.width),dropWidth>width?width=dropWidth:dropWidth=width,dropHeight=$dropdown.outerHeight(!1),enoughRoomOnRight=viewPortRight>=dropLeft+dropWidth):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(bodyOffset=this.body.offset(),dropTop-=bodyOffset.top,dropLeft-=bodyOffset.left),enoughRoomOnRight||(dropLeft=offset.left+this.container.outerWidth(!1)-dropWidth),css={left:dropLeft,width:width},above?(css.top=offset.top-dropHeight,css.bottom="auto",this.container.addClass("select2-drop-above"),$dropdown.addClass("select2-drop-above")):(css.top=dropTop,css.bottom="auto",this.container.removeClass("select2-drop-above"),$dropdown.removeClass("select2-drop-above")),css=$.extend(css,evaluate(this.opts.dropdownCss)),$dropdown.css(css)
7
+ },shouldOpen:function(){var event;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(event=$.Event("select2-opening"),this.opts.element.trigger(event),!event.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){var mask,cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),mask=$("#select2-drop-mask"),0==mask.length&&(mask=$(document.createElement("div")),mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),mask.hide(),mask.appendTo(this.body),mask.on("mousedown touchstart click",function(e){reinsertElement(mask);var self,dropdown=$("#select2-drop");dropdown.length>0&&(self=dropdown.data("select2"),self.opts.selectOnBlur&&self.selectHighlighted({noFocus:!0}),self.close(),e.preventDefault(),e.stopPropagation())})),this.dropdown.prev()[0]!==mask[0]&&this.dropdown.before(mask),$("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),mask.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var that=this;this.container.parents().add(window).each(function(){$(this).on(resize+" "+scroll+" "+orient,function(){that.opened()&&that.positionDropdown()})})},close:function(){if(this.opened()){var cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid;this.container.parents().add(window).each(function(){$(this).off(scroll).off(resize).off(orient)}),this.clearDropdownAlignmentPreference(),$("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger($.Event("select2-close"))}},externalSearch:function(term){this.open(),this.search.val(term),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return evaluate(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var children,index,child,hb,rb,y,more,results=this.results;if(index=this.highlight(),!(0>index)){if(0==index)return void results.scrollTop(0);children=this.findHighlightableChoices().find(".select2-result-label"),child=$(children[index]),hb=child.offset().top+child.outerHeight(!0),index===children.length-1&&(more=results.find("li.select2-more-results"),more.length>0&&(hb=more.offset().top+more.outerHeight(!0))),rb=results.offset().top+results.outerHeight(!0),hb>rb&&results.scrollTop(results.scrollTop()+(hb-rb)),y=child.offset().top-results.offset().top,0>y&&"none"!=child.css("display")&&results.scrollTop(results.scrollTop()+y)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(delta){for(var choices=this.findHighlightableChoices(),index=this.highlight();index>-1&&index<choices.length;){index+=delta;var choice=$(choices[index]);if(choice.hasClass("select2-result-selectable")&&!choice.hasClass("select2-disabled")&&!choice.hasClass("select2-selected")){this.highlight(index);break}}},highlight:function(index){var choice,data,choices=this.findHighlightableChoices();return 0===arguments.length?indexOf(choices.filter(".select2-highlighted")[0],choices.get()):(index>=choices.length&&(index=choices.length-1),0>index&&(index=0),this.removeHighlight(),choice=$(choices[index]),choice.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",choice.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(choice.text()),data=choice.data("select2-data"),void(data&&this.opts.element.trigger({type:"select2-highlight",val:this.id(data),choice:data})))},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(event){var el=$(event.target).closest(".select2-result-selectable");if(el.length>0&&!el.is(".select2-highlighted")){var choices=this.findHighlightableChoices();this.highlight(choices.index(el))}else 0==el.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var below,results=this.results,more=results.find("li.select2-more-results"),page=this.resultsPage+1,self=this,term=this.search.val(),context=this.context;0!==more.length&&(below=more.offset().top-results.offset().top-results.height(),below<=this.opts.loadMorePadding&&(more.addClass("select2-active"),this.opts.query({element:this.opts.element,term:term,page:page,context:context,matcher:this.opts.matcher,callback:this.bind(function(data){self.opened()&&(self.opts.populateResults.call(this,results,data.results,{term:term,page:page,context:context}),self.postprocessResults(data,!1,!1),data.more===!0?(more.detach().appendTo(results).text(evaluate(self.opts.formatLoadMore,page+1)),window.setTimeout(function(){self.loadMoreIfNeeded()},10)):more.remove(),self.positionDropdown(),self.resultsPage=page,self.context=data.context,this.opts.element.trigger({type:"select2-loaded",items:data}))})})))},tokenize:function(){},updateResults:function(initial){function postRender(){search.removeClass("select2-active"),self.positionDropdown(),self.liveRegion.text(results.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?results.text():self.opts.formatMatches(results.find(".select2-result-selectable").length))}function render(html){results.html(html),postRender()}var data,input,queryNumber,search=this.search,results=this.results,opts=this.opts,self=this,term=search.val(),lastTerm=$.data(this.container,"select2-last-term");if((initial===!0||!lastTerm||!equal(term,lastTerm))&&($.data(this.container,"select2-last-term",term),initial===!0||this.showSearchInput!==!1&&this.opened())){queryNumber=++this.queryCount;var maxSelSize=this.getMaximumSelectionSize();if(maxSelSize>=1&&(data=this.data(),$.isArray(data)&&data.length>=maxSelSize&&checkFormatter(opts.formatSelectionTooBig,"formatSelectionTooBig")))return void render("<li class='select2-selection-limit'>"+evaluate(opts.formatSelectionTooBig,maxSelSize)+"</li>");if(search.val().length<opts.minimumInputLength)return render(checkFormatter(opts.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+evaluate(opts.formatInputTooShort,search.val(),opts.minimumInputLength)+"</li>":""),void(initial&&this.showSearch&&this.showSearch(!0));if(opts.maximumInputLength&&search.val().length>opts.maximumInputLength)return void render(checkFormatter(opts.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+evaluate(opts.formatInputTooLong,search.val(),opts.maximumInputLength)+"</li>":"");opts.formatSearching&&0===this.findHighlightableChoices().length&&render("<li class='select2-searching'>"+evaluate(opts.formatSearching)+"</li>"),search.addClass("select2-active"),this.removeHighlight(),input=this.tokenize(),input!=undefined&&null!=input&&search.val(input),this.resultsPage=1,opts.query({element:opts.element,term:search.val(),page:this.resultsPage,context:null,matcher:opts.matcher,callback:this.bind(function(data){var def;if(queryNumber==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(this.context=data.context===undefined?null:data.context,this.opts.createSearchChoice&&""!==search.val()&&(def=this.opts.createSearchChoice.call(self,search.val(),data.results),def!==undefined&&null!==def&&self.id(def)!==undefined&&null!==self.id(def)&&0===$(data.results).filter(function(){return equal(self.id(this),self.id(def))}).length&&this.opts.createSearchChoicePosition(data.results,def)),0===data.results.length&&checkFormatter(opts.formatNoMatches,"formatNoMatches"))return void render("<li class='select2-no-results'>"+evaluate(opts.formatNoMatches,search.val())+"</li>");results.empty(),self.opts.populateResults.call(this,results,data.results,{term:search.val(),page:this.resultsPage,context:null}),data.more===!0&&checkFormatter(opts.formatLoadMore,"formatLoadMore")&&(results.append("<li class='select2-more-results'>"+self.opts.escapeMarkup(evaluate(opts.formatLoadMore,this.resultsPage))+"</li>"),window.setTimeout(function(){self.loadMoreIfNeeded()},10)),this.postprocessResults(data,initial),postRender(),this.opts.element.trigger({type:"select2-loaded",items:data})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){focus(this.search)},selectHighlighted:function(options){if(this._touchMoved)return void this.clearTouchMoved();var index=this.highlight(),highlighted=this.results.find(".select2-highlighted"),data=highlighted.closest(".select2-result").data("select2-data");data?(this.highlight(index),this.onSelect(data,options)):options&&options.noFocus&&this.close()},getPlaceholder:function(){var placeholderOption;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((placeholderOption=this.getPlaceholderOption())!==undefined?placeholderOption.text():undefined)},getPlaceholderOption:function(){if(this.select){var firstOption=this.select.children("option").first();if(this.opts.placeholderOption!==undefined)return"first"===this.opts.placeholderOption&&firstOption||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===$.trim(firstOption.text())&&""===firstOption.val())return firstOption}},initContainerWidth:function(){function resolveContainerWidth(){var style,attrs,matches,i,l,attr;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(style=this.opts.element.attr("style"),style!==undefined)for(attrs=style.split(";"),i=0,l=attrs.length;l>i;i+=1)if(attr=attrs[i].replace(/\s/g,""),matches=attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==matches&&matches.length>=1)return matches[1];return"resolve"===this.opts.width?(style=this.opts.element.css("width"),style.indexOf("%")>0?style:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return $.isFunction(this.opts.width)?this.opts.width():this.opts.width}var width=resolveContainerWidth.call(this);null!==width&&this.container.css("width",width)}}),SingleSelect2=clazz(AbstractSelect2,{createContainer:function(){var container=$(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return container},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var el,range,len;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),el=this.search.get(0),el.createTextRange?(range=el.createTextRange(),range.collapse(!1),range.select()):el.setSelectionRange&&(len=this.search.val().length,el.setSelectionRange(len,len))),""===this.search.val()&&this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger($.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){$("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),cleanupJQueryElements.call(this,"selection","focusser")},initContainer:function(){var selection,elementLabel,container=this.container,dropdown=this.dropdown,idSuffix=nextUid();this.showSearch(this.opts.minimumResultsForSearch<0?!1:!0),this.selection=selection=container.find(".select2-choice"),this.focusser=container.find(".select2-focusser"),selection.find(".select2-chosen").attr("id","select2-chosen-"+idSuffix),this.focusser.attr("aria-labelledby","select2-chosen-"+idSuffix),this.results.attr("id","select2-results-"+idSuffix),this.search.attr("aria-owns","select2-results-"+idSuffix),this.focusser.attr("id","s2id_autogen"+idSuffix),elementLabel=$("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(elementLabel.text()).attr("for",this.focusser.attr("id"));var originalTitle=this.opts.element.attr("title");this.opts.element.attr("title",originalTitle||elementLabel.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text($("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){if(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN)return void killEvent(e);switch(e.which){case KEY.UP:case KEY.DOWN:return this.moveHighlight(e.which===KEY.UP?-1:1),void killEvent(e);case KEY.ENTER:return this.selectHighlighted(),void killEvent(e);case KEY.TAB:return void this.selectHighlighted({noFocus:!0});case KEY.ESC:return this.cancel(e),void killEvent(e)}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==KEY.TAB&&!KEY.isControl(e)&&!KEY.isFunctionKey(e)&&e.which!==KEY.ESC){if(this.opts.openOnEnter===!1&&e.which===KEY.ENTER)return void killEvent(e);if(e.which==KEY.DOWN||e.which==KEY.UP||e.which==KEY.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void killEvent(e)}return e.which==KEY.DELETE||e.which==KEY.BACKSPACE?(this.opts.allowClear&&this.clear(),void killEvent(e)):void 0}})),installKeyUpChangeEvent(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),selection.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),killEventImmediately(e),this.close(),this.selection.focus())})),selection.on("mousedown touchstart",this.bind(function(e){reinsertElement(selection),this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),killEvent(e)})),dropdown.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),selection.on("focus",this.bind(function(e){killEvent(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger($.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(triggerChange){var data=this.selection.data("select2-data");if(data){var evt=$.Event("select2-clearing");if(this.opts.element.trigger(evt),evt.isDefaultPrevented())return;var placeholderOption=this.getPlaceholderOption();this.opts.element.val(placeholderOption?placeholderOption.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),triggerChange!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data}),this.triggerChange({removed:data}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var self=this;this.opts.initSelection.call(null,this.opts.element,function(selected){selected!==undefined&&null!==selected&&(self.updateSelection(selected),self.close(),self.setPlaceholder(),self.nextSearchTerm=self.opts.nextSearchTerm(selected,self.search.val()))})}},isPlaceholderOptionSelected:function(){var placeholderOption;return this.getPlaceholder()===undefined?!1:(placeholderOption=this.getPlaceholderOption())!==undefined&&placeholderOption.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===undefined||null===this.opts.element.val()},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;return"select"===opts.element.get(0).tagName.toLowerCase()?opts.initSelection=function(element,callback){var selected=element.find("option").filter(function(){return this.selected&&!this.disabled});callback(self.optionToData(selected))}:"data"in opts&&(opts.initSelection=opts.initSelection||function(element,callback){var id=element.val(),match=null;opts.query({matcher:function(term,text,el){var is_match=equal(id,opts.id(el));return is_match&&(match=el),is_match},callback:$.isFunction(callback)?function(){callback(match)}:$.noop})}),opts},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===undefined?undefined:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var placeholder=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&placeholder!==undefined){if(this.select&&this.getPlaceholderOption()===undefined)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(data,initial,noHighlightUpdate){var selected=0,self=this;if(this.findHighlightableChoices().each2(function(i,elm){return equal(self.id(elm.data("select2-data")),self.opts.element.val())?(selected=i,!1):void 0}),noHighlightUpdate!==!1&&this.highlight(initial===!0&&selected>=0?selected:0),initial===!0){var min=this.opts.minimumResultsForSearch;min>=0&&this.showSearch(countResults(data.results)>=min)}},showSearch:function(showSearchInput){this.showSearchInput!==showSearchInput&&(this.showSearchInput=showSearchInput,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!showSearchInput),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!showSearchInput),$(this.dropdown,this.container).toggleClass("select2-with-searchbox",showSearchInput))},onSelect:function(data,options){if(this.triggerSelect(data)){var old=this.opts.element.val(),oldData=this.data();this.opts.element.val(this.id(data)),this.updateSelection(data),this.opts.element.trigger({type:"select2-selected",val:this.id(data),choice:data}),this.nextSearchTerm=this.opts.nextSearchTerm(data,this.search.val()),this.close(),options&&options.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),equal(old,this.id(data))||this.triggerChange({added:data,removed:oldData})}},updateSelection:function(data){var formatted,cssClass,container=this.selection.find(".select2-chosen");this.selection.data("select2-data",data),container.empty(),null!==data&&(formatted=this.opts.formatSelection(data,container,this.opts.escapeMarkup)),formatted!==undefined&&container.append(formatted),cssClass=this.opts.formatSelectionCssClass(data,container),cssClass!==undefined&&container.addClass(cssClass),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==undefined&&this.container.addClass("select2-allowclear")},val:function(){var val,triggerChange=!1,data=null,self=this,oldData=this.data();if(0===arguments.length)return this.opts.element.val();if(val=arguments[0],arguments.length>1&&(triggerChange=arguments[1]),this.select)this.select.val(val).find("option").filter(function(){return this.selected}).each2(function(i,elm){return data=self.optionToData(elm),!1}),this.updateSelection(data),this.setPlaceholder(),triggerChange&&this.triggerChange({added:data,removed:oldData});else{if(!val&&0!==val)return void this.clear(triggerChange);if(this.opts.initSelection===undefined)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(val),this.opts.initSelection(this.opts.element,function(data){self.opts.element.val(data?self.id(data):""),self.updateSelection(data),self.setPlaceholder(),triggerChange&&self.triggerChange({added:data,removed:oldData})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(value){var data,triggerChange=!1;return 0===arguments.length?(data=this.selection.data("select2-data"),data==undefined&&(data=null),data):(arguments.length>1&&(triggerChange=arguments[1]),void(value?(data=this.data(),this.opts.element.val(value?this.id(value):""),this.updateSelection(value),triggerChange&&this.triggerChange({added:value,removed:data})):this.clear(triggerChange)))}}),MultiSelect2=clazz(AbstractSelect2,{createContainer:function(){var container=$(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return container},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;return"select"===opts.element.get(0).tagName.toLowerCase()?opts.initSelection=function(element,callback){var data=[];element.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(i,elm){data.push(self.optionToData(elm))}),callback(data)}:"data"in opts&&(opts.initSelection=opts.initSelection||function(element,callback){var ids=splitVal(element.val(),opts.separator),matches=[];opts.query({matcher:function(term,text,el){var is_match=$.grep(ids,function(id){return equal(id,opts.id(el))}).length;return is_match&&matches.push(el),is_match},callback:$.isFunction(callback)?function(){for(var ordered=[],i=0;i<ids.length;i++)for(var id=ids[i],j=0;j<matches.length;j++){var match=matches[j];if(equal(id,opts.id(match))){ordered.push(match),matches.splice(j,1);break}}callback(ordered)}:$.noop})}),opts},selectChoice:function(choice){var selected=this.container.find(".select2-search-choice-focus");selected.length&&choice&&choice[0]==selected[0]||(selected.length&&this.opts.element.trigger("choice-deselected",selected),selected.removeClass("select2-search-choice-focus"),choice&&choice.length&&(this.close(),choice.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",choice)))},destroy:function(){$("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),cleanupJQueryElements.call(this,"searchContainer","selection")},initContainer:function(){var selection,selector=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=selection=this.container.find(selector);var _this=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){_this.search[0].focus(),_this.selectChoice($(this))}),this.search.attr("id","s2id_autogen"+nextUid()),this.search.prev().text($("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var selected=selection.find(".select2-search-choice-focus"),prev=selected.prev(".select2-search-choice:not(.select2-locked)"),next=selected.next(".select2-search-choice:not(.select2-locked)"),pos=getCursorInfo(this.search);if(selected.length&&(e.which==KEY.LEFT||e.which==KEY.RIGHT||e.which==KEY.BACKSPACE||e.which==KEY.DELETE||e.which==KEY.ENTER)){var selectedChoice=selected;return e.which==KEY.LEFT&&prev.length?selectedChoice=prev:e.which==KEY.RIGHT?selectedChoice=next.length?next:null:e.which===KEY.BACKSPACE?this.unselect(selected.first())&&(this.search.width(10),selectedChoice=prev.length?prev:next):e.which==KEY.DELETE?this.unselect(selected.first())&&(this.search.width(10),selectedChoice=next.length?next:null):e.which==KEY.ENTER&&(selectedChoice=null),this.selectChoice(selectedChoice),killEvent(e),void(selectedChoice&&selectedChoice.length||this.open())}if((e.which===KEY.BACKSPACE&&1==this.keydowns||e.which==KEY.LEFT)&&0==pos.offset&&!pos.length)return this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last()),void killEvent(e);if(this.selectChoice(null),this.opened())switch(e.which){case KEY.UP:case KEY.DOWN:return this.moveHighlight(e.which===KEY.UP?-1:1),void killEvent(e);case KEY.ENTER:return this.selectHighlighted(),void killEvent(e);case KEY.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case KEY.ESC:return this.cancel(e),void killEvent(e)}if(e.which!==KEY.TAB&&!KEY.isControl(e)&&!KEY.isFunctionKey(e)&&e.which!==KEY.BACKSPACE&&e.which!==KEY.ESC){if(e.which===KEY.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN)&&killEvent(e),e.which===KEY.ENTER&&killEvent(e)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),e.stopImmediatePropagation(),this.opts.element.trigger($.Event("select2-blur"))})),this.container.on("click",selector,this.bind(function(e){this.isInterfaceEnabled()&&($(e.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.open(),this.focusSearch(),e.preventDefault()))})),this.container.on("focus",selector,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger($.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var self=this;this.opts.initSelection.call(null,this.opts.element,function(data){data!==undefined&&null!==data&&(self.updateSelection(data),self.close(),self.clearSearch())})}},clearSearch:function(){var placeholder=this.getPlaceholder(),maxWidth=this.getMaxSearchWidth();placeholder!==undefined&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(placeholder).addClass("select2-default"),this.search.width(maxWidth>0?maxWidth:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger($.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(data){var ids=[],filtered=[],self=this;$(data).each(function(){indexOf(self.id(this),ids)<0&&(ids.push(self.id(this)),filtered.push(this))}),data=filtered,this.selection.find(".select2-search-choice").remove(),$(data).each(function(){self.addSelectedChoice(this)}),self.postprocessResults()},tokenize:function(){var input=this.search.val();input=this.opts.tokenizer.call(this,input,this.data(),this.bind(this.onSelect),this.opts),null!=input&&input!=undefined&&(this.search.val(input),input.length>0&&this.open())},onSelect:function(data,options){this.triggerSelect(data)&&(this.addSelectedChoice(data),this.opts.element.trigger({type:"selected",val:this.id(data),choice:data}),this.nextSearchTerm=this.opts.nextSearchTerm(data,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(data,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=undefined&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:data}),options&&options.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(data){var formatted,cssClass,enableChoice=!data.locked,enabledItem=$("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),disabledItem=$("<li class='select2-search-choice select2-locked'><div></div></li>"),choice=enableChoice?enabledItem:disabledItem,id=this.id(data),val=this.getVal();
8
+ formatted=this.opts.formatSelection(data,choice.find("div"),this.opts.escapeMarkup),formatted!=undefined&&choice.find("div").replaceWith("<div>"+formatted+"</div>"),cssClass=this.opts.formatSelectionCssClass(data,choice.find("div")),cssClass!=undefined&&choice.addClass(cssClass),enableChoice&&choice.find(".select2-search-choice-close").on("mousedown",killEvent).on("click dblclick",this.bind(function(e){this.isInterfaceEnabled()&&(this.unselect($(e.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),killEvent(e),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),choice.data("select2-data",data),choice.insertBefore(this.searchContainer),val.push(id),this.setVal(val)},unselect:function(selected){var data,index,val=this.getVal();if(selected=selected.closest(".select2-search-choice"),0===selected.length)throw"Invalid argument: "+selected+". Must be .select2-search-choice";if(data=selected.data("select2-data")){var evt=$.Event("select2-removing");if(evt.val=this.id(data),evt.choice=data,this.opts.element.trigger(evt),evt.isDefaultPrevented())return!1;for(;(index=indexOf(this.id(data),val))>=0;)val.splice(index,1),this.setVal(val),this.select&&this.postprocessResults();return selected.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data}),this.triggerChange({removed:data}),!0}},postprocessResults:function(data,initial,noHighlightUpdate){var val=this.getVal(),choices=this.results.find(".select2-result"),compound=this.results.find(".select2-result-with-children"),self=this;choices.each2(function(i,choice){var id=self.id(choice.data("select2-data"));indexOf(id,val)>=0&&(choice.addClass("select2-selected"),choice.find(".select2-result-selectable").addClass("select2-selected"))}),compound.each2(function(i,choice){choice.is(".select2-result-selectable")||0!==choice.find(".select2-result-selectable:not(.select2-selected)").length||choice.addClass("select2-selected")}),-1==this.highlight()&&noHighlightUpdate!==!1&&self.highlight(0),!this.opts.createSearchChoice&&!choices.filter(".select2-result:not(.select2-selected)").length>0&&(!data||data&&!data.more&&0===this.results.find(".select2-no-results").length)&&checkFormatter(self.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+evaluate(self.opts.formatNoMatches,self.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-getSideBorderPadding(this.search)},resizeSearch:function(){var minimumWidth,left,maxWidth,containerLeft,searchWidth,sideBorderPadding=getSideBorderPadding(this.search);minimumWidth=measureTextWidth(this.search)+10,left=this.search.offset().left,maxWidth=this.selection.width(),containerLeft=this.selection.offset().left,searchWidth=maxWidth-(left-containerLeft)-sideBorderPadding,minimumWidth>searchWidth&&(searchWidth=maxWidth-sideBorderPadding),40>searchWidth&&(searchWidth=maxWidth-sideBorderPadding),0>=searchWidth&&(searchWidth=minimumWidth),this.search.width(Math.floor(searchWidth))},getVal:function(){var val;return this.select?(val=this.select.val(),null===val?[]:val):(val=this.opts.element.val(),splitVal(val,this.opts.separator))},setVal:function(val){var unique;this.select?this.select.val(val):(unique=[],$(val).each(function(){indexOf(this,unique)<0&&unique.push(this)}),this.opts.element.val(0===unique.length?"":unique.join(this.opts.separator)))},buildChangeDetails:function(old,current){for(var current=current.slice(0),old=old.slice(0),i=0;i<current.length;i++)for(var j=0;j<old.length;j++)equal(this.opts.id(current[i]),this.opts.id(old[j]))&&(current.splice(i,1),i>0&&i--,old.splice(j,1),j--);return{added:current,removed:old}},val:function(val,triggerChange){var oldData,self=this;if(0===arguments.length)return this.getVal();if(oldData=this.data(),oldData.length||(oldData=[]),!val&&0!==val)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(triggerChange&&this.triggerChange({added:this.data(),removed:oldData}));if(this.setVal(val),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),triggerChange&&this.triggerChange(this.buildChangeDetails(oldData,this.data()));else{if(this.opts.initSelection===undefined)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(data){var ids=$.map(data,self.id);self.setVal(ids),self.updateSelection(data),self.clearSearch(),triggerChange&&self.triggerChange(self.buildChangeDetails(oldData,self.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var val=[],self=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){val.push(self.opts.id($(this).data("select2-data")))}),this.setVal(val),this.triggerChange()},data:function(values,triggerChange){var ids,old,self=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return $(this).data("select2-data")}).get():(old=this.data(),values||(values=[]),ids=$.map(values,function(e){return self.opts.id(e)}),this.setVal(ids),this.updateSelection(values),this.clearSearch(),triggerChange&&this.triggerChange(this.buildChangeDetails(old,this.data())),void 0)}}),$.fn.select2=function(){var opts,select2,method,value,multiple,args=Array.prototype.slice.call(arguments,0),allowedMethods=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],valueMethods=["opened","isFocused","container","dropdown"],propertyMethods=["val","data"],methodsMap={search:"externalSearch"};return this.each(function(){if(0===args.length||"object"==typeof args[0])opts=0===args.length?{}:$.extend({},args[0]),opts.element=$(this),"select"===opts.element.get(0).tagName.toLowerCase()?multiple=opts.element.prop("multiple"):(multiple=opts.multiple||!1,"tags"in opts&&(opts.multiple=multiple=!0)),select2=multiple?new window.Select2["class"].multi:new window.Select2["class"].single,select2.init(opts);else{if("string"!=typeof args[0])throw"Invalid arguments to select2 plugin: "+args;if(indexOf(args[0],allowedMethods)<0)throw"Unknown method: "+args[0];if(value=undefined,select2=$(this).data("select2"),select2===undefined)return;if(method=args[0],"container"===method?value=select2.container:"dropdown"===method?value=select2.dropdown:(methodsMap[method]&&(method=methodsMap[method]),value=select2[method].apply(select2,args.slice(1))),indexOf(args[0],valueMethods)>=0||indexOf(args[0],propertyMethods)>=0&&1==args.length)return!1}}),value===undefined?this:value},$.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(result,container,query,escapeMarkup){var markup=[];return markMatch(result.text,query.term,markup,escapeMarkup),markup.join("")},formatSelection:function(data,container,escapeMarkup){return data?escapeMarkup(data.text):undefined},sortResults:function(results){return results},formatResultCssClass:function(data){return data.css},formatSelectionCssClass:function(){return undefined},formatMatches:function(matches){return matches+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(input,min){var n=min-input.length;return"Please enter "+n+" or more character"+(1==n?"":"s")},formatInputTooLong:function(input,max){var n=input.length-max;return"Please delete "+n+" character"+(1==n?"":"s")},formatSelectionTooBig:function(limit){return"You can only select "+limit+" item"+(1==limit?"":"s")},formatLoadMore:function(){return"Loading more results…"},formatSearching:function(){return"Searching…"},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==undefined?null:e.id},matcher:function(term,text){return stripDiacritics(""+text).toUpperCase().indexOf(stripDiacritics(""+term).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:defaultTokenizer,escapeMarkup:defaultEscapeMarkup,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(c){return c},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return undefined},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(instance){var supportsTouchEvents="ontouchstart"in window||navigator.msMaxTouchPoints>0;return supportsTouchEvents&&instance.opts.minimumResultsForSearch<0?!1:!0}},$.fn.select2.ajaxDefaults={transport:$.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:ajax,local:local,tags:tags},util:{debounce:debounce,markMatch:markMatch,escapeMarkup:defaultEscapeMarkup,stripDiacritics:stripDiacritics},"class":{"abstract":AbstractSelect2,single:SingleSelect2,multi:MultiSelect2}}}}(jQuery),jQuery(document).ready(function($){$("#filter_action, #filter_content, #filter_form").change(function(){$("#leadin-contacts-filter-button").addClass("button-primary")})});
assets/js/build/leadin-subscribe.js CHANGED
@@ -344,38 +344,12 @@ ignore_date.setTime(ignore_date.getTime() + (60 * 60 * 24 * 14 * 1000));
344
  jQuery(document).ready( function ( $ ) {
345
  var li_subscribe_flag = $.cookie('li_subscribe');
346
 
347
- var preview_subscribe = leadin_get_parameter_by_name('preview-subscribe');
348
-
349
- if ( !preview_subscribe )
350
  {
351
- if ( ! li_subscribe_flag )
352
- {
353
- leadin_check_visitor_status($.cookie("li_hash"), function ( data ) {
354
- if ( data != 'vex_set' )
355
- {
356
- $.cookie("li_subscribe", 'show', {path: "/", domain: ""});
357
- bind_leadin_subscribe_widget(
358
- $('#leadin-subscribe-heading').val(),
359
- $('#leadin-subscribe-text').val(),
360
- $('#leadin-subscribe-name-fields').val(),
361
- $('#leadin-subscribe-phone-field').val(),
362
- $('#leadin-subscribe-btn-label').val(),
363
- $('#leadin-subscribe-btn-color').val(),
364
- $('#leadin-subscribe-vex-class').val(),
365
- $('#leadin-subscribe-confirmation').val(),
366
- $('#leadin-subscribe-mobile-popup').val()
367
- );
368
- }
369
- else
370
- {
371
- $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
372
- }
373
- });
374
- }
375
- else
376
- {
377
- if ( li_subscribe_flag == 'show' )
378
  {
 
379
  bind_leadin_subscribe_widget(
380
  $('#leadin-subscribe-heading').val(),
381
  $('#leadin-subscribe-text').val(),
@@ -386,25 +360,30 @@ jQuery(document).ready( function ( $ ) {
386
  $('#leadin-subscribe-vex-class').val(),
387
  $('#leadin-subscribe-confirmation').val(),
388
  $('#leadin-subscribe-mobile-popup').val()
389
- );
390
  }
391
- }
 
 
 
 
392
  }
393
- else if ( preview_subscribe )
394
  {
395
- bind_leadin_subscribe_widget(
396
- leadin_get_parameter_by_name('lis_heading'),
397
- leadin_get_parameter_by_name('lis_desc'),
398
- leadin_get_parameter_by_name('lis_show_names'),
399
- leadin_get_parameter_by_name('lis_show_phone'),
400
- leadin_get_parameter_by_name('lis_btn_label'),
401
- leadin_get_parameter_by_name('lis_btn_color'),
402
- leadin_get_parameter_by_name('lis_vex_class'),
403
- leadin_get_parameter_by_name('lis_confirmation'),
404
- leadin_get_parameter_by_name('lis_mobile_popup')
405
- );
406
-
407
- subscribe.open();
 
408
  }
409
  });
410
 
344
  jQuery(document).ready( function ( $ ) {
345
  var li_subscribe_flag = $.cookie('li_subscribe');
346
 
347
+ if ( ! li_subscribe_flag )
 
 
348
  {
349
+ leadin_check_visitor_status($.cookie("li_hash"), function ( data ) {
350
+ if ( data != 'vex_set' )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  {
352
+ $.cookie("li_subscribe", 'show', {path: "/", domain: ""});
353
  bind_leadin_subscribe_widget(
354
  $('#leadin-subscribe-heading').val(),
355
  $('#leadin-subscribe-text').val(),
360
  $('#leadin-subscribe-vex-class').val(),
361
  $('#leadin-subscribe-confirmation').val(),
362
  $('#leadin-subscribe-mobile-popup').val()
363
+ );
364
  }
365
+ else
366
+ {
367
+ $.cookie("li_subscribe", 'ignore', {path: "/", domain: "", expires: ignore_date});
368
+ }
369
+ });
370
  }
371
+ else
372
  {
373
+ if ( li_subscribe_flag == 'show' )
374
+ {
375
+ bind_leadin_subscribe_widget(
376
+ $('#leadin-subscribe-heading').val(),
377
+ $('#leadin-subscribe-text').val(),
378
+ $('#leadin-subscribe-name-fields').val(),
379
+ $('#leadin-subscribe-phone-field').val(),
380
+ $('#leadin-subscribe-btn-label').val(),
381
+ $('#leadin-subscribe-btn-color').val(),
382
+ $('#leadin-subscribe-vex-class').val(),
383
+ $('#leadin-subscribe-confirmation').val(),
384
+ $('#leadin-subscribe-mobile-popup').val()
385
+ );
386
+ }
387
  }
388
  });
389
 
assets/js/build/leadin-subscribe.min.js CHANGED
@@ -1 +1 @@
1
- function bind_leadin_subscribe_widget(lis_heading,lis_desc,lis_show_names,lis_show_phone,lis_btn_label,lis_btn_color,lis_vex_class,lis_confirmation,lis_mobile_popup){lis_heading=lis_heading?lis_heading:"Sign up for email updates",lis_desc=lis_desc?lis_desc:"",lis_btn_label=lis_btn_label?lis_btn_label:"SUBSCRIBE",lis_btn_color=lis_btn_color?lis_btn_color:"leadin-popup-color-blue",lis_vex_class=lis_vex_class?lis_vex_class:"vex-theme-bottom-right-corner",lis_confirmation=lis_confirmation?lis_confirmation:1,lis_mobile_popup=lis_mobile_popup?lis_mobile_popup:1,function(){var $=jQuery,subscribe={};subscribe.vex=void 0,subscribe.init=function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open(),$(window).scroll(function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open()})},subscribe.open=function(){return subscribe.vex?subscribe._open():(subscribe.vex=vex.dialog.open({showCloseButton:!0,className:"leadin-subscribe "+lis_vex_class+" "+lis_btn_color+(1==lis_mobile_popup?"":" leadin-subscribe-mobile-hide"),message:"<h4>"+lis_heading+"</h4><p>"+lis_desc+"</p>",input:'<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" />'+(parseInt(lis_show_names)?'<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" />':"")+(parseInt(lis_show_phone)?'<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" />':""),buttons:[$.extend({},vex.dialog.buttons.YES,{text:lis_btn_label?lis_btn_label:"SUBSCRIBE"})],onSubmit:function(){$subscribe_form=$(this),$subscribe_form.find("input.error").removeClass("error");var form_validated=!0;return $subscribe_form.find("input").each(function(){var $input=$(this);$input.val()||($input.addClass("error"),form_validated=!1)}),form_validated?($(".vex-dialog-form").fadeOut(300,function(){$(".vex-dialog-form").html('<div class="vex-close"></div>'+(parseInt(lis_confirmation)?"<h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3>":"<h3>Thanks!<br>We received your submission.</h3>")+'<div id="powered-by-leadin-thank-you"><span class="powered-by">Powered by</span><br><a href="http://leadin.com/wordpress-subscribe-widget?utm_source=virality&utm_medium=referral&utm_term='+window.location.host+'&utm_content=e11&utm_campaign=subscribe%20widget"><img alt="Leadin" height="20px" width="99px" src="'+document.location.protocol+'//leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a></div>').css("text-align","center").fadeIn(250)}),leadin_submit_form($(".leadin-subscribe form"),$),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),!1):!1},callback:function(data){data===!1&&$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})}}),void $(".leadin-subscribe form.vex-dialog-form").append('<a href="http://leadin.com/wordpress-subscribe-widget?utm_source=virality&utm_medium=referral&utm_term='+window.location.host+'&utm_content=e11&utm_campaign=subscribe%20widget" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by Leadin</a>'))},subscribe._open=function(){subscribe.vex.parent().removeClass("vex-closing")},subscribe.close=function(){subscribe.vex&&subscribe.vex.parent().addClass("vex-closing")},subscribe.init(),window.subscribe=subscribe}()}function leadin_subscribe_show(){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_subscribe_show"},success:function(){},error:function(){}})}function leadin_get_parameter_by_name(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}(function(){var vexFactory;vexFactory=function($){var animationEndSupport,vex;return animationEndSupport=!1,$(function(){var s;return s=(document.body||document.documentElement).style,animationEndSupport=void 0!==s.animation||void 0!==s.WebkitAnimation||void 0!==s.MozAnimation||void 0!==s.MsAnimation||void 0!==s.OAnimation,$(window).bind("keyup.vex",function(event){return 27===event.keyCode?vex.closeByEscape():void 0})}),vex={globalID:1,animationEndEvent:"animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",baseClassNames:{vex:"vex",content:"vex-content",overlay:"vex-overlay",close:"vex-close",closing:"vex-closing",open:"vex-open"},defaultOptions:{content:"",showCloseButton:!0,escapeButtonCloses:!0,overlayClosesOnClick:!0,appendLocation:"body",className:"",css:{},overlayClassName:"",overlayCSS:{},contentClassName:"",contentCSS:{},closeClassName:"",closeCSS:{}},open:function(options){return options=$.extend({},vex.defaultOptions,options),options.id=vex.globalID,vex.globalID+=1,options.$vex=$("<div>").addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({vex:options}),options.$vexOverlay=$("<div>").addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({vex:options}),options.overlayClosesOnClick&&options.$vexOverlay.bind("click.vex",function(e){return e.target===this?vex.close($(this).data().vex.id):void 0}),options.$vex.append(options.$vexOverlay),options.$vexContent=$("<div>").addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).append(options.content).data({vex:options}),options.$vex.append(options.$vexContent),options.showCloseButton&&(options.$closeButton=$("<div>").addClass(vex.baseClassNames.close).addClass(options.closeClassName).css(options.closeCSS).data({vex:options}).bind("click.vex",function(){return vex.close($(this).data().vex.id)}),options.$vexContent.append(options.$closeButton)),$(options.appendLocation).append(options.$vex),vex.setupBodyClassName(options.$vex),options.afterOpen&&options.afterOpen(options.$vexContent,options),setTimeout(function(){return options.$vexContent.trigger("vexOpen",options)},0),options.$vexContent},getAllVexes:function(){return $("."+vex.baseClassNames.vex+':not(".'+vex.baseClassNames.closing+'") .'+vex.baseClassNames.content)},getVexByID:function(id){return vex.getAllVexes().filter(function(){return $(this).data().vex.id===id})},close:function(id){var $lastVex;if(!id){if($lastVex=vex.getAllVexes().last(),!$lastVex.length)return!1;id=$lastVex.data().vex.id}return vex.closeByID(id)},closeAll:function(){var ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?($.each(ids.reverse(),function(index,id){return vex.closeByID(id)}),!0):!1},closeByID:function(id){var $vex,$vexContent,beforeClose,close,options;return $vexContent=vex.getVexByID(id),$vexContent.length?($vex=$vexContent.data().vex.$vex,options=$.extend({},$vexContent.data().vex),beforeClose=function(){return options.beforeClose?options.beforeClose($vexContent,options):void 0},close=function(){return $vexContent.trigger("vexClose",options),$vex.remove(),options.afterClose?options.afterClose($vexContent,options):void 0},animationEndSupport?(beforeClose(),$vex.unbind(vex.animationEndEvent).bind(vex.animationEndEvent,function(){return close()}).addClass(vex.baseClassNames.closing)):(beforeClose(),close()),!0):void 0},closeByEscape:function(){var $lastVex,id,ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?(id=Math.max.apply(Math,ids),$lastVex=vex.getVexByID(id),$lastVex.data().vex.escapeButtonCloses!==!0?!1:vex.closeByID(id)):!1},setupBodyClassName:function($vex){return $vex.bind("vexOpen.vex",function(){return $("body").addClass(vex.baseClassNames.open)}).bind("vexClose.vex",function(){return vex.getAllVexes().length?void 0:$("body").removeClass(vex.baseClassNames.open)})},hideLoading:function(){return $(".vex-loading-spinner").remove()},showLoading:function(){return vex.hideLoading(),$("body").append('<div class="vex-loading-spinner '+vex.defaultOptions.className+'"></div>')}}},"function"==typeof define&&define.amd?define(["jquery"],vexFactory):"object"==typeof exports?module.exports=vexFactory(require("jquery")):window.vex=vexFactory(jQuery)}).call(this),function(){var vexDialogFactory;vexDialogFactory=function($,vex){var $formToObject,dialog;return null==vex?$.error("Vex is required to use vex.dialog"):($formToObject=function($form){var object;return object={},$.each($form.serializeArray(),function(){return object[this.name]?(object[this.name].push||(object[this.name]=[object[this.name]]),object[this.name].push(this.value||"")):object[this.name]=this.value||""}),object},dialog={},dialog.buttons={YES:{text:"OK",type:"submit",className:"vex-dialog-button-primary"},NO:{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function($vexContent){return $vexContent.data().vex.value=!1,vex.close($vexContent.data().vex.id)}}},dialog.defaultOptions={callback:function(){},afterOpen:function(){},message:"Message",input:'<input name="vex" type="hidden" value="_vex-empty-value" />',value:!1,buttons:[dialog.buttons.YES,dialog.buttons.NO],showCloseButton:!1,onSubmit:function(event){var $form,$vexContent;return $form=$(this),$vexContent=$form.parent(),event.preventDefault(),event.stopPropagation(),$vexContent.data().vex.value=dialog.getFormValueOnSubmit($formToObject($form)),vex.close($vexContent.data().vex.id)},focusFirstInput:!0},dialog.defaultAlertOptions={message:"Alert",buttons:[dialog.buttons.YES]},dialog.defaultConfirmOptions={message:"Confirm"},dialog.open=function(options){var $vexContent;return options=$.extend({},vex.defaultOptions,dialog.defaultOptions,options),options.content=dialog.buildDialogForm(options),options.beforeClose=function($vexContent){return options.callback($vexContent.data().vex.value)},$vexContent=vex.open(options),options.focusFirstInput&&$vexContent.find('input[type="submit"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus(),$vexContent},dialog.alert=function(options){return"string"==typeof options&&(options={message:options}),options=$.extend({},dialog.defaultAlertOptions,options),dialog.open(options)},dialog.confirm=function(options){return"string"==typeof options?$.error("dialog.confirm(options) requires options.callback."):(options=$.extend({},dialog.defaultConfirmOptions,options),dialog.open(options))},dialog.prompt=function(options){var defaultPromptOptions;return"string"==typeof options?$.error("dialog.prompt(options) requires options.callback."):(defaultPromptOptions={message:'<label for="vex">'+(options.label||"Prompt:")+"</label>",input:'<input name="vex" type="text" class="vex-dialog-prompt-input" placeholder="'+(options.placeholder||"")+'" value="'+(options.value||"")+'" />'},options=$.extend({},defaultPromptOptions,options),dialog.open(options))},dialog.buildDialogForm=function(options){var $form,$input,$message;return $form=$('<form class="vex-dialog-form" />'),$message=$('<div class="vex-dialog-message" />'),$input=$('<div class="vex-dialog-input" />'),$form.append($message.append(options.message)).append($input.append(options.input)).append(dialog.buttonsToDOM(options.buttons)).bind("submit.vex",options.onSubmit),$form},dialog.getFormValueOnSubmit=function(formData){return formData.vex||""===formData.vex?"_vex-empty-value"===formData.vex?!0:formData.vex:formData},dialog.buttonsToDOM=function(buttons){var $buttons;return $buttons=$('<div class="vex-dialog-buttons" />'),$.each(buttons,function(index,button){return $buttons.append($('<input type="'+button.type+'" />').val(button.text).addClass(button.className+" vex-dialog-button "+(0===index?"vex-first ":"")+(index===buttons.length-1?"vex-last ":"")).bind("click.vex",function(e){return button.click?button.click($(this).parents("."+vex.baseClassNames.content),e):void 0}))}),$buttons},dialog)},"function"==typeof define&&define.amd?define(["jquery","vex"],vexDialogFactory):"object"==typeof exports?module.exports=vexDialogFactory(require("jquery"),require("vex")):window.vex.dialog=vexDialogFactory(window.jQuery,window.vex)}.call(this);var ignore_date=new Date;ignore_date.setTime(ignore_date.getTime()+12096e5),jQuery(document).ready(function($){var li_subscribe_flag=$.cookie("li_subscribe"),preview_subscribe=leadin_get_parameter_by_name("preview-subscribe");preview_subscribe?preview_subscribe&&(bind_leadin_subscribe_widget(leadin_get_parameter_by_name("lis_heading"),leadin_get_parameter_by_name("lis_desc"),leadin_get_parameter_by_name("lis_show_names"),leadin_get_parameter_by_name("lis_show_phone"),leadin_get_parameter_by_name("lis_btn_label"),leadin_get_parameter_by_name("lis_btn_color"),leadin_get_parameter_by_name("lis_vex_class"),leadin_get_parameter_by_name("lis_confirmation"),leadin_get_parameter_by_name("lis_mobile_popup")),subscribe.open()):li_subscribe_flag?"show"==li_subscribe_flag&&bind_leadin_subscribe_widget($("#leadin-subscribe-heading").val(),$("#leadin-subscribe-text").val(),$("#leadin-subscribe-name-fields").val(),$("#leadin-subscribe-phone-field").val(),$("#leadin-subscribe-btn-label").val(),$("#leadin-subscribe-btn-color").val(),$("#leadin-subscribe-vex-class").val(),$("#leadin-subscribe-confirmation").val(),$("#leadin-subscribe-mobile-popup").val()):leadin_check_visitor_status($.cookie("li_hash"),function(data){"vex_set"!=data?($.cookie("li_subscribe","show",{path:"/",domain:""}),bind_leadin_subscribe_widget($("#leadin-subscribe-heading").val(),$("#leadin-subscribe-text").val(),$("#leadin-subscribe-name-fields").val(),$("#leadin-subscribe-phone-field").val(),$("#leadin-subscribe-btn-label").val(),$("#leadin-subscribe-btn-color").val(),$("#leadin-subscribe-vex-class").val(),$("#leadin-subscribe-confirmation").val(),$("#leadin-subscribe-mobile-popup").val())):$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})})});
1
+ function bind_leadin_subscribe_widget(lis_heading,lis_desc,lis_show_names,lis_show_phone,lis_btn_label,lis_btn_color,lis_vex_class,lis_confirmation,lis_mobile_popup){lis_heading=lis_heading?lis_heading:"Sign up for email updates",lis_desc=lis_desc?lis_desc:"",lis_btn_label=lis_btn_label?lis_btn_label:"SUBSCRIBE",lis_btn_color=lis_btn_color?lis_btn_color:"leadin-popup-color-blue",lis_vex_class=lis_vex_class?lis_vex_class:"vex-theme-bottom-right-corner",lis_confirmation=lis_confirmation?lis_confirmation:1,lis_mobile_popup=lis_mobile_popup?lis_mobile_popup:1,function(){var $=jQuery,subscribe={};subscribe.vex=void 0,subscribe.init=function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open(),$(window).scroll(function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open()})},subscribe.open=function(){return subscribe.vex?subscribe._open():(subscribe.vex=vex.dialog.open({showCloseButton:!0,className:"leadin-subscribe "+lis_vex_class+" "+lis_btn_color+(1==lis_mobile_popup?"":" leadin-subscribe-mobile-hide"),message:"<h4>"+lis_heading+"</h4><p>"+lis_desc+"</p>",input:'<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" />'+(parseInt(lis_show_names)?'<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" />':"")+(parseInt(lis_show_phone)?'<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" />':""),buttons:[$.extend({},vex.dialog.buttons.YES,{text:lis_btn_label?lis_btn_label:"SUBSCRIBE"})],onSubmit:function(){$subscribe_form=$(this),$subscribe_form.find("input.error").removeClass("error");var form_validated=!0;return $subscribe_form.find("input").each(function(){var $input=$(this);$input.val()||($input.addClass("error"),form_validated=!1)}),form_validated?($(".vex-dialog-form").fadeOut(300,function(){$(".vex-dialog-form").html('<div class="vex-close"></div>'+(parseInt(lis_confirmation)?"<h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3>":"<h3>Thanks!<br>We received your submission.</h3>")+'<div id="powered-by-leadin-thank-you"><span class="powered-by">Powered by</span><br><a href="http://leadin.com/wordpress-subscribe-widget?utm_source=virality&utm_medium=referral&utm_term='+window.location.host+'&utm_content=e11&utm_campaign=subscribe%20widget"><img alt="Leadin" height="20px" width="99px" src="'+document.location.protocol+'//leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a></div>').css("text-align","center").fadeIn(250)}),leadin_submit_form($(".leadin-subscribe form"),$),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),!1):!1},callback:function(data){data===!1&&$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})}}),void $(".leadin-subscribe form.vex-dialog-form").append('<a href="http://leadin.com/wordpress-subscribe-widget?utm_source=virality&utm_medium=referral&utm_term='+window.location.host+'&utm_content=e11&utm_campaign=subscribe%20widget" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by Leadin</a>'))},subscribe._open=function(){subscribe.vex.parent().removeClass("vex-closing")},subscribe.close=function(){subscribe.vex&&subscribe.vex.parent().addClass("vex-closing")},subscribe.init(),window.subscribe=subscribe}()}function leadin_subscribe_show(){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_subscribe_show"},success:function(){},error:function(){}})}function leadin_get_parameter_by_name(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}(function(){var vexFactory;vexFactory=function($){var animationEndSupport,vex;return animationEndSupport=!1,$(function(){var s;return s=(document.body||document.documentElement).style,animationEndSupport=void 0!==s.animation||void 0!==s.WebkitAnimation||void 0!==s.MozAnimation||void 0!==s.MsAnimation||void 0!==s.OAnimation,$(window).bind("keyup.vex",function(event){return 27===event.keyCode?vex.closeByEscape():void 0})}),vex={globalID:1,animationEndEvent:"animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",baseClassNames:{vex:"vex",content:"vex-content",overlay:"vex-overlay",close:"vex-close",closing:"vex-closing",open:"vex-open"},defaultOptions:{content:"",showCloseButton:!0,escapeButtonCloses:!0,overlayClosesOnClick:!0,appendLocation:"body",className:"",css:{},overlayClassName:"",overlayCSS:{},contentClassName:"",contentCSS:{},closeClassName:"",closeCSS:{}},open:function(options){return options=$.extend({},vex.defaultOptions,options),options.id=vex.globalID,vex.globalID+=1,options.$vex=$("<div>").addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({vex:options}),options.$vexOverlay=$("<div>").addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({vex:options}),options.overlayClosesOnClick&&options.$vexOverlay.bind("click.vex",function(e){return e.target===this?vex.close($(this).data().vex.id):void 0}),options.$vex.append(options.$vexOverlay),options.$vexContent=$("<div>").addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).append(options.content).data({vex:options}),options.$vex.append(options.$vexContent),options.showCloseButton&&(options.$closeButton=$("<div>").addClass(vex.baseClassNames.close).addClass(options.closeClassName).css(options.closeCSS).data({vex:options}).bind("click.vex",function(){return vex.close($(this).data().vex.id)}),options.$vexContent.append(options.$closeButton)),$(options.appendLocation).append(options.$vex),vex.setupBodyClassName(options.$vex),options.afterOpen&&options.afterOpen(options.$vexContent,options),setTimeout(function(){return options.$vexContent.trigger("vexOpen",options)},0),options.$vexContent},getAllVexes:function(){return $("."+vex.baseClassNames.vex+':not(".'+vex.baseClassNames.closing+'") .'+vex.baseClassNames.content)},getVexByID:function(id){return vex.getAllVexes().filter(function(){return $(this).data().vex.id===id})},close:function(id){var $lastVex;if(!id){if($lastVex=vex.getAllVexes().last(),!$lastVex.length)return!1;id=$lastVex.data().vex.id}return vex.closeByID(id)},closeAll:function(){var ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?($.each(ids.reverse(),function(index,id){return vex.closeByID(id)}),!0):!1},closeByID:function(id){var $vex,$vexContent,beforeClose,close,options;return $vexContent=vex.getVexByID(id),$vexContent.length?($vex=$vexContent.data().vex.$vex,options=$.extend({},$vexContent.data().vex),beforeClose=function(){return options.beforeClose?options.beforeClose($vexContent,options):void 0},close=function(){return $vexContent.trigger("vexClose",options),$vex.remove(),options.afterClose?options.afterClose($vexContent,options):void 0},animationEndSupport?(beforeClose(),$vex.unbind(vex.animationEndEvent).bind(vex.animationEndEvent,function(){return close()}).addClass(vex.baseClassNames.closing)):(beforeClose(),close()),!0):void 0},closeByEscape:function(){var $lastVex,id,ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?(id=Math.max.apply(Math,ids),$lastVex=vex.getVexByID(id),$lastVex.data().vex.escapeButtonCloses!==!0?!1:vex.closeByID(id)):!1},setupBodyClassName:function($vex){return $vex.bind("vexOpen.vex",function(){return $("body").addClass(vex.baseClassNames.open)}).bind("vexClose.vex",function(){return vex.getAllVexes().length?void 0:$("body").removeClass(vex.baseClassNames.open)})},hideLoading:function(){return $(".vex-loading-spinner").remove()},showLoading:function(){return vex.hideLoading(),$("body").append('<div class="vex-loading-spinner '+vex.defaultOptions.className+'"></div>')}}},"function"==typeof define&&define.amd?define(["jquery"],vexFactory):"object"==typeof exports?module.exports=vexFactory(require("jquery")):window.vex=vexFactory(jQuery)}).call(this),function(){var vexDialogFactory;vexDialogFactory=function($,vex){var $formToObject,dialog;return null==vex?$.error("Vex is required to use vex.dialog"):($formToObject=function($form){var object;return object={},$.each($form.serializeArray(),function(){return object[this.name]?(object[this.name].push||(object[this.name]=[object[this.name]]),object[this.name].push(this.value||"")):object[this.name]=this.value||""}),object},dialog={},dialog.buttons={YES:{text:"OK",type:"submit",className:"vex-dialog-button-primary"},NO:{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function($vexContent){return $vexContent.data().vex.value=!1,vex.close($vexContent.data().vex.id)}}},dialog.defaultOptions={callback:function(){},afterOpen:function(){},message:"Message",input:'<input name="vex" type="hidden" value="_vex-empty-value" />',value:!1,buttons:[dialog.buttons.YES,dialog.buttons.NO],showCloseButton:!1,onSubmit:function(event){var $form,$vexContent;return $form=$(this),$vexContent=$form.parent(),event.preventDefault(),event.stopPropagation(),$vexContent.data().vex.value=dialog.getFormValueOnSubmit($formToObject($form)),vex.close($vexContent.data().vex.id)},focusFirstInput:!0},dialog.defaultAlertOptions={message:"Alert",buttons:[dialog.buttons.YES]},dialog.defaultConfirmOptions={message:"Confirm"},dialog.open=function(options){var $vexContent;return options=$.extend({},vex.defaultOptions,dialog.defaultOptions,options),options.content=dialog.buildDialogForm(options),options.beforeClose=function($vexContent){return options.callback($vexContent.data().vex.value)},$vexContent=vex.open(options),options.focusFirstInput&&$vexContent.find('input[type="submit"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus(),$vexContent},dialog.alert=function(options){return"string"==typeof options&&(options={message:options}),options=$.extend({},dialog.defaultAlertOptions,options),dialog.open(options)},dialog.confirm=function(options){return"string"==typeof options?$.error("dialog.confirm(options) requires options.callback."):(options=$.extend({},dialog.defaultConfirmOptions,options),dialog.open(options))},dialog.prompt=function(options){var defaultPromptOptions;return"string"==typeof options?$.error("dialog.prompt(options) requires options.callback."):(defaultPromptOptions={message:'<label for="vex">'+(options.label||"Prompt:")+"</label>",input:'<input name="vex" type="text" class="vex-dialog-prompt-input" placeholder="'+(options.placeholder||"")+'" value="'+(options.value||"")+'" />'},options=$.extend({},defaultPromptOptions,options),dialog.open(options))},dialog.buildDialogForm=function(options){var $form,$input,$message;return $form=$('<form class="vex-dialog-form" />'),$message=$('<div class="vex-dialog-message" />'),$input=$('<div class="vex-dialog-input" />'),$form.append($message.append(options.message)).append($input.append(options.input)).append(dialog.buttonsToDOM(options.buttons)).bind("submit.vex",options.onSubmit),$form},dialog.getFormValueOnSubmit=function(formData){return formData.vex||""===formData.vex?"_vex-empty-value"===formData.vex?!0:formData.vex:formData},dialog.buttonsToDOM=function(buttons){var $buttons;return $buttons=$('<div class="vex-dialog-buttons" />'),$.each(buttons,function(index,button){return $buttons.append($('<input type="'+button.type+'" />').val(button.text).addClass(button.className+" vex-dialog-button "+(0===index?"vex-first ":"")+(index===buttons.length-1?"vex-last ":"")).bind("click.vex",function(e){return button.click?button.click($(this).parents("."+vex.baseClassNames.content),e):void 0}))}),$buttons},dialog)},"function"==typeof define&&define.amd?define(["jquery","vex"],vexDialogFactory):"object"==typeof exports?module.exports=vexDialogFactory(require("jquery"),require("vex")):window.vex.dialog=vexDialogFactory(window.jQuery,window.vex)}.call(this);var ignore_date=new Date;ignore_date.setTime(ignore_date.getTime()+12096e5),jQuery(document).ready(function($){var li_subscribe_flag=$.cookie("li_subscribe");li_subscribe_flag?"show"==li_subscribe_flag&&bind_leadin_subscribe_widget($("#leadin-subscribe-heading").val(),$("#leadin-subscribe-text").val(),$("#leadin-subscribe-name-fields").val(),$("#leadin-subscribe-phone-field").val(),$("#leadin-subscribe-btn-label").val(),$("#leadin-subscribe-btn-color").val(),$("#leadin-subscribe-vex-class").val(),$("#leadin-subscribe-confirmation").val(),$("#leadin-subscribe-mobile-popup").val()):leadin_check_visitor_status($.cookie("li_hash"),function(data){"vex_set"!=data?($.cookie("li_subscribe","show",{path:"/",domain:""}),bind_leadin_subscribe_widget($("#leadin-subscribe-heading").val(),$("#leadin-subscribe-text").val(),$("#leadin-subscribe-name-fields").val(),$("#leadin-subscribe-phone-field").val(),$("#leadin-subscribe-btn-label").val(),$("#leadin-subscribe-btn-color").val(),$("#leadin-subscribe-vex-class").val(),$("#leadin-subscribe-confirmation").val(),$("#leadin-subscribe-mobile-popup").val())):$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})})});
assets/js/build/leadin-tracking.js CHANGED
@@ -359,20 +359,29 @@ function leadin_submit_form ( $form, $ )
359
  // Set first name
360
  if ( ! lead_first_name )
361
  {
362
- if ( lower_label_text == 'first' || lower_label_text == 'first name' || lower_label_text == 'name' || lower_label_text == 'your name' )
 
 
363
  lead_first_name = $value;
364
  }
365
 
366
  // Set last name
367
  if ( ! lead_last_name )
368
  {
369
- if ( lower_label_text == 'last' || lower_label_text == 'last name' || lower_label_text == 'your last name' || lower_label_text == 'surname' )
 
 
370
  lead_last_name = $value;
371
  }
372
 
373
  // Set phone number
374
- if ( lower_label_text == 'phone' || lower_label_text == 'phone' )
375
- lead_phone = $value;
 
 
 
 
 
376
  });
377
 
378
  var radio_groups = [];
359
  // Set first name
360
  if ( ! lead_first_name )
361
  {
362
+ if ( $element.attr('id') == 'leadin-subscribe-fname' )
363
+ lead_first_name = $value;
364
+ else if ( lower_label_text == 'first' || lower_label_text == 'first name' || lower_label_text == 'name' || lower_label_text == 'your name' )
365
  lead_first_name = $value;
366
  }
367
 
368
  // Set last name
369
  if ( ! lead_last_name )
370
  {
371
+ if ( $element.attr('id') == 'leadin-subscribe-lname' )
372
+ lead_last_name = $value;
373
+ else if ( lower_label_text == 'last' || lower_label_text == 'last name' || lower_label_text == 'your last name' || lower_label_text == 'surname' )
374
  lead_last_name = $value;
375
  }
376
 
377
  // Set phone number
378
+ if ( ! lead_phone )
379
+ {
380
+ if ( $element.attr('id') == 'leadin-subscribe-phone' )
381
+ lead_phone = $value;
382
+ else if ( lower_label_text == 'phone' || lower_label_text == 'phone' )
383
+ lead_phone = $value;
384
+ }
385
  });
386
 
387
  var radio_groups = [];
assets/js/build/leadin-tracking.min.js CHANGED
@@ -1 +1 @@
1
- function leadin_start_debug_mode(){return leadin_debug_mode=!0,jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_print_debug_values"},success:function(data){console.log("SERVER CONFIG:\n------------\n"),console.log("jQuery version: "+jQuery.fn.jquery+"\n"),console.log(data),-1!=jQuery.versioncompare("1.7.0",jQuery.fn.jquery)&&console.log("- jQuery version < 1.7.0")},error:function(){}}),"Debug started..."}function leadin_submit_form($form,$){leadin_debug_mode&&(console.log("\nFUNCTION FIRED: leadin_submit_form()"),console.log("FIELDS:\n-----------\n"));var $this=$form,form_fields=[],lead_email="",lead_first_name="",lead_last_name="",lead_phone="",form_selector_id=$form.attr("id")?$form.attr("id"):"",form_selector_classes=$form.classes()?$form.classes().join(","):"";$this.find('input[type!="submit"], textarea').not('input[type="hidden"], input[type="radio"], input[type="password"]').each(function(){var $element=$(this),$value=$element.val();if(!$element.is(":visible"))return!0;var $label=$("label[for='"+$element.attr("id")+"']").text();0==$label.length&&$("#"+$element.attr("id")+"_label").length&&($label=$("#"+$element.attr("id")+"_label").text()),0==$label.length&&($label=$element.prev("label").not(".li_used").addClass("li_used").first().text(),$label.length||($label=$element.prevAll("b, strong, span").text())),0==$label.length&&($label=$element.next("label").not(".li_used").addClass("li_used").first().text(),$label.length||($label=$element.nextAll("b, strong, span").text())),0==$label.length&&($label=$element.parent().find("label, b, strong").not(".li_used").first().text()),0==$label.length&&$.contains($this,$element.parent().parent())&&($label=$element.parent().parent().find("label, b, strong").first().text()),0==$label.length&&($p=$element.closest("p").not(".li_used").addClass("li_used"),$p.length&&($label=$p.text(),$label=$.trim($label.replace($value,"")))),0==$label.length&&void 0!==$element.attr("placeholder")&&($label=$element.attr("placeholder").toString()),0==$label.length&&void 0!==$element.attr("name")&&($label=$element.attr("name").toString()),$element.is(":checkbox")&&($value=$element.is(":checked")?"Checked":"Not checked"),$value=$value.replace("C:\\fakepath\\","");var $label_text=$.trim($label.replaceArray(["(",")","required","Required","*",":"],[""])),lower_label_text=$label_text.toLowerCase();ignore_field($label_text,$value)?leadin_debug_mode&&console.log(" - Skipping... label: "+$label+" value: "+$value):push_form_field($label_text,$value,form_fields),-1==$value.indexOf("@")||-1==$value.indexOf(".")||lead_email||(lead_email=$value),lead_first_name||("first"==lower_label_text||"first name"==lower_label_text||"name"==lower_label_text||"your name"==lower_label_text)&&(lead_first_name=$value),lead_last_name||("last"==lower_label_text||"last name"==lower_label_text||"your last name"==lower_label_text||"surname"==lower_label_text)&&(lead_last_name=$value),("phone"==lower_label_text||"phone"==lower_label_text)&&(lead_phone=$value)});var radio_groups=[],rbg_label_values=[];$this.find(":radio").each(function(){-1==$.inArray(this.name,radio_groups)&&radio_groups.push(this.name),rbg_label_values.push($(this).val())});for(var i=0;i<radio_groups.length;i++){{var $rbg=$("input:radio[name='"+radio_groups[i]+"']");$("input:radio[name='"+radio_groups[i]+"']:checked").val()}$p=$this.find(".gfield").length?$rbg.closest(".gfield").not(".li_used").addClass("li_used"):$this.find(".frm_form_field").length?$rbg.closest(".frm_form_field").not(".li_used").addClass("li_used"):$rbg.closest("div, p").not(".li_used").addClass("li_used"),$p.length&&($rbg_label=$p.text(),$rbg_label=$.trim($rbg_label.replaceArray(rbg_label_values,[""]).replace($p.find(".gfield_description").text(),"")));var rgb_selected=$("input:radio[name='"+radio_groups[i]+"']:checked").val()?$("input:radio[name='"+radio_groups[i]+"']:checked").val():"not selected";ignore_field($rbg_label,rgb_selected)?leadin_debug_mode&&console.log("Skipping... label: "+$label+" value: "+$value):push_form_field($rbg_label,rgb_selected,form_fields)}if($this.find("select").each(function(){var $select=$(this),$select_label=$("label[for='"+$select.attr("id")+"']").text();if(!$select_label.length){var select_values=[];$select.find("option").each(function(){-1==$.inArray($(this).val(),select_values)&&select_values.push($(this).val())}),$p=$select.closest("div, p").not(".li_used").addClass("li_used"),$p=$this.find(".gfield").length?$select.closest(".gfield").not(".li_used").addClass("li_used"):$select.closest("div, p").addClass("li_used"),$p.length&&($select_label=$p.text(),$select_label=$.trim($select_label.replaceArray(select_values,[""]).replace($p.find(".gfield_description").text(),"")))}var select_value="";if($select.val()instanceof Array){var select_vals=$select.val();for(i=0;i<select_vals.length;i++)select_value+=select_vals[i],i!=select_vals.length-1&&(select_value+=", ")}else select_value=$select.find("option:selected").text()?$select.find("option:selected").text():$select.val();ignore_field($select_label,select_value)?leadin_debug_mode&&console.log("Skipping... label: "+$label+" value: "+$value):push_form_field($select_label,select_value,form_fields)}),$this.find(".li_used").removeClass("li_used"),lead_email){leadin_debug_mode&&console.log("\nFOUND lead_email: "+lead_email+"\n"),ignore_form&&push_form_field("Credit card form submitted","Payment fields not collected for security",form_fields);var submission_hash=Math.random().toString(36).slice(2),hashkey=$.cookie("li_hash"),json_form_fields=JSON.stringify(form_fields),form_submission={};form_submission={submission_hash:submission_hash,hashkey:hashkey,lead_email:lead_email,lead_first_name:lead_first_name,lead_last_name:lead_last_name,lead_phone:lead_phone,page_title:page_title,page_url:page_url,json_form_fields:json_form_fields,form_selector_id:form_selector_id,form_selector_classes:form_selector_classes},leadin_debug_mode&&(console.log("\nFORM SUBMISSION OBJECT:"),console.log(form_submission)),$.cookie("li_submission",JSON.stringify(form_submission),{path:"/",domain:""}),leadin_insert_form_submission(submission_hash,hashkey,page_title,page_url,json_form_fields,lead_email,lead_first_name,lead_last_name,lead_phone,form_selector_id,form_selector_classes,function(){$.removeCookie("li_submission",{path:"/",domain:""})})}else form_saved=!0,leadin_debug_mode&&console.log("ERROR: lead_email not found\n")}function leadin_check_merged_contact(hashkey){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_check_merged_contact",li_id:hashkey},success:function(data){var json_data=jQuery.parseJSON(data);json_data&&jQuery.cookie("li_hash",json_data,{path:"/",domain:""})},error:function(){}})}function leadin_check_visitor_status(hashkey,callback){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_check_visitor_status",li_id:hashkey},success:function(data){var json_data=jQuery.parseJSON(data);callback&&callback(json_data)},error:function(){}})}function leadin_log_pageview(hashkey,page_title,page_url,page_referrer,last_visit){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_log_pageview",li_id:hashkey,li_title:page_title,li_url:page_url,li_referrer:page_referrer,li_last_visit:last_visit},success:function(){},error:function(){}})}function leadin_insert_lead(hashkey,page_referrer){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_insert_lead",li_id:hashkey,li_referrer:page_referrer},success:function(){},error:function(){}})}function leadin_insert_form_submission(submission_haskey,hashkey,page_title,page_url,json_fields,lead_email,lead_first_name,lead_last_name,lead_phone,form_selector_id,form_selector_classes,Callback){leadin_debug_mode&&console.log("\nFUNCTION FIRED: leadin_insert_form_submission()"),jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_insert_form_submission",li_submission_id:submission_haskey,li_id:hashkey,li_title:page_title,li_url:page_url,li_fields:json_fields,li_email:lead_email,li_first_name:lead_first_name,li_last_name:lead_last_name,li_phone:lead_phone,li_form_selector_id:form_selector_id,li_form_selector_classes:form_selector_classes},success:function(data){leadin_debug_mode&&console.log("RESULT rows updated: "+data),Callback&&Callback(data)},error:function(){}})}function push_form_field(label,value,form_fields){var field={label:label,value:value};form_fields.push(field),leadin_debug_mode&&console.log(" + Adding... [label:] "+label+" [value:] "+value)}function ignore_field(label,value){var bool_ignore_field=!1;(-1!=label.toLowerCase().indexOf("credit card")||-1!=label.toLowerCase().indexOf("card number"))&&(bool_ignore_field=!0),(-1!=label.toLowerCase().indexOf("expiration")||-1!=label.toLowerCase().indexOf("expiry"))&&(bool_ignore_field=!0),("month"==label.toLowerCase()||"mm"==label.toLowerCase()||"yy"==label.toLowerCase()||"yyyy"==label.toLowerCase()||"year"==label.toLowerCase())&&(bool_ignore_field=!0),(-1!=label.toLowerCase().indexOf("cvv")||-1!=label.toLowerCase().indexOf("cvc")||-1!=label.toLowerCase().indexOf("secure code")||-1!=label.toLowerCase().indexOf("security code"))&&(bool_ignore_field=!0),("visa"==value.toLowerCase()||"mastercard"==value.toLowerCase()||"american express"==value.toLowerCase()||"amex"==value.toLowerCase()||"discover"==value.toLowerCase())&&(bool_ignore_field=!0);var int_regex=new RegExp("/^[0-9]+$/");if(int_regex.test(value)){var value_no_spaces=value.replace(" ","");isInt(value_no_spaces)&&value_no_spaces.length>=16&&(bool_ignore_field=!0)}return label.length>250&&(bool_ignore_field=!0),bool_ignore_field?(ignore_form||(ignore_form=!0),!0):!1}function isInt(n){return"number"==typeof n&&isFinite(n)&&n%1===0}!function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):factory(jQuery)}(function($){function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){0===s.indexOf('"')&&(s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return s=decodeURIComponent(s.replace(pluses," ")),config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var pluses=/\+/g,config=$.cookie=function(key,value,options){if(void 0!==value&&!$.isFunction(value)){if(options=$.extend({},config.defaults,options),"number"==typeof options.expires){var days=options.expires,t=options.expires=new Date;t.setDate(t.getDate()+days)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}for(var result=key?void 0:{},cookies=document.cookie?document.cookie.split("; "):[],i=0,l=cookies.length;l>i;i++){var parts=cookies[i].split("="),name=decode(parts.shift()),cookie=parts.join("=");if(key&&key===name){result=read(cookie,value);break}key||void 0===(cookie=read(cookie))||(result[name]=cookie)}return result};config.defaults={},$.removeCookie=function(key,options){return void 0===$.cookie(key)?!1:($.cookie(key,"",$.extend({},options,{expires:-1})),!$.cookie(key))}});var page_title=jQuery(document).find("title").text(),page_url=window.location.href,page_referrer=document.referrer,form_saved=!1,ignore_form=!1,leadin_debug_mode=!1;jQuery(document).ready(function($){var hashkey=$.cookie("li_hash"),li_submission_cookie=$.cookie("li_submission");if(li_submission_cookie){var submission_data=JSON.parse(li_submission_cookie);leadin_insert_form_submission(submission_data.submission_hash,submission_data.hashkey,submission_data.page_title,submission_data.page_url,submission_data.json_form_fields,submission_data.lead_email,submission_data.lead_first_name,submission_data.lead_last_name,submission_data.lead_phone,submission_data.form_selector_id,submission_data.form_selector_classes,function(){$.removeCookie("li_submission",{path:"/",domain:""})})}hashkey||(hashkey=Math.random().toString(36).slice(2),$.cookie("li_hash",hashkey,{path:"/",domain:""}),leadin_insert_lead(hashkey,page_referrer)),leadin_log_pageview(hashkey,page_title,page_url,page_referrer,$.cookie("li_last_visit"));var date=new Date,current_time=date.getTime();date.setTime(date.getTime()+36e5),$.cookie("li_last_visit")||leadin_check_merged_contact(hashkey),$.cookie("li_last_visit",current_time,{path:"/",domain:"",expires:date})}),jQuery(function($){-1!=$.versioncompare($.fn.jquery,"1.7.0")?$(document).on("submit","form",function(){if(!("loginform"==$(this).attr("id")&&-1!=$(this).attr("action").indexOf("wp-login.php")||"lostpasswordform"==$(this).attr("id")&&-1!=$(this).attr("action").indexOf("wp-login.php"))){var $form=$(this).closest("form");leadin_submit_form($form,$)}}):$(document).bind("submit","form",function(){if(!("loginform"==$(this).attr("id")&&-1!=$(this).attr("action").indexOf("wp-login.php")||"lostpasswordform"==$(this).attr("id")&&-1!=$(this).attr("action").indexOf("wp-login.php"))){var $form=$(this).closest("form");leadin_submit_form($form,$)}})}),String.prototype.replaceArray=function(find,replace){for(var replaceString=this,i=0;i<find.length;i++)replaceString=1!=replace.length?replaceString.replace(find[i],replace[i]):replaceString.replace(find[i],replace[0]);return replaceString},function($){function normalize(version){return $.map(version.split("."),function(value){return parseInt(value,10)})}$.versioncompare=function(version1,version2){if("undefined"==typeof version1)throw new Error("$.versioncompare needs at least one parameter.");if(version2=version2||$.fn.jquery,version1==version2)return 0;for(var v1=normalize(version1),v2=normalize(version2),len=Math.max(v1.length,v2.length),i=0;len>i;i++)if(v1[i]=v1[i]||0,v2[i]=v2[i]||0,v1[i]!=v2[i])return v1[i]>v2[i]?1:-1;return 0}}(jQuery),function($){$.fn.classes=function(callback){var classes=[];if($.each(this,function(i,v){var splitClassName=v.className.split(/\s+/);for(var j in splitClassName){var className=splitClassName[j];-1===classes.indexOf(className)&&classes.push(className)}}),"function"==typeof callback)for(var i in classes)callback(classes[i]);return classes}}(jQuery);
1
+ function leadin_start_debug_mode(){return leadin_debug_mode=!0,jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_print_debug_values"},success:function(data){console.log("SERVER CONFIG:\n------------\n"),console.log("jQuery version: "+jQuery.fn.jquery+"\n"),console.log(data),-1!=jQuery.versioncompare("1.7.0",jQuery.fn.jquery)&&console.log("- jQuery version < 1.7.0")},error:function(){}}),"Debug started..."}function leadin_submit_form($form,$){leadin_debug_mode&&(console.log("\nFUNCTION FIRED: leadin_submit_form()"),console.log("FIELDS:\n-----------\n"));var $this=$form,form_fields=[],lead_email="",lead_first_name="",lead_last_name="",lead_phone="",form_selector_id=$form.attr("id")?$form.attr("id"):"",form_selector_classes=$form.classes()?$form.classes().join(","):"";$this.find('input[type!="submit"], textarea').not('input[type="hidden"], input[type="radio"], input[type="password"]').each(function(){var $element=$(this),$value=$element.val();if(!$element.is(":visible"))return!0;var $label=$("label[for='"+$element.attr("id")+"']").text();0==$label.length&&$("#"+$element.attr("id")+"_label").length&&($label=$("#"+$element.attr("id")+"_label").text()),0==$label.length&&($label=$element.prev("label").not(".li_used").addClass("li_used").first().text(),$label.length||($label=$element.prevAll("b, strong, span").text())),0==$label.length&&($label=$element.next("label").not(".li_used").addClass("li_used").first().text(),$label.length||($label=$element.nextAll("b, strong, span").text())),0==$label.length&&($label=$element.parent().find("label, b, strong").not(".li_used").first().text()),0==$label.length&&$.contains($this,$element.parent().parent())&&($label=$element.parent().parent().find("label, b, strong").first().text()),0==$label.length&&($p=$element.closest("p").not(".li_used").addClass("li_used"),$p.length&&($label=$p.text(),$label=$.trim($label.replace($value,"")))),0==$label.length&&void 0!==$element.attr("placeholder")&&($label=$element.attr("placeholder").toString()),0==$label.length&&void 0!==$element.attr("name")&&($label=$element.attr("name").toString()),$element.is(":checkbox")&&($value=$element.is(":checked")?"Checked":"Not checked"),$value=$value.replace("C:\\fakepath\\","");var $label_text=$.trim($label.replaceArray(["(",")","required","Required","*",":"],[""])),lower_label_text=$label_text.toLowerCase();ignore_field($label_text,$value)?leadin_debug_mode&&console.log(" - Skipping... label: "+$label+" value: "+$value):push_form_field($label_text,$value,form_fields),-1==$value.indexOf("@")||-1==$value.indexOf(".")||lead_email||(lead_email=$value),lead_first_name||("leadin-subscribe-fname"==$element.attr("id")?lead_first_name=$value:("first"==lower_label_text||"first name"==lower_label_text||"name"==lower_label_text||"your name"==lower_label_text)&&(lead_first_name=$value)),lead_last_name||("leadin-subscribe-lname"==$element.attr("id")?lead_last_name=$value:("last"==lower_label_text||"last name"==lower_label_text||"your last name"==lower_label_text||"surname"==lower_label_text)&&(lead_last_name=$value)),lead_phone||("leadin-subscribe-phone"==$element.attr("id")?lead_phone=$value:("phone"==lower_label_text||"phone"==lower_label_text)&&(lead_phone=$value))});var radio_groups=[],rbg_label_values=[];$this.find(":radio").each(function(){-1==$.inArray(this.name,radio_groups)&&radio_groups.push(this.name),rbg_label_values.push($(this).val())});for(var i=0;i<radio_groups.length;i++){{var $rbg=$("input:radio[name='"+radio_groups[i]+"']");$("input:radio[name='"+radio_groups[i]+"']:checked").val()}$p=$this.find(".gfield").length?$rbg.closest(".gfield").not(".li_used").addClass("li_used"):$this.find(".frm_form_field").length?$rbg.closest(".frm_form_field").not(".li_used").addClass("li_used"):$rbg.closest("div, p").not(".li_used").addClass("li_used"),$p.length&&($rbg_label=$p.text(),$rbg_label=$.trim($rbg_label.replaceArray(rbg_label_values,[""]).replace($p.find(".gfield_description").text(),"")));var rgb_selected=$("input:radio[name='"+radio_groups[i]+"']:checked").val()?$("input:radio[name='"+radio_groups[i]+"']:checked").val():"not selected";ignore_field($rbg_label,rgb_selected)?leadin_debug_mode&&console.log("Skipping... label: "+$label+" value: "+$value):push_form_field($rbg_label,rgb_selected,form_fields)}if($this.find("select").each(function(){var $select=$(this),$select_label=$("label[for='"+$select.attr("id")+"']").text();if(!$select_label.length){var select_values=[];$select.find("option").each(function(){-1==$.inArray($(this).val(),select_values)&&select_values.push($(this).val())}),$p=$select.closest("div, p").not(".li_used").addClass("li_used"),$p=$this.find(".gfield").length?$select.closest(".gfield").not(".li_used").addClass("li_used"):$select.closest("div, p").addClass("li_used"),$p.length&&($select_label=$p.text(),$select_label=$.trim($select_label.replaceArray(select_values,[""]).replace($p.find(".gfield_description").text(),"")))}var select_value="";if($select.val()instanceof Array){var select_vals=$select.val();for(i=0;i<select_vals.length;i++)select_value+=select_vals[i],i!=select_vals.length-1&&(select_value+=", ")}else select_value=$select.find("option:selected").text()?$select.find("option:selected").text():$select.val();ignore_field($select_label,select_value)?leadin_debug_mode&&console.log("Skipping... label: "+$label+" value: "+$value):push_form_field($select_label,select_value,form_fields)}),$this.find(".li_used").removeClass("li_used"),lead_email){leadin_debug_mode&&console.log("\nFOUND lead_email: "+lead_email+"\n"),ignore_form&&push_form_field("Credit card form submitted","Payment fields not collected for security",form_fields);var submission_hash=Math.random().toString(36).slice(2),hashkey=$.cookie("li_hash"),json_form_fields=JSON.stringify(form_fields),form_submission={};form_submission={submission_hash:submission_hash,hashkey:hashkey,lead_email:lead_email,lead_first_name:lead_first_name,lead_last_name:lead_last_name,lead_phone:lead_phone,page_title:page_title,page_url:page_url,json_form_fields:json_form_fields,form_selector_id:form_selector_id,form_selector_classes:form_selector_classes},leadin_debug_mode&&(console.log("\nFORM SUBMISSION OBJECT:"),console.log(form_submission)),$.cookie("li_submission",JSON.stringify(form_submission),{path:"/",domain:""}),leadin_insert_form_submission(submission_hash,hashkey,page_title,page_url,json_form_fields,lead_email,lead_first_name,lead_last_name,lead_phone,form_selector_id,form_selector_classes,function(){$.removeCookie("li_submission",{path:"/",domain:""})})}else form_saved=!0,leadin_debug_mode&&console.log("ERROR: lead_email not found\n")}function leadin_check_merged_contact(hashkey){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_check_merged_contact",li_id:hashkey},success:function(data){var json_data=jQuery.parseJSON(data);json_data&&jQuery.cookie("li_hash",json_data,{path:"/",domain:""})},error:function(){}})}function leadin_check_visitor_status(hashkey,callback){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_check_visitor_status",li_id:hashkey},success:function(data){var json_data=jQuery.parseJSON(data);callback&&callback(json_data)},error:function(){}})}function leadin_log_pageview(hashkey,page_title,page_url,page_referrer,last_visit){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_log_pageview",li_id:hashkey,li_title:page_title,li_url:page_url,li_referrer:page_referrer,li_last_visit:last_visit},success:function(){},error:function(){}})}function leadin_insert_lead(hashkey,page_referrer){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_insert_lead",li_id:hashkey,li_referrer:page_referrer},success:function(){},error:function(){}})}function leadin_insert_form_submission(submission_haskey,hashkey,page_title,page_url,json_fields,lead_email,lead_first_name,lead_last_name,lead_phone,form_selector_id,form_selector_classes,Callback){leadin_debug_mode&&console.log("\nFUNCTION FIRED: leadin_insert_form_submission()"),jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_insert_form_submission",li_submission_id:submission_haskey,li_id:hashkey,li_title:page_title,li_url:page_url,li_fields:json_fields,li_email:lead_email,li_first_name:lead_first_name,li_last_name:lead_last_name,li_phone:lead_phone,li_form_selector_id:form_selector_id,li_form_selector_classes:form_selector_classes},success:function(data){leadin_debug_mode&&console.log("RESULT rows updated: "+data),Callback&&Callback(data)},error:function(){}})}function push_form_field(label,value,form_fields){var field={label:label,value:value};form_fields.push(field),leadin_debug_mode&&console.log(" + Adding... [label:] "+label+" [value:] "+value)}function ignore_field(label,value){var bool_ignore_field=!1;(-1!=label.toLowerCase().indexOf("credit card")||-1!=label.toLowerCase().indexOf("card number"))&&(bool_ignore_field=!0),(-1!=label.toLowerCase().indexOf("expiration")||-1!=label.toLowerCase().indexOf("expiry"))&&(bool_ignore_field=!0),("month"==label.toLowerCase()||"mm"==label.toLowerCase()||"yy"==label.toLowerCase()||"yyyy"==label.toLowerCase()||"year"==label.toLowerCase())&&(bool_ignore_field=!0),(-1!=label.toLowerCase().indexOf("cvv")||-1!=label.toLowerCase().indexOf("cvc")||-1!=label.toLowerCase().indexOf("secure code")||-1!=label.toLowerCase().indexOf("security code"))&&(bool_ignore_field=!0),("visa"==value.toLowerCase()||"mastercard"==value.toLowerCase()||"american express"==value.toLowerCase()||"amex"==value.toLowerCase()||"discover"==value.toLowerCase())&&(bool_ignore_field=!0);var int_regex=new RegExp("/^[0-9]+$/");if(int_regex.test(value)){var value_no_spaces=value.replace(" ","");isInt(value_no_spaces)&&value_no_spaces.length>=16&&(bool_ignore_field=!0)}return label.length>250&&(bool_ignore_field=!0),bool_ignore_field?(ignore_form||(ignore_form=!0),!0):!1}function isInt(n){return"number"==typeof n&&isFinite(n)&&n%1===0}!function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):factory(jQuery)}(function($){function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){0===s.indexOf('"')&&(s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return s=decodeURIComponent(s.replace(pluses," ")),config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var pluses=/\+/g,config=$.cookie=function(key,value,options){if(void 0!==value&&!$.isFunction(value)){if(options=$.extend({},config.defaults,options),"number"==typeof options.expires){var days=options.expires,t=options.expires=new Date;t.setDate(t.getDate()+days)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}for(var result=key?void 0:{},cookies=document.cookie?document.cookie.split("; "):[],i=0,l=cookies.length;l>i;i++){var parts=cookies[i].split("="),name=decode(parts.shift()),cookie=parts.join("=");if(key&&key===name){result=read(cookie,value);break}key||void 0===(cookie=read(cookie))||(result[name]=cookie)}return result};config.defaults={},$.removeCookie=function(key,options){return void 0===$.cookie(key)?!1:($.cookie(key,"",$.extend({},options,{expires:-1})),!$.cookie(key))}});var page_title=jQuery(document).find("title").text(),page_url=window.location.href,page_referrer=document.referrer,form_saved=!1,ignore_form=!1,leadin_debug_mode=!1;jQuery(document).ready(function($){var hashkey=$.cookie("li_hash"),li_submission_cookie=$.cookie("li_submission");if(li_submission_cookie){var submission_data=JSON.parse(li_submission_cookie);leadin_insert_form_submission(submission_data.submission_hash,submission_data.hashkey,submission_data.page_title,submission_data.page_url,submission_data.json_form_fields,submission_data.lead_email,submission_data.lead_first_name,submission_data.lead_last_name,submission_data.lead_phone,submission_data.form_selector_id,submission_data.form_selector_classes,function(){$.removeCookie("li_submission",{path:"/",domain:""})})}hashkey||(hashkey=Math.random().toString(36).slice(2),$.cookie("li_hash",hashkey,{path:"/",domain:""}),leadin_insert_lead(hashkey,page_referrer)),leadin_log_pageview(hashkey,page_title,page_url,page_referrer,$.cookie("li_last_visit"));var date=new Date,current_time=date.getTime();date.setTime(date.getTime()+36e5),$.cookie("li_last_visit")||leadin_check_merged_contact(hashkey),$.cookie("li_last_visit",current_time,{path:"/",domain:"",expires:date})}),jQuery(function($){-1!=$.versioncompare($.fn.jquery,"1.7.0")?$(document).on("submit","form",function(){if(!("loginform"==$(this).attr("id")&&-1!=$(this).attr("action").indexOf("wp-login.php")||"lostpasswordform"==$(this).attr("id")&&-1!=$(this).attr("action").indexOf("wp-login.php"))){var $form=$(this).closest("form");leadin_submit_form($form,$)}}):$(document).bind("submit","form",function(){if(!("loginform"==$(this).attr("id")&&-1!=$(this).attr("action").indexOf("wp-login.php")||"lostpasswordform"==$(this).attr("id")&&-1!=$(this).attr("action").indexOf("wp-login.php"))){var $form=$(this).closest("form");leadin_submit_form($form,$)}})}),String.prototype.replaceArray=function(find,replace){for(var replaceString=this,i=0;i<find.length;i++)replaceString=1!=replace.length?replaceString.replace(find[i],replace[i]):replaceString.replace(find[i],replace[0]);return replaceString},function($){function normalize(version){return $.map(version.split("."),function(value){return parseInt(value,10)})}$.versioncompare=function(version1,version2){if("undefined"==typeof version1)throw new Error("$.versioncompare needs at least one parameter.");if(version2=version2||$.fn.jquery,version1==version2)return 0;for(var v1=normalize(version1),v2=normalize(version2),len=Math.max(v1.length,v2.length),i=0;len>i;i++)if(v1[i]=v1[i]||0,v2[i]=v2[i]||0,v1[i]!=v2[i])return v1[i]>v2[i]?1:-1;return 0}}(jQuery),function($){$.fn.classes=function(callback){var classes=[];if($.each(this,function(i,v){var splitClassName=v.className.split(/\s+/);for(var j in splitClassName){var className=splitClassName[j];-1===classes.indexOf(className)&&classes.push(className)}}),"function"==typeof callback)for(var i in classes)callback(classes[i]);return classes}}(jQuery);
images/Leadin_logo.png ADDED
Binary file
images/popup-bottom.png CHANGED
Binary file
images/popup-over.png CHANGED
Binary file
images/popup-top.png CHANGED
Binary file
inc/class-emailer.php CHANGED
@@ -611,7 +611,7 @@ class LI_Emailer {
611
  $fields_string = http_build_query($fields);
612
 
613
  $ch = curl_init();
614
- curl_setopt($ch,CURLOPT_URL, 'http://andygcook.com/scripts/notifications/sendgrid_email_localhost.php');
615
  curl_setopt($ch,CURLOPT_POST, 1);
616
  curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
617
  curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
611
  $fields_string = http_build_query($fields);
612
 
613
  $ch = curl_init();
614
+ curl_setopt($ch,CURLOPT_URL, 'http://leadin.com/pro/notifications/sendgrid_email.php');
615
  curl_setopt($ch,CURLOPT_POST, 1);
616
  curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
617
  curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
inc/leadin-ajax-functions.php CHANGED
@@ -490,10 +490,12 @@ add_action('wp_ajax_nopriv_leadin_get_form_selectors', 'leadin_get_form_selector
490
  * Sets the Pro flag for the Leadin Pro upgrade
491
  *
492
  */
493
- function leadin_upgrade_to_pro ( )
494
  {
495
  global $wpdb;
496
 
 
 
497
  $options = get_option('leadin_options');
498
  if ( isset($options['pro']) && $options['pro'] )
499
  {
@@ -504,27 +506,12 @@ function leadin_upgrade_to_pro ( )
504
  $updated = leadin_update_option('leadin_options', 'pro', 1);
505
  echo get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_contacts';
506
  }
507
-
508
- WPLeadIn::activate_power_up('lookups', FALSE);
509
-
510
- // Create the user in Segment
511
- $traits = leadin_get_segment_traits();
512
- $traits["last_activated"] = date("Y-m-d H:i:s");
513
- $traits["li-status"] = "activated";
514
- leadin_set_user_properties($traits);
515
-
516
- // Add the UTM tags to the options table to permanently store them
517
- $leadin_utm = get_option('leadin_utm');
518
- if ( ! $leadin_utm )
519
- leadin_update_utm_option();
520
 
521
- leadin_track_plugin_activity("Upgraded to Pro");
522
-
523
  die();
524
  }
525
 
526
- add_action('wp_ajax_leadin_upgrade_to_pro', 'leadin_upgrade_to_pro'); // Call when user logged in
527
- add_action('wp_ajax_nopriv_leadin_upgrade_to_pro', 'leadin_upgrade_to_pro'); // Call when user is not logged in
528
 
529
  /**
530
  * Checks the first entry in the pageviews table and echos flag to Javascript
@@ -566,8 +553,7 @@ function leadin_print_debug_values ( )
566
  $error_string .= "- WordPress version < 3.7. Leadin requires WordPress 3.7+\n";
567
  }
568
 
569
- $q = "SELECT table_name FROM information_schema.tables WHERE table_name LIKE '" . ( is_multisite() ? $wpdb->prefix : '' ) . "li_%'";
570
- $li_tables = $wpdb->get_results($q);
571
 
572
  $li_tables_count = count($li_tables);
573
 
490
  * Sets the Pro flag for the Leadin Pro upgrade
491
  *
492
  */
493
+ function leadin_upgrade_to_pro_ajax_call ( )
494
  {
495
  global $wpdb;
496
 
497
+ leadin_upgrade_to_pro('pro upgrade');
498
+
499
  $options = get_option('leadin_options');
500
  if ( isset($options['pro']) && $options['pro'] )
501
  {
506
  $updated = leadin_update_option('leadin_options', 'pro', 1);
507
  echo get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_contacts';
508
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
509
 
 
 
510
  die();
511
  }
512
 
513
+ add_action('wp_ajax_leadin_upgrade_to_pro_ajax_call', 'leadin_upgrade_to_pro_ajax_call'); // Call when user logged in
514
+ add_action('wp_ajax_nopriv_leadin_upgrade_to_pro_ajax_call', 'leadin_upgrade_to_pro_ajax_call'); // Call when user is not logged in
515
 
516
  /**
517
  * Checks the first entry in the pageviews table and echos flag to Javascript
553
  $error_string .= "- WordPress version < 3.7. Leadin requires WordPress 3.7+\n";
554
  }
555
 
556
+ $li_tables = leadin_check_tables_exist();
 
557
 
558
  $li_tables_count = count($li_tables);
559
 
inc/leadin-functions.php CHANGED
@@ -144,7 +144,6 @@ function leadin_get_segment_traits ()
144
  "wp-version" => $leadin_user["wp_version"],
145
  "li-version" => $leadin_user["li_version"],
146
  "li-source" => LEADIN_SOURCE,
147
- "createdAt" => date("Y-m-d H:i:s"),
148
  "website" => $leadin_user["wp_url"],
149
  "company" => $leadin_user["wp_url"],
150
  "contacts" => $leadin_user["total_contacts"],
@@ -223,6 +222,7 @@ function leadin_register_user ()
223
 
224
  $leadin_user = leadin_get_current_user();
225
  $traits = leadin_get_segment_traits();
 
226
 
227
  Segment::init(SEGMENT_WRITE_KEY);
228
 
@@ -1115,4 +1115,45 @@ function leadin_check_first_pageview_data ( )
1115
  }
1116
  }
1117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1118
  ?>
144
  "wp-version" => $leadin_user["wp_version"],
145
  "li-version" => $leadin_user["li_version"],
146
  "li-source" => LEADIN_SOURCE,
 
147
  "website" => $leadin_user["wp_url"],
148
  "company" => $leadin_user["wp_url"],
149
  "contacts" => $leadin_user["total_contacts"],
222
 
223
  $leadin_user = leadin_get_current_user();
224
  $traits = leadin_get_segment_traits();
225
+ $traits["createdAt"] = date("Y-m-d H:i:s");
226
 
227
  Segment::init(SEGMENT_WRITE_KEY);
228
 
1115
  }
1116
  }
1117
 
1118
+ /**
1119
+ * Sets the Pro flag for the Leadin Pro upgrade in the database + register user in Segment
1120
+ *
1121
+ */
1122
+ function leadin_upgrade_to_pro ( $location = '' )
1123
+ {
1124
+ global $wpdb;
1125
+
1126
+ $options = get_option('leadin_options');
1127
+ if ( ( isset($options['pro']) && ! $options['pro']) || ! isset($options['pro']) )
1128
+ {
1129
+ $updated = leadin_update_option('leadin_options', 'pro', 1);
1130
+ }
1131
+
1132
+ WPLeadIn::activate_power_up('lookups', FALSE);
1133
+
1134
+ // Create the user in Segment
1135
+ $traits = leadin_get_segment_traits();
1136
+ $traits["last_activated"] = date("Y-m-d H:i:s");
1137
+ $traits["li-status"] = "activated";
1138
+ $traits["createdAt"] = date("Y-m-d H:i:s");
1139
+ leadin_set_user_properties($traits);
1140
+
1141
+ // Add the UTM tags to the options table to permanently store them
1142
+ $leadin_utm = get_option('leadin_utm');
1143
+ if ( ! $leadin_utm )
1144
+ leadin_update_utm_option();
1145
+
1146
+ leadin_track_plugin_activity("Upgraded to Pro", array('location' => $location));
1147
+ }
1148
+
1149
+ function leadin_check_tables_exist ()
1150
+ {
1151
+ global $wpdb;
1152
+
1153
+ $q = "SELECT table_name FROM information_schema.tables WHERE table_name = '" . $wpdb->li_leads . "' OR table_name = '" . $wpdb->li_submissions . "' OR table_name = '" . $wpdb->li_pageviews . "' OR table_name = '" . $wpdb->li_tags . "' OR table_name = '" . $wpdb->li_tag_relationships . "'";
1154
+ $li_tables = $wpdb->get_results($q);
1155
+
1156
+ return $li_tables;
1157
+ }
1158
+
1159
  ?>
leadin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Leadin
4
  Plugin URI: http://leadin.com
5
  Description: Leadin is an easy-to-use marketing automation and lead tracking plugin for WordPress that helps you better understand your web site visitors.
6
- Version: 3.1.7
7
  Author: Andy Cook, Nelson Joyce
8
  Author URI: http://leadin.com
9
  License: GPL2
@@ -26,7 +26,7 @@ if ( !defined('LEADIN_DB_VERSION') )
26
  define('LEADIN_DB_VERSION', '2.2.4');
27
 
28
  if ( !defined('LEADIN_PLUGIN_VERSION') )
29
- define('LEADIN_PLUGIN_VERSION', '3.1.7');
30
 
31
  if ( !defined('MIXPANEL_PROJECT_TOKEN') )
32
  define('MIXPANEL_PROJECT_TOKEN', '2791b6942b57bbef2ba12b2452468253');
3
  Plugin Name: Leadin
4
  Plugin URI: http://leadin.com
5
  Description: Leadin is an easy-to-use marketing automation and lead tracking plugin for WordPress that helps you better understand your web site visitors.
6
+ Version: 3.1.8
7
  Author: Andy Cook, Nelson Joyce
8
  Author URI: http://leadin.com
9
  License: GPL2
26
  define('LEADIN_DB_VERSION', '2.2.4');
27
 
28
  if ( !defined('LEADIN_PLUGIN_VERSION') )
29
+ define('LEADIN_PLUGIN_VERSION', '3.1.8');
30
 
31
  if ( !defined('MIXPANEL_PROJECT_TOKEN') )
32
  define('MIXPANEL_PROJECT_TOKEN', '2791b6942b57bbef2ba12b2452468253');
power-ups/aweber-connect/admin/aweber-connect-admin.php CHANGED
@@ -31,7 +31,10 @@ class LIAweberConnectAdmin extends WPLeadInAdmin {
31
  {
32
  if ( ! isset($this->options['li_ac_ck']) )
33
  {
34
- $this->li_ac_connect_to_api($this->options['li_ac_auth_code']);
 
 
 
35
  }
36
  else
37
  {
@@ -56,7 +59,7 @@ class LIAweberConnectAdmin extends WPLeadInAdmin {
56
 
57
  if ( isset($this->options['li_ac_auth_code']) )
58
  {
59
- if ( $this->options['li_ac_auth_code'] )
60
  add_settings_field('li_print_synced_lists', 'Synced tags', array($this, 'li_print_synced_lists'), LEADIN_ADMIN_PATH, $this->power_up_settings_section);
61
  }
62
  }
@@ -69,10 +72,10 @@ class LIAweberConnectAdmin extends WPLeadInAdmin {
69
  function print_hidden_settings_fields ()
70
  {
71
  // Hacky solution to solve the Settings API overwriting the default values
72
- $li_ac_ck = ( $this->options['li_ac_ck'] ? $this->options['li_ac_ck'] : '' );
73
- $li_ac_cs = ( $this->options['li_ac_cs'] ? $this->options['li_ac_cs'] : '' );
74
- $li_ac_ak = ( $this->options['li_ac_ak'] ? $this->options['li_ac_ak'] : '' );
75
- $li_ac_as = ( $this->options['li_ac_as'] ? $this->options['li_ac_as'] : '' );
76
 
77
  if ( $li_ac_ck )
78
  {
@@ -146,7 +149,7 @@ class LIAweberConnectAdmin extends WPLeadInAdmin {
146
  $li_ac_auth_code
147
  );
148
 
149
- if ( ! isset($li_ac_auth_code) || ! $li_ac_auth_code )
150
  echo '<p><a target="_blank" href="https://help.aweber.com/hc/en-us/articles/204031226-How-Do-I-Authorize-an-App-">Get your Authorization Code</a> from <a href="https://auth.aweber.com/1.0/oauth/authorize_app/156b03fb" target="_blank">AWeber.com</a></p>';
151
  }
152
 
@@ -268,24 +271,17 @@ class LIAweberConnectAdmin extends WPLeadInAdmin {
268
  {
269
  $aweber = new LI_AWeberAPI($consumer_key, $consumer_secret);
270
  $account = $aweber->getAccount($access_key, $access_secret);
271
-
272
- return FALSE;
273
  }
274
  catch ( LI_AWeberAPIException $exc )
275
  {
276
  if ( $exc->type == 'UnauthorizedError' )
277
  {
278
- unset($this->options['li_ac_auth_code']);
279
- unset($this->options['li_ac_ck']);
280
- unset($this->options['li_ac_cs']);
281
- unset($this->options['li_ac_ak']);
282
- unset($this->options['li_ac_as']);
283
-
284
- update_option($this->power_option_name, $this->options);
285
  return TRUE;
286
  }
287
  else
 
288
  return FALSE;
 
289
 
290
  /*print "<h3>AWeberAPIException:</h3>";
291
  print " <li> Type: $exc->type <br>";
@@ -302,10 +298,20 @@ class LIAweberConnectAdmin extends WPLeadInAdmin {
302
  $auth = LI_AWeberAPI::getDataFromAweberID($auth_code);
303
  list($consumerKey, $consumerSecret, $accessKey, $accessSecret) = $auth;
304
 
305
- $this->options['li_ac_ck'] = $consumerKey;
306
- $this->options['li_ac_cs'] = $consumerSecret;
307
- $this->options['li_ac_ak'] = $accessKey;
308
- $this->options['li_ac_as'] = $accessSecret;
 
 
 
 
 
 
 
 
 
 
309
 
310
  update_option($this->power_option_name, $this->options);
311
  }
31
  {
32
  if ( ! isset($this->options['li_ac_ck']) )
33
  {
34
+ $valid = $this->li_ac_connect_to_api($this->options['li_ac_auth_code']);
35
+
36
+ if ( ! $valid )
37
+ $this->invalid_key = TRUE;
38
  }
39
  else
40
  {
59
 
60
  if ( isset($this->options['li_ac_auth_code']) )
61
  {
62
+ if ( $this->options['li_ac_auth_code'] && ! $this->invalid_key )
63
  add_settings_field('li_print_synced_lists', 'Synced tags', array($this, 'li_print_synced_lists'), LEADIN_ADMIN_PATH, $this->power_up_settings_section);
64
  }
65
  }
72
  function print_hidden_settings_fields ()
73
  {
74
  // Hacky solution to solve the Settings API overwriting the default values
75
+ $li_ac_ck = ( isset($this->options['li_ac_ck']) && $this->options['li_ac_ck'] ? $this->options['li_ac_ck'] : '' );
76
+ $li_ac_cs = ( isset($this->options['li_ac_cs']) && $this->options['li_ac_cs'] ? $this->options['li_ac_cs'] : '' );
77
+ $li_ac_ak = ( isset($this->options['li_ac_ak']) && $this->options['li_ac_ak'] ? $this->options['li_ac_ak'] : '' );
78
+ $li_ac_as = ( isset($this->options['li_ac_as']) && $this->options['li_ac_as'] ? $this->options['li_ac_as'] : '' );
79
 
80
  if ( $li_ac_ck )
81
  {
149
  $li_ac_auth_code
150
  );
151
 
152
+ if ( ! isset($li_ac_auth_code) || ! $li_ac_auth_code || $this->invalid_key )
153
  echo '<p><a target="_blank" href="https://help.aweber.com/hc/en-us/articles/204031226-How-Do-I-Authorize-an-App-">Get your Authorization Code</a> from <a href="https://auth.aweber.com/1.0/oauth/authorize_app/156b03fb" target="_blank">AWeber.com</a></p>';
154
  }
155
 
271
  {
272
  $aweber = new LI_AWeberAPI($consumer_key, $consumer_secret);
273
  $account = $aweber->getAccount($access_key, $access_secret);
 
 
274
  }
275
  catch ( LI_AWeberAPIException $exc )
276
  {
277
  if ( $exc->type == 'UnauthorizedError' )
278
  {
 
 
 
 
 
 
 
279
  return TRUE;
280
  }
281
  else
282
+ {
283
  return FALSE;
284
+ }
285
 
286
  /*print "<h3>AWeberAPIException:</h3>";
287
  print " <li> Type: $exc->type <br>";
298
  $auth = LI_AWeberAPI::getDataFromAweberID($auth_code);
299
  list($consumerKey, $consumerSecret, $accessKey, $accessSecret) = $auth;
300
 
301
+ if ( $consumerKey )
302
+ $this->options['li_ac_ck'] = $consumerKey;
303
+
304
+ if ( $consumerSecret )
305
+ $this->options['li_ac_cs'] = $consumerSecret;
306
+
307
+ if ( $accessKey )
308
+ $this->options['li_ac_ak'] = $accessKey;
309
+
310
+ if ( $accessSecret )
311
+ $this->options['li_ac_as'] = $accessSecret;
312
+
313
+ if ( ! $consumerKey && ! $consumerSecret &&! $accessKey &&! $accessSecret )
314
+ return FALSE;
315
 
316
  update_option($this->power_option_name, $this->options);
317
  }
power-ups/campaign-monitor-connect/admin/campaign-monitor-connect-admin.php CHANGED
@@ -47,7 +47,7 @@ class LICampaignMonitorConnectAdmin extends WPLeadInAdmin {
47
 
48
  if ( isset($this->options['li_cm_api_key']) )
49
  {
50
- if ( $this->options['li_cm_api_key'] )
51
  add_settings_field('li_print_synced_lists', 'Synced tags', array($this, 'li_print_synced_lists'), LEADIN_ADMIN_PATH, $this->power_up_settings_section);
52
  }
53
  }
@@ -72,14 +72,14 @@ class LICampaignMonitorConnectAdmin extends WPLeadInAdmin {
72
  */
73
  function li_cm_api_key_callback ()
74
  {
75
- $li_cm_api_key = ( $this->options['li_cm_api_key'] ? $this->options['li_cm_api_key'] : '' ); // Get header from options, or show default
76
 
77
  printf(
78
  '<input id="li_cm_api_key" type="text" id="title" name="' . $this->power_option_name . '[li_cm_api_key]" value="%s" style="width: 430px;"/>',
79
  $li_cm_api_key
80
  );
81
 
82
- if ( ! isset($li_cm_api_key) || ! $li_cm_api_key )
83
  echo '<p><a target="_blank" href="http://help.campaignmonitor.com/topic.aspx?t=206">Get your API key</a> from <a href="https://login.createsend.com/l" target="_blank">CampaignMonitor.com</a></p>';
84
  }
85
 
@@ -181,6 +181,7 @@ class LICampaignMonitorConnectAdmin extends WPLeadInAdmin {
181
  {
182
  foreach ( $clients['response'] as $client )
183
  {
 
184
  $lists = $cm->call('clients/' . $client['ClientID'] . '/lists', 'GET');
185
 
186
  if ( count($lists['response']) )
@@ -210,9 +211,6 @@ class LICampaignMonitorConnectAdmin extends WPLeadInAdmin {
210
 
211
  if ( $test['code'] >= 400 )
212
  {
213
- unset($this->options['li_cm_api_key']);
214
- update_option($this->power_option_name, $this->options);
215
-
216
  $invalid_key = TRUE;
217
  }
218
  else
47
 
48
  if ( isset($this->options['li_cm_api_key']) )
49
  {
50
+ if ( $this->options['li_cm_api_key'] && ! $this->invalid_key )
51
  add_settings_field('li_print_synced_lists', 'Synced tags', array($this, 'li_print_synced_lists'), LEADIN_ADMIN_PATH, $this->power_up_settings_section);
52
  }
53
  }
72
  */
73
  function li_cm_api_key_callback ()
74
  {
75
+ $li_cm_api_key = ( isset($this->options['li_cm_api_key']) && $this->options['li_cm_api_key'] ? $this->options['li_cm_api_key'] : '' ); // Get header from options, or show default
76
 
77
  printf(
78
  '<input id="li_cm_api_key" type="text" id="title" name="' . $this->power_option_name . '[li_cm_api_key]" value="%s" style="width: 430px;"/>',
79
  $li_cm_api_key
80
  );
81
 
82
+ if ( ! isset($li_cm_api_key) || ! $li_cm_api_key || $this->invalid_key )
83
  echo '<p><a target="_blank" href="http://help.campaignmonitor.com/topic.aspx?t=206">Get your API key</a> from <a href="https://login.createsend.com/l" target="_blank">CampaignMonitor.com</a></p>';
84
  }
85
 
181
  {
182
  foreach ( $clients['response'] as $client )
183
  {
184
+ $lists = array();
185
  $lists = $cm->call('clients/' . $client['ClientID'] . '/lists', 'GET');
186
 
187
  if ( count($lists['response']) )
211
 
212
  if ( $test['code'] >= 400 )
213
  {
 
 
 
214
  $invalid_key = TRUE;
215
  }
216
  else
power-ups/campaign-monitor-connect/inc/test.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- //api key 6efceb8935e61ab01f2a1f216b023d4b
3
- //client id f70880b91dd8c7dd73d599cad4a5a639
4
- //list id de1fa82595ce3b2eb99a6f4a69bbe452
5
-
6
- require_once("li_campaign_monitor.php");
7
-
8
- $cm = new LI_Campaign_Monitor("6efceb8935e61ab01f2a1f216b023d4b");
9
-
10
- //test POST request
11
- //adding a new subscriber with email name@test.com
12
- $r = $cm->call("clients/f70880b91dd8c7dd73d599cad4a5a639/lists", "GET");
13
- var_dump($r);
14
- /*
15
- //test GET request
16
- //get details for subscriber with email name@test.com
17
- $r = $cm->call("subscribers/de1fa82595ce3b2eb99a6f4a69bbe452", "GET", array(), array("email" => "name@test.com"));
18
- var_dump($r);
19
-
20
- //test PUT request
21
- //change email of subscriber with email name@test.com to othername@test.com
22
- $r = $cm->call("subscribers/de1fa82595ce3b2eb99a6f4a69bbe452", "PUT", array("EmailAddress" => "othername@test.com"), array("email" => "name@test.com"));
23
- var_dump($r);
24
-
25
- //test PUT request again
26
- //change email of subscriber with email othername@test.com to name@test.com
27
- $r = $cm->call("subscribers/de1fa82595ce3b2eb99a6f4a69bbe452", "PUT", array("EmailAddress" => "name@test.com"), array("email" => "othername@test.com"));
28
- var_dump($r);
29
-
30
- //test DELETE request
31
- //delete subscriber with email name@test.com
32
- $r = $cm->call("subscribers/de1fa82595ce3b2eb99a6f4a69bbe452", "DELETE", array(), array("email" => "name@test.com"));
33
- var_dump($r);
34
- */
35
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
power-ups/constant-contact-connect/admin/constant-contact-connect-admin.php CHANGED
@@ -12,6 +12,7 @@ class WPConstantContactConnectAdmin extends WPLeadInAdmin {
12
  var $lists;
13
  var $options;
14
  var $authed = FALSE;
 
15
 
16
  /**
17
  * Class constructor
@@ -83,8 +84,8 @@ class WPConstantContactConnectAdmin extends WPLeadInAdmin {
83
  function print_hidden_settings_fields ()
84
  {
85
  // Hacky solution to solve the Settings API overwriting the default values
86
- $li_cc_email = ( $this->options['li_cc_email'] ? $this->options['li_cc_email'] : '' );
87
- $li_cc_password = ( $this->options['li_cc_password'] ? $this->options['li_cc_password'] : '' );
88
 
89
  if ( $li_cc_email )
90
  {
@@ -153,9 +154,13 @@ class WPConstantContactConnectAdmin extends WPLeadInAdmin {
153
  $lists = $this->constant_contact->get_lists();
154
 
155
  if ( count($lists) )
 
156
  return $lists;
 
157
  else
158
- return FALSE;
 
 
159
  }
160
 
161
  /**
@@ -210,6 +215,7 @@ class WPConstantContactConnectAdmin extends WPLeadInAdmin {
210
  $lists = $this->li_cc_get_email_lists(LEADIN_CONSTANT_CONTACT_API_KEY, $this->options['li_cc_email'], $this->options['li_cc_password']);
211
 
212
  $sanitized_lists = array();
 
213
  if ( count($lists) )
214
  {
215
  foreach ( $lists as $list )
12
  var $lists;
13
  var $options;
14
  var $authed = FALSE;
15
+ var $invalid_key = FALSE;
16
 
17
  /**
18
  * Class constructor
84
  function print_hidden_settings_fields ()
85
  {
86
  // Hacky solution to solve the Settings API overwriting the default values
87
+ $li_cc_email = ( isset($this->options['li_cc_email']) && $this->options['li_cc_email'] ? $this->options['li_cc_email'] : '' );
88
+ $li_cc_password = ( isset($this->options['li_cc_password']) && $this->options['li_cc_password'] ? $this->options['li_cc_password'] : '' );
89
 
90
  if ( $li_cc_email )
91
  {
154
  $lists = $this->constant_contact->get_lists();
155
 
156
  if ( count($lists) )
157
+ {
158
  return $lists;
159
+ }
160
  else
161
+ {
162
+ return array();
163
+ }
164
  }
165
 
166
  /**
215
  $lists = $this->li_cc_get_email_lists(LEADIN_CONSTANT_CONTACT_API_KEY, $this->options['li_cc_email'], $this->options['li_cc_password']);
216
 
217
  $sanitized_lists = array();
218
+
219
  if ( count($lists) )
220
  {
221
  foreach ( $lists as $list )
power-ups/constant-contact-connect/inc/li_constant_contact.php CHANGED
@@ -677,11 +677,18 @@ end;
677
  $response = $this->fetch($url,$post);
678
 
679
  $entries = Array();
680
- if (isset($response['feed']['entry']['link']))
681
- $entries[] = $response['feed']['entry'];
 
 
 
 
 
682
  else
683
- $entries = $response['feed']['entry'];
684
-
 
 
685
  if ( count($entries) )
686
  {
687
  foreach ($entries as $data)
677
  $response = $this->fetch($url,$post);
678
 
679
  $entries = Array();
680
+ if ( isset($response['feed']) )
681
+ {
682
+ if (isset($response['feed']['entry']['link']))
683
+ $entries[] = $response['feed']['entry'];
684
+ else
685
+ $entries = $response['feed']['entry'];
686
+ }
687
  else
688
+ {
689
+ return array();
690
+ }
691
+
692
  if ( count($entries) )
693
  {
694
  foreach ($entries as $data)
power-ups/contacts/admin/contacts-admin.php CHANGED
@@ -84,7 +84,7 @@ class WPLeadInContactsAdmin extends WPLeadInAdmin {
84
  $li_contact->get_contact_history();
85
  $lead_name = ( $li_contact->history->lead->lead_first_name || $li_contact->history->lead->lead_last_name ? $li_contact->history->lead->lead_first_name . ' ' . $li_contact->history->lead->lead_last_name : '' );
86
  $lead_email = $li_contact->history->lead->lead_email;
87
- $lead_source = leadin_strip_params_from_url($li_contact->history->lead->lead_source);
88
  $leadin_user = leadin_get_current_user();
89
 
90
  ?>
@@ -100,7 +100,6 @@ class WPLeadInContactsAdmin extends WPLeadInAdmin {
100
  "wp-version" : "<?php echo $leadin_user['wp_version']; ?>",
101
  "li-version" : "<?php echo $leadin_user['li_version']; ?>",
102
  "li-source" : "<?php echo LEADIN_SOURCE; ?>",
103
- "createdAt" : "<?php echo date('Y-m-d H:i:s'); ?>",
104
  "website" : "<?php echo $leadin_user['wp_url']; ?>",
105
  "company" : "<?php echo $leadin_user['wp_url']; ?>",
106
  "contacts" : <?php echo $leadin_user['total_contacts']; ?>,
@@ -137,11 +136,13 @@ class WPLeadInContactsAdmin extends WPLeadInAdmin {
137
 
138
  echo '<div class="contact-top-navigation">';
139
 
140
- if ( $li_contact->history->lead->lead_deleted ) {
 
141
  $li_contact->display_error_message_for_merged_contact($li_contact->history->lead->lead_email);
142
  }
143
 
144
- if ( isset($_GET['stats_dashboard']) ) {
 
145
  echo '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_stats">&larr; Stat Dashboard</a>';
146
  }
147
  else
@@ -175,10 +176,13 @@ class WPLeadInContactsAdmin extends WPLeadInAdmin {
175
  echo '<h2 class="contact-name">' . ( $lead_name ? $lead_name : $lead_email ) . '</h2>';
176
  echo '<div class="contact-networks">';
177
 
178
- if ( isset($li_contact->history->lead->social_data->social_profiles) && count($li_contact->history->lead->social_data->social_profiles) )
179
  {
180
- foreach ( $li_contact->history->lead->social_data->social_profiles as $key => $profile )
181
- echo '<a href="' . leadin_safe_social_profile_url($profile->url) . '" class="icon-' . $profile->typeid . '" target="_blank"></a>';
 
 
 
182
  }
183
 
184
  echo '<a href="mailto:' . $lead_email . '" class="icon-envelope"></a>';
@@ -187,248 +191,251 @@ class WPLeadInContactsAdmin extends WPLeadInAdmin {
187
  echo '</div>';
188
  echo '</div>'; // leadin-meta-section
189
 
190
- echo '<div class="leadin-meta-section">';
191
- echo '<h4 class="leain-meta-header">Tags - <a class="thickbox contact-edit-tags" '.( $li_contact->history->lead->lead_deleted ? 'style="display: none;"' : '' ).' href="#TB_inline?width=400&height=400&inlineId=edit-contact-tags">edit</a></h4>';
192
- echo '<div class="leadin-postbox__content">';
193
- foreach( $li_contact->history->tags as $tag ) {
194
- if ($tag->tag_set)
195
- echo '<a class="contact-tag" href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_contacts&contact_type=' . $tag->tag_slug . '">' . $tag->tag_text . '</a>';
196
- }
197
- ?>
 
 
198
 
199
- <?php add_thickbox(); ?>
200
- <div id="edit-contact-tags" style="display:none;">
201
- <h2>Edit Tags - <?php echo $li_contact->history->lead->lead_email; ?></h2>
202
- <form id="edit_tags" action="" method="POST">
203
 
204
- <?php
205
-
206
- foreach( $li_contact->history->tags as $tag )
207
- {
208
- echo '<p>';
209
- echo '<label for="tag_slug_' . $tag->tag_slug . '">';
210
- echo '<input name="tag_slug_' . $tag->tag_slug . '" type="checkbox" id="tag_slug_' . $tag->tag_slug . '" value="' . $tag->tag_id . '" ' . ( $tag->tag_set ? ' checked' : '' ) . '>' . $tag->tag_text . '</label>';
211
- echo '</p>';
212
- }
213
 
214
- ?>
215
 
216
- <input type="hidden" name="edit_tags" value="1"/>
217
- <p class="submit">
218
- <input type="submit" name="submit" id="submit" class="button button-primary" value="Save Tags">
219
- </p>
220
- </form>
221
- </div>
222
 
223
- <?php
224
- echo '</div>'; // leadin-postbox__content
225
- echo '</div>'; // leadin-meta-section
226
 
227
- echo '<div class="leadin-meta-section">';
228
- echo '<h4 class="leain-meta-header">Tracking Info</h4>';
229
- echo '<div class="leadin-postbox__content">';
230
- echo '<table class="leadin-meta-table"><tbody>';
231
 
232
- if ( $li_contact->history->lead->lead_first_name )
233
- {
 
 
 
 
 
234
  echo '<tr>';
235
- echo '<th>Name</th>';
236
- echo '<td>' . $li_contact->history->lead->lead_first_name . ' ' . $li_contact->history->lead->lead_last_name . '</td>';
237
  echo '</tr>';
238
- }
239
- echo '<tr>';
240
- echo '<th>Email</th>';
241
- echo '<td> <a href="mailto:' . $lead_email . '">' . $lead_email . '</a></td>';
242
- echo '</tr>';
243
- echo '<tr>';
244
- echo '<th>Original source</th>';
245
- echo '<td>' . ( $li_contact->history->lead->lead_source ? '<a href="' . $li_contact->history->lead->lead_source . '">' . $lead_source . '</a>' : 'Direct' ) . '</td>';
246
- echo '</tr>';
247
- echo '<tr>';
248
- echo '<th>First visit</th>';
249
- echo '<td>' . self::date_format_contact_stat($li_contact->history->lead->first_visit) . '</td>';
250
- echo '</tr>';
251
- echo '<tr>';
252
- echo '<th>Pageviews</th>';
253
- echo '<td>' . $li_contact->history->lead->total_pageviews . '</td>';
254
- echo '</tr>';
255
- echo '<tr>';
256
- echo '<th>Form submissions</th>';
257
- echo '<td>' . $li_contact->history->lead->total_submissions . '</td>';
258
- echo '</tr>';
259
- echo '</tbody></table>';
260
- echo '</div>'; // leadin-postbox__content
261
- echo '</div>'; // leadin-meta-section
262
- echo '<div class="leadin-meta-section">';
263
- echo '<h4 class="leain-meta-header leadin-premium-tag">Personal Info</h4>';
264
- echo '<div class="leadin-postbox__content">';
265
- echo '<table class="leadin-meta-table"><tbody>';
266
- echo '<tr>';
267
- if ( leadin_check_pro_user() )
268
- {
269
- $social_data = ( isset($li_contact->history->lead->social_data) ? $li_contact->history->lead->social_data : array() );
270
-
271
- if ( ! $social_data )
272
  {
273
- echo 'We couldn\'t find any personal info for this contact.';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  }
275
  else
276
  {
277
- echo '<b>' . $social_data->title . ( $social_data->company_name ? ' - ' . $social_data->company_name : '' ) . '</b>';
278
- echo '</br>' . $social_data->description;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
280
- if ( count($social_data->social_profiles) )
281
  {
282
- echo '<table class="leadin-meta-table"><tbody>';
283
- foreach ( $social_data->social_profiles as $key => $profile )
 
 
 
 
 
284
  {
285
- echo '<tr>';
286
- echo '<th>';
287
- echo $profile->typename;
288
- echo '</th>';
289
- echo '<td>';
290
- echo '<a href="' . leadin_safe_social_profile_url($profile->url) . '" target="_blank">' . ( $profile->typeid == 'twitter' ? '@' : '' ) . ( $profile->typeid == 'linkedin' ? '/in/' : '' ) . $profile->username . '</a>';
291
- echo '</td>';
292
- echo '</tr>';
 
 
 
293
  }
294
- echo '</tbody></table>';
295
- }
296
- }
297
- }
298
- else
299
- {
300
- echo '<table class="leadin-meta-table"><tbody>';
301
- echo '<tr>';
302
- echo '<td><a href="'. admin_url() . 'admin.php?page=leadin_pro_upgrade">Upgrade to Leadin Pro for free</a> to get personal info</td>';
303
- echo '</tr>';
304
- echo '</tbody></table>';
305
- }
306
- echo '</tr>';
307
- echo '</tbody></table>';
308
- echo '</div>'; // leadin-postbox__content
309
- echo '</div>'; // leadin-meta-section
310
- echo '<div class="leadin-meta-section">';
311
- echo '<h4 class="leain-meta-header leadin-premium-tag">Company Info</h4>';
312
- echo '<div class="leadin-postbox__content">';
313
- echo '<table class="leadin-meta-table"><tbody>';
314
- echo '<tr>';
315
- if ( leadin_check_pro_user() )
316
- {
317
- $company_data = ( isset($li_contact->history->lead->company_data) ? $li_contact->history->lead->company_data : array() );
318
 
319
- if ( ! $company_data )
320
- {
321
- echo 'We couldn\'t find any company info for this contact.';
322
- }
323
- else
324
- {
325
- echo '<p>';
326
- echo '<b>About ' . $company_data->name . '</b>';
327
- if ( isset($company_data->overview) )
328
  {
329
- $overview = $company_data->overview;
330
-
331
- if ( strlen($overview) < 260 )
332
- {
333
- echo '<br>' . $overview;
334
- }
335
- else
336
- {
337
- echo '<div id="company-detail-overview-short">' . substr($overview, 0, strpos($overview, '.', 260)) . ' ... <a id="contact-detail-read-more" href="javascript:void(0);">read more</a></div>';
338
- echo '<div style="display: none;" id="company-detail-overview-full">' . $overview . ' <a id="contact-detail-read-less" href="javascript:void(0);">read less</a></div>';
339
- }
340
  }
341
- echo '</p>';
342
 
343
- echo '<table class="leadin-meta-table"><tbody>';
 
 
 
 
 
 
344
 
345
- if ( $company_data->employees )
346
- {
347
- echo '<tr>';
348
- echo '<th>Employees</th>';
349
- echo '<td>' . $company_data->employees . '</td>';
350
- echo '</tr>';
351
- }
352
 
353
- if ( $company_data->revenue )
354
- {
355
- echo '<tr>';
356
- echo '<th>Revenue</th>';
357
- echo '<td>' . $company_data->revenue . '</td>';
358
- echo '</tr>';
359
- }
360
 
361
- if ( $company_data->state || $company_data->country )
362
- {
363
- echo '<tr>';
364
- echo '<th>Headquarters</th>';
365
- echo '<td>' . ( !empty($company_data->state) ? $company_data->state : '' ) . ( !empty($company_data->state) && !empty($company_data->country) ? ', ' : '' ) . ( !empty($company_data->country) ? $company_data->country : '' ) . '</td>';
366
- echo '</tr>';
367
- }
368
 
369
- if ( $company_data->founded )
370
- {
371
- echo '<tr>';
372
- echo '<th>Founded</th>';
373
- echo '<td>' . $company_data->founded . '</td>';
374
- echo '</tr>';
375
- }
376
 
377
- if ( $company_data->facebookpageurl )
378
- {
379
- echo '<tr>';
380
- echo '<th>Facebook</th>';
381
- echo '<td>' . '<a href="' . $company_data->facebookpageurl . '" target="_blank">' . $company_data->name . '</a></td>';
382
- echo '</tr>';
383
- }
384
 
385
- if ( $company_data->twitterusername )
386
- {
387
- echo '<tr>';
388
- echo '<th>Twitter</th>';
389
- echo '<td>' . '<a href="' . $company_data->twitterurl . '" target="_blank">' . '@' . $company_data->twitterusername . '</a></td>';
390
- echo '</tr>';
391
- }
392
 
393
- if ( $company_data->linkedinurl )
394
- {
395
- echo '<tr>';
396
- echo '<th>LinkedIn</th>';
397
- echo '<td>' . '<a href="' . $company_data->linkedinurl . '" target="_blank">' . $company_data->name . '</a></td>';
398
- echo '</tr>';
399
- }
400
 
401
- if ( $company_data->address )
402
- {
403
- echo '<tr>';
404
- echo '<th>Address</th>';
405
- echo '<td><a href="http://maps.google.com/maps?q=' . urlencode($company_data->address) . '"" target="_blank">' . $company_data->address . '</a></td>';
406
- echo '</tr>';
407
  }
408
-
409
- if ( $company_data->country )
410
- {
 
411
  echo '<tr>';
412
- echo '<th>Country</th>';
413
- echo '<td>' . $company_data->country . '</td>';
414
  echo '</tr>';
415
- }
416
-
417
  echo '</tbody></table>';
418
  }
419
- }
420
- else
421
- {
422
- echo '<table class="leadin-meta-table"><tbody>';
423
- echo '<tr>';
424
- echo '<td><a href="'. admin_url() . 'admin.php?page=leadin_pro_upgrade">Upgrade to Leadin Pro for free</a> to get company info</td>';
425
- echo '</tr>';
426
- echo '</tbody></table>';
427
- }
428
- echo '</tr>';
429
- echo '</tbody></table>';
430
- echo '</div>'; // leadin-postbox__content
431
- echo '</div>'; // leadin-meta-section
432
  echo '</div>'; // contact-deatils-column
433
 
434
  echo '<div class="contact-timeline-column" ' . ( $li_contact->history->lead->lead_deleted ? 'style="display: none;"' : '' ) . '>';
84
  $li_contact->get_contact_history();
85
  $lead_name = ( $li_contact->history->lead->lead_first_name || $li_contact->history->lead->lead_last_name ? $li_contact->history->lead->lead_first_name . ' ' . $li_contact->history->lead->lead_last_name : '' );
86
  $lead_email = $li_contact->history->lead->lead_email;
87
+ $lead_source = ( isset($li_contact->history->lead->lead_source) ? leadin_strip_params_from_url($li_contact->history->lead->lead_source) : '' );
88
  $leadin_user = leadin_get_current_user();
89
 
90
  ?>
100
  "wp-version" : "<?php echo $leadin_user['wp_version']; ?>",
101
  "li-version" : "<?php echo $leadin_user['li_version']; ?>",
102
  "li-source" : "<?php echo LEADIN_SOURCE; ?>",
 
103
  "website" : "<?php echo $leadin_user['wp_url']; ?>",
104
  "company" : "<?php echo $leadin_user['wp_url']; ?>",
105
  "contacts" : <?php echo $leadin_user['total_contacts']; ?>,
136
 
137
  echo '<div class="contact-top-navigation">';
138
 
139
+ if ( $li_contact->history->lead->lead_deleted )
140
+ {
141
  $li_contact->display_error_message_for_merged_contact($li_contact->history->lead->lead_email);
142
  }
143
 
144
+ if ( isset($_GET['stats_dashboard']) )
145
+ {
146
  echo '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_stats">&larr; Stat Dashboard</a>';
147
  }
148
  else
176
  echo '<h2 class="contact-name">' . ( $lead_name ? $lead_name : $lead_email ) . '</h2>';
177
  echo '<div class="contact-networks">';
178
 
179
+ if ( isset($li_contact->history->lead->social_data->social_profiles) )
180
  {
181
+ if ( count($li_contact->history->lead->social_data->social_profiles) )
182
+ {
183
+ foreach ( $li_contact->history->lead->social_data->social_profiles as $key => $profile )
184
+ echo '<a href="' . leadin_safe_social_profile_url($profile->url) . '" class="icon-' . $profile->typeid . '" target="_blank"></a>';
185
+ }
186
  }
187
 
188
  echo '<a href="mailto:' . $lead_email . '" class="icon-envelope"></a>';
191
  echo '</div>';
192
  echo '</div>'; // leadin-meta-section
193
 
194
+ if ( ! $li_contact->history->lead->lead_deleted )
195
+ {
196
+ echo '<div class="leadin-meta-section">';
197
+ echo '<h4 class="leain-meta-header">Tags - <a class="thickbox contact-edit-tags" '.( $li_contact->history->lead->lead_deleted ? 'style="display: none;"' : '' ).' href="#TB_inline?width=400&height=400&inlineId=edit-contact-tags">edit</a></h4>';
198
+ echo '<div class="leadin-postbox__content">';
199
+ foreach( $li_contact->history->tags as $tag ) {
200
+ if ($tag->tag_set)
201
+ echo '<a class="contact-tag" href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_contacts&contact_type=' . $tag->tag_slug . '">' . $tag->tag_text . '</a>';
202
+ }
203
+ ?>
204
 
205
+ <?php add_thickbox(); ?>
206
+ <div id="edit-contact-tags" style="display:none;">
207
+ <h2>Edit Tags - <?php echo $li_contact->history->lead->lead_email; ?></h2>
208
+ <form id="edit_tags" action="" method="POST">
209
 
210
+ <?php
211
+
212
+ foreach( $li_contact->history->tags as $tag )
213
+ {
214
+ echo '<p>';
215
+ echo '<label for="tag_slug_' . $tag->tag_slug . '">';
216
+ echo '<input name="tag_slug_' . $tag->tag_slug . '" type="checkbox" id="tag_slug_' . $tag->tag_slug . '" value="' . $tag->tag_id . '" ' . ( $tag->tag_set ? ' checked' : '' ) . '>' . $tag->tag_text . '</label>';
217
+ echo '</p>';
218
+ }
219
 
220
+ ?>
221
 
222
+ <input type="hidden" name="edit_tags" value="1"/>
223
+ <p class="submit">
224
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="Save Tags">
225
+ </p>
226
+ </form>
227
+ </div>
228
 
229
+ <?php
230
+ echo '</div>'; // leadin-postbox__content
231
+ echo '</div>'; // leadin-meta-section
232
 
233
+ echo '<div class="leadin-meta-section">';
234
+ echo '<h4 class="leain-meta-header">Tracking Info</h4>';
235
+ echo '<div class="leadin-postbox__content">';
236
+ echo '<table class="leadin-meta-table"><tbody>';
237
 
238
+ if ( $li_contact->history->lead->lead_first_name )
239
+ {
240
+ echo '<tr>';
241
+ echo '<th>Name</th>';
242
+ echo '<td>' . $li_contact->history->lead->lead_first_name . ' ' . $li_contact->history->lead->lead_last_name . '</td>';
243
+ echo '</tr>';
244
+ }
245
  echo '<tr>';
246
+ echo '<th>Email</th>';
247
+ echo '<td> <a href="mailto:' . $lead_email . '">' . $lead_email . '</a></td>';
248
  echo '</tr>';
249
+ echo '<tr>';
250
+ echo '<th>Original source</th>';
251
+ echo '<td>' . ( $li_contact->history->lead->lead_source ? '<a href="' . $li_contact->history->lead->lead_source . '">' . $lead_source . '</a>' : 'Direct' ) . '</td>';
252
+ echo '</tr>';
253
+ echo '<tr>';
254
+ echo '<th>First visit</th>';
255
+ echo '<td>' . self::date_format_contact_stat($li_contact->history->lead->first_visit) . '</td>';
256
+ echo '</tr>';
257
+ echo '<tr>';
258
+ echo '<th>Pageviews</th>';
259
+ echo '<td>' . $li_contact->history->lead->total_pageviews . '</td>';
260
+ echo '</tr>';
261
+ echo '<tr>';
262
+ echo '<th>Form submissions</th>';
263
+ echo '<td>' . $li_contact->history->lead->total_submissions . '</td>';
264
+ echo '</tr>';
265
+ echo '</tbody></table>';
266
+ echo '</div>'; // leadin-postbox__content
267
+ echo '</div>'; // leadin-meta-section
268
+ echo '<div class="leadin-meta-section">';
269
+ echo '<h4 class="leain-meta-header leadin-premium-tag">Personal Info</h4>';
270
+ echo '<div class="leadin-postbox__content">';
271
+ echo '<table class="leadin-meta-table"><tbody>';
272
+ echo '<tr>';
273
+ if ( leadin_check_pro_user() )
 
 
 
 
 
 
 
 
 
274
  {
275
+ $social_data = ( isset($li_contact->history->lead->social_data) ? $li_contact->history->lead->social_data : array() );
276
+
277
+ if ( ! $social_data )
278
+ {
279
+ echo 'We couldn\'t find any personal info for this contact.';
280
+ }
281
+ else
282
+ {
283
+ echo '<b>' . $social_data->title . ( $social_data->company_name ? ' - ' . $social_data->company_name : '' ) . '</b>';
284
+ echo '</br>' . $social_data->description;
285
+
286
+ if ( count($social_data->social_profiles) )
287
+ {
288
+ echo '<table class="leadin-meta-table"><tbody>';
289
+ foreach ( $social_data->social_profiles as $key => $profile )
290
+ {
291
+ echo '<tr>';
292
+ echo '<th>';
293
+ echo $profile->typename;
294
+ echo '</th>';
295
+ echo '<td>';
296
+ echo '<a href="' . leadin_safe_social_profile_url($profile->url) . '" target="_blank">' . ( $profile->typeid == 'twitter' ? '@' : '' ) . ( $profile->typeid == 'linkedin' ? '/in/' : '' ) . $profile->username . '</a>';
297
+ echo '</td>';
298
+ echo '</tr>';
299
+ }
300
+ echo '</tbody></table>';
301
+ }
302
+ }
303
  }
304
  else
305
  {
306
+ echo '<table class="leadin-meta-table"><tbody>';
307
+ echo '<tr>';
308
+ echo '<td><a href="'. admin_url() . 'admin.php?page=leadin_pro_upgrade">Upgrade to Leadin Pro for free</a> to get personal info</td>';
309
+ echo '</tr>';
310
+ echo '</tbody></table>';
311
+ }
312
+ echo '</tr>';
313
+ echo '</tbody></table>';
314
+ echo '</div>'; // leadin-postbox__content
315
+ echo '</div>'; // leadin-meta-section
316
+ echo '<div class="leadin-meta-section">';
317
+ echo '<h4 class="leain-meta-header leadin-premium-tag">Company Info</h4>';
318
+ echo '<div class="leadin-postbox__content">';
319
+ echo '<table class="leadin-meta-table"><tbody>';
320
+ echo '<tr>';
321
+ if ( leadin_check_pro_user() )
322
+ {
323
+ $company_data = ( isset($li_contact->history->lead->company_data) ? $li_contact->history->lead->company_data : array() );
324
 
325
+ if ( ! $company_data )
326
  {
327
+ echo 'We couldn\'t find any company info for this contact.';
328
+ }
329
+ else
330
+ {
331
+ echo '<p>';
332
+ echo '<b>About ' . $company_data->name . '</b>';
333
+ if ( isset($company_data->overview) )
334
  {
335
+ $overview = $company_data->overview;
336
+
337
+ if ( strlen($overview) < 260 )
338
+ {
339
+ echo '<br>' . $overview;
340
+ }
341
+ else
342
+ {
343
+ echo '<div id="company-detail-overview-short">' . substr($overview, 0, strpos($overview, '.', 260)) . ' ... <a id="contact-detail-read-more" href="javascript:void(0);">read more</a></div>';
344
+ echo '<div style="display: none;" id="company-detail-overview-full">' . $overview . ' <a id="contact-detail-read-less" href="javascript:void(0);">read less</a></div>';
345
+ }
346
  }
347
+ echo '</p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
 
349
+ echo '<table class="leadin-meta-table"><tbody>';
350
+
351
+ if ( $company_data->employees )
 
 
 
 
 
 
352
  {
353
+ echo '<tr>';
354
+ echo '<th>Employees</th>';
355
+ echo '<td>' . $company_data->employees . '</td>';
356
+ echo '</tr>';
 
 
 
 
 
 
 
357
  }
 
358
 
359
+ if ( $company_data->revenue )
360
+ {
361
+ echo '<tr>';
362
+ echo '<th>Revenue</th>';
363
+ echo '<td>' . $company_data->revenue . '</td>';
364
+ echo '</tr>';
365
+ }
366
 
367
+ if ( $company_data->state || $company_data->country )
368
+ {
369
+ echo '<tr>';
370
+ echo '<th>Headquarters</th>';
371
+ echo '<td>' . ( !empty($company_data->state) ? $company_data->state : '' ) . ( !empty($company_data->state) && !empty($company_data->country) ? ', ' : '' ) . ( !empty($company_data->country) ? $company_data->country : '' ) . '</td>';
372
+ echo '</tr>';
373
+ }
374
 
375
+ if ( $company_data->founded )
376
+ {
377
+ echo '<tr>';
378
+ echo '<th>Founded</th>';
379
+ echo '<td>' . $company_data->founded . '</td>';
380
+ echo '</tr>';
381
+ }
382
 
383
+ if ( $company_data->facebookpageurl )
384
+ {
385
+ echo '<tr>';
386
+ echo '<th>Facebook</th>';
387
+ echo '<td>' . '<a href="' . $company_data->facebookpageurl . '" target="_blank">' . $company_data->name . '</a></td>';
388
+ echo '</tr>';
389
+ }
390
 
391
+ if ( $company_data->twitterusername )
392
+ {
393
+ echo '<tr>';
394
+ echo '<th>Twitter</th>';
395
+ echo '<td>' . '<a href="' . $company_data->twitterurl . '" target="_blank">' . '@' . $company_data->twitterusername . '</a></td>';
396
+ echo '</tr>';
397
+ }
398
 
399
+ if ( $company_data->linkedinurl )
400
+ {
401
+ echo '<tr>';
402
+ echo '<th>LinkedIn</th>';
403
+ echo '<td>' . '<a href="' . $company_data->linkedinurl . '" target="_blank">' . $company_data->name . '</a></td>';
404
+ echo '</tr>';
405
+ }
406
 
407
+ if ( $company_data->address )
408
+ {
409
+ echo '<tr>';
410
+ echo '<th>Address</th>';
411
+ echo '<td><a href="http://maps.google.com/maps?q=' . urlencode($company_data->address) . '"" target="_blank">' . $company_data->address . '</a></td>';
412
+ echo '</tr>';
413
+ }
414
 
415
+ if ( $company_data->country )
416
+ {
417
+ echo '<tr>';
418
+ echo '<th>Country</th>';
419
+ echo '<td>' . $company_data->country . '</td>';
420
+ echo '</tr>';
421
+ }
422
 
423
+ echo '</tbody></table>';
 
 
 
 
 
424
  }
425
+ }
426
+ else
427
+ {
428
+ echo '<table class="leadin-meta-table"><tbody>';
429
  echo '<tr>';
430
+ echo '<td><a href="'. admin_url() . 'admin.php?page=leadin_pro_upgrade">Upgrade to Leadin Pro for free</a> to get company info</td>';
 
431
  echo '</tr>';
 
 
432
  echo '</tbody></table>';
433
  }
434
+ echo '</tr>';
435
+ echo '</tbody></table>';
436
+ echo '</div>'; // leadin-postbox__content
437
+ echo '</div>'; // leadin-meta-section
438
+ }
 
 
 
 
 
 
 
 
439
  echo '</div>'; // contact-deatils-column
440
 
441
  echo '<div class="contact-timeline-column" ' . ( $li_contact->history->lead->lead_deleted ? 'style="display: none;"' : '' ) . '>';
power-ups/getresponse-connect/admin/getresponse-connect-admin.php CHANGED
@@ -47,7 +47,7 @@ class LIGetResponseConnectAdmin extends WPLeadInAdmin {
47
 
48
  if ( isset($this->options['li_gr_api_key']) )
49
  {
50
- if ( $this->options['li_gr_api_key'] )
51
  add_settings_field('li_print_synced_lists', 'Synced tags', array($this, 'li_print_synced_lists'), LEADIN_ADMIN_PATH, $this->power_up_settings_section);
52
  }
53
  }
@@ -72,14 +72,14 @@ class LIGetResponseConnectAdmin extends WPLeadInAdmin {
72
  */
73
  function li_gr_api_key_callback ()
74
  {
75
- $li_gr_api_key = ( $this->options['li_gr_api_key'] ? $this->options['li_gr_api_key'] : '' ); // Get header from options, or show default
76
 
77
  printf(
78
  '<input id="li_gr_api_key" type="text" id="title" name="' . $this->power_option_name . '[li_gr_api_key]" value="%s" size="50"/>',
79
  $li_gr_api_key
80
  );
81
 
82
- if ( ! isset($li_gr_api_key) || ! $li_gr_api_key )
83
  echo '<p><a target="_blank" href="http://support.getresponse.com/faq/where-i-find-api-key">Get your API key</a> from <a href="https://app.getresponse.com/account.html#api" target="_blank">GetResponse.com</a></p>';
84
  }
85
 
@@ -193,9 +193,6 @@ class LIGetResponseConnectAdmin extends WPLeadInAdmin {
193
  $invalid_key = FALSE;
194
  else
195
  {
196
- unset($this->options['li_gr_api_key']);
197
- update_option($this->power_option_name, $this->options);
198
-
199
  $invalid_key = TRUE;
200
  }
201
 
47
 
48
  if ( isset($this->options['li_gr_api_key']) )
49
  {
50
+ if ( $this->options['li_gr_api_key'] && ! $this->invalid_key )
51
  add_settings_field('li_print_synced_lists', 'Synced tags', array($this, 'li_print_synced_lists'), LEADIN_ADMIN_PATH, $this->power_up_settings_section);
52
  }
53
  }
72
  */
73
  function li_gr_api_key_callback ()
74
  {
75
+ $li_gr_api_key = ( isset($this->options['li_gr_api_key']) && $this->options['li_gr_api_key'] ? $this->options['li_gr_api_key'] : '' ); // Get header from options, or show default
76
 
77
  printf(
78
  '<input id="li_gr_api_key" type="text" id="title" name="' . $this->power_option_name . '[li_gr_api_key]" value="%s" size="50"/>',
79
  $li_gr_api_key
80
  );
81
 
82
+ if ( ! isset($li_gr_api_key) || ! $li_gr_api_key || $this->invalid_key )
83
  echo '<p><a target="_blank" href="http://support.getresponse.com/faq/where-i-find-api-key">Get your API key</a> from <a href="https://app.getresponse.com/account.html#api" target="_blank">GetResponse.com</a></p>';
84
  }
85
 
193
  $invalid_key = FALSE;
194
  else
195
  {
 
 
 
196
  $invalid_key = TRUE;
197
  }
198
 
power-ups/getresponse-connect/inc/LI_GetResponseAPI.php CHANGED
@@ -57,7 +57,7 @@ class LI_GetResponse
57
  {
58
  $request = $this->prepRequest('ping');
59
  $response = $this->execute($request);
60
- return $response->ping;
61
  }
62
 
63
  /**
57
  {
58
  $request = $this->prepRequest('ping');
59
  $response = $this->execute($request);
60
+ return ( isset($response->ping) ? $response->ping : '' );
61
  }
62
 
63
  /**
power-ups/mailchimp-connect/admin/mailchimp-connect-admin.php CHANGED
@@ -47,7 +47,7 @@ class WPMailChimpConnectAdmin extends WPLeadInAdmin {
47
 
48
  if ( isset($this->options['li_mls_api_key']) )
49
  {
50
- if ( $this->options['li_mls_api_key'] )
51
  add_settings_field('li_print_synced_lists', 'Synced tags', array($this, 'li_print_synced_lists'), LEADIN_ADMIN_PATH, $this->power_up_settings_section);
52
  }
53
  }
@@ -72,14 +72,14 @@ class WPMailChimpConnectAdmin extends WPLeadInAdmin {
72
  */
73
  function li_mls_api_key_callback ()
74
  {
75
- $li_mls_api_key = ( $this->options['li_mls_api_key'] ? $this->options['li_mls_api_key'] : '' ); // Get header from options, or show default
76
 
77
  printf(
78
  '<input id="li_mls_api_key" type="text" id="title" name="' . $this->power_option_name . '[li_mls_api_key]" value="%s" style="width: 430px;"/>',
79
  $li_mls_api_key
80
  );
81
 
82
- if ( ! isset($li_mls_api_key) || ! $li_mls_api_key )
83
  echo '<p><a target="_blank" href="http://kb.mailchimp.com/accounts/management/about-api-keys#Find-or-Generate-Your-API-Key">Get your API key</a> from <a href="http://admin.mailchimp.com/account/api/" target="_blank">MailChimp.com</a></p>';
84
  }
85
 
@@ -200,9 +200,6 @@ class WPMailChimpConnectAdmin extends WPLeadInAdmin {
200
  $invalid_key = FALSE;
201
  else
202
  {
203
- unset($this->options['li_mc_api_key']);
204
- update_option($this->power_option_name, $this->options);
205
-
206
  $invalid_key = TRUE;
207
  }
208
 
47
 
48
  if ( isset($this->options['li_mls_api_key']) )
49
  {
50
+ if ( $this->options['li_mls_api_key'] && ! $this->invalid_key )
51
  add_settings_field('li_print_synced_lists', 'Synced tags', array($this, 'li_print_synced_lists'), LEADIN_ADMIN_PATH, $this->power_up_settings_section);
52
  }
53
  }
72
  */
73
  function li_mls_api_key_callback ()
74
  {
75
+ $li_mls_api_key = ( isset($this->options['li_mls_api_key']) && $this->options['li_mls_api_key'] ? $this->options['li_mls_api_key'] : '' ); // Get header from options, or show default
76
 
77
  printf(
78
  '<input id="li_mls_api_key" type="text" id="title" name="' . $this->power_option_name . '[li_mls_api_key]" value="%s" style="width: 430px;"/>',
79
  $li_mls_api_key
80
  );
81
 
82
+ if ( ! isset($li_mls_api_key) || ! $li_mls_api_key || $this->invalid_key )
83
  echo '<p><a target="_blank" href="http://kb.mailchimp.com/accounts/management/about-api-keys#Find-or-Generate-Your-API-Key">Get your API key</a> from <a href="http://admin.mailchimp.com/account/api/" target="_blank">MailChimp.com</a></p>';
84
  }
85
 
200
  $invalid_key = FALSE;
201
  else
202
  {
 
 
 
203
  $invalid_key = TRUE;
204
  }
205
 
power-ups/subscribe-widget/admin/subscribe-widget-admin.php CHANGED
@@ -92,14 +92,6 @@ class WPLeadInSubscribeAdmin extends WPLeadInAdmin {
92
  $this->power_up_settings_section
93
  );
94
 
95
- add_settings_field(
96
- 'li_preview_popup',
97
- '&nbsp;',
98
- array($this, 'li_preview_popup_callback'),
99
- LEADIN_ADMIN_PATH,
100
- $this->power_up_settings_section
101
- );
102
-
103
  add_settings_field(
104
  'li_subscribe_templates',
105
  'Show subscribe pop-up on',
@@ -369,30 +361,6 @@ class WPLeadInSubscribeAdmin extends WPLeadInAdmin {
369
  echo '<option value="0"' . ( $li_subscribe_mobile_popup == '0' ? ' selected' : '' ) . '>No</option>';
370
  echo '</select>';
371
  }
372
-
373
- /**
374
- * Prints the options for toggling the widget on posts, pages, archives and homepage
375
- */
376
- function li_preview_popup_callback ()
377
- {
378
- $options = $this->options;
379
-
380
- $preview_link = get_bloginfo('wpurl') . '?preview-subscribe=1';
381
- $preview_link .= '&lis_heading=' . ( isset($options['li_subscribe_heading']) ? $options['li_subscribe_heading'] : 'Sign up for email updates' );
382
- $preview_link .= '&lis_desc=' . ( isset($options['li_subscribe_text']) ? $options['li_subscribe_text'] : '' );
383
- $preview_link .= '&lis_show_names=' . ( isset($options['li_subscribe_name_fields']) ? $options['li_subscribe_name_fields'] : 0 );
384
- $preview_link .= '&lis_show_phone=' . ( isset($options['li_subscribe_phone_field']) ? $options['li_subscribe_phone_field'] : 0 );
385
- $preview_link .= '&lis_btn_label=' . ( isset($options['li_subscribe_btn_label']) ? $options['li_subscribe_btn_label'] : 'SUBSCRIBE' );
386
- $preview_link .= '&lis_btn_color=' . ( isset($options['li_subscribe_btn_color']) ? $options['li_subscribe_btn_color'] : 'leadin-popup-color-blue' );
387
- $preview_link .= '&lis_vex_class=' . ( isset($options['li_subscribe_vex_class']) ? $options['li_subscribe_vex_class'] : 'vex-theme-bottom-right-corner' );
388
- $preview_link .= '&lis_confirmation=' . ( isset($options['li_subscribe_confirmation']) ? $options['li_subscribe_confirmation'] : 0 );
389
- $preview_link .= '&lis_mobile_popup=' . ( isset($options['li_subscribe_mobile_popup']) ? $options['li_subscribe_mobile_popup'] : 1 );
390
-
391
- printf(
392
- '<p><a id="preview-popup-link" href="%s" target="_blank" class="button button-secondary">Preview Pop-up Form</a></p>',
393
- $preview_link
394
- );
395
- }
396
  }
397
 
398
  ?>
92
  $this->power_up_settings_section
93
  );
94
 
 
 
 
 
 
 
 
 
95
  add_settings_field(
96
  'li_subscribe_templates',
97
  'Show subscribe pop-up on',
361
  echo '<option value="0"' . ( $li_subscribe_mobile_popup == '0' ? ' selected' : '' ) . '>No</option>';
362
  echo '</select>';
363
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
364
  }
365
 
366
  ?>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: andygcook, nelsonjoyce
3
  Tags: crm, contacts, lead tracking, click tracking, visitor tracking, analytics, marketing automation, inbound marketing, subscription, marketing, lead generation, mailchimp, constant contact, newsletter, popup, popover, email list, email, contacts database, contact form, forms, form widget, popup form
4
  Requires at least: 3.7
5
- Tested up to: 4.1.1
6
- Stable tag: 3.1.7
7
 
8
  Leadin is an easy-to-use marketing automation and lead tracking plugin for WordPress that helps you better understand your web site visitors.
9
 
@@ -68,8 +68,22 @@ Having trouble? Check out our <a href="http://support.leadin.com/" target="_blan
68
 
69
  == Changelog ==
70
 
71
- - Current version: 3.1.7
72
- - Current version release: 2015-04-15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  = 3.1.7 (2015.04.15) =
75
  = Enhancements =
2
  Contributors: andygcook, nelsonjoyce
3
  Tags: crm, contacts, lead tracking, click tracking, visitor tracking, analytics, marketing automation, inbound marketing, subscription, marketing, lead generation, mailchimp, constant contact, newsletter, popup, popover, email list, email, contacts database, contact form, forms, form widget, popup form
4
  Requires at least: 3.7
5
+ Tested up to: 4.2.2
6
+ Stable tag: 3.1.8
7
 
8
  Leadin is an easy-to-use marketing automation and lead tracking plugin for WordPress that helps you better understand your web site visitors.
9
 
68
 
69
  == Changelog ==
70
 
71
+ - Current version: 3.1.8
72
+ - Current version release: 2015-05-15
73
+
74
+ = 3.1.8 (2015.05.15) =
75
+
76
+ - Added email connector sync to onboarding
77
+ - Sources now check the UTM tags on the first page view visit
78
+ - Privacy policy added to plugin
79
+
80
+ - Bug fixes
81
+ - Fixed dismiss button conflict on WordPress notifications
82
+ - Icon styles no longer conflict with other plugins
83
+ - Deleted contacts no longer show up in the dashboard
84
+ - Popup sync now looks at the actual inputs instead of the field names so it’ll work in other languages
85
+ - Popup labels now work in IE
86
+ - Fixed bug with SendGrid email delivery for Leadin Pro
87
 
88
  = 3.1.7 (2015.04.15) =
89
  = Enhancements =