myCRED - Version beta2.2

Version Description

= 2.2 = New features and Bug fixes.

= 2.1.1 = New features and Bug fixes.

= 2.1 = New features and Bug fixes.

= 2.0 = The banking module have been replaced by Central deposite module, and interest related functionality has been removed. If you are using simple interest or compound interest related functionality, you will fine the respective functionalities missing after the update.

= 1.8.0 = Major release(Make sure to take backup before updating)

= 1.8.1 = Bug fixes release.

= 1.8.2 = Bug fixes release.

= 1.8.3 = Bug fixes release.

= 1.8.4 = Bug fixes release.

= 1.8.4.1 = Bug fixes release.

= 1.8.4.2 = Bug fixes release.

= 1.8.5 = Bug fixes release.

= 1.8.5.1 = Bug fixes release.

= 1.8.6 = Bug fixes release.

= 1.8.7 = Bug fixes release.

= 1.8.8 = Bug fixes release.

= 1.8.9 = Bug fixes release.

= 1.8.11 = Bug fixes release.

= 1.8.12 = Bug fixes release.

= 1.8.13 = Bug fixes release.

= 1.8.13.1 = Bug fixes release.

= 1.8.14 = Bug fixes release.

= 1.8.14.1 = Bug fixes release.

= 1.8.14.2 = Bug fixes release.

Download this release

Release Info

Developer wpexpertsio
Plugin Icon 128x128 myCRED
Version beta2.2
Comparing to
See all releases

Code changes from version 2.1.1 to beta2.2

Files changed (80) hide show
  1. abstracts/mycred-abstract-module.php +9 -1
  2. addons/badges/includes/mycred-badge-functions.php +1 -1
  3. addons/badges/includes/mycred-badge-object.php +4 -0
  4. addons/badges/includes/mycred-badge-shortcodes.php +5 -2
  5. addons/badges/myCRED-addon-badges.php +230 -40
  6. addons/buy-creds/gateways/Bitpay/Client/Client.php +0 -3
  7. addons/buy-creds/gateways/bitpay.php +3 -0
  8. addons/buy-creds/modules/buycred-module-core.php +6 -5
  9. addons/buy-creds/modules/buycred-module-pending.php +9 -10
  10. addons/cash-creds/modules/cashcred-module-core.php +10 -6
  11. addons/cash-creds/modules/cashcred-module-withdrawal.php +7 -7
  12. addons/coupons/myCRED-addon-coupons.php +3 -4
  13. addons/email-notices/includes/mycred-email-functions.php +2 -0
  14. addons/email-notices/includes/mycred-email-object.php +21 -0
  15. addons/email-notices/myCRED-addon-email-notices.php +3 -4
  16. addons/gateway/carts/mycred-woocommerce.php +3 -3
  17. addons/ranks/includes/mycred-rank-functions.php +74 -3
  18. addons/ranks/myCRED-addon-ranks.php +44 -5
  19. addons/sell-content/assets/js/admin.js +19 -0
  20. addons/sell-content/includes/mycred-sell-functions.php +3 -3
  21. addons/sell-content/myCRED-addon-sell-content.php +100 -9
  22. addons/stats/myCRED-addon-stats.php +2 -2
  23. addons/transfer/assets/js/mycred-transfer.js +2 -3
  24. addons/transfer/includes/mycred-transfer-object.php +108 -18
  25. addons/transfer/myCRED-addon-transfer.php +4 -3
  26. assets/css/admin-subscription.css +201 -0
  27. assets/css/fonts/mycred-social-icons.eot +0 -0
  28. assets/css/fonts/mycred-social-icons.svg +19 -0
  29. assets/css/fonts/mycred-social-icons.ttf +0 -0
  30. assets/css/fonts/mycred-social-icons.woff +0 -0
  31. assets/css/mycred-admin.css +10 -6
  32. assets/css/mycred-font/mycred.eot +0 -0
  33. assets/css/mycred-font/mycred.svg +12 -0
  34. assets/css/mycred-font/mycred.ttf +0 -0
  35. assets/css/mycred-font/mycred.woff +0 -0
  36. assets/css/mycred-forms.css +3 -0
  37. assets/css/mycred-front.css +1 -1
  38. assets/css/mycred-social-icons.css +54 -0
  39. assets/css/mycred-social-share.css +363 -0
  40. assets/css/tourguide.css +11 -5
  41. assets/images/addons/mycred-birthdays.jpg +0 -0
  42. assets/images/addons/mycred-blocks.jpg +0 -0
  43. assets/images/addons/mycred-bp-charges.jpg +0 -0
  44. assets/images/addons/mycred-bp-group-leaderboards.jpg +0 -0
  45. assets/images/addons/mycred-for-elementor.jpg +0 -0
  46. assets/images/addons/mycred-h5p.jpg +0 -0
  47. assets/images/addons/mycred-learndash.jpg +0 -0
  48. assets/images/addons/mycred-notification-plus.jpg +0 -0
  49. assets/images/addons/mycred-pacman.jpg +0 -0
  50. assets/images/addons/mycred-social-share.jpg +0 -0
  51. assets/images/addons/mycred-spin-wheel.jpg +0 -0
  52. assets/images/addons/mycred-woocommerce-plus.jpg +0 -0
  53. assets/images/default-point-type.png +0 -0
  54. assets/images/treasures/badges.jpg +0 -0
  55. assets/images/treasures/currency.jpg +0 -0
  56. assets/images/treasures/fitness.jpg +0 -0
  57. assets/images/treasures/gems.jpg +0 -0
  58. assets/images/treasures/learning.jpg +0 -0
  59. assets/images/treasures/rank.jpg +0 -0
  60. assets/js/mycred-type-management.js +50 -0
  61. assets/js/shepherd.js.map +1 -1
  62. assets/js/tourguide.min.js +43 -13
  63. assets/libs/parsecsv.lib.php +7 -7
  64. includes/classes/class.query-leaderboard.php +15 -15
  65. includes/hooks/external/mycred-hook-woocommerce.php +13 -3
  66. includes/hooks/mycred-hook-referrals.php +1 -0
  67. includes/mycred-functions.php +184 -0
  68. includes/mycred-install.php +5 -20
  69. includes/mycred-main-menu.php +92 -0
  70. includes/mycred-setup.php +29 -451
  71. includes/mycred-uninstall.php +1 -1
  72. includes/mycred-walkthrough.php +37 -24
  73. membership/mycred-connect-membership.php +304 -2
  74. modules/mycred-module-addons.php +390 -5
  75. modules/mycred-module-br-social-share.php +165 -0
  76. modules/mycred-module-caching.php +2 -2
  77. modules/mycred-module-hooks.php +1 -1
  78. modules/mycred-module-settings.php +137 -22
  79. mycred.php +47 -89
  80. readme.txt +23 -8
abstracts/mycred-abstract-module.php CHANGED
@@ -55,6 +55,9 @@ if ( ! class_exists( 'myCRED_Module' ) ) :
55
  // Pages
56
  public $pages = array();
57
 
 
 
 
58
  /**
59
  * Construct
60
  */
@@ -90,7 +93,8 @@ if ( ! class_exists( 'myCRED_Module' ) ) :
90
  'add_to_core' => false,
91
  'accordion' => false,
92
  'cap' => 'plugin',
93
- 'menu_pos' => 10
 
94
  );
95
  $args = wp_parse_args( $args, $defaults );
96
 
@@ -118,6 +122,7 @@ if ( ! class_exists( 'myCRED_Module' ) ) :
118
 
119
  $this->default_prefs = $args['defaults'];
120
  $this->now = current_time( 'timestamp' );
 
121
 
122
  $this->set_settings();
123
 
@@ -414,6 +419,9 @@ if ( ! class_exists( 'myCRED_Module' ) ) :
414
  elseif ( isset( $this->labels['menu'] ) )
415
  $label_title = $this->labels['menu'];
416
 
 
 
 
417
  // Add Submenu Page
418
  $page = add_submenu_page(
419
  $menu_slug,
55
  // Pages
56
  public $pages = array();
57
 
58
+ // Submenu Inside Main menu
59
+ public $main_menu;
60
+
61
  /**
62
  * Construct
63
  */
93
  'add_to_core' => false,
94
  'accordion' => false,
95
  'cap' => 'plugin',
96
+ 'menu_pos' => 10,
97
+ 'main_menu' => false
98
  );
99
  $args = wp_parse_args( $args, $defaults );
100
 
122
 
123
  $this->default_prefs = $args['defaults'];
124
  $this->now = current_time( 'timestamp' );
125
+ $this->main_menu = $args['main_menu'];
126
 
127
  $this->set_settings();
128
 
419
  elseif ( isset( $this->labels['menu'] ) )
420
  $label_title = $this->labels['menu'];
421
 
422
+ if ( $this->main_menu )
423
+ $menu_slug = MYCRED_MAIN_SLUG;
424
+
425
  // Add Submenu Page
426
  $page = add_submenu_page(
427
  $menu_slug,
addons/badges/includes/mycred-badge-functions.php CHANGED
@@ -591,7 +591,7 @@ if ( ! function_exists( 'mycred_get_users_badges' ) ) :
591
  global $wpdb;
592
 
593
  $badge_ids = array();
594
- $query = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key LIKE %s", $user_id, mycred_get_meta_key( MYCRED_BADGE_KEY ) . '%' ) );
595
 
596
  if ( ! empty( $query ) ) {
597
 
591
  global $wpdb;
592
 
593
  $badge_ids = array();
594
+ $query = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key LIKE %s AND meta_key NOT LIKE '%_issued_on' AND meta_key NOT LIKE '%_ids'", $user_id, mycred_get_meta_key( MYCRED_BADGE_KEY ) . '%' ) );
595
 
596
  if ( ! empty( $query ) ) {
597
 
addons/badges/includes/mycred-badge-object.php CHANGED
@@ -645,11 +645,15 @@ if ( ! class_exists( 'myCRED_Badge' ) ) :
645
  if ( $user_id === false || absint( $user_id ) === 0 ) return false;
646
 
647
  mycred_delete_user_meta( $user_id, $this->user_meta_key );
 
 
 
648
 
649
  $this->earnedby --;
650
  if ( $this->earnedby < 0 ) $this->earnedby = 0;
651
 
652
  mycred_update_post_meta( $this->post_id, 'total-users-with-badge', $this->earnedby );
 
653
 
654
  return true;
655
 
645
  if ( $user_id === false || absint( $user_id ) === 0 ) return false;
646
 
647
  mycred_delete_user_meta( $user_id, $this->user_meta_key );
648
+ mycred_delete_user_meta( $user_id, $this->user_meta_key . '_issued_on' );
649
+ $usermeta = mycred_get_user_meta( $user_id, 'mycred_badge_ids', true );
650
+ unset( $usermeta[$this->post_id] );
651
 
652
  $this->earnedby --;
653
  if ( $this->earnedby < 0 ) $this->earnedby = 0;
654
 
655
  mycred_update_post_meta( $this->post_id, 'total-users-with-badge', $this->earnedby );
656
+ mycred_update_user_meta( $this->post_id, 'mycred_badge_ids', $this->earnedby );
657
 
658
  return true;
659
 
addons/badges/includes/mycred-badge-shortcodes.php CHANGED
@@ -115,10 +115,13 @@ if ( ! function_exists( 'mycred_render_badges' ) ) :
115
  $row = str_replace( '%badge_title%', $badge->title, $row );
116
  $row = str_replace( '%requirements%', mycred_display_badge_requirements( $badge_id ), $row );
117
  $row = str_replace( '%count%', $badge->earnedby, $row );
118
- $row = str_replace( '%default_image%', $badge->get_image( 'main' ), $row );
119
 
120
  if( mycred_user_has_badge( get_current_user_id(), $badge_id) ) {
121
- $row = str_replace( '%main_image%', $badge->level_image, $row );
 
 
 
122
  }
123
  else {
124
  $row = str_replace( '%main_image%', '', $row );
115
  $row = str_replace( '%badge_title%', $badge->title, $row );
116
  $row = str_replace( '%requirements%', mycred_display_badge_requirements( $badge_id ), $row );
117
  $row = str_replace( '%count%', $badge->earnedby, $row );
118
+ $row = str_replace( '%default_image%', $badge->get_image( 'main' ), $row );
119
 
120
  if( mycred_user_has_badge( get_current_user_id(), $badge_id) ) {
121
+ $user_id = get_current_user_id();
122
+ $badge = mycred_get_badge( $badge_id );
123
+ $level = $badge->get_users_current_level( $user_id );
124
+ $row = str_replace( '%main_image%', $badge->get_image( $level ), $row );
125
  }
126
  else {
127
  $row = str_replace( '%main_image%', '', $row );
addons/badges/myCRED-addon-badges.php CHANGED
@@ -59,13 +59,15 @@ if ( ! class_exists( 'myCRED_Badge_Module' ) ) :
59
  /**
60
  * Module Pre Init
61
  * @since 1.0
62
- * @version 1.1
63
  */
64
  public function module_pre_init() {
65
 
 
66
  add_filter( 'mycred_add_finished', array( $this, 'add_finished' ), 30, 3 );
67
- add_action("wp_ajax_mycred_switch_all_to_open_badge", array( $this, "mycred_switch_all_to_open_badge" ) );
68
- add_action("wp_ajax_nopriv_mycred_switch_all_to_open_badge", array( $this, "mycred_switch_all_to_open_badge" ) );
 
69
  }
70
 
71
  /**
@@ -452,18 +454,16 @@ if ( ! class_exists( 'myCRED_Badge_Module' ) ) :
452
  // site in the network, bail.
453
  if ( mycred_override_settings() && ! mycred_is_main_site() ) return;
454
 
455
- add_submenu_page(
456
- MYCRED_SLUG,
457
  __( 'Badges', 'mycred' ),
458
  __( 'Badges', 'mycred' ),
459
  $this->core->get_point_editor_capability(),
460
  'edit.php?post_type=' . MYCRED_BADGE_KEY
461
  );
462
 
463
- add_submenu_page(
464
- MYCRED_SLUG,
465
- __( 'Achievements', 'mycred' ),
466
- __( 'Achievements', 'mycred' ),
467
  $this->core->get_point_editor_capability(),
468
  'edit-tags.php?post_type=' . MYCRED_BADGE_KEY . '&taxonomy=' . MYCRED_BADGE_CATEGORY
469
  );
@@ -481,13 +481,13 @@ if ( ! class_exists( 'myCRED_Badge_Module' ) ) :
481
 
482
  if ( ( $pagenow == 'edit.php' || $pagenow == 'post-new.php' ) && isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_BADGE_KEY ) {
483
 
484
- return MYCRED_SLUG;
485
 
486
  }
487
 
488
  elseif ( $pagenow == 'post.php' && isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_BADGE_KEY ) {
489
 
490
- return MYCRED_SLUG;
491
 
492
  }
493
 
@@ -495,7 +495,7 @@ if ( ! class_exists( 'myCRED_Badge_Module' ) ) :
495
  {
496
  $submenu_file = 'edit-tags.php?post_type=' . MYCRED_BADGE_KEY . '&taxonomy=' . MYCRED_BADGE_CATEGORY;
497
 
498
- return MYCRED_SLUG;
499
  }
500
 
501
  return $parent;
@@ -796,6 +796,24 @@ th#badge-users { width: 10%; }
796
  'low'
797
  );
798
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
799
  }
800
 
801
  /**
@@ -979,6 +997,102 @@ th#badge-users { width: 10%; }
979
 
980
  }
981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
982
  /**
983
  * Open Badge Metabox
984
  * @since 2.1
@@ -1271,6 +1385,14 @@ th#badge-users { width: 10%; }
1271
  if ( isset( $_POST['mycred_badge']['congratulation_msg'] ) )
1272
  $congratulation_msg = sanitize_text_field( $_POST['mycred_badge']['congratulation_msg'] );
1273
 
 
 
 
 
 
 
 
 
1274
  $badge_levels = array();
1275
  $badge_requirements = array();
1276
 
@@ -1389,6 +1511,10 @@ th#badge-users { width: 10%; }
1389
 
1390
  mycred_update_post_meta( $post_id, 'main_image', $image );
1391
 
 
 
 
 
1392
  // Let others play
1393
  do_action( 'mycred_save_badge', $post_id );
1394
 
@@ -1468,30 +1594,30 @@ th#badge-users { width: 10%; }
1468
  </div>
1469
  </div>
1470
  </div>
1471
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1472
- <?php if( $settings['open_badge'] == '1' ):?>
1473
- <div class="form-group">
1474
- <label for="<?php echo $this->field_id( 'open_badge_evidence_page' ); ?>"><?php _e( 'Evidence Page', 'mycred' ); ?></label>
1475
- <?php
1476
 
1477
- $selectedEvidencePage = mycred_get_evidence_page_id();
1478
 
1479
- $args = array(
1480
- 'id' => $this->field_id( 'open_badge_evidence_page' ),
1481
- 'name' => $this->field_name( 'open_badge_evidence_page' ),
1482
- 'selected' => $selectedEvidencePage
1483
- );
1484
 
1485
- wp_dropdown_pages( $args );
1486
- ?>
 
1487
  </div>
1488
- <?php endif;?>
1489
- </div>
1490
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1491
- <div class="form-group">
1492
- <button class="button button-large large button-primary" id="switch-all-to-open-badge"><span class="dashicons dashicons-update mycred-switch-all-badges-icon"></span> Switch All Badges To Open Badge.</button>
1493
  </div>
1494
- </div>
1495
  </div>
1496
 
1497
  <h3><?php _e( 'Third-party Integrations', 'mycred' ); ?></h3>
@@ -1572,7 +1698,7 @@ th#badge-users { width: 10%; }
1572
  <p><a href="http://codex.mycred.me/shortcodes/mycred_my_badges/" target="_blank">[mycred_my_badges]</a>, <a href="http://codex.mycred.me/shortcodes/mycred_badges/" target="_blank">[mycred_badges]</a></p>
1573
  </div>
1574
  </div>
1575
-
1576
  </div>
1577
  <?php
1578
 
@@ -1925,18 +2051,52 @@ th#badge-users { width: 10%; }
1925
 
1926
  }
1927
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1928
  /**
1929
  * Automatically runs when MYCRED_BADGE_KEY (Post Type Page Loads)
1930
  * @param $content
1931
  * @return string
1932
  * @since 2.1
1933
- * @version 1.0
1934
  */
1935
  public function mycred_badge_page_template( $content ) {
1936
 
1937
  global $post;
1938
 
1939
- if ( $post->post_type == MYCRED_BADGE_KEY && is_single() ) {
1940
 
1941
  $mycred = mycred();
1942
 
@@ -1946,8 +2106,10 @@ th#badge-users { width: 10%; }
1946
  $show_level_points = false;
1947
  $show_steps_to_achieve = false;
1948
  $show_earners = false;
 
1949
 
1950
- if ( is_array( $mycred->core ) && array_key_exists('badges', $mycred->core ) ) {
 
1951
  $show_level_description = $mycred->core["badges"]["show_level_description"] == '1' ? true : false;
1952
  $show_congo_text = $mycred->core["badges"]["show_congo_text"] == '1' ? true : false;
1953
  $show_levels = $mycred->core["badges"]["show_levels"] == '1' ? true : false;
@@ -1974,17 +2136,38 @@ th#badge-users { width: 10%; }
1974
  $content = '<div class="mycred-badge-page">';
1975
 
1976
  if ( $show_congo_text && $has_earned ) {
1977
-
1978
- if ( ! empty( $badge_object->congratulation_msg ) ) {
1979
 
1980
  $content .= '<div class="mycred-badge-congratulation-msg">' . $badge_object->congratulation_msg . '</div>';
1981
-
1982
  }
1983
-
1984
  }
1985
-
 
 
 
 
 
 
 
 
 
 
 
 
1986
  $content .= '<img src="' . $badge_image_url . '" class="mycred-badge-image" alt="">';
1987
 
 
 
 
 
 
 
 
 
 
 
 
1988
  //Level Description
1989
  if( $show_level_description ) {
1990
 
@@ -2082,6 +2265,13 @@ th#badge-users { width: 10%; }
2082
 
2083
  $content .= '</div>';
2084
 
 
 
 
 
 
 
 
2085
  return $content;
2086
 
2087
  }
59
  /**
60
  * Module Pre Init
61
  * @since 1.0
62
+ * @version 1.2
63
  */
64
  public function module_pre_init() {
65
 
66
+ add_action( 'wp_head', array( $this, 'social_share_br_header' ) );
67
  add_filter( 'mycred_add_finished', array( $this, 'add_finished' ), 30, 3 );
68
+ add_action( 'wp_ajax_mycred_switch_all_to_open_badge', array( $this, 'mycred_switch_all_to_open_badge' ) );
69
+ add_action( 'wp_ajax_nopriv_mycred_switch_all_to_open_badge', array( $this, 'mycred_switch_all_to_open_badge' ) );
70
+
71
  }
72
 
73
  /**
454
  // site in the network, bail.
455
  if ( mycred_override_settings() && ! mycred_is_main_site() ) return;
456
 
457
+ mycred_add_main_submenu(
 
458
  __( 'Badges', 'mycred' ),
459
  __( 'Badges', 'mycred' ),
460
  $this->core->get_point_editor_capability(),
461
  'edit.php?post_type=' . MYCRED_BADGE_KEY
462
  );
463
 
464
+ mycred_add_main_submenu(
465
+ __( 'Achievement Types', 'mycred' ),
466
+ __( 'Achievement Types', 'mycred' ),
 
467
  $this->core->get_point_editor_capability(),
468
  'edit-tags.php?post_type=' . MYCRED_BADGE_KEY . '&taxonomy=' . MYCRED_BADGE_CATEGORY
469
  );
481
 
482
  if ( ( $pagenow == 'edit.php' || $pagenow == 'post-new.php' ) && isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_BADGE_KEY ) {
483
 
484
+ return MYCRED_MAIN_SLUG;
485
 
486
  }
487
 
488
  elseif ( $pagenow == 'post.php' && isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_BADGE_KEY ) {
489
 
490
+ return MYCRED_MAIN_SLUG;
491
 
492
  }
493
 
495
  {
496
  $submenu_file = 'edit-tags.php?post_type=' . MYCRED_BADGE_KEY . '&taxonomy=' . MYCRED_BADGE_CATEGORY;
497
 
498
+ return MYCRED_MAIN_SLUG;
499
  }
500
 
501
  return $parent;
796
  'low'
797
  );
798
 
799
+ add_meta_box(
800
+ 'mycred-badge-align',
801
+ __( 'Alignment', 'mycred' ),
802
+ array( $this, 'metabox_badge_align' ),
803
+ MYCRED_BADGE_KEY,
804
+ 'side',
805
+ 'low'
806
+ );
807
+
808
+ add_meta_box(
809
+ 'mycred-badge-layout',
810
+ __( 'Badge-Layout', 'mycred' ),
811
+ array( $this, 'metabox_badge_layout' ),
812
+ MYCRED_BADGE_KEY,
813
+ 'side',
814
+ 'low'
815
+ );
816
+
817
  }
818
 
819
  /**
997
 
998
  }
999
 
1000
+ public function metabox_badge_align( $post ) {
1001
+
1002
+ $mycred_badge_align = mycred_get_post_meta( $post->ID, 'mycred_badge_align', true );
1003
+
1004
+ ?>
1005
+ <div class="row">
1006
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1007
+ <div class="mycred-align-option">
1008
+ <ul class="mycred-radio-list">
1009
+ <li>
1010
+ <input type="radio" class="mycred-align-radio" name="mycred_badge[mycred_badge_align]" id="mycred_align_left" value="mycred_align_left" <?php echo ( $mycred_badge_align == 'mycred_align_left' ) ? 'checked' : '' ; ?>>
1011
+ <label for="mycred_align_left">
1012
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#10212b;}.cls-2{fill:#aab5bc;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><rect class="cls-1" x="9.02" y="13.98" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="10.55" y="18.88" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.55" y="21.18" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.55" y="23.48" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.55" y="25.78" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.55" y="28.08" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.55" y="30.38" width="20.48" height="1.27" rx="0.44"/><rect class="cls-1" x="9.02" y="36.13" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="10.55" y="41.03" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.55" y="43.33" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.55" y="45.63" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.55" y="47.81" width="20.48" height="1.27" rx="0.44"/><path class="cls-2" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><circle class="cls-1" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-1" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-1" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'Left', 'mycred' ); ?>
1013
+ </label>
1014
+ </li>
1015
+ <li>
1016
+ <input type="radio" class="mycred-align-radio" name="mycred_badge[mycred_badge_align]" id="mycred_align_right" value="mycred_align_right" <?php echo ( $mycred_badge_align == 'mycred_align_right' ) ? 'checked' : '' ; ?>>
1017
+ <label for="mycred_align_right">
1018
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#10212b;}.cls-2{fill:#aab5bc;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><rect class="cls-1" x="9.02" y="13.98" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="10.76" y="20.03" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.76" y="22.33" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.76" y="24.63" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.76" y="26.93" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.76" y="29.23" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="29.86" y="31.53" width="20.48" height="1.27" rx="0.44"/><rect class="cls-1" x="9.02" y="36.13" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="10.76" y="42.18" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.76" y="44.48" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.76" y="46.78" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="29.86" y="49.08" width="20.48" height="1.27" rx="0.44"/><path class="cls-2" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><circle class="cls-1" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-1" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-1" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'Right', 'mycred' ); ?>
1019
+ </label>
1020
+ </li>
1021
+ <li>
1022
+ <input type="radio" class="mycred-align-radio" name="mycred_badge[mycred_badge_align]" id="mycred_align_center" value="mycred_align_center" <?php echo ( $mycred_badge_align == 'mycred_align_center' ) ? 'checked' : '' ; ?>>
1023
+ <label for="mycred_align_center">
1024
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#10212b;}.cls-2{fill:#aab5bc;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><rect class="cls-1" x="9.59" y="13.98" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="11.34" y="18.4" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="20.7" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="23" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="25.3" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="27.6" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="20.89" y="29.9" width="20.48" height="1.27" rx="0.44"/><rect class="cls-1" x="9.59" y="36.13" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="11.34" y="40.55" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="42.85" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="45.15" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="20.89" y="47.45" width="20.48" height="1.27" rx="0.44"/><path class="cls-2" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><circle class="cls-1" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-1" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-1" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'Center', 'mycred' ); ?>
1025
+ </label>
1026
+ </li>
1027
+ <li>
1028
+ <input type="radio" class="mycred-align-radio" name="mycred_badge[mycred_badge_align]" id="mycred_align_justify" value="mycred_align_justify" <?php echo ( $mycred_badge_align == 'mycred_align_justify' ) ? 'checked' : '' ; ?>>
1029
+ <label for="mycred_align_justify">
1030
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#10212b;}.cls-2{fill:#aab5bc;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><rect class="cls-1" x="9.59" y="13.98" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="11.34" y="20.03" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="22.33" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="24.63" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="26.93" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="29.23" width="39.58" height="1.27" rx="0.44"/><rect class="cls-1" x="9.59" y="36.13" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="11.34" y="42.18" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="44.48" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="11.34" y="46.78" width="39.58" height="1.27" rx="0.44"/><path class="cls-2" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><circle class="cls-1" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-1" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-1" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'Justify', 'mycred' ); ?>
1031
+ </label>
1032
+ </li>
1033
+ <li>
1034
+ <input type="radio" class="mycred-align-radio" name="mycred_badge[mycred_badge_align]" id="mycred_align_none" value="mycred_align_none" <?php echo ($mycred_badge_align == 'mycred_align_none' ) ? 'checked' : '' ; if ( empty( $mycred_badge_align ) ) echo 'checked'; ?>>
1035
+ <label for="mycred_align_none">
1036
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#10212b;}.cls-2{fill:#aab5bc;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><rect class="cls-1" x="9.02" y="13.98" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="10.42" y="19.03" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.42" y="21.33" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.42" y="23.63" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.42" y="25.93" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.42" y="28.23" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.42" y="30.53" width="20.48" height="1.27" rx="0.44"/><rect class="cls-1" x="9.02" y="36.13" width="43.07" height="3.33" rx="1.67"/><rect class="cls-2" x="10.42" y="41.18" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.42" y="43.48" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.42" y="45.78" width="39.58" height="1.27" rx="0.44"/><rect class="cls-2" x="10.42" y="48.08" width="20.48" height="1.27" rx="0.44"/><path class="cls-2" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><circle class="cls-1" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-1" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-1" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'None', 'mycred' ); ?>
1037
+ </label>
1038
+ </li>
1039
+ </ul>
1040
+ </div>
1041
+ </div>
1042
+ </div>
1043
+ <?php
1044
+
1045
+ }
1046
+
1047
+
1048
+
1049
+ public function metabox_badge_layout( $post ) {
1050
+
1051
+ $mycred_layout = mycred_get_post_meta( $post->ID, 'mycred_layout_check', true );
1052
+
1053
+ ?>
1054
+ <div class="row">
1055
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1056
+ <div class="mycred-layout-option">
1057
+ <ul class="mycred-radio-list">
1058
+ <li>
1059
+ <input type="radio" class="mycred-layout-radio" name="mycred_badge[mycred_layout_check]" id="mycred_layout_left" value="mycred_layout_left" <?php echo ( $mycred_layout == 'mycred_layout_left' ) ? 'checked' : '' ; ?>>
1060
+ <label for="mycred_layout_left">
1061
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#aab5bc;}.cls-2{fill:#10212b;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><path class="cls-1" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><path class="cls-2" d="M24.51,15.85H5.93a1.34,1.34,0,0,0-1.34,1.33v11.7a1.34,1.34,0,0,0,1.34,1.34H24.51a1.34,1.34,0,0,0,1.33-1.34V17.18A1.34,1.34,0,0,0,24.51,15.85Zm.9,13a.9.9,0,0,1-.9.91H5.93A.91.91,0,0,1,5,28.88V17.18a.9.9,0,0,1,.91-.9H24.51a.9.9,0,0,1,.9.9Z"/><rect class="cls-2" x="28.02" y="16.06" width="29.65" height="2.29" rx="1.15"/><rect class="cls-1" x="29.22" y="20.23" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="21.81" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="23.39" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="24.98" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="26.56" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="28.14" width="14.1" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="31.5" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="33.09" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="34.67" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="29.22" y="36.25" width="14.1" height="0.87" rx="0.44"/><rect class="cls-1" x="31.65" y="45.35" width="20.1" height="0.87" rx="0.44"/><rect class="cls-1" x="31.65" y="48.26" width="24.49" height="0.87" rx="0.44"/><rect class="cls-1" x="31.65" y="51.04" width="14.1" height="0.87" rx="0.44"/><rect class="cls-2" x="28.02" y="41" width="29.65" height="2.29" rx="1.15"/><circle class="cls-1" cx="29.95" cy="45.95" r="0.6"/><circle class="cls-1" cx="29.95" cy="48.7" r="0.6"/><circle class="cls-1" cx="29.95" cy="51.47" r="0.6"/><path class="cls-2" d="M25.84,20.29v8.59a1.34,1.34,0,0,1-1.33,1.34H5.93a1.34,1.34,0,0,1-1.34-1.34v-.64c.13-.14.27-.3.43-.46a10.18,10.18,0,0,1,6.71-3.1c5.4-.31,8.69-5.59,13.68-4.5l.22.05Z"/><circle class="cls-2" cx="7.5" cy="19.24" r="1.22"/><circle class="cls-2" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-2" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-2" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'Left', 'mycred' ); ?>
1062
+ </label>
1063
+ </li>
1064
+ <li>
1065
+ <input type="radio" class="mycred-layout-radio" name="mycred_badge[mycred_layout_check]" id="mycred_layout_top" value="mycred_layout_top" <?php echo ( $mycred_layout == 'mycred_layout_top' ) ? 'checked' : '' ; ?>>
1066
+ <label for="mycred_layout_top">
1067
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#aab5bc;}.cls-2{fill:#10212b;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><path class="cls-1" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><rect class="cls-2" x="16.31" y="31.62" width="29.65" height="2.29" rx="1.15"/><rect class="cls-1" x="17.51" y="35.78" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="37.37" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="38.95" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="40.53" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="42.11" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="43.7" width="14.1" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="47.06" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="48.64" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="50.22" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="51.81" width="14.1" height="0.87" rx="0.44"/><path class="cls-2" d="M40.42,13.17H21.84a1.34,1.34,0,0,0-1.34,1.34v11.7a1.34,1.34,0,0,0,1.34,1.33H40.42a1.34,1.34,0,0,0,1.33-1.33V14.51A1.34,1.34,0,0,0,40.42,13.17Zm.9,13a.9.9,0,0,1-.9.9H21.84a.9.9,0,0,1-.91-.9V14.51a.91.91,0,0,1,.91-.91H40.42a.9.9,0,0,1,.9.91Z"/><path class="cls-2" d="M41.75,17.62v8.59a1.34,1.34,0,0,1-1.33,1.33H21.84a1.34,1.34,0,0,1-1.34-1.33v-.64c.13-.15.27-.3.43-.46A10.21,10.21,0,0,1,27.64,22c5.4-.31,8.69-5.58,13.68-4.49l.22,0A1.29,1.29,0,0,1,41.75,17.62Z"/><circle class="cls-2" cx="23.41" cy="16.56" r="1.22"/><circle class="cls-2" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-2" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-2" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'Top', 'mycred' ); ?>
1068
+ </label>
1069
+ </li>
1070
+ <li>
1071
+ <input type="radio" class="mycred-layout-radio" name="mycred_badge[mycred_layout_check]" id="mycred_layout_right" value="mycred_layout_right" <?php echo ( $mycred_layout == 'mycred_layout_right' ) ? 'checked' : '' ; ?>>
1072
+ <label for="mycred_layout_right">
1073
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#aab5bc;}.cls-2{fill:#10212b;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><path class="cls-1" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><rect class="cls-2" x="4.59" y="16.06" width="29.65" height="2.29" rx="1.15"/><rect class="cls-1" x="5.79" y="20.23" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="21.81" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="23.39" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="24.98" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="26.56" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="28.14" width="14.1" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="31.5" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="33.09" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="34.67" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="5.79" y="36.25" width="14.1" height="0.87" rx="0.44"/><rect class="cls-1" x="8.22" y="45.35" width="20.1" height="0.87" rx="0.44"/><rect class="cls-1" x="8.22" y="48.26" width="24.49" height="0.87" rx="0.44"/><rect class="cls-1" x="8.22" y="51.04" width="14.1" height="0.87" rx="0.44"/><rect class="cls-2" x="4.59" y="41" width="29.65" height="2.29" rx="1.15"/><circle class="cls-1" cx="6.52" cy="45.95" r="0.6"/><circle class="cls-1" cx="6.52" cy="48.7" r="0.6"/><circle class="cls-1" cx="6.52" cy="51.47" r="0.6"/><path class="cls-2" d="M56.33,15.85H37.75a1.34,1.34,0,0,0-1.34,1.33v11.7a1.34,1.34,0,0,0,1.34,1.34H56.33a1.34,1.34,0,0,0,1.34-1.34V17.18A1.34,1.34,0,0,0,56.33,15.85Zm.9,13a.9.9,0,0,1-.9.91H37.75a.91.91,0,0,1-.91-.91V17.18a.9.9,0,0,1,.91-.9H56.33a.9.9,0,0,1,.9.9Z"/><path class="cls-2" d="M57.67,20.29v8.59a1.34,1.34,0,0,1-1.34,1.34H37.75a1.34,1.34,0,0,1-1.34-1.34v-.64c.13-.14.27-.3.43-.46a10.21,10.21,0,0,1,6.72-3.1c5.39-.31,8.68-5.59,13.67-4.5l.22.05Z"/><circle class="cls-2" cx="39.32" cy="19.24" r="1.22"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'Right', 'mycred' ); ?>
1074
+ </label>
1075
+ </li>
1076
+ <li>
1077
+ <input type="radio" class="mycred-layout-radio" name="mycred_badge[mycred_layout_check]" id="mycred_layout_bottom" value="mycred_layout_bottom" <?php echo ( $mycred_layout == 'mycred_layout_bottom' ) ? 'checked' : '' ; ?>>
1078
+ <label for="mycred_layout_bottom">
1079
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#aab5bc;}.cls-2{fill:#10212b;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><path class="cls-1" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><rect class="cls-2" x="16.31" y="12.76" width="29.65" height="2.29" rx="1.15"/><rect class="cls-1" x="17.51" y="16.92" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="18.51" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="20.09" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="21.67" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="23.26" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="24.08" y="24.84" width="14.1" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="28.2" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="29.78" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="17.51" y="31.37" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="24.08" y="32.95" width="14.1" height="0.87" rx="0.44"/><path class="cls-2" d="M40.42,40.74H21.84a1.34,1.34,0,0,0-1.34,1.34v11.7a1.34,1.34,0,0,0,1.34,1.34H40.42a1.34,1.34,0,0,0,1.33-1.34V42.08A1.34,1.34,0,0,0,40.42,40.74Zm.9,13a.9.9,0,0,1-.9.91H21.84a.91.91,0,0,1-.91-.91V42.08a.9.9,0,0,1,.91-.9H40.42a.9.9,0,0,1,.9.9Z"/><path class="cls-2" d="M41.75,45.19v8.59a1.34,1.34,0,0,1-1.33,1.34H21.84a1.34,1.34,0,0,1-1.34-1.34v-.64c.13-.15.27-.3.43-.46a10.21,10.21,0,0,1,6.71-3.11c5.4-.3,8.69-5.58,13.68-4.49l.22.05Z"/><circle class="cls-2" cx="23.41" cy="44.14" r="1.22"/><circle class="cls-2" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-2" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-2" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'Bottom', 'mycred' ); ?>
1080
+ </label>
1081
+ </li>
1082
+ <li>
1083
+ <input type="radio" class="mycred-layout-radio" name="mycred_badge[mycred_layout_check]" id="mycred_layout_none" value="mycred_layout_none" <?php echo ($mycred_layout == 'mycred_layout_none' ) ? 'checked' : '' ; if ( empty( $mycred_layout ) ) echo 'checked'; ?>>
1084
+ <label for="mycred_layout_none">
1085
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62.26 61.16"><defs><style>.cls-1{fill:#aab5bc;}.cls-2{fill:#10212b;}.cls-3{fill:none;stroke:#10212b;stroke-miterlimit:10;}</style></defs><title>icon</title><path class="cls-1" d="M61.76,2.53v5H.5v-5c0-1.12.68-2,1.53-2h58.2C61.07.5,61.76,1.41,61.76,2.53Z"/><rect class="cls-2" x="6.4" y="31.62" width="29.65" height="2.29" rx="1.15"/><rect class="cls-1" x="7.61" y="35.78" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="37.37" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="38.95" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="40.53" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="42.11" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="43.7" width="14.1" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="47.06" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="48.64" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="50.22" width="27.24" height="0.87" rx="0.44"/><rect class="cls-1" x="7.61" y="51.81" width="14.1" height="0.87" rx="0.44"/><path class="cls-2" d="M26.32,13.17H7.74A1.34,1.34,0,0,0,6.4,14.51v11.7a1.34,1.34,0,0,0,1.34,1.33H26.32a1.34,1.34,0,0,0,1.34-1.33V14.51A1.34,1.34,0,0,0,26.32,13.17Zm.91,13a.9.9,0,0,1-.91.9H7.74a.9.9,0,0,1-.9-.9V14.51a.9.9,0,0,1,.9-.91H26.32a.91.91,0,0,1,.91.91Z"/><path class="cls-2" d="M27.66,17.62v8.59a1.34,1.34,0,0,1-1.34,1.33H7.74A1.34,1.34,0,0,1,6.4,26.21v-.64c.13-.15.28-.3.44-.46A10.16,10.16,0,0,1,13.55,22c5.39-.31,8.68-5.58,13.68-4.49l.21,0Z"/><circle class="cls-2" cx="9.31" cy="16.56" r="1.22"/><circle class="cls-2" cx="58.22" cy="4.64" r="0.63"/><circle class="cls-2" cx="55.83" cy="4.64" r="0.63"/><circle class="cls-2" cx="52.67" cy="4.64" r="0.63"/><rect class="cls-3" x="0.5" y="0.5" width="61.26" height="60.16"/></svg><?php _e( 'None', 'mycred' ); ?>
1086
+ </label>
1087
+ </li>
1088
+ </ul>
1089
+ </div>
1090
+ </div>
1091
+ </div>
1092
+ <?php
1093
+
1094
+ }
1095
+
1096
  /**
1097
  * Open Badge Metabox
1098
  * @since 2.1
1385
  if ( isset( $_POST['mycred_badge']['congratulation_msg'] ) )
1386
  $congratulation_msg = sanitize_text_field( $_POST['mycred_badge']['congratulation_msg'] );
1387
 
1388
+ $badge_align = '';
1389
+ if ( isset( $_POST['mycred_badge']['mycred_badge_align'] ) )
1390
+ $badge_align = sanitize_text_field( $_POST['mycred_badge']['mycred_badge_align'] );
1391
+
1392
+ $layout = '';
1393
+ if ( isset( $_POST['mycred_badge']['mycred_layout_check'] ) )
1394
+ $layout = sanitize_text_field( $_POST['mycred_badge']['mycred_layout_check'] );
1395
+
1396
  $badge_levels = array();
1397
  $badge_requirements = array();
1398
 
1511
 
1512
  mycred_update_post_meta( $post_id, 'main_image', $image );
1513
 
1514
+ mycred_update_post_meta( $post_id, 'mycred_badge_align', $badge_align );
1515
+
1516
+ mycred_update_post_meta( $post_id, 'mycred_layout_check', $layout );
1517
+
1518
  // Let others play
1519
  do_action( 'mycred_save_badge', $post_id );
1520
 
1594
  </div>
1595
  </div>
1596
  </div>
1597
+ <?php if( $settings['open_badge'] == '1' ):?>
1598
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1599
+ <div class="form-group">
1600
+ <label for="<?php echo $this->field_id( 'open_badge_evidence_page' ); ?>"><?php _e( 'Evidence Page', 'mycred' ); ?></label>
1601
+ <?php
1602
 
1603
+ $selectedEvidencePage = mycred_get_evidence_page_id();
1604
 
1605
+ $args = array(
1606
+ 'id' => $this->field_id( 'open_badge_evidence_page' ),
1607
+ 'name' => $this->field_name( 'open_badge_evidence_page' ),
1608
+ 'selected' => $selectedEvidencePage
1609
+ );
1610
 
1611
+ wp_dropdown_pages( $args );
1612
+ ?>
1613
+ </div>
1614
  </div>
1615
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1616
+ <div class="form-group">
1617
+ <button class="button button-large large button-primary" id="switch-all-to-open-badge"><span class="dashicons dashicons-update mycred-switch-all-badges-icon"></span> Switch All Badges To Open Badge.</button>
1618
+ </div>
 
1619
  </div>
1620
+ <?php endif;?>
1621
  </div>
1622
 
1623
  <h3><?php _e( 'Third-party Integrations', 'mycred' ); ?></h3>
1698
  <p><a href="http://codex.mycred.me/shortcodes/mycred_my_badges/" target="_blank">[mycred_my_badges]</a>, <a href="http://codex.mycred.me/shortcodes/mycred_badges/" target="_blank">[mycred_badges]</a></p>
1699
  </div>
1700
  </div>
1701
+ <?php do_action( 'mycred_admin_after_badges_settings' ); ?>
1702
  </div>
1703
  <?php
1704
 
2051
 
2052
  }
2053
 
2054
+ /**
2055
+ * Loads meta in header for Social Sharing
2056
+ * @since 2.2
2057
+ * @version 1.0
2058
+ */
2059
+ public function social_share_br_header() {
2060
+
2061
+ global $post;
2062
+
2063
+ $badge_align = mycred_get_post_meta( $post->ID, 'mycred_badge_align', true );
2064
+ $badge_layout = mycred_get_post_meta( $post->ID, 'mycred_layout_check', true );
2065
+
2066
+ if( is_single() && $post->post_type == MYCRED_BADGE_KEY ) {
2067
+
2068
+ $badge_id = $post->ID;
2069
+
2070
+ $user_id = get_current_user_id();
2071
+
2072
+ $badge_object = mycred_get_badge( $badge_id );
2073
+
2074
+ $badge_image_url = $badge_object->get_earned_image( $user_id );?>
2075
+
2076
+ <meta property="og:url" content="<?php echo esc_url( get_the_permalink() ); ?>">
2077
+ <meta property="og:title" content="<?php echo esc_attr( get_the_title() ); ?>">
2078
+ <meta property="og:description" content="<?php echo esc_attr( $post->post_content );?>">
2079
+ <meta property="og:image" content="<?php echo esc_url( $badge_image_url ); ?>">
2080
+ <meta name="twitter:image" content="<?php echo esc_url( $badge_image_url ); ?>">
2081
+ <meta name="twitter:card" content="summary_large_image">
2082
+
2083
+ <?php
2084
+ }
2085
+
2086
+ }
2087
+
2088
  /**
2089
  * Automatically runs when MYCRED_BADGE_KEY (Post Type Page Loads)
2090
  * @param $content
2091
  * @return string
2092
  * @since 2.1
2093
+ * @version 1.1
2094
  */
2095
  public function mycred_badge_page_template( $content ) {
2096
 
2097
  global $post;
2098
 
2099
+ if ( is_single() && $post->post_type == MYCRED_BADGE_KEY ) {
2100
 
2101
  $mycred = mycred();
2102
 
2106
  $show_level_points = false;
2107
  $show_steps_to_achieve = false;
2108
  $show_earners = false;
2109
+ $enable_open_badge_ss = isset( $mycred->core["br_social_share"]["enable_open_badge_ss"] ) && $mycred->core["br_social_share"]["enable_open_badge_ss"] == '1' ? true : false;
2110
 
2111
+ if ( is_array( $mycred->core ) && array_key_exists('badges', $mycred->core ) )
2112
+ {
2113
  $show_level_description = $mycred->core["badges"]["show_level_description"] == '1' ? true : false;
2114
  $show_congo_text = $mycred->core["badges"]["show_congo_text"] == '1' ? true : false;
2115
  $show_levels = $mycred->core["badges"]["show_levels"] == '1' ? true : false;
2136
  $content = '<div class="mycred-badge-page">';
2137
 
2138
  if ( $show_congo_text && $has_earned ) {
2139
+ if (!empty($badge_object->congratulation_msg))
2140
+ {
2141
 
2142
  $content .= '<div class="mycred-badge-congratulation-msg">' . $badge_object->congratulation_msg . '</div>';
 
2143
  }
 
2144
  }
2145
+ $content .= '<div class="'.$badge_layout.' '.$badge_align.'">';
2146
+ if( $badge_layout == 'mycred_layout_none')
2147
+ $content .= '<img src="' . $badge_image_url . '" class="mycred-badge-image" alt="">';
2148
+
2149
+ if( $badge_layout == 'mycred_layout_right')
2150
+ $content .= '<img src="' . $badge_image_url . '" class="mycred-badge-image" alt="">';
2151
+
2152
+ if( $badge_layout == 'mycred_layout_left')
2153
+ $content .= '<img src="' . $badge_image_url . '" class="mycred-badge-image" alt="">';
2154
+
2155
+ if( $badge_layout == 'mycred_layout_top' )
2156
+ $content .= '<img src="' . $badge_image_url . '" class="mycred-badge-image" alt="">';
2157
+
2158
  $content .= '<img src="' . $badge_image_url . '" class="mycred-badge-image" alt="">';
2159
 
2160
+ //If user has earned badge, show user sharing badge option
2161
+ if( $has_earned && $enable_open_badge_ss)
2162
+ {
2163
+ $facebook_url = "http://www.facebook.com/sharer.php?u=".get_permalink()."&amp;p[images[0]=$badge_image_url";
2164
+ $twitter_url = "https://twitter.com/share?url=".get_permalink()."";
2165
+ $linkedin_url = "http://www.linkedin.com/shareArticle?url=".get_permalink()."";
2166
+ $pinterest_url = "https://pinterest.com/pin/create/bookmarklet/?media=$badge_image_url&amp;url=".get_permalink()."";
2167
+
2168
+ $content .= mycred_br_get_social_icons( $facebook_url, $twitter_url, $linkedin_url, $pinterest_url );
2169
+ }
2170
+
2171
  //Level Description
2172
  if( $show_level_description ) {
2173
 
2265
 
2266
  $content .= '</div>';
2267
 
2268
+ if( $badge_layout == 'mycred_layout_bottom')
2269
+ $content .= '<img src="' . $badge_image_url . '" class="mycred-badge-image" alt="">';
2270
+
2271
+ $content .= '</div>';
2272
+
2273
+ $content .= '</div>';
2274
+
2275
  return $content;
2276
 
2277
  }
addons/buy-creds/gateways/Bitpay/Client/Client.php CHANGED
@@ -174,13 +174,10 @@ class Client implements ClientInterface
174
  ->setId($data['id'])
175
  ->setUrl($data['url'])
176
  ->setStatus($data['status'])
177
- ->setBtcPrice($data['btcPrice'])
178
  ->setPrice($data['price'])
179
  ->setInvoiceTime($data['invoiceTime'])
180
  ->setExpirationTime($data['expirationTime'])
181
  ->setCurrentTime($data['currentTime'])
182
- ->setBtcPaid($data['btcPaid'])
183
- ->setRate($data['rate'])
184
  ->setExceptionStatus($data['exceptionStatus']);
185
 
186
  return $invoice;
174
  ->setId($data['id'])
175
  ->setUrl($data['url'])
176
  ->setStatus($data['status'])
 
177
  ->setPrice($data['price'])
178
  ->setInvoiceTime($data['invoiceTime'])
179
  ->setExpirationTime($data['expirationTime'])
180
  ->setCurrentTime($data['currentTime'])
 
 
181
  ->setExceptionStatus($data['exceptionStatus']);
182
 
183
  return $invoice;
addons/buy-creds/gateways/bitpay.php CHANGED
@@ -246,6 +246,9 @@ if ( ! class_exists( 'myCRED_Bitpay' ) ) :
246
  // Set currency
247
  $this->currency = ( $this->currency == '' ) ? $this->prefs['currency'] : $this->currency;
248
 
 
 
 
249
  // Item Name
250
  $item_name = str_replace( '%number%', $this->amount, $this->prefs['item_name'] );
251
  $item_name = $this->core->template_tags_general( $item_name );
246
  // Set currency
247
  $this->currency = ( $this->currency == '' ) ? $this->prefs['currency'] : $this->currency;
248
 
249
+ //Set Cost in raw format
250
+ $this->cost = $this->get_cost( $this->amount, $this->point_type, true );
251
+
252
  // Item Name
253
  $item_name = str_replace( '%number%', $this->amount, $this->prefs['item_name'] );
254
  $item_name = $this->core->template_tags_general( $item_name );
addons/buy-creds/modules/buycred-module-core.php CHANGED
@@ -25,14 +25,15 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
25
  'gateway_prefs' => array()
26
  ),
27
  'labels' => array(
28
- 'menu' => __( 'Payment Gateways', 'mycred' ),
29
- 'page_title' => __( 'Payment Gateways', 'mycred' ),
30
- 'page_header' => __( 'Payment Gateways', 'mycred' )
31
  ),
32
  'screen_id' => MYCRED_SLUG . '-gateways',
33
  'accordion' => true,
34
  'add_to_core' => true,
35
- 'menu_pos' => 70
 
36
  ), $type );
37
 
38
  $this->mycred_type = MYCRED_DEFAULT_TYPE_KEY;
@@ -725,7 +726,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
725
 
726
  ?>
727
  <div class="wrap mycred-metabox" id="myCRED-wrap">
728
- <h1><?php _e( 'Payment Gateways', 'mycred' ); ?></h1>
729
  <?php
730
 
731
  // Updated settings
25
  'gateway_prefs' => array()
26
  ),
27
  'labels' => array(
28
+ 'menu' => __( 'buyCred Gateways', 'mycred' ),
29
+ 'page_title' => __( 'buyCred Gateways', 'mycred' ),
30
+ 'page_header' => __( 'buyCred Gateways', 'mycred' )
31
  ),
32
  'screen_id' => MYCRED_SLUG . '-gateways',
33
  'accordion' => true,
34
  'add_to_core' => true,
35
+ 'menu_pos' => 70,
36
+ 'main_menu' => true
37
  ), $type );
38
 
39
  $this->mycred_type = MYCRED_DEFAULT_TYPE_KEY;
726
 
727
  ?>
728
  <div class="wrap mycred-metabox" id="myCRED-wrap">
729
+ <h1><?php _e( 'buyCred Payment Gateways', 'mycred' ); ?></h1>
730
  <?php
731
 
732
  // Updated settings
addons/buy-creds/modules/buycred-module-pending.php CHANGED
@@ -150,15 +150,15 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
150
  protected function register_pending_payments() {
151
 
152
  $labels = array(
153
- 'name' => _x( 'Pending Payments', 'Post Type General Name', 'mycred' ),
154
- 'singular_name' => _x( 'Pending Payment', 'Post Type Singular Name', 'mycred' ),
155
- 'menu_name' => __( 'Pending Payments', 'mycred' ),
156
  'parent_item_colon' => '',
157
- 'all_items' => __( 'Pending Payments', 'mycred' ),
158
  'view_item' => '',
159
  'add_new_item' => '',
160
  'add_new' => '',
161
- 'edit_item' => __( 'Edit Pending Payment', 'mycred' ),
162
  'update_item' => '',
163
  'search_items' => '',
164
  'not_found' => __( 'Not found in Trash', 'mycred' ),
@@ -245,8 +245,7 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
245
  */
246
  public function add_to_menu() {
247
 
248
- add_submenu_page(
249
- MYCRED_SLUG,
250
  __( 'Pending Payments', 'mycred' ),
251
  __( 'Pending Payments', 'mycred' ),
252
  $this->core->get_point_editor_capability(),
@@ -265,7 +264,7 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
265
  global $pagenow;
266
 
267
  if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_BUY_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
268
- return MYCRED_SLUG;
269
 
270
  return $parent;
271
 
@@ -597,7 +596,7 @@ jQuery(function($){
597
  $mycred = $this->core;
598
 
599
  else
600
- $mycred = mycred( $type );
601
 
602
  ?>
603
  <div class="form">
@@ -642,7 +641,7 @@ jQuery(function($){
642
 
643
  echo '<option value="' . $point_type . '"';
644
  if ( $pending_payment->point_type == $point_type ) echo ' selected="selected"';
645
- echo '>' . mycred_get_point_type_name( $pending_payment->point_type, false ) . '</option>';
646
 
647
  }
648
 
150
  protected function register_pending_payments() {
151
 
152
  $labels = array(
153
+ 'name' => _x( 'buyCred Pending Payments', 'Post Type General Name', 'mycred' ),
154
+ 'singular_name' => _x( 'buyCred Pending Payment', 'Post Type Singular Name', 'mycred' ),
155
+ 'menu_name' => __( 'buyCred Pending Payments', 'mycred' ),
156
  'parent_item_colon' => '',
157
+ 'all_items' => __( 'buyCred Pending Payments', 'mycred' ),
158
  'view_item' => '',
159
  'add_new_item' => '',
160
  'add_new' => '',
161
+ 'edit_item' => __( 'Edit buyCred Pending Payment', 'mycred' ),
162
  'update_item' => '',
163
  'search_items' => '',
164
  'not_found' => __( 'Not found in Trash', 'mycred' ),
245
  */
246
  public function add_to_menu() {
247
 
248
+ mycred_add_main_submenu(
 
249
  __( 'Pending Payments', 'mycred' ),
250
  __( 'Pending Payments', 'mycred' ),
251
  $this->core->get_point_editor_capability(),
264
  global $pagenow;
265
 
266
  if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_BUY_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
267
+ return MYCRED_MAIN_SLUG;
268
 
269
  return $parent;
270
 
596
  $mycred = $this->core;
597
 
598
  else
599
+ $mycred = mycred( $pending_payment->point_type );
600
 
601
  ?>
602
  <div class="form">
641
 
642
  echo '<option value="' . $point_type . '"';
643
  if ( $pending_payment->point_type == $point_type ) echo ' selected="selected"';
644
+ echo '>' . mycred_get_point_type_name( $point_type, false ) . '</option>';
645
 
646
  }
647
 
addons/cash-creds/modules/cashcred-module-core.php CHANGED
@@ -32,7 +32,8 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
32
  'screen_id' => MYCRED_SLUG . '-cashcreds',
33
  'accordion' => true,
34
  'add_to_core' => true,
35
- 'menu_pos' => 90
 
36
  ), $type );
37
 
38
  $this->mycred_type = MYCRED_DEFAULT_TYPE_KEY;
@@ -154,7 +155,6 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
154
 
155
  if( ! empty( $_POST['cashcred_pay_method'] ) ) {
156
  $cashcred_pay_method = $_POST['cashcred_pay_method'];
157
-
158
  }
159
  else {
160
  return $this->response( false, array( 'message' => 'Invalid Payment Gateway' ), $auto );
@@ -163,28 +163,31 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
163
  if ( $cashcred_pay_method !== false && array_key_exists( $cashcred_pay_method, $cashcred_instance->active ) ) {
164
 
165
  $cashcred_instance->gateway = cashcred_gateway( $cashcred_pay_method );
166
- $cashcred_prefs = mycred_get_option( 'mycred_pref_cashcreds' , false );
167
 
 
 
168
  do_action( 'mycred_cashcred_process',$cashcred_pay_method, $cashcred_prefs );
169
  do_action( "mycred_cashcred_process_{$cashcred_pay_method}", $cashcred_prefs );
170
 
171
  $payment_response = $cashcred_instance->gateway->process( $post_id );
172
 
173
  if( $payment_response['status'] == true ) {
 
174
  $history_comments = $this->cashcred_update_payment_status( $post_id, $auto );
175
  $payment_response['cashcred_total'] = $history_comments['cashcred_total'];
176
  $payment_response['history_comments'] = $history_comments['comments'];
177
  return $this->response( true, $payment_response, $auto );
178
-
179
  }
180
  else {
181
-
182
  $payment_response['cashcred_total'] = '';
183
  $payment_response['date'] = '';
184
  $payment_response['history_comments'] = '';
185
  return $this->response( false, $payment_response, $auto );
186
 
187
  }
 
188
  }
189
  else {
190
 
@@ -386,6 +389,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
386
  public function process_new_withdraw_request( $gateway_id ){
387
 
388
  global $wp;
 
389
  $requested_url = home_url( $wp->request ) . $_SERVER['REQUEST_URI'];
390
  $point_type = sanitize_text_field( $_POST['cashcred_point_type'] );
391
  $cashcred_pay_method = sanitize_text_field( $_POST['cashcred_pay_method'] );
@@ -653,7 +657,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
653
 
654
  ?>
655
  <div class="wrap mycred-metabox" id="myCRED-wrap">
656
- <h1><?php _e( 'cashCreds', 'mycred' ); ?></h1>
657
  <?php
658
 
659
  // Updated settings
32
  'screen_id' => MYCRED_SLUG . '-cashcreds',
33
  'accordion' => true,
34
  'add_to_core' => true,
35
+ 'menu_pos' => 90,
36
+ 'main_menu' => true
37
  ), $type );
38
 
39
  $this->mycred_type = MYCRED_DEFAULT_TYPE_KEY;
155
 
156
  if( ! empty( $_POST['cashcred_pay_method'] ) ) {
157
  $cashcred_pay_method = $_POST['cashcred_pay_method'];
 
158
  }
159
  else {
160
  return $this->response( false, array( 'message' => 'Invalid Payment Gateway' ), $auto );
163
  if ( $cashcred_pay_method !== false && array_key_exists( $cashcred_pay_method, $cashcred_instance->active ) ) {
164
 
165
  $cashcred_instance->gateway = cashcred_gateway( $cashcred_pay_method );
 
166
 
167
+ $cashcred_prefs = mycred_get_option( 'mycred_pref_cashcreds' , false );
168
+
169
  do_action( 'mycred_cashcred_process',$cashcred_pay_method, $cashcred_prefs );
170
  do_action( "mycred_cashcred_process_{$cashcred_pay_method}", $cashcred_prefs );
171
 
172
  $payment_response = $cashcred_instance->gateway->process( $post_id );
173
 
174
  if( $payment_response['status'] == true ) {
175
+
176
  $history_comments = $this->cashcred_update_payment_status( $post_id, $auto );
177
  $payment_response['cashcred_total'] = $history_comments['cashcred_total'];
178
  $payment_response['history_comments'] = $history_comments['comments'];
179
  return $this->response( true, $payment_response, $auto );
180
+
181
  }
182
  else {
183
+
184
  $payment_response['cashcred_total'] = '';
185
  $payment_response['date'] = '';
186
  $payment_response['history_comments'] = '';
187
  return $this->response( false, $payment_response, $auto );
188
 
189
  }
190
+
191
  }
192
  else {
193
 
389
  public function process_new_withdraw_request( $gateway_id ){
390
 
391
  global $wp;
392
+
393
  $requested_url = home_url( $wp->request ) . $_SERVER['REQUEST_URI'];
394
  $point_type = sanitize_text_field( $_POST['cashcred_point_type'] );
395
  $cashcred_pay_method = sanitize_text_field( $_POST['cashcred_pay_method'] );
657
 
658
  ?>
659
  <div class="wrap mycred-metabox" id="myCRED-wrap">
660
+ <h1><?php _e( 'cashCred Payment Gateways', 'mycred' ); ?></h1>
661
  <?php
662
 
663
  // Updated settings
addons/cash-creds/modules/cashcred-module-withdrawal.php CHANGED
@@ -70,10 +70,10 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
70
  add_filter( 'bulk_actions-edit-' . MYCRED_CASHCRED_KEY, array( $this, 'bulk_actions' ) );
71
  add_action( 'save_post_' . MYCRED_CASHCRED_KEY, array( $this, 'save_pending_payment' ), 10, 2 );
72
 
73
- add_action( 'restrict_manage_posts', array( $this, 'cashcred_filter_html' ));
74
- add_filter( 'parse_query', array( $this, 'cashcred_filter_query' ));
75
 
76
- add_action( 'admin_enqueue_scripts', array( $this, 'cashcred_admin_assets' ));
77
 
78
  }
79
 
@@ -193,7 +193,8 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
193
  );
194
  }
195
 
196
- $query->set( 'meta_query', $meta_query);
 
197
 
198
  }
199
 
@@ -304,8 +305,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
304
  // site in the network, bail.
305
  //if ( mycred_override_settings() && ! mycred_is_main_site() ) return;
306
 
307
- add_submenu_page(
308
- MYCRED_SLUG,
309
  __( 'cashCred Withdrawal', 'mycred' ),
310
  __( 'cashCred Withdrawal', 'mycred' ),
311
  $this->core->get_point_editor_capability(),
@@ -324,7 +324,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
324
  global $pagenow;
325
 
326
  if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_CASHCRED_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
327
- return MYCRED_SLUG;
328
 
329
  return $parent;
330
 
70
  add_filter( 'bulk_actions-edit-' . MYCRED_CASHCRED_KEY, array( $this, 'bulk_actions' ) );
71
  add_action( 'save_post_' . MYCRED_CASHCRED_KEY, array( $this, 'save_pending_payment' ), 10, 2 );
72
 
73
+ add_action( 'restrict_manage_posts', array( $this, 'cashcred_filter_html' ) );
74
+ add_action( 'parse_query', array( $this, 'cashcred_filter_query' ) );
75
 
76
+ add_action( 'admin_enqueue_scripts', array( $this, 'cashcred_admin_assets' ) );
77
 
78
  }
79
 
193
  );
194
  }
195
 
196
+ if( ! empty( $meta_query ) )
197
+ $query->set( 'meta_query', $meta_query );
198
 
199
  }
200
 
305
  // site in the network, bail.
306
  //if ( mycred_override_settings() && ! mycred_is_main_site() ) return;
307
 
308
+ mycred_add_main_submenu(
 
309
  __( 'cashCred Withdrawal', 'mycred' ),
310
  __( 'cashCred Withdrawal', 'mycred' ),
311
  $this->core->get_point_editor_capability(),
324
  global $pagenow;
325
 
326
  if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_CASHCRED_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
327
+ return MYCRED_MAIN_SLUG;
328
 
329
  return $parent;
330
 
addons/coupons/myCRED-addon-coupons.php CHANGED
@@ -163,8 +163,7 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
163
  // site in the network, bail.
164
  if ( mycred_override_settings() && ! mycred_is_main_site() ) return;
165
 
166
- add_submenu_page(
167
- MYCRED_SLUG,
168
  __( 'Coupons', 'mycred' ),
169
  __( 'Coupons', 'mycred' ),
170
  $this->core->get_point_editor_capability(),
@@ -183,10 +182,10 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
183
  global $pagenow;
184
 
185
  if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_COUPON_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
186
- return MYCRED_SLUG;
187
 
188
  if ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_COUPON_KEY )
189
- return MYCRED_SLUG;
190
 
191
  return $parent;
192
 
163
  // site in the network, bail.
164
  if ( mycred_override_settings() && ! mycred_is_main_site() ) return;
165
 
166
+ mycred_add_main_submenu(
 
167
  __( 'Coupons', 'mycred' ),
168
  __( 'Coupons', 'mycred' ),
169
  $this->core->get_point_editor_capability(),
182
  global $pagenow;
183
 
184
  if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_COUPON_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
185
+ return MYCRED_MAIN_SLUG;
186
 
187
  if ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_COUPON_KEY )
188
+ return MYCRED_MAIN_SLUG;
189
 
190
  return $parent;
191
 
addons/email-notices/includes/mycred-email-functions.php CHANGED
@@ -424,7 +424,9 @@ if ( ! function_exists( 'mycred_get_event_emails' ) ) :
424
 
425
  if ( array_key_exists( $instance, $triggers[ $event_type ] ) && ! empty( $triggers[ $event_type ][ $instance ] ) )
426
  $notices = $triggers[ $event_type ][ $instance ];
 
427
  }
 
428
  return apply_filters( 'mycred_get_event_emails', $notices, $triggers, $point_type, $event_type, $instance );
429
 
430
  }
424
 
425
  if ( array_key_exists( $instance, $triggers[ $event_type ] ) && ! empty( $triggers[ $event_type ][ $instance ] ) )
426
  $notices = $triggers[ $event_type ][ $instance ];
427
+
428
  }
429
+
430
  return apply_filters( 'mycred_get_event_emails', $notices, $triggers, $point_type, $event_type, $instance );
431
 
432
  }
addons/email-notices/includes/mycred-email-object.php CHANGED
@@ -406,16 +406,37 @@ if ( ! class_exists( 'myCRED_Email' ) ) :
406
  // Template tags can only be used if the email triggers for one point type only.
407
  $content = str_replace( '%entry%', $event['entry'], $content );
408
  $content = $mycred->template_tags_amount( $content, $event['amount'] );
 
409
  // to display correct user names in transfer email
410
  if( $event['ref']==='transfer' ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  $content = $mycred->template_tags_user( $content, $event['ref_id'] );
412
  $content = mycred_transfer_render_message( $content, $event['data'] );
 
413
  }
414
  elseif( $event['ref']==='woocommerce_payment' ){
 
415
  $content = str_replace( '%order_id%', $event['ref_id'], $content );
 
416
  }
417
  else{
 
418
  $content = $mycred->template_tags_user( $content, $event['user_id'] );
 
419
  }
420
 
421
  if ( array_key_exists( 'data', $event ) && is_array($event['data']) && ! empty( $event['data'] ) && array_key_exists( 'ref_type', $event['data'] ) && $event['data']['ref_type'] == 'post' )
406
  // Template tags can only be used if the email triggers for one point type only.
407
  $content = str_replace( '%entry%', $event['entry'], $content );
408
  $content = $mycred->template_tags_amount( $content, $event['amount'] );
409
+
410
  // to display correct user names in transfer email
411
  if( $event['ref']==='transfer' ){
412
+
413
+ $content = $mycred->template_tags_user( $content, $event['user_id'] );
414
+
415
+ $content = str_replace( '%user_id_o%', '%user_id%', $content );
416
+ $content = str_replace( '%user_name_o%', '%user_name%', $content );
417
+ $content = str_replace( '%user_name_en_o%', '%user_name_en%', $content );
418
+ $content = str_replace( '%display_name_o%', '%display_name%', $content );
419
+ $content = str_replace( '%user_profile_url_o%', '%user_profile_url%', $content );
420
+ $content = str_replace( '%user_profile_link_o%', '%user_profile_link%', $content );
421
+ $content = str_replace( '%user_nicename_o%', '%user_nicename%', $content );
422
+ $content = str_replace( '%user_email_o%', '%user_email%', $content );
423
+ $content = str_replace( '%user_url_o%', '%user_url%', $content );
424
+ $content = str_replace( '%balance_o%', '%balance%', $content );
425
+ $content = str_replace( '%balance_f_o%', '%balance_f%', $content );
426
+
427
  $content = $mycred->template_tags_user( $content, $event['ref_id'] );
428
  $content = mycred_transfer_render_message( $content, $event['data'] );
429
+
430
  }
431
  elseif( $event['ref']==='woocommerce_payment' ){
432
+
433
  $content = str_replace( '%order_id%', $event['ref_id'], $content );
434
+
435
  }
436
  else{
437
+
438
  $content = $mycred->template_tags_user( $content, $event['user_id'] );
439
+
440
  }
441
 
442
  if ( array_key_exists( 'data', $event ) && is_array($event['data']) && ! empty( $event['data'] ) && array_key_exists( 'ref_type', $event['data'] ) && $event['data']['ref_type'] == 'post' )
addons/email-notices/myCRED-addon-email-notices.php CHANGED
@@ -261,8 +261,7 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
261
  // site in the network, bail.
262
  if ( mycred_override_settings() && ! mycred_is_main_site() ) return;
263
 
264
- add_submenu_page(
265
- MYCRED_SLUG,
266
  __( 'Email Notifications', 'mycred' ),
267
  __( 'Email Notifications', 'mycred' ),
268
  $this->core->get_point_editor_capability(),
@@ -281,10 +280,10 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
281
  global $pagenow;
282
 
283
  if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_EMAIL_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
284
- return MYCRED_SLUG;
285
 
286
  if ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_EMAIL_KEY )
287
- return MYCRED_SLUG;
288
 
289
  return $parent;
290
 
261
  // site in the network, bail.
262
  if ( mycred_override_settings() && ! mycred_is_main_site() ) return;
263
 
264
+ mycred_add_main_submenu(
 
265
  __( 'Email Notifications', 'mycred' ),
266
  __( 'Email Notifications', 'mycred' ),
267
  $this->core->get_point_editor_capability(),
280
  global $pagenow;
281
 
282
  if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_EMAIL_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
283
+ return MYCRED_MAIN_SLUG;
284
 
285
  if ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_EMAIL_KEY )
286
+ return MYCRED_MAIN_SLUG;
287
 
288
  return $parent;
289
 
addons/gateway/carts/mycred-woocommerce.php CHANGED
@@ -401,7 +401,7 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
401
  /**
402
  * Process Refunds
403
  * @since 1.5.4
404
- * @version 1.0.3
405
  */
406
  public function process_refund( $order_id, $amount = null, $reason = '' ) {
407
 
@@ -420,7 +420,7 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
420
  $this->mycred->add_creds(
421
  'woocommerce_refund',
422
  $user_id,
423
- 0 - $refund,
424
  $this->log_template_refund,
425
  $order_id,
426
  array( 'ref_type' => 'post', 'reason' => $reason ),
@@ -552,7 +552,7 @@ if ( ! function_exists( 'mycred_woo_available_gateways' ) ) :
552
 
553
  // Calculate cost in CREDs
554
  $currency = get_woocommerce_currency();
555
- if(!is_object($woocommerce)) return;
556
  $cost = $woocommerce->cart->total;
557
  if ( ! mycred_point_type_exists( $currency ) && $currency != 'MYC' )
558
  $cost = $mycred->number( ( $woocommerce->cart->total / $gateways['mycred']->get_option( 'exchange_rate' ) ) );
401
  /**
402
  * Process Refunds
403
  * @since 1.5.4
404
+ * @version 1.0.4
405
  */
406
  public function process_refund( $order_id, $amount = null, $reason = '' ) {
407
 
420
  $this->mycred->add_creds(
421
  'woocommerce_refund',
422
  $user_id,
423
+ $refund,
424
  $this->log_template_refund,
425
  $order_id,
426
  array( 'ref_type' => 'post', 'reason' => $reason ),
552
 
553
  // Calculate cost in CREDs
554
  $currency = get_woocommerce_currency();
555
+ if( ! is_object( $woocommerce ) || empty( $woocommerce->cart ) ) return;
556
  $cost = $woocommerce->cart->total;
557
  if ( ! mycred_point_type_exists( $currency ) && $currency != 'MYC' )
558
  $cost = $mycred->number( ( $woocommerce->cart->total / $gateways['mycred']->get_option( 'exchange_rate' ) ) );
addons/ranks/includes/mycred-rank-functions.php CHANGED
@@ -251,7 +251,7 @@ if ( ! function_exists( 'mycred_get_users_rank_id' ) ) :
251
  if ( $user_id === 0 ) return false;
252
 
253
  $account_object = mycred_get_account( $user_id );
254
- if ( isset( $account_object->ranks ) && $account_object->balance[ $point_type ] !== false && $account_object->balance[ $point_type ]->rank !== false )
255
  return $account_object->balance[ $point_type ]->rank->post_id;
256
 
257
  $rank_id = mycred_get_user_meta( $user_id, MYCRED_RANK_KEY, ( ( $point_type != MYCRED_DEFAULT_TYPE_KEY ) ? $point_type : '' ), true );
@@ -292,6 +292,8 @@ if ( ! function_exists( 'mycred_save_users_rank' ) ) :
292
 
293
  mycred_update_user_meta( $user_id, MYCRED_RANK_KEY, ( ( $point_type != MYCRED_DEFAULT_TYPE_KEY ) ? $point_type : '' ), $rank_id );
294
 
 
 
295
  if ( isset( $mycred_current_account->ranks ) && $mycred_current_account->balance[ $point_type ] !== false )
296
  $mycred_current_account->balance[ $point_type ]->rank = new myCRED_Rank( $rank_id );
297
 
@@ -390,8 +392,8 @@ if ( ! function_exists( 'mycred_find_users_rank' ) ) :
390
  if ( $balance_object === false ) return false;
391
 
392
  if ( isset( $account_object->ranks ) ) {
393
- $current_rank_id = ( $balance_object->rank !== false ) ? $balance_object->rank->post_id : false;
394
- $current_rank = ( $balance_object->rank !== false ) ? $balance_object->rank : false;
395
  }
396
 
397
  else {
@@ -721,3 +723,72 @@ if ( ! function_exists( 'mycred_show_rank_in_bbpress' ) ) :
721
 
722
  }
723
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  if ( $user_id === 0 ) return false;
252
 
253
  $account_object = mycred_get_account( $user_id );
254
+ if ( isset( $account_object->ranks ) && $account_object->balance[ $point_type ] !== false && ! empty( $account_object->balance[ $point_type ]->rank ) )
255
  return $account_object->balance[ $point_type ]->rank->post_id;
256
 
257
  $rank_id = mycred_get_user_meta( $user_id, MYCRED_RANK_KEY, ( ( $point_type != MYCRED_DEFAULT_TYPE_KEY ) ? $point_type : '' ), true );
292
 
293
  mycred_update_user_meta( $user_id, MYCRED_RANK_KEY, ( ( $point_type != MYCRED_DEFAULT_TYPE_KEY ) ? $point_type : '' ), $rank_id );
294
 
295
+ mycred_update_user_rank_id( $user_id, $rank_id );
296
+
297
  if ( isset( $mycred_current_account->ranks ) && $mycred_current_account->balance[ $point_type ] !== false )
298
  $mycred_current_account->balance[ $point_type ]->rank = new myCRED_Rank( $rank_id );
299
 
392
  if ( $balance_object === false ) return false;
393
 
394
  if ( isset( $account_object->ranks ) ) {
395
+ $current_rank_id = ( ! empty( $balance_object->rank ) ) ? $balance_object->rank->post_id : false;
396
+ $current_rank = ( ! empty( $balance_object->rank ) ) ? $balance_object->rank : false;
397
  }
398
 
399
  else {
723
 
724
  }
725
  endif;
726
+
727
+ /**
728
+ * Update User Ranks IDs
729
+ * @since 2.3
730
+ * @version 1.0
731
+ */
732
+ if( !function_exists( 'mycred_update_user_rank_id' ) ):
733
+ function mycred_update_user_rank_id( $user_id, $rank_id )
734
+ {
735
+ $current_rank_id = $rank_id;
736
+
737
+ $rank_ids = mycred_get_user_meta( $user_id, 'mycred_rank_ids', '', true );
738
+
739
+ $promoted_ids = mycred_get_user_meta( $user_id, 'mycred_promoted_rank_ids', '', true );
740
+
741
+ $demoted_ids = mycred_get_user_meta( $user_id, 'mycred_demoted_rank_ids', '', true );
742
+
743
+ if( !empty( $rank_ids ) )
744
+ {
745
+ $previous_rank_id = array_key_last( $rank_ids );
746
+
747
+ $previous_rank_id = $rank_ids[$previous_rank_id];
748
+
749
+ array_push( $rank_ids, $current_rank_id );
750
+
751
+ $prev_maximum = mycred_get_rank( $previous_rank_id )->maximum;
752
+
753
+ $current_minimum = mycred_get_rank( $current_rank_id )->minimum;
754
+
755
+ //Update for next time
756
+ mycred_update_user_meta( $user_id, 'mycred_rank_ids', '', $rank_ids );
757
+
758
+ //If Demoted
759
+ if( $current_minimum < $prev_maximum )
760
+ {
761
+ //If already exists just update
762
+ if( !empty( $demoted_ids ) )
763
+ {
764
+ array_push( $demoted_ids, $current_rank_id );
765
+
766
+ mycred_update_user_meta( $user_id, 'mycred_demoted_rank_ids', '', $demoted_ids );
767
+
768
+ }
769
+ else
770
+ mycred_update_user_meta( $user_id, 'mycred_demoted_rank_ids', '', array( $current_rank_id ) );
771
+
772
+ }
773
+ //If Promoted
774
+ else
775
+ {
776
+ //If already exists just update
777
+ if( !empty( $promoted_ids ) )
778
+ {
779
+ array_push( $promoted_ids, $current_rank_id );
780
+
781
+ mycred_update_user_meta( $user_id, 'mycred_promoted_rank_ids', '', $promoted_ids );
782
+
783
+ }
784
+ else
785
+ mycred_update_user_meta( $user_id, 'mycred_promoted_rank_ids', '', array( $current_rank_id ) );
786
+ }
787
+ }
788
+ else
789
+ {
790
+ mycred_update_user_meta( $user_id, 'mycred_rank_ids', '', array( $current_rank_id ) );
791
+ mycred_update_user_meta( $user_id, 'mycred_promoted_rank_ids', '', array( $current_rank_id ) );
792
+ }
793
+ }
794
+ endif;
addons/ranks/myCRED-addon-ranks.php CHANGED
@@ -22,8 +22,8 @@ if ( ! defined( 'MYCRED_RANK_WIDTH' ) )
22
  if ( ! defined( 'MYCRED_RANK_HEIGHT' ) )
23
  define( 'MYCRED_RANK_HEIGHT', 250 );
24
 
25
- require_once myCRED_RANKS_DIR . 'includes/mycred-rank-functions.php';
26
  require_once myCRED_RANKS_DIR . 'includes/mycred-rank-object.php';
 
27
  require_once myCRED_RANKS_DIR . 'includes/mycred-rank-shortcodes.php';
28
 
29
  /**
@@ -141,7 +141,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
141
  /**
142
  * Hook into Admin Init
143
  * @since 1.1
144
- * @version 1.2
145
  */
146
  public function module_admin_init() {
147
 
@@ -166,7 +166,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
166
  add_filter( 'manage_' . MYCRED_RANK_KEY . '_posts_columns', array( $this, 'adjust_column_headers' ), 50 );
167
  add_action( 'manage_' . MYCRED_RANK_KEY . '_posts_custom_column', array( $this, 'adjust_column_content' ), 10, 2 );
168
  add_action( 'save_post_' . MYCRED_RANK_KEY, array( $this, 'save_rank' ), 10, 2 );
169
-
170
  }
171
 
172
  /**
@@ -201,7 +201,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
201
  public function add_multiple_point_types_support() {
202
 
203
  add_action( 'mycred_management_prefs', array( $this, 'rank_management' ) );
204
- add_action( 'mycred_after_core_prefs', array( $this, 'after_general_settings' ) );
205
  add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 90, 3 );
206
 
207
  add_action( 'mycred_add_menu', array( $this, 'add_menus' ), $this->menu_pos );
@@ -213,7 +213,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
213
 
214
  add_action( 'mycred_management_prefs' . $type_id, array( $this, 'rank_management' ), $priority );
215
 
216
- add_action( 'mycred_after_core_prefs' . $type_id, array( $this, 'after_general_settings' ), $priority );
217
  add_filter( 'mycred_save_core_prefs' . $type_id, array( $this, 'sanitize_extra_settings' ), $priority, 3 );
218
 
219
  $priority += 10;
@@ -1983,6 +1983,45 @@ jQuery(function($){
1983
 
1984
  }
1985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1986
  }
1987
  endif;
1988
 
22
  if ( ! defined( 'MYCRED_RANK_HEIGHT' ) )
23
  define( 'MYCRED_RANK_HEIGHT', 250 );
24
 
 
25
  require_once myCRED_RANKS_DIR . 'includes/mycred-rank-object.php';
26
+ require_once myCRED_RANKS_DIR . 'includes/mycred-rank-functions.php';
27
  require_once myCRED_RANKS_DIR . 'includes/mycred-rank-shortcodes.php';
28
 
29
  /**
141
  /**
142
  * Hook into Admin Init
143
  * @since 1.1
144
+ * @version 1.3
145
  */
146
  public function module_admin_init() {
147
 
166
  add_filter( 'manage_' . MYCRED_RANK_KEY . '_posts_columns', array( $this, 'adjust_column_headers' ), 50 );
167
  add_action( 'manage_' . MYCRED_RANK_KEY . '_posts_custom_column', array( $this, 'adjust_column_content' ), 10, 2 );
168
  add_action( 'save_post_' . MYCRED_RANK_KEY, array( $this, 'save_rank' ), 10, 2 );
169
+ add_filter( 'views_edit-mycred_rank', array( $this, 'modify_ranks_views_links' ) );
170
  }
171
 
172
  /**
201
  public function add_multiple_point_types_support() {
202
 
203
  add_action( 'mycred_management_prefs', array( $this, 'rank_management' ) );
204
+ add_action( 'mycred_type_prefs', array( $this, 'after_general_settings' ) );
205
  add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 90, 3 );
206
 
207
  add_action( 'mycred_add_menu', array( $this, 'add_menus' ), $this->menu_pos );
213
 
214
  add_action( 'mycred_management_prefs' . $type_id, array( $this, 'rank_management' ), $priority );
215
 
216
+ add_action( 'mycred_type_prefs' . $type_id, array( $this, 'after_general_settings' ), $priority );
217
  add_filter( 'mycred_save_core_prefs' . $type_id, array( $this, 'sanitize_extra_settings' ), $priority, 3 );
218
 
219
  $priority += 10;
1983
 
1984
  }
1985
 
1986
+ /**
1987
+ * Actives current view link
1988
+ * @since 2.2
1989
+ * @version 1.0
1990
+ */
1991
+ public function active_current_view( $view )
1992
+ {
1993
+ $post_status = isset( $_GET['post_status'] ) ? $_GET['post_status'] : '';
1994
+
1995
+ if( $post_status == $view )
1996
+ return 'class="current" aria-current="page"';
1997
+ }
1998
+
1999
+ /**
2000
+ * Assign Ranks
2001
+ * @since 2.2
2002
+ * @version 1.0
2003
+ */
2004
+ public function modify_ranks_views_links( $view )
2005
+ {
2006
+ $post_status = isset( $_GET['post_status'] ) ? $_GET['post_status'] : '';
2007
+
2008
+ $current = 'class="current" aria-current="page"';
2009
+
2010
+ $current_point_type = isset( $_GET['ctype'] ) ? $_GET['ctype'] : MYCRED_DEFAULT_TYPE_KEY;
2011
+
2012
+ $view['all'] = '<a href="edit.php?post_type=mycred_rank&ctype='.$current_point_type.'" '.$this->active_current_view( '' ).'>All</a>';
2013
+
2014
+ $view['publish'] = '<a href="edit.php?post_status=publish&#038;post_type=mycred_rank&ctype='.$current_point_type.'" '.$this->active_current_view( 'publish' ).'>Published</a>';
2015
+
2016
+ if( array_key_exists( 'trash', $view ) )
2017
+ $view['trash'] = '<a href="edit.php?post_status=trash&amp;post_type=mycred_rank&ctype='.$current_point_type.'" '.$this->active_current_view( 'trash' ).'>Trash</a>';
2018
+
2019
+ if( array_key_exists( 'trash', $view ) )
2020
+ $view['draft'] = '<a href="edit.php?post_status=draft&amp;post_type=mycred_rank&ctype='.$current_point_type.'" '.$this->active_current_view( 'draft' ).'>Drafts</a>';
2021
+
2022
+ return $view;
2023
+ }
2024
+
2025
  }
2026
  endif;
2027
 
addons/sell-content/assets/js/admin.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+ $( document ).on( 'click', '#update-sales-count', function( e ){
3
+ e.preventDefault();
4
+ $.ajax({
5
+ url: ajaxurl,
6
+ type: 'POST',
7
+ data:{
8
+ action: 'mycred_ajax_update_sell_count'
9
+ },
10
+ beforeSend: function() {
11
+ jQuery('.mycred-update-sells-count').css("display", "inherit");
12
+ },
13
+ success:function(data) {
14
+ alert( data );
15
+ jQuery('.mycred-update-sells-count').hide();
16
+ }
17
+ })
18
+ } )
19
+ })( jQuery );
addons/sell-content/includes/mycred-sell-functions.php CHANGED
@@ -501,7 +501,7 @@ endif;
501
  * Sell Content Template
502
  * Parses a particular template.
503
  * @since 1.7
504
- * @version 1.0.1
505
  */
506
  if ( ! function_exists( 'mycred_sell_content_template' ) ) :
507
  function mycred_sell_content_template( $template = '', $post = NULL, $type = 'mycred-sell-partial-content', $status = 'visitor' ) {
@@ -512,7 +512,7 @@ if ( ! function_exists( 'mycred_sell_content_template' ) ) :
512
  $url = mycred_get_permalink( $post->ID );
513
 
514
  if ( $status == 'mycred-sell-insufficient' ) {
515
- $post = mycred_get_post( $post_id );
516
  $settings = mycred_sell_content_settings();
517
  $prices = array();
518
 
@@ -525,7 +525,7 @@ if ( ! function_exists( 'mycred_sell_content_template' ) ) :
525
  if ( $status == 'disabled' ) continue;
526
 
527
  $mycred = mycred( $point_type );
528
- $price = mycred_get_content_price( $post->ID, $point_type, $user_id );
529
 
530
  // Manual mode
531
  if ( $settings['filters'][ $post->post_type ]['by'] == 'manual' ) {
501
  * Sell Content Template
502
  * Parses a particular template.
503
  * @since 1.7
504
+ * @version 1.0.2
505
  */
506
  if ( ! function_exists( 'mycred_sell_content_template' ) ) :
507
  function mycred_sell_content_template( $template = '', $post = NULL, $type = 'mycred-sell-partial-content', $status = 'visitor' ) {
512
  $url = mycred_get_permalink( $post->ID );
513
 
514
  if ( $status == 'mycred-sell-insufficient' ) {
515
+ $post = mycred_get_post( $post->ID );
516
  $settings = mycred_sell_content_settings();
517
  $prices = array();
518
 
525
  if ( $status == 'disabled' ) continue;
526
 
527
  $mycred = mycred( $point_type );
528
+ $price = mycred_get_content_price( $post->ID, $point_type, get_current_user_id() );
529
 
530
  // Manual mode
531
  if ( $settings['filters'][ $post->post_type ]['by'] == 'manual' ) {
addons/sell-content/myCRED-addon-sell-content.php CHANGED
@@ -47,7 +47,7 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
47
  /**
48
  * Module Init
49
  * @since 0.1
50
- * @version 1.2.1
51
  */
52
  public function module_init() {
53
 
@@ -70,9 +70,13 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
70
  add_shortcode( MYCRED_SLUG . '_content_buyer_avatars', 'mycred_render_sell_buyer_avatars' );
71
 
72
  // Setup Script
73
- add_action( 'mycred_register_assets', array( $this, 'register_assets' ) );
74
- add_action( 'mycred_front_enqueue_footer', array( $this, 'enqueue_footer' ) );
75
- add_action( 'bbp_template_redirect', array( $this, 'bbp_content' ), 10 );
 
 
 
 
76
 
77
  }
78
 
@@ -102,6 +106,23 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
102
 
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  /**
106
  * Register Assets
107
  * @since 1.7
@@ -113,7 +134,7 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
113
  'mycred-sell-this',
114
  plugins_url( 'assets/js/buy-content.js', myCRED_SELL ),
115
  array( 'jquery' ),
116
- '2.0.1',
117
  true
118
  );
119
 
@@ -151,6 +172,39 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
151
 
152
  }
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  /**
155
  * Setup Content Filter
156
  * We are using the template_redirect action to prevent this add-on having to run anywhere else but
@@ -194,10 +248,6 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
194
  if ( ! array_key_exists( $point_type, $mycred_types ) || mycred_force_singular_session( $this->current_user_id, 'mycred-last-content-purchase' ) || !in_array($point_type, $buying_cred) )
195
  wp_send_json( 'ERROR' );
196
 
197
-
198
-
199
-
200
-
201
  // If the content is for sale and we have not paid for it
202
  if ( mycred_post_is_for_sale( $post_id ) && ! mycred_user_paid_for_content( $this->current_user_id, $post_id ) ) {
203
 
@@ -249,6 +299,40 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
249
 
250
  }
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  /**
253
  * The Content Overwrite
254
  * Handles content sales by replacing the posts content with the appropriate template
@@ -909,6 +993,13 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
909
  </div>
910
  </div>
911
 
 
 
 
 
 
 
 
912
  </div>
913
  <script type="text/javascript">
914
  (function($) {
47
  /**
48
  * Module Init
49
  * @since 0.1
50
+ * @version 1.2.2
51
  */
52
  public function module_init() {
53
 
70
  add_shortcode( MYCRED_SLUG . '_content_buyer_avatars', 'mycred_render_sell_buyer_avatars' );
71
 
72
  // Setup Script
73
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
74
+ add_action( 'mycred_register_assets', array( $this, 'register_assets' ) );
75
+ add_action( 'mycred_front_enqueue_footer', array( $this, 'enqueue_footer' ) );
76
+ add_action( 'bbp_template_redirect', array( $this, 'bbp_content' ), 10 );
77
+ add_action( 'mycred_delete_log_entry', array( $this, 'sale_content_count_ajax' ), 10, 2 );
78
+ add_action( 'wp_ajax_mycred_ajax_update_sell_count', array( $this, 'ajax_update_sell_count' ) );
79
+ add_action( 'wp_ajax_nopriv_mycred_ajax_update_sell_count', array( $this, 'ajax_update_sell_count' ) );
80
 
81
  }
82
 
106
 
107
  }
108
 
109
+
110
+ /**
111
+ * Enqueue Admin Script
112
+ * @since 2.0.1
113
+ * @version 1.0
114
+ */
115
+ public function admin_enqueue_scripts()
116
+ {
117
+ wp_enqueue_script(
118
+ 'mycred-admin-sell-content',
119
+ plugins_url( 'assets/js/admin.js', myCRED_SELL ),
120
+ array( 'jquery' ),
121
+ myCRED_SELL_VERSION,
122
+ true
123
+ );
124
+ }
125
+
126
  /**
127
  * Register Assets
128
  * @since 1.7
134
  'mycred-sell-this',
135
  plugins_url( 'assets/js/buy-content.js', myCRED_SELL ),
136
  array( 'jquery' ),
137
+ myCRED_SELL_VERSION,
138
  true
139
  );
140
 
172
 
173
  }
174
 
175
+ /**
176
+ * Fires when user deletes single log entry ref = buy_content
177
+ * @since 2.2
178
+ * @version 1.0
179
+ */
180
+ public function sale_content_count_ajax( $row_id, $point_type )
181
+ {
182
+ $log = new myCRED_Query_Log( "entry_id = $row_id" );
183
+
184
+ $logs = $log->results;
185
+
186
+ foreach( $logs as $log )
187
+ {
188
+ $content_id = '';
189
+
190
+ if( $log->ref == 'buy_content' && $log->id == $row_id)
191
+ {
192
+
193
+ $content_id = (int)$log->ref_id;
194
+
195
+ $sold_content = mycred_get_post_meta( $content_id, '_mycred_content_sales' );
196
+
197
+ $sold_content = (int)$sold_content[0];
198
+
199
+ $sold_content--;
200
+
201
+ mycred_update_post_meta( $content_id, '_mycred_content_sales', $sold_content );
202
+ }
203
+
204
+ }
205
+ }
206
+
207
+
208
  /**
209
  * Setup Content Filter
210
  * We are using the template_redirect action to prevent this add-on having to run anywhere else but
248
  if ( ! array_key_exists( $point_type, $mycred_types ) || mycred_force_singular_session( $this->current_user_id, 'mycred-last-content-purchase' ) || !in_array($point_type, $buying_cred) )
249
  wp_send_json( 'ERROR' );
250
 
 
 
 
 
251
  // If the content is for sale and we have not paid for it
252
  if ( mycred_post_is_for_sale( $post_id ) && ! mycred_user_paid_for_content( $this->current_user_id, $post_id ) ) {
253
 
299
 
300
  }
301
 
302
+ /**
303
+ * AXAJ Updates sell count
304
+ * @since 2.0.1
305
+ * @version 1.0
306
+ */
307
+ public function ajax_update_sell_count()
308
+ {
309
+ global $wpdb;
310
+
311
+ $wpdb->delete(
312
+ $wpdb->postmeta,
313
+ array(
314
+ 'meta_key' => '_mycred_content_sales'
315
+ )
316
+ );
317
+
318
+ $logs = new myCRED_Query_Log( 'ref=buy_content' );
319
+
320
+ $logs = $logs->results;
321
+
322
+ $ref_counts = array();
323
+
324
+ foreach( $logs as $log )
325
+ $ref_counts[] = $log->ref_id;
326
+
327
+ $sell_counts = array_count_values( $ref_counts );
328
+
329
+ foreach( $sell_counts as $post_id => $sell_count )
330
+ update_post_meta( $post_id, '_mycred_content_sales', $sell_count );
331
+
332
+ echo 'Sell Counts Updated';
333
+ die;
334
+ }
335
+
336
  /**
337
  * The Content Overwrite
338
  * Handles content sales by replacing the posts content with the appropriate template
993
  </div>
994
  </div>
995
 
996
+ <div class="row">
997
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
998
+ <h3><?php _e( 'Sales Count', 'mycred' ); ?></h3>
999
+ <button class="button button-primary" id="update-sales-count"><span class="dashicons dashicons-update mycred-update-sells-count" style="-webkit-animation: spin 2s linear infinite;animation: spin 2s linear infinite;display: none;vertical-align: middle;"></span>Update Sales Count</button>
1000
+ </div>
1001
+ </div>
1002
+
1003
  </div>
1004
  <script type="text/javascript">
1005
  (function($) {
addons/stats/myCRED-addon-stats.php CHANGED
@@ -120,7 +120,7 @@ if ( ! class_exists( 'myCRED_Stats_Module' ) ) :
120
 
121
  }
122
 
123
- add_action( 'mycred_after_core_prefs', array( $this, 'after_general_settings' ) );
124
  add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 90, 3 );
125
 
126
  if ( count( $this->point_types ) > 1 ) {
@@ -128,7 +128,7 @@ if ( ! class_exists( 'myCRED_Stats_Module' ) ) :
128
  $priority = 10;
129
  foreach ( $this->point_types as $type_id => $label ) {
130
 
131
- add_action( 'mycred_after_core_prefs' . $type_id, array( $this, 'after_general_settings' ), $priority );
132
  add_filter( 'mycred_save_core_prefs' . $type_id, array( $this, 'sanitize_extra_settings' ), $priority, 3 );
133
 
134
  $priority += 10;
120
 
121
  }
122
 
123
+ add_action( 'mycred_type_prefs', array( $this, 'after_general_settings' ) );
124
  add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 90, 3 );
125
 
126
  if ( count( $this->point_types ) > 1 ) {
128
  $priority = 10;
129
  foreach ( $this->point_types as $type_id => $label ) {
130
 
131
+ add_action( 'mycred_type_prefs' . $type_id, array( $this, 'after_general_settings' ), $priority );
132
  add_filter( 'mycred_save_core_prefs' . $type_id, array( $this, 'sanitize_extra_settings' ), $priority, 3 );
133
 
134
  $priority += 10;
addons/transfer/assets/js/mycred-transfer.js CHANGED
@@ -72,8 +72,8 @@
72
  $.ajax({
73
  type : "POST",
74
  data : {
75
- action : 'mycred-new-transfer',
76
- form : transferform.serialize(),
77
  },
78
  dataType : "JSON",
79
  url : myCREDTransfer.ajaxurl,
@@ -88,7 +88,6 @@
88
 
89
  },
90
  success : function( response ) {
91
-
92
  console.log( response );
93
 
94
  $( formid + ' input.form-control' ).each(function(index){
72
  $.ajax({
73
  type : "POST",
74
  data : {
75
+ action : 'mycred-new-transfer',
76
+ form : transferform.serialize()
77
  },
78
  dataType : "JSON",
79
  url : myCREDTransfer.ajaxurl,
88
 
89
  },
90
  success : function( response ) {
 
91
  console.log( response );
92
 
93
  $( formid + ' input.form-control' ).each(function(index){
addons/transfer/includes/mycred-transfer-object.php CHANGED
@@ -115,6 +115,13 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
115
  */
116
  public $errors = array();
117
 
 
 
 
 
 
 
 
118
  /**
119
  * Construct
120
  */
@@ -585,15 +592,15 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
585
  'user_id' => 'current',
586
  'ctype' => MYCRED_DEFAULT_TYPE_KEY,
587
  'amount' => NULL,
588
- 'amount_placeholder' => NULL,
589
  'reference' => 'transfer',
590
  'message' => isset( $posted['message'] ) ? $posted['message'] : '',
591
- // 'message_placeholder' => isset( $posted['message_placeholder'] ) ? $posted['message_placeholder'] : ''
592
 
593
  ), $posted ), $request );
594
 
595
  // Security
596
- if ( ! wp_verify_nonce( $this->request['token'], 'mycred-new-transfer-' . $this->request['reference'] ) )
597
  return 'error_1';
598
 
599
  // Reference
@@ -616,9 +623,26 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
616
 
617
  // Transfer recipient
618
  $recipient_id = mycred_get_transfer_recipient( sanitize_text_field( $this->request['recipient_id'] ) );
 
619
  if ( $recipient_id === false )
620
  return 'error_3';
621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  $this->recipient_id = absint( $recipient_id );
623
 
624
  // We are trying to transfer to ourselves
@@ -871,6 +895,7 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
871
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
872
  <input type="hidden" name="mycred_new_transfer[token]" value="<?php echo wp_create_nonce( 'mycred-new-transfer-' . $this->reference ); ?>" />
873
  <input type="hidden" name="mycred_new_transfer[reference]" value="<?php echo esc_attr( $this->reference ); ?>" />
 
874
  <input type="submit" class="mycred-submit-transfer<?php echo ' ' . esc_attr( $this->args['button_class'] ); ?>" value="<?php echo esc_attr( $this->args['button'] ); ?>" />
875
  </div>
876
 
@@ -892,7 +917,7 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
892
  /**
893
  * Get Transfer Recipient Field
894
  * @since 1.8
895
- * @version 1.0
896
  */
897
  public function get_transfer_recipient_field( $return = false ) {
898
 
@@ -963,7 +988,9 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
963
  if ( isset( $fist_user->$autofill ) )
964
  $value = $fist_user->$autofill;
965
 
966
- $field .= '<span class="form-control-static">' . $value . '</span><input type="hidden" name="mycred_new_transfer[recipient_id]" value="' . esc_attr( $fist_user->ID ) . '" />';
 
 
967
 
968
  }
969
 
@@ -977,7 +1004,7 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
977
  $autofill = $this->settings['autofill'];
978
  if ( isset( $user->$autofill ) )
979
  $value = $user->$autofill;
980
-
981
  $field .= '<option value="' . $user_id . '">' . $value . '</option>';
982
 
983
  }
@@ -1044,10 +1071,6 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1044
  $balance = $this->balances[ $type_id ];
1045
  $point_type = $balance->point_type;
1046
 
1047
-
1048
-
1049
-
1050
-
1051
  $field = '<div class="form-group select-amount-wrapper">';
1052
  if ( $this->args['amount_label'] != '' ) $field .= '<label class="amount-label">' . esc_html( $this->args['amount_label'] ) . '</label>';
1053
 
@@ -1070,6 +1093,7 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1070
  // An amount has been nominated
1071
  else {
1072
 
 
1073
  $field .= '<input type="hidden" name="mycred_new_transfer[amount]" value="' . esc_attr( $this->transfer_amount ) . '" />';
1074
  $field .= '<span class="form-control-static" id="mycred-transfer-form-amount-field">' . esc_attr( $this->transfer_amount ) . '</span>';
1075
 
@@ -1089,12 +1113,14 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1089
  /**
1090
  * Get Transfer Point Type Field
1091
  * @since 1.8
1092
- * @version 1.0
1093
  */
1094
  public function get_transfer_point_type_field( $return = false ) {
1095
 
1096
  $field = '<input type="hidden" name="mycred_new_transfer[ctype]" value="' . esc_attr( $this->transferable_types[0] ) . '" />';
1097
 
 
 
1098
  if ( count( $this->transferable_types ) > 1 ) {
1099
 
1100
  $field = '<div class="form-group select-point-type-wrapper">';
@@ -1102,9 +1128,15 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1102
  if ( $this->args['balance_label'] != '' ) $field .= '<label>' . esc_html( $this->args['balance_label'] ) . '</label>';
1103
  $field .= '<select name="mycred_new_transfer[ctype]" class="form-control">';
1104
 
1105
- foreach ( $this->balances as $type_id => $balance )
 
 
 
 
1106
  $field .= '<option value="' . esc_attr( $type_id ) . '">' . $balance->point_type->plural . '</option>';
1107
 
 
 
1108
  $field .= '</select></div>';
1109
 
1110
  }
@@ -1132,7 +1164,7 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1132
  $field = '<div class="form-group message-wrapper">';
1133
  if ( $this->args['message_label'] != '' ) $field .= '<label>' . esc_html( $this->args['message_label'] ) . '</label>';
1134
 
1135
- $field .= '<input type="text" class="form-control" id="mycred-transfer-form-message-field" name="message" value="" placeholder="' . esc_html( $this->args['message_placeholder'] ) . '" />';
1136
 
1137
  $field .= '</div>';
1138
 
@@ -1223,6 +1255,68 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1223
 
1224
  }
1225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1226
  /**
1227
  * Get Error Message
1228
  * @since 1.8
@@ -1249,8 +1343,4 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1249
  }
1250
 
1251
  }
1252
- endif;
1253
-
1254
-
1255
-
1256
-
115
  */
116
  public $errors = array();
117
 
118
+ /**
119
+ * Localize Shortcode Attributes
120
+ * @since 2.2
121
+ * @
122
+ */
123
+ public $shortcode_attr = array();
124
+
125
  /**
126
  * Construct
127
  */
592
  'user_id' => 'current',
593
  'ctype' => MYCRED_DEFAULT_TYPE_KEY,
594
  'amount' => NULL,
595
+ 'amount_placeholder' => NULL,
596
  'reference' => 'transfer',
597
  'message' => isset( $posted['message'] ) ? $posted['message'] : '',
598
+ 'transfered_attributes' => NULL
599
 
600
  ), $posted ), $request );
601
 
602
  // Security
603
+ if ( ! wp_verify_nonce( $this->request['token'], 'mycred-new-transfer-' . $this->request['reference'] ) || ! isset( $this->request['transfered_attributes'] ) )
604
  return 'error_1';
605
 
606
  // Reference
623
 
624
  // Transfer recipient
625
  $recipient_id = mycred_get_transfer_recipient( sanitize_text_field( $this->request['recipient_id'] ) );
626
+
627
  if ( $recipient_id === false )
628
  return 'error_3';
629
 
630
+ //If user is trying to hack
631
+
632
+ $transfered_attributes = json_decode( $this->decode( $this->request['transfered_attributes'] ) );
633
+
634
+ if ( ! empty( $transfered_attributes->recipient_id ) && ! in_array( $recipient_id, $transfered_attributes->recipient_id ) ) {
635
+ $recipient_id = $transfered_attributes->recipient_id[0];
636
+ }
637
+
638
+ if ( ! empty( $transfered_attributes->types ) && ! in_array( $this->request['ctype'], $transfered_attributes->types ) ) {
639
+ $this->point_type = $transfered_attributes->types[0];
640
+ }
641
+
642
+ if ( ! empty( $transfered_attributes->amount ) && $this->request['amount'] !== $transfered_attributes->amount ) {
643
+ $this->request['amount'] = $transfered_attributes->amount;
644
+ }
645
+
646
  $this->recipient_id = absint( $recipient_id );
647
 
648
  // We are trying to transfer to ourselves
895
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
896
  <input type="hidden" name="mycred_new_transfer[token]" value="<?php echo wp_create_nonce( 'mycred-new-transfer-' . $this->reference ); ?>" />
897
  <input type="hidden" name="mycred_new_transfer[reference]" value="<?php echo esc_attr( $this->reference ); ?>" />
898
+ <input type="hidden" name="mycred_new_transfer[transfered_attributes]" value="<?php echo esc_attr( $this->encode( $this->shortcode_attr ) ); ?>" />
899
  <input type="submit" class="mycred-submit-transfer<?php echo ' ' . esc_attr( $this->args['button_class'] ); ?>" value="<?php echo esc_attr( $this->args['button'] ); ?>" />
900
  </div>
901
 
917
  /**
918
  * Get Transfer Recipient Field
919
  * @since 1.8
920
+ * @version 1.0.1
921
  */
922
  public function get_transfer_recipient_field( $return = false ) {
923
 
988
  if ( isset( $fist_user->$autofill ) )
989
  $value = $fist_user->$autofill;
990
 
991
+ $this->shortcode_attr['recipient_id'][] = $fist_user->ID;
992
+
993
+ $field .= '<span class="form-control-static">' . $value . '</span><input type="hidden" name="mycred_new_transfer[recipient_id]" value="' . esc_attr( $fist_user->ID ) . '" />';
994
 
995
  }
996
 
1004
  $autofill = $this->settings['autofill'];
1005
  if ( isset( $user->$autofill ) )
1006
  $value = $user->$autofill;
1007
+ $this->shortcode_attr['recipient_id'][] = $user_id;
1008
  $field .= '<option value="' . $user_id . '">' . $value . '</option>';
1009
 
1010
  }
1071
  $balance = $this->balances[ $type_id ];
1072
  $point_type = $balance->point_type;
1073
 
 
 
 
 
1074
  $field = '<div class="form-group select-amount-wrapper">';
1075
  if ( $this->args['amount_label'] != '' ) $field .= '<label class="amount-label">' . esc_html( $this->args['amount_label'] ) . '</label>';
1076
 
1093
  // An amount has been nominated
1094
  else {
1095
 
1096
+ $this->shortcode_attr['amount'] = $this->transfer_amount;
1097
  $field .= '<input type="hidden" name="mycred_new_transfer[amount]" value="' . esc_attr( $this->transfer_amount ) . '" />';
1098
  $field .= '<span class="form-control-static" id="mycred-transfer-form-amount-field">' . esc_attr( $this->transfer_amount ) . '</span>';
1099
 
1113
  /**
1114
  * Get Transfer Point Type Field
1115
  * @since 1.8
1116
+ * @version 1.0.1
1117
  */
1118
  public function get_transfer_point_type_field( $return = false ) {
1119
 
1120
  $field = '<input type="hidden" name="mycred_new_transfer[ctype]" value="' . esc_attr( $this->transferable_types[0] ) . '" />';
1121
 
1122
+ $this->shortcode_attr['types'][] = $this->transferable_types[0];
1123
+
1124
  if ( count( $this->transferable_types ) > 1 ) {
1125
 
1126
  $field = '<div class="form-group select-point-type-wrapper">';
1128
  if ( $this->args['balance_label'] != '' ) $field .= '<label>' . esc_html( $this->args['balance_label'] ) . '</label>';
1129
  $field .= '<select name="mycred_new_transfer[ctype]" class="form-control">';
1130
 
1131
+ $this->shortcode_attr['types'] = [];
1132
+
1133
+ foreach ( $this->balances as $type_id => $balance ){
1134
+
1135
+ $this->shortcode_attr['types'][] = $type_id;
1136
  $field .= '<option value="' . esc_attr( $type_id ) . '">' . $balance->point_type->plural . '</option>';
1137
 
1138
+ }
1139
+
1140
  $field .= '</select></div>';
1141
 
1142
  }
1164
  $field = '<div class="form-group message-wrapper">';
1165
  if ( $this->args['message_label'] != '' ) $field .= '<label>' . esc_html( $this->args['message_label'] ) . '</label>';
1166
 
1167
+ $field .= '<input type="text" class="form-control" id="mycred-transfer-form-message-field" name="message" maxlength="'. intval( $this->settings['message'] ) .'" placeholder="' . esc_html( $this->args['message_placeholder'] ) . '" />';
1168
 
1169
  $field .= '</div>';
1170
 
1255
 
1256
  }
1257
 
1258
+ /**
1259
+ * Encodes array for security
1260
+ * @since 2.2
1261
+ * @version 1.0
1262
+ */
1263
+ public function encode( $value = array() )
1264
+ {
1265
+ if (!$value) {
1266
+ return false;
1267
+ }
1268
+
1269
+ $value = json_encode( $value );
1270
+
1271
+ $key = sha1( AUTH_KEY );
1272
+ $strLen = strlen($value);
1273
+ $keyLen = strlen($key);
1274
+ $j = 0;
1275
+ $crypttext = '';
1276
+
1277
+ for ($i = 0; $i < $strLen; $i++) {
1278
+ $ordStr = ord(substr($value, $i, 1));
1279
+ if ($j == $keyLen) {
1280
+ $j = 0;
1281
+ }
1282
+ $ordKey = ord(substr($key, $j, 1));
1283
+ $j++;
1284
+ $crypttext .= strrev(base_convert(dechex($ordStr + $ordKey), 16, 36));
1285
+ }
1286
+
1287
+ return $crypttext;
1288
+ }
1289
+
1290
+ /**
1291
+ * Decodes
1292
+ * @since 2.2
1293
+ * @version 1.0
1294
+ */
1295
+ public function decode( $value )
1296
+ {
1297
+ if ( !$value ) {
1298
+ return false;
1299
+ }
1300
+
1301
+ $key = sha1( AUTH_KEY );
1302
+ $strLen = strlen($value);
1303
+ $keyLen = strlen($key);
1304
+ $j = 0;
1305
+ $decrypttext = '';
1306
+
1307
+ for ($i = 0; $i < $strLen; $i += 2) {
1308
+ $ordStr = hexdec(base_convert(strrev(substr($value, $i, 2)), 36, 16));
1309
+ if ($j == $keyLen) {
1310
+ $j = 0;
1311
+ }
1312
+ $ordKey = ord(substr($key, $j, 1));
1313
+ $j++;
1314
+ $decrypttext .= chr($ordStr - $ordKey);
1315
+ }
1316
+
1317
+ return $decrypttext;
1318
+ }
1319
+
1320
  /**
1321
  * Get Error Message
1322
  * @since 1.8
1343
  }
1344
 
1345
  }
1346
+ endif;
 
 
 
 
addons/transfer/myCRED-addon-transfer.php CHANGED
@@ -119,7 +119,7 @@ if ( ! class_exists( 'myCRED_Transfer_Module' ) ) :
119
  * Front Footer
120
  * @filter 'mycred_transfer_messages'
121
  * @since 0.1
122
- * @version 1.2.1
123
  */
124
  public function maybe_load_script() {
125
 
@@ -152,9 +152,10 @@ if ( ! class_exists( 'myCRED_Transfer_Module' ) ) :
152
  'error_7' => esc_attr__( 'Insufficient Funds. Please try a lower amount.', 'mycred' ),
153
  'error_8' => esc_attr__( 'Transfer Limit exceeded.', 'mycred' ),
154
  'error_9' => esc_attr__( 'Communications error. Please try again later.', 'mycred' ),
155
- 'error_10' => esc_attr__( 'The selected point type can not be transferred.', 'mycred' )
 
156
  ) );
157
-
158
  wp_localize_script(
159
  'mycred-transfer',
160
  'myCREDTransfer',
119
  * Front Footer
120
  * @filter 'mycred_transfer_messages'
121
  * @since 0.1
122
+ * @version 1.2.2
123
  */
124
  public function maybe_load_script() {
125
 
152
  'error_7' => esc_attr__( 'Insufficient Funds. Please try a lower amount.', 'mycred' ),
153
  'error_8' => esc_attr__( 'Transfer Limit exceeded.', 'mycred' ),
154
  'error_9' => esc_attr__( 'Communications error. Please try again later.', 'mycred' ),
155
+ 'error_10' => esc_attr__( 'The selected point type can not be transferred.', 'mycred' ),
156
+ 'error_11' => esc_attr__( 'Selected recipient ain\'t allowed by admin.', 'mycred' ),
157
  ) );
158
+
159
  wp_localize_script(
160
  'mycred-transfer',
161
  'myCREDTransfer',
assets/css/admin-subscription.css CHANGED
@@ -21,6 +21,50 @@
21
  .mycred-review-ul li a { display: inline-block; color: #10738B; text-decoration: none; padding-left: 26px; position: relative; }
22
  .mycred-review-ul li a span { position: absolute; left: 0; top: -2px; }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  .membership-license-activated{
26
  float: left;
@@ -292,6 +336,55 @@ line-height:34px;
292
  .row.mycred-money-back {
293
  display: none;
294
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  @media (max-width: 510px) {
296
  div#tabs_package_1{
297
  margin-bottom: 30px;
@@ -330,6 +423,34 @@ line-height:34px;
330
  margin: 0 auto;
331
  }
332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  .mmc-addons .theme .theme-screenshot {
334
  display: block;
335
  overflow: hidden;
@@ -350,3 +471,83 @@ line-height:34px;
350
  float: none;
351
  position: relative!important;
352
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  .mycred-review-ul li a { display: inline-block; color: #10738B; text-decoration: none; padding-left: 26px; position: relative; }
22
  .mycred-review-ul li a span { position: absolute; left: 0; top: -2px; }
23
 
24
+ a.thickbox.open-plugin-details-modal {
25
+ text-decoration: none ;
26
+ }
27
+
28
+ .wrap {
29
+ margin: 10px 20px 0 2px;
30
+ }
31
+
32
+ .wrap h1.wp-heading-inline {
33
+ display: inline-block;
34
+ margin-right: 5px;
35
+ }
36
+
37
+ h1, h2, h3, h4, h5, h6 {
38
+ display: block;
39
+ font-weight: 600;
40
+ }
41
+
42
+ h2, h3 {
43
+ color: #1d2327;
44
+ font-size: 1.3em;
45
+ margin: 1em 0;
46
+ }
47
+
48
+
49
+
50
+ p {
51
+ font-size: 13px;
52
+ line-height: 1.5;
53
+ margin: 1em 0;
54
+ }
55
+
56
+ /*.theme.active {
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ flex-direction: row;
61
+ flex-wrap: wrap;
62
+ }*/
63
+
64
+
65
+ .theme-browser .theme {
66
+ min-height: 10em;
67
+ }
68
 
69
  .membership-license-activated{
70
  float: left;
336
  .row.mycred-money-back {
337
  display: none;
338
  }
339
+
340
+
341
+ @media (min-width: 1640px) {
342
+
343
+ .mycred-treasures .theme-browser .theme {
344
+ width: 29.7%;
345
+ margin: 0 3% 3% 0;
346
+
347
+ }
348
+
349
+ .mycred-treasures .theme-id-container {
350
+ width: 100%;
351
+ height: 100%;
352
+
353
+
354
+ }
355
+
356
+ .mycred-treasures .theme.active {
357
+ width: 30%;
358
+ width: calc(33.1% - 5em);
359
+ }
360
+
361
+
362
+ }
363
+
364
+
365
+ /*@media screen and (min-width: 1600px) and (max-width: 2299px){
366
+ .theme.active {
367
+ width: 30%;
368
+ width: calc(33.1% - 8px);
369
+ }
370
+
371
+ }*/
372
+
373
+ @media (max-width: 1120px) {
374
+
375
+ .theme-browser .theme {
376
+ cursor: pointer;
377
+ float: left;
378
+ margin: 0 4% 4% 0;
379
+ position: relative;
380
+ width: 100%;
381
+ border: 1px solid #dcdcde;
382
+ box-shadow: 0 1px 1px -1px rgb(0 0 0 / 10%);
383
+ box-sizing: border-box;
384
+ }
385
+
386
+ }
387
+
388
  @media (max-width: 510px) {
389
  div#tabs_package_1{
390
  margin-bottom: 30px;
423
  margin: 0 auto;
424
  }
425
 
426
+ .mmc-addons .theme .theme-screenshot1 img {
427
+ /* height: 100%; */
428
+ width: 100%;
429
+ /* text-align: center;
430
+ margin: 0 auto;*/
431
+ }
432
+
433
+ .mmc-addons .theme .theme-screenshot1 {
434
+ display: block;
435
+ overflow: hidden;
436
+ position: relative;
437
+ -webkit-backface-visibility: hidden;
438
+ transition: opacity .2s ease-in-out;
439
+ /*background-color: white;*/
440
+ text-align: center;
441
+ }
442
+
443
+ .mmc-addons .theme .theme-screenshot1:after {
444
+ padding-top: 0%;
445
+ }
446
+
447
+ .mmc-addons .theme .theme-screenshot1 img {
448
+ /*margin: 0 auto;*/
449
+ display: block;
450
+ float: none;
451
+ /*position: relative!important;*/
452
+ }
453
+
454
  .mmc-addons .theme .theme-screenshot {
455
  display: block;
456
  overflow: hidden;
471
  float: none;
472
  position: relative!important;
473
  }
474
+
475
+ #myCRED-wrap h1{
476
+ display: block!important;
477
+ font-weight: 600;
478
+ }
479
+
480
+ @font-face {
481
+ font-family: 'mycred-font';
482
+ src: url('mycred-font/mycred.eot?85147245');
483
+ src: url('mycred-font/mycred.eot?85147245#iefix') format('embedded-opentype'),
484
+ url('mycred-font/mycred.woff?85147245') format('woff'),
485
+ url('mycred-font/mycred.ttf?85147245') format('truetype'),
486
+ url('mycred-font/mycred.svg?85147245#fontello') format('svg');
487
+ font-weight: normal;
488
+ font-style: normal;
489
+ }
490
+
491
+ .dashicons-mycred:before {
492
+ content: '\e800';
493
+ font-family: "mycred-font";
494
+ font-style: normal;
495
+ font-weight: normal;
496
+ speak: never;
497
+ display: inline-block;
498
+ text-decoration: inherit;
499
+ text-align: center;
500
+ font-variant: normal;
501
+ text-transform: none;
502
+ line-height: 1em;
503
+ -webkit-font-smoothing: antialiased;
504
+ -moz-osx-font-smoothing: grayscale;
505
+ }
506
+
507
+ .mycred-support-page-container {
508
+ max-width: 1024px;
509
+ }
510
+
511
+ .mycred-support-page-content {
512
+ padding: 10px 27px 14px 27px;
513
+ background: white;
514
+ margin-top: 10px;
515
+ }
516
+
517
+ .mycred-support-page-content h2 {
518
+ margin-bottom: 2px;
519
+ }
520
+
521
+ .mycred-support-page-content p {
522
+ margin-top: 5px;
523
+ }
524
+
525
+ .mycred-treasure-pack {
526
+ /*background: white;*/
527
+ cursor: auto !important;
528
+ }
529
+
530
+ .mycred-treasure-pack-content {
531
+ padding: 20px 20px 10px 20px;
532
+ }
533
+
534
+ .mycred-treasure-pack img {
535
+ width: 100%;
536
+ }
537
+
538
+ .mycred-treasure-pack h3 {
539
+ color: #2271b1;
540
+ margin: 8px 0 0 0;
541
+ }
542
+
543
+ .mycred-treasure-pack p {
544
+ margin: 8px 0 0 0;
545
+ }
546
+
547
+ .mycred-treasure-pack .theme-id-container .theme-name {
548
+ padding: 20px;
549
+ }
550
+
551
+ .mycred-treasure-pack .theme-id-container .theme-actions {
552
+ padding: 14px 20px !important;
553
+ }
assets/css/fonts/mycred-social-icons.eot ADDED
Binary file
assets/css/fonts/mycred-social-icons.svg ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="mycred-social-icons" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe900;" glyph-name="mycred-social-icon-bars" horiz-adv-x="896" d="M32 696h832c17.674 0 32 14.326 32 32v80c0 17.674-14.326 32-32 32h-832c-17.674 0-32-14.326-32-32v-80c0-17.674 14.326-32 32-32zM32 376h832c17.674 0 32 14.326 32 32v80c0 17.674-14.326 32-32 32h-832c-17.674 0-32-14.326-32-32v-80c0-17.674 14.326-32 32-32zM32 56h832c17.674 0 32 14.326 32 32v80c0 17.674-14.326 32-32 32h-832c-17.674 0-32-14.326-32-32v-80c0-17.674 14.326-32 32-32z" />
11
+ <glyph unicode="&#xe901;" glyph-name="mycred-social-icon-facebook" horiz-adv-x="640" d="M558.28 384l28.44 185.32h-177.82v120.26c0 50.7 24.84 100.12 104.48 100.12h80.84v157.78s-73.36 12.52-143.5 12.52c-146.44 0-242.16-88.76-242.16-249.44v-141.24h-162.78v-185.32h162.78v-448h200.34v448z" />
12
+ <glyph unicode="&#xe902;" glyph-name="mycred-social-icon-instagram" horiz-adv-x="896" d="M448.2 678c-127.2 0-229.8-102.6-229.8-229.8s102.6-229.8 229.8-229.8 229.8 102.6 229.8 229.8-102.6 229.8-229.8 229.8zM448.2 298.8c-82.2 0-149.4 67-149.4 149.4s67 149.4 149.4 149.4 149.4-67 149.4-149.4-67.2-149.4-149.4-149.4zM741 687.4c0-29.8-24-53.6-53.6-53.6-29.8 0-53.6 24-53.6 53.6s24 53.6 53.6 53.6 53.6-24 53.6-53.6zM893.2 633c-3.4 71.8-19.8 135.4-72.4 187.8-52.4 52.4-116 68.8-187.8 72.4-74 4.2-295.8 4.2-369.8 0-71.6-3.4-135.2-19.8-187.8-72.2s-68.8-116-72.4-187.8c-4.2-74-4.2-295.8 0-369.8 3.4-71.8 19.8-135.4 72.4-187.8s116-68.8 187.8-72.4c74-4.2 295.8-4.2 369.8 0 71.8 3.4 135.4 19.8 187.8 72.4 52.4 52.4 68.8 116 72.4 187.8 4.2 74 4.2 295.6 0 369.6zM797.6 184c-15.6-39.2-45.8-69.4-85.2-85.2-59-23.4-199-18-264.2-18s-205.4-5.2-264.2 18c-39.2 15.6-69.4 45.8-85.2 85.2-23.4 59-18 199-18 264.2s-5.2 205.4 18 264.2c15.6 39.2 45.8 69.4 85.2 85.2 59 23.4 199 18 264.2 18s205.4 5.2 264.2-18c39.2-15.6 69.4-45.8 85.2-85.2 23.4-59 18-199 18-264.2s5.4-205.4-18-264.2z" />
13
+ <glyph unicode="&#xe903;" glyph-name="mycred-social-icon-linkedin" horiz-adv-x="896" d="M200.56 64h-185.76v598.2h185.76zM107.58 743.8c-59.4 0-107.58 49.2-107.58 108.6 0 59.415 48.165 107.58 107.58 107.58s107.58-48.165 107.58-107.58v0c0-59.4-48.2-108.6-107.58-108.6zM895.8 64h-185.36v291.2c0 69.4-1.4 158.4-96.58 158.4-96.58 0-111.38-75.4-111.38-153.4v-296.2h-185.56v598.2h178.16v-81.6h2.6c24.8 47 85.38 96.6 175.76 96.6 188 0 222.56-123.8 222.56-284.6v-328.6z" />
14
+ <glyph unicode="&#xe904;" glyph-name="mycred-social-icon-pinterest" horiz-adv-x="768" d="M408 947c-205.2 0-408-136.8-408-358.2 0-140.8 79.2-220.8 127.2-220.8 19.8 0 31.2 55.2 31.2 70.8 0 18.6-47.4 58.2-47.4 135.6 0 160.8 122.4 274.8 280.8 274.8 136.2 0 237-77.4 237-219.6 0-106.2-42.6-305.4-180.6-305.4-49.8 0-92.4 36-92.4 87.6 0 75.6 52.8 148.8 52.8 226.8 0 132.4-187.8 108.4-187.8-51.6 0-33.6 4.2-70.8 19.2-101.4-27.6-118.8-84-295.8-84-418.2 0-37.8 5.4-75 9-112.8 6.8-7.6 3.4-6.8 13.8-3 100.8 138 97.2 165 142.8 345.6 24.6-46.8 88.2-72 138.6-72 212.4 0 307.8 207 307.8 393.6 0 198.6-171.6 328.2-360 328.2z" />
15
+ <glyph unicode="&#xe905;" glyph-name="mycred-social-icon-twitch" d="M782.34 753.060h-77.26v-219.4h77.26zM570 754h-77.26v-219.5h77.26zM241.66 960l-193.040-182.84v-658.32h231.66v-182.84l193.060 182.84h154.5l347.54 329.16v512zM898.14 484.5l-154.44-146.24h-154.48l-135.2-128v128h-173.74v548.58h617.86z" />
16
+ <glyph unicode="&#xe906;" glyph-name="mycred-social-icon-twitter" d="M918.74 656.568c0.65-9.096 0.65-18.194 0.65-27.29 0-277.44-211.166-597.116-597.116-597.116-118.904 0-229.36 34.438-322.274 94.212 16.894-1.948 33.136-2.598 50.68-2.598 98.11 0 188.426 33.136 260.548 89.664-92.264 1.95-169.584 62.376-196.224 145.544 12.996-1.948 25.99-3.248 39.636-3.248 18.842 0 37.686 2.6 55.228 7.146-96.162 19.494-168.286 103.96-168.286 205.97v2.598c27.938-15.594 60.428-25.34 94.862-26.638-56.528 37.686-93.562 102.010-93.562 174.782 0 38.984 10.394 74.72 28.588 105.908 103.31-127.35 258.6-210.516 432.73-219.614-3.248 15.594-5.198 31.836-5.198 48.080 0 115.656 93.564 209.868 209.868 209.868 60.426 0 115.004-25.34 153.34-66.274 47.43 9.096 92.912 26.64 133.198 50.68-15.596-48.732-48.732-89.666-92.264-115.654 42.234 4.546 83.168 16.244 120.852 32.486-28.584-41.582-64.322-78.616-105.256-108.506z" />
17
+ <glyph unicode="&#xe907;" glyph-name="mycred-social-icon-whatsapp" horiz-adv-x="896" d="M761.8 765.8c-83.8 84-195.4 130.2-314 130.2-244.8 0-444-199.2-444-444 0-78.2 20.4-154.6 59.2-222l-63-230 235.4 61.8c64.8-35.4 137.8-54 212.2-54h0.2c244.6 0 448.2 199.2 448.2 444 0 118.6-50.4 230-134.2 314zM447.8 82.6c-66.4 0-131.4 17.8-188 51.4l-13.4 8-139.6-36.6 37.2 136.2-8.8 14c-37 58.8-56.4 126.6-56.4 196.4 0 203.4 165.6 369 369.2 369 98.6 0 191.2-38.4 260.8-108.2s112.4-162.4 112.2-261c0-203.6-169.8-369.2-373.2-369.2zM650.2 359c-11 5.6-65.6 32.4-75.8 36-10.2 3.8-17.6 5.6-25-5.6s-28.6-36-35.2-43.6c-6.4-7.4-13-8.4-24-2.8-65.2 32.6-108 58.2-151 132-11.4 19.6 11.4 18.2 32.6 60.6 3.6 7.4 1.8 13.8-1 19.4s-25 60.2-34.2 82.4c-9 21.6-18.2 18.6-25 19-6.4 0.4-13.8 0.4-21.2 0.4s-19.4-2.8-29.6-13.8c-10.2-11.2-38.8-38-38.8-92.6s39.8-107.4 45.2-114.8c5.6-7.4 78.2-119.4 189.6-167.6 70.4-30.4 98-33 133.2-27.8 21.4 3.2 65.6 26.8 74.8 52.8s9.2 48.2 6.4 52.8c-2.6 5-10 7.8-21 13.2z" />
18
+ <glyph unicode="&#xe908;" glyph-name="mycred-social-icon-youtube" horiz-adv-x="1152" d="M1099.31 711.834c-12.562 47.3-49.574 84.552-96.568 97.194-85.18 22.972-426.742 22.972-426.742 22.972s-341.56 0-426.742-22.972c-46.994-12.644-84.006-49.894-96.568-97.194-22.824-85.734-22.824-264.61-22.824-264.61s0-178.876 22.824-264.61c12.562-47.3 49.574-83 96.568-95.642 85.182-22.972 426.742-22.972 426.742-22.972s341.56 0 426.742 22.972c46.994 12.642 84.006 48.342 96.568 95.642 22.824 85.734 22.824 264.61 22.824 264.61s0 178.876-22.824 264.61zM464.29 284.818v324.812l285.478-162.41-285.478-162.402z" />
19
+ </font></defs></svg>
assets/css/fonts/mycred-social-icons.ttf ADDED
Binary file
assets/css/fonts/mycred-social-icons.woff ADDED
Binary file
assets/css/mycred-admin.css CHANGED
@@ -19,6 +19,8 @@
19
  .tr { text-align: right; }
20
  .tj { text-align: justify; }
21
 
 
 
22
  /* Specifics */
23
  #myCRED-wrap p.submit { margin-top: 0; padding-top: 0; }
24
  #mycred-social { text-align: right; }
@@ -54,9 +56,9 @@ p span.description { display: block; line-height: 16px; }
54
  #myCRED-wrap #accordion { margin: 24px 0; padding: 0; float: none; clear: both; }
55
  body #myCRED-wrap #accordion { border-top: none; border-bottom: 1px solid #dedede; }
56
  body.version-3-8 #myCRED-wrap #accordion { border-top: 1px solid #dedede; border-bottom: 1px solid #fafafa; }
57
- #myCRED-wrap #accordion>h4 { font-size: 18px; line-height: 48px; font-weight: normal; color: #464646; font-family: "Open Sans", sans-serif; letter-spacing: 1px; width: 100%; text-align: left; }
58
- #myCRED-wrap #accordion>h4:focus { outline: none; }
59
- #myCRED-wrap #accordion>h4:hover { cursor: pointer; }
60
  #myCRED-wrap #accordion .ui-accordion-header { padding: 0; margin: 0; background-color: transparent; background: none; border-left: none; border-right: none; }
61
  #myCRED-wrap .ui-accordion .ui-accordion-header .ui-accordion-header-icon { display: none; }
62
  body #myCRED-wrap #accordion .ui-accordion-header { border-top: 1px solid #dedede; border-bottom: none; }
@@ -108,8 +110,8 @@ body.version-3-8 #myCRED-wrap #accordion .ui-accordion-header { border-top: 1px
108
  #myCRED-wrap #accordion h4 .core { background-position: 0 -528px; }
109
  #myCRED-wrap #accordion h4 .core.icon-active { background-position: -48px -528px; }
110
 
111
- #myCRED-wrap #accordion>div { margin: 0; padding: 12px; }
112
- #myCRED-wrap #accordion>div>p { margin-top: 0; }
113
  #myCRED-wrap #accordion .ui-accordion-content { display: none;float: none; clear: both; }
114
  body #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px solid #dedede; border-bottom: none; background-color: transparent; background: none; border-left: none; border-right: none; }
115
  body.version-3-8 #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px solid #fafafa; border-bottom: 1px solid #dedede; }
@@ -190,4 +192,6 @@ body.version-3-8 #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px
190
  .mycred-switch-all-badges-icon { -webkit-animation: spin 2s linear infinite; /* Safari */animation: spin 2s linear infinite;}
191
  /* Safari */
192
  @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } }
193
- @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
 
 
19
  .tr { text-align: right; }
20
  .tj { text-align: justify; }
21
 
22
+
23
+
24
  /* Specifics */
25
  #myCRED-wrap p.submit { margin-top: 0; padding-top: 0; }
26
  #mycred-social { text-align: right; }
56
  #myCRED-wrap #accordion { margin: 24px 0; padding: 0; float: none; clear: both; }
57
  body #myCRED-wrap #accordion { border-top: none; border-bottom: 1px solid #dedede; }
58
  body.version-3-8 #myCRED-wrap #accordion { border-top: 1px solid #dedede; border-bottom: 1px solid #fafafa; }
59
+ #myCRED-wrap #accordion>h4, #myCRED-wrap #accordion>div>h4 { font-size: 18px; line-height: 48px; font-weight: normal; color: #464646; font-family: "Open Sans", sans-serif; letter-spacing: 1px; width: 100%; text-align: left; }
60
+ #myCRED-wrap #accordion>h4:focus, #myCRED-wrap #accordion>div>h4:focus { outline: none; }
61
+ #myCRED-wrap #accordion>h4:hover, #myCRED-wrap #accordion>div>h4:hover { cursor: pointer; }
62
  #myCRED-wrap #accordion .ui-accordion-header { padding: 0; margin: 0; background-color: transparent; background: none; border-left: none; border-right: none; }
63
  #myCRED-wrap .ui-accordion .ui-accordion-header .ui-accordion-header-icon { display: none; }
64
  body #myCRED-wrap #accordion .ui-accordion-header { border-top: 1px solid #dedede; border-bottom: none; }
110
  #myCRED-wrap #accordion h4 .core { background-position: 0 -528px; }
111
  #myCRED-wrap #accordion h4 .core.icon-active { background-position: -48px -528px; }
112
 
113
+ #myCRED-wrap #accordion>div, #myCRED-wrap #accordion>.mycred-after-core-prefs>div, #myCRED-wrap #accordion>.mycred-type-prefs>div { margin: 0; padding: 12px; }
114
+ #myCRED-wrap #accordion>div>p, , #myCRED-wrap #accordion>.mycred-after-core-prefs>div>p, #myCRED-wrap #accordion>.mycred-type-prefs>div>p { margin-top: 0; }
115
  #myCRED-wrap #accordion .ui-accordion-content { display: none;float: none; clear: both; }
116
  body #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px solid #dedede; border-bottom: none; background-color: transparent; background: none; border-left: none; border-right: none; }
117
  body.version-3-8 #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px solid #fafafa; border-bottom: 1px solid #dedede; }
192
  .mycred-switch-all-badges-icon { -webkit-animation: spin 2s linear infinite; /* Safari */animation: spin 2s linear infinite;}
193
  /* Safari */
194
  @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } }
195
+ @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
196
+
197
+ .mycred-after-core-prefs, .mycred-type-prefs {margin: 0px !important;padding: 0px !important;}
assets/css/mycred-font/mycred.eot ADDED
Binary file
assets/css/mycred-font/mycred.svg ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2021 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="fontello" horiz-adv-x="1000" >
7
+ <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="mycred-icon" unicode="&#xe800;" d="M835 310m55 345c20-55 95-310-30-465 5 55-5 245-55 390l0 5-5 0c-5 0-300-55-485-55-25 0-45 0-65 5-75 10-100 35-100 35l0 5 0-10c0 0-35-125-50-335-25 25-60 110-50 255 10 145 45 215 60 240l10-40 30 55 10-40 35 40 0-30 5 5c5 0 280 130 530 130 90 0 165-15 225-50-30-5-95-20-105-45l-5-10 10 0c0 0 15 5 30 5 10 0 15 0 25-5-15-5-40-35-20-85z m-55-345m-45 245c-75-15-310-55-470-55-25 0-50 0-65 5-35 5-65 10-90 25-10-50-35-160-45-315l0-35c0-10 0-20 0-30 0-5 0-10 0-10 10-85 10-255 340-280 265-25 345 160 360 230 0 10 5 20 5 30 0 5 0 10 5 15 5 20 5 35 5 55v25c-5 65-10 220-45 340z m-495-255c-30 0-50 25-50 55 0 30 25 50 55 50 30-5 50-30 50-55 0-30-25-50-55-50z m290-230c-25-20-50-35-80-40-35-5-65-5-100 5-20 5-40 20-60 35-5 5-10 5-10 10 0 5 0 10 5 15 5 5 15 0 20-5 25-20 55-35 85-35 40-5 85 10 115 35 5 5 10 10 15 10 10 0 15-5 15-15 5-10 0-10-5-15z m80 210c-30 0-50 25-50 55 0 30 25 50 55 45 30 0 50-25 50-55-5-25-30-50-55-45z m305 495m-220-70m155-10m-25 40c0 0 0 0 0 0 0 0 0 0 0 0l0 0z m-85-15m80 5c0 5 0 0 0 0l0 0z m0 0c0 5 0 0 0 0l0 0z" horiz-adv-x="1000" />
10
+ </font>
11
+ </defs>
12
+ </svg>
assets/css/mycred-font/mycred.ttf ADDED
Binary file
assets/css/mycred-font/mycred.woff ADDED
Binary file
assets/css/mycred-forms.css CHANGED
@@ -39,6 +39,9 @@
39
  .mycred-metabox a.selected:hover { text-decoration: none; color: #ddd; cursor: not-allowed; }
40
  .mycred-metabox .level-type-by p { padding-left: 12px; }
41
  .mycred-metabox .level-compare p { color: #aaa; }
 
 
 
42
 
43
  .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; }
44
  .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; }
39
  .mycred-metabox a.selected:hover { text-decoration: none; color: #ddd; cursor: not-allowed; }
40
  .mycred-metabox .level-type-by p { padding-left: 12px; }
41
  .mycred-metabox .level-compare p { color: #aaa; }
42
+ .mycred-metabox .image-wrapper.default-image:before { display: block; width: 90%; height: 100px; line-height: 100px; text-align: center; border: 2px dashed #ddd; color: #524848; content: "Upload Image"; }
43
+
44
+
45
 
46
  .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; }
47
  .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; }
assets/css/mycred-front.css CHANGED
@@ -1 +1 @@
1
- .widget .myCRED-rank{float:right}.widget .myCRED-rank span{padding-right:4px;color:gray}.widget .myCRED-balance{display:block;margin-bottom:24px;text-align:center;font-size:larger}.widget .myCRED-leaderboard .cred{float:right}.widget .myCRED-leaderboard .first-item{font-size:110%}.widget .myCRED-history{padding:0;margin:0;list-style-type:none}.widget .myCRED-history .creds{float:right;padding:0;clear:left}.mycred-nav-rank img{display:inherit}input.mycred-submit-transfer.btn.btn-primary.btn-block.btn-lg{margin:20px 0}input.mycred-autofill.form-control.ui-autocomplete-input{margin-left:20px}input.form-control{margin-left:28px;margin-top:10px}.site .button:focus,.wp-block-button .wp-block-button__link:focus,.wp-block-search__button:focus,input[type=reset]:focus,input[type=submit]:focus{background:0;outline-offset:-6px;outline:2px solid currentColor}.site textarea:focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{color:var(--form--color-text);outline-offset:2px;outline:0}.site .button:focus,.wp-block-button .wp-block-button__link:focus,.wp-block-search__button:focus,input[type=reset]:focus,input[type=submit]:focus{background:0;outline-offset:-6px;outline:0}span.form-control-static{text-transform:capitalize;font-weight:400;margin-left:20px}p.form-control-static{margin:0 16px}form#mycred-transfer-form-transfer{background:#f9f9f9;padding:25px;margin:150px 0;box-shadow:0 0 20px 0 rgb(0 0 0 / 20%),0 5px 5px 0 rgb(0 0 0 / 24%);border-radius:10px}form#mycred-transfer-form-donation{background:#f9f9f9;padding:25px;margin:150px 0;box-shadow:0 0 20px 0 rgb(0 0 0 / 20%),0 5px 5px 0 rgb(0 0 0 / 24%);border-radius:10px}input#mycred-transfer-form-message-field{margin-left:24px}span#mycred-transfer-form-amount-field{margin-left:28px}.mycred-badges-list-item img{width:25%;display:inline-block;float:left}.mycred-badges-list-item h3{color:red}.mycred-badges-list-item .mycred-left{float:left;width:72%;margin-left:15px}.mycred-badges-list-item .clear{clear:both}.mycred-badges-list-item .mycred-mr-l{margin-left:25px}.mycred-badges-list-item{border-top:0 solid #9c9c9c;min-height:180px;padding:15px 0;cursor:pointer}.mycred-badges-list-item~.mycred-badges-list-item{border-top-width:1px}.mycred-badges-list h3:first-child{margin-bottom:15px;margin-top:0}.mycred-badges-list-item.not-earned{filter:grayscale(1)}.mycred-badges-list-item .mycred-sup-category{background:#0173aa;color:#fff;margin:0 3px;padding:2px 6px;font-size:14px;border-radius:4px}ul.mycred-badges-list-tabs{list-style-type:none;display:flex;margin:0;padding:0}ul.mycred-badges-list-tabs li{padding:10px;cursor:pointer;border:1px solid transparent;margin-right:5px;margin-bottom:-1px}ul.mycred-badges-list-tabs li.active{border:1px solid #47525d;border-bottom:1px solid #ccc}.mycred-badges-list-panels{border-top:1px solid #47525d}.mycred-badges-list-panel.active{display:initial}.mycred-badges-list-panel{display:none}.mycred-badge-count{color:#fff;font-size:18px;background:#0173aa;border-radius:50%;padding:0 7px;margin-left:5px}.mycred-badge-page .mycred-level-image{width:150px}.mycred-badge-page .mycred-badge-page-level{float:left;width:30%;text-align:center}.mycred-badge-page .mycred-level-requirement{font-size:19px;text-align:left}.mycred-badge-page .mycred-badge-image{width:150px}.mycred-badge-page-level .mycred-level-image{width:70px}.mycred-float-left{float:left}.mycred-float-right{float:right}.mycred-badge-earner-grid img{width:150px;height:150px;padding:10px}.mycred-badge-earner-grid h4{margin:0}.mycred-badge-earner-grid{text-align:center}.mycred-badges-list-item p{margin-top:0}.mycred-left{float:left}.mycred-right{float:right}.mycred-clear{clear:both}.mycred-remove-margin{margin:0}.mycred-remove-padding{padding:0}.mycred-evidence-page .intro{margin-left:45px}.mycred-evidence-page p{font-size:19px;margin:0}.mycred-evidence-page a{text-decoration:none;color:red}.mycred-evidence-page .dashicons-yes-alt{line-height:inherit;color:green}.mycred-badge-page-level ul{margin-left:0;padding-left:20px}.mycred-badge-page-level .mycred-level-reward{text-align:left}.mycred-level-reward{margin-bottom:15px}.mycred-badge-page-level{margin-right:15px}.mycred-badges-list-item:hover{background:#efefef}.mycred-badge-congratulation-msg{background:#f0f0f0;padding:25px 10px;margin:20px 0;border-radius:5px}li.mycred-strike-off{text-decoration:line-through}.mycred-search-bar{padding:10px 0}.mycred-history-wrapper .pagination>li{display:inline-block;padding:5px}
1
+ .widget .myCRED-rank{float:right}.widget .myCRED-rank span{padding-right:4px;color:gray}.widget .myCRED-balance{display:block;margin-bottom:24px;text-align:center;font-size:larger}.widget .myCRED-leaderboard .cred{float:right}.widget .myCRED-leaderboard .first-item{font-size:110%}.widget .myCRED-history{padding:0;margin:0;list-style-type:none}.widget .myCRED-history .creds{float:right;padding:0;clear:left}.mycred-nav-rank img{display:inherit}input.mycred-submit-transfer.btn.btn-primary.btn-block.btn-lg{margin:20px 0}input.mycred-autofill.form-control.ui-autocomplete-input{margin-left:20px}.mycred-transfer-form input.form-control{margin-left:28px;margin-top:10px}.site .button:focus,.wp-block-button .wp-block-button__link:focus,.wp-block-search__button:focus,input[type=reset]:focus,input[type=submit]:focus{background:0;outline-offset:-6px;outline:2px solid currentColor}.site textarea:focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{color:var(--form--color-text);outline-offset:2px;outline:0}.site .button:focus,.wp-block-button .wp-block-button__link:focus,.wp-block-search__button:focus,input[type=reset]:focus,input[type=submit]:focus{background:0;outline-offset:-6px;outline:0}span.form-control-static{text-transform:capitalize;font-weight:400;margin-left:20px}p.form-control-static{margin:0 16px}form#mycred-transfer-form-transfer{background:#f9f9f9;padding:25px;margin:150px 0;box-shadow:0 0 20px 0 rgb(0 0 0 / 20%),0 5px 5px 0 rgb(0 0 0 / 24%);border-radius:10px}form#mycred-transfer-form-donation{background:#f9f9f9;padding:25px;margin:150px 0;box-shadow:0 0 20px 0 rgb(0 0 0 / 20%),0 5px 5px 0 rgb(0 0 0 / 24%);border-radius:10px}input#mycred-transfer-form-message-field{margin-left:24px}span#mycred-transfer-form-amount-field{margin-left:28px}.mycred-badges-list-item img{width:25%;display:inline-block;float:left}.mycred-badges-list-item h3{color:red}.mycred-badges-list-item .mycred-left{float:left;width:72%;margin-left:15px}.mycred-badges-list-item .clear{clear:both}.mycred-badges-list-item .mycred-mr-l{margin-left:25px}.mycred-badges-list-item{border-top:0 solid #9c9c9c;min-height:180px;padding:15px 0;cursor:pointer}.mycred-badges-list-item~.mycred-badges-list-item{border-top-width:1px}.mycred-badges-list h3:first-child{margin-bottom:15px;margin-top:0}.mycred-badges-list-item.not-earned{filter:grayscale(1)}.mycred-tabset .mycred-badge-count{color:#fff;font-size:18px;background:#0173aa;border-radius:50%;padding:0 7px}.mycred-badges-list-item .mycred-sup-category{background:#0173aa;color:#fff;margin:0 3px;padding:2px 6px;font-size:14px;border-radius:4px}ul.mycred-badges-list-tabs{list-style-type:none;display:flex;margin:0;padding:0}ul.mycred-badges-list-tabs li{padding:10px;cursor:pointer;border:1px solid transparent;margin-right:5px;margin-bottom:-1px}ul.mycred-badges-list-tabs li.active{border:1px solid #47525d;border-bottom:1px solid #ccc}.mycred-badges-list-panels{border-top:1px solid #47525d}.mycred-badges-list-panel.active{display:initial}.mycred-badges-list-panel{display:none}.mycred-badge-count{color:#fff;font-size:18px;background:#0173aa;border-radius:50%;padding:0 7px;margin-left:5px}.mycred-badge-page .mycred-level-image{width:150px}.mycred-badge-page .mycred-badge-page-level{float:left;width:30%;text-align:center}.mycred-badge-page .mycred-level-requirement{font-size:19px;text-align:left}.mycred-badge-page .mycred-badge-image{width:150px}.mycred-badge-page-level .mycred-level-image{width:70px}.mycred-float-left{float:left}.mycred-float-right{float:right}.mycred-badge-earner-grid img{width:150px;height:150px;padding:10px}.mycred-badge-earner-grid h4{margin:0}.mycred-badge-earner-grid{text-align:center}.mycred-badges-list-item p{margin-top:0}.mycred-left{float:left}.mycred-right{float:right}.mycred-clear{clear:both}.mycred-remove-margin{margin:0}.mycred-remove-padding{padding:0}.mycred-evidence-page .intro{margin-left:45px}.mycred-evidence-page p{font-size:19px;margin:0}.mycred-evidence-page a{text-decoration:none;color:red}.mycred-evidence-page .dashicons-yes-alt{line-height:inherit;color:green}.mycred-badge-page-level ul{margin-left:0;padding-left:20px}.mycred-badge-page-level .mycred-level-reward{text-align:left}.mycred-level-reward{margin-bottom:15px}.mycred-badge-page-level{margin-right:15px}.mycred-badges-list-item:hover{background:#efefef}.mycred-badge-congratulation-msg{background:#f0f0f0;padding:25px 10px;margin:20px 0;border-radius:5px}li.mycred-strike-off{text-decoration:line-through}.mycred-search-bar{padding:10px 0}.mycred-history-wrapper .pagination>li{display:inline-block;padding:5px}
assets/css/mycred-social-icons.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'mycred-social-icons';
3
+ src: url('fonts/mycred-social-icons.eot?u9j1dx');
4
+ src: url('fonts/mycred-social-icons.eot?u9j1dx#iefix') format('embedded-opentype'),
5
+ url('fonts/mycred-social-icons.ttf?u9j1dx') format('truetype'),
6
+ url('fonts/mycred-social-icons.woff?u9j1dx') format('woff'),
7
+ url('fonts/mycred-social-icons.svg?u9j1dx#mycred-social-icons') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ font-display: block;
11
+ }
12
+
13
+ [class^="mycred-social-icon-"], [class*=" mycred-social-icon-"] {
14
+ /* use !important to prevent issues with browser extensions that change fonts */
15
+ font-family: 'mycred-social-icons' !important;
16
+ speak: none;
17
+ font-style: normal;
18
+ font-weight: normal;
19
+ font-variant: normal;
20
+ text-transform: none;
21
+ line-height: 1;
22
+
23
+ /* Better Font Rendering =========== */
24
+ -webkit-font-smoothing: antialiased;
25
+ -moz-osx-font-smoothing: grayscale;
26
+ }
27
+
28
+ .mycred-social-icon-bars:before {
29
+ content: "\e900";
30
+ }
31
+ .mycred-social-icon-facebook:before {
32
+ content: "\e901";
33
+ }
34
+ .mycred-social-icon-instagram:before {
35
+ content: "\e902";
36
+ }
37
+ .mycred-social-icon-linkedin:before {
38
+ content: "\e903";
39
+ }
40
+ .mycred-social-icon-pinterest:before {
41
+ content: "\e904";
42
+ }
43
+ .mycred-social-icon-twitch:before {
44
+ content: "\e905";
45
+ }
46
+ .mycred-social-icon-twitter:before {
47
+ content: "\e906";
48
+ }
49
+ .mycred-social-icon-whatsapp:before {
50
+ content: "\e907";
51
+ }
52
+ .mycred-social-icon-youtube:before {
53
+ content: "\e908";
54
+ }
assets/css/mycred-social-share.css ADDED
@@ -0,0 +1,363 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .social-media-br br {
2
+ display: none;
3
+ }
4
+
5
+ button.mycred-social-icons, a.mycred-social-icons, button.social-text {
6
+ text-align: center;
7
+ margin: 5px 2px;
8
+ cursor: pointer;
9
+ }
10
+
11
+ button.mycred-social-icons:before {
12
+ margin-right: 11px;
13
+ font-size: 20px;
14
+ margin-left: 2px;
15
+ vertical-align: middle;
16
+ }
17
+
18
+ button.mycred-social-icons a, button.social-text a {
19
+ text-decoration: none;
20
+ color: #FFF;
21
+ line-height: normal;
22
+ /*vertical-align: middle;*/
23
+ text-transform: capitalize;
24
+ font-family: sans-serif;
25
+ font-weight: bold;
26
+ box-shadow: none;
27
+ }
28
+
29
+ button.mycred-social-icons a {
30
+ vertical-align: middle;
31
+ }
32
+
33
+ button.mycred-social-icons a:hover, button.social-text a:hover {
34
+ box-shadow: none;
35
+ color: #fff;
36
+ }
37
+
38
+ button.mycred-social-icons, button.social-text {
39
+ padding: 10px 15px;
40
+ font-size: 15px;
41
+ text-align: center;
42
+ border: 0px;
43
+ white-space: nowrap;
44
+ }
45
+
46
+ a.mycred-social-icons {
47
+ font-size: 20px;
48
+ text-decoration: none;
49
+ box-shadow: none;
50
+ min-width: 40px;
51
+ height: 40px;
52
+ display: inline-flex;
53
+ flex-direction: column;
54
+ flex: 0 0 10%;
55
+ max-width: 10%;
56
+ align-items: center;
57
+ justify-content: center;
58
+ transition: all .2s ease-in-out;
59
+ }
60
+
61
+ a.mycred-social-icons:hover, button.mycred-social-icons:hover, button.social-text:hover {
62
+ opacity: 0.7;
63
+ box-shadow: none;
64
+ color: #fff;
65
+ }
66
+
67
+ a.mycred-social-icon-facebook, button.mycred-social-icon-facebook, button.facebook {
68
+ background: #3b5998;
69
+ color: white;
70
+ }
71
+ a.mycred-social-icon-youtube, button.mycred-social-icon-youtube, button.youtube {
72
+ background: #f80000;
73
+ color: white;
74
+ }
75
+
76
+ a.mycred-social-icon-twitter, button.mycred-social-icon-twitter, button.twitter {
77
+ background: #55acee;
78
+ color: white;
79
+ }
80
+ a.mycred-social-icon-twitch, button.mycred-social-icon-twitch, button.twitch {
81
+ background: #6441a5;
82
+ color: white;
83
+ }
84
+
85
+ a.mycred-social-icon-instagram, button.mycred-social-icon-instagram, button.instagram {
86
+ background: #C03B92;
87
+ color: white;
88
+ }
89
+
90
+ a.mycred-social-icon-pinterest, button.mycred-social-icon-pinterest, button.pinterest {
91
+ background: #bd081c;
92
+ color: white;
93
+ }
94
+
95
+ a.mycred-social-icon-linkedin, button.mycred-social-icon-linkedin, button.linkedin {
96
+ background: #0077b5;
97
+ color: white;
98
+ }
99
+
100
+ a.mycred-social-icon-whatsapp, button.mycred-social-icon-whatsapp, button.whatsapp {
101
+ background: #43d854;
102
+ color: white;
103
+ }
104
+
105
+
106
+ /*-text hover-*/
107
+
108
+ a.mycred-social-icons.i-text:hover, a.mycred-social-icons.i-text-admin:hover {
109
+ position: relative;
110
+ max-width: 35%;
111
+ flex: 0 0 35%;
112
+ }
113
+
114
+ a.mycred-social-icons.i-text-admin:hover {
115
+ top: -4px;
116
+ }
117
+
118
+ a.mycred-social-icons.i-text:hover:before, a.mycred-social-icons.i-text-admin:hover:before {
119
+ position: absolute;
120
+ left: 15px;
121
+ z-index: 9999;
122
+ }
123
+
124
+ a.mycred-social-icons.i-text span {
125
+ display: none;
126
+ }
127
+
128
+ a.mycred-social-icons.i-text:hover span, a.mycred-social-icons.i-text-admin:hover:after {
129
+ margin-left: 14px;
130
+ font-family: sans-serif;
131
+ font-weight: bold;
132
+ font-size: 14px;
133
+ }
134
+
135
+ a.mycred-social-icons.i-text-admin:hover:after {
136
+ min-width: 150px;
137
+ display: inline-block;
138
+ }
139
+
140
+ a.mycred-social-icons.i-text:hover span {
141
+ display: inline-block;
142
+ }
143
+
144
+
145
+ a.mycred-social-icon-whatsapp.i-text:hover {
146
+ min-width: 130px;
147
+ }
148
+
149
+ .entry .entry-content a.social-share {
150
+ text-decoration: none;
151
+ }
152
+
153
+ .social-wrapper {
154
+ align-items: center;
155
+ }
156
+
157
+ .social-wrapper>* {
158
+ flex-basis: auto;
159
+ margin: 5px !important;
160
+ }
161
+
162
+ .social-wrapper .mycred-social-icon-whatsapp, .social-wrapper button.whatsapp {
163
+ display: none !important;
164
+ }
165
+
166
+ .social-wrapper .show-more {
167
+ display: block;
168
+ width: 40px;
169
+ height: 40px;
170
+ line-height: 40px;
171
+ padding: 0;
172
+ margin-right: 0 !important;
173
+ min-width: 40px;
174
+ }
175
+
176
+ .social-wrapper>a+.show-more {
177
+ border-radius: 0;
178
+ }
179
+
180
+ span.social-span {
181
+ font-weight: 400;
182
+ color: #afaaa4;
183
+ display: block;
184
+ font-style: italic;
185
+ }
186
+
187
+
188
+ /*backend inputs*/
189
+
190
+ ul.filter-fields-list {
191
+ max-width: 80%;
192
+ }
193
+
194
+ ul.filter-fields-list li {
195
+ clear: both;
196
+ }
197
+
198
+ ul.filter-fields-list li input[type="text"] {
199
+ float: right;
200
+ }
201
+
202
+ .mycred-tab-content .form-table th {
203
+ width: 24%;
204
+ text-align: right;
205
+ }
206
+
207
+ .border-row {
208
+ border-top: 1px solid #DDD;
209
+ }
210
+
211
+ .border-b-row {
212
+ border-bottom: 1px solid #DDD;
213
+ }
214
+
215
+
216
+
217
+ @media (max-width:1024px) {
218
+ ul.filter-fields-list {
219
+ max-width: 80%;
220
+ }
221
+ }
222
+
223
+ @media (max-width:768px) {
224
+ a.mycred-social-icons.i-text:hover, a.mycred-social-icons.i-text-admin:hover {
225
+ min-width: 45%;
226
+ }
227
+ }
228
+
229
+ .mycred-tab-content.tab-container {
230
+ background-color: white;
231
+ border: solid #cccccc 1px;
232
+ margin-top: -1px;
233
+ }
234
+
235
+ .mycred-tab-content .form-table td {
236
+ padding: 15px 55px;
237
+ }
238
+ .filter-fields-list .mycred-social-custom-fields{
239
+ width: 49%;
240
+ margin-top: 13px;
241
+ }
242
+ .filter-fields-list .mycred-select-option {
243
+ display: inline-block;
244
+ margin-top: 18px;
245
+ min-width: 125px;
246
+ max-width: 109px;
247
+ float: left;
248
+ }
249
+ .mycred-tab-content a{
250
+ text-decoration: none;
251
+ }
252
+ .correct-app-id
253
+ {
254
+ border: #01ab01 solid 1px!important;
255
+ }
256
+ .incorrect-app-id
257
+ {
258
+ border: #dc3232 solid 1px!important;
259
+ }
260
+ small.response_message {
261
+ color: red;
262
+ display: none;
263
+ }
264
+ .mycred-tab-content li.sortable-item.ui-sortable-handle {
265
+ background-color: whitesmoke;
266
+ padding-bottom: 8px;
267
+ padding-right: 10px;
268
+ padding-left: 8px;
269
+ border: 1px solid #dadada;
270
+
271
+
272
+ }
273
+ .mycred-tab-content li.sortable-item i.mycred-social-icon-bars {
274
+ cursor: all-scroll;
275
+ }
276
+ .mycred-tab-content li.sortable-item.ui-sortable-handle:hover {
277
+ -webkit-box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.2);
278
+ -moz-box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.2);
279
+ box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.2);
280
+ transition: all 0.3s ease;
281
+ }
282
+
283
+
284
+ .mycred-tab-content i.mycred-social-icon-bars {
285
+ margin-right: 6px;
286
+ }
287
+
288
+ .my_cred_follow_button_input_field
289
+ {
290
+ display: inline-block;
291
+ width: 78%;
292
+ }
293
+ .mycred_share_width_fix .my_cred_follow_button_input_field .mycred-social-custom-fields
294
+ {
295
+ width: 100%;
296
+ }
297
+
298
+ .mycred-tab-content.admin-mycred a.mycred-social-icon-pinterest.i-text-admin:hover:after,
299
+ a.i-text-admin.mycred-social-icon-pinterest:hover:after {
300
+ content: "Pinterest";
301
+ }
302
+ .mycred-tab-content.admin-mycred a.mycred-social-icon-facebook.i-text-admin:hover:after,
303
+ a.mycred-social-icon-facebook.i-text-admin:hover:after {
304
+ content: "Facebook";
305
+ }
306
+ .mycred-tab-content.admin-mycred a.mycred-social-icon-twitter.i-text-admin:hover:after,
307
+ a.mycred-social-icon-twitter.i-text-admin:hover:after {
308
+ content: "Twitter";
309
+ }
310
+ .mycred-tab-content.admin-mycred a.mycred-social-icon-linkedin.i-text-admin:hover:after,
311
+ a.mycred-social-icon-linkedin.i-text-admin:hover:after {
312
+ content: "Linkedin";
313
+ }
314
+ .mycred-tab-content.admin-mycred a.mycred-social-icon-youtube.i-text-admin:hover:after,
315
+ a.mycred-social-icon-youtube.i-text-admin:hover:after {
316
+ content: "Youtube";
317
+ }
318
+ .mycred-tab-content.admin-mycred a.mycred-social-icon-twitch.i-text-admin:hover:after,
319
+ a.mycred-social-icon-twitch.i-text-admin:hover:after {
320
+ content: "Twitch";
321
+ }
322
+ .mycred-tab-content.admin-mycred a.mycred-social-icon-instagram.i-text-admin:hover:after,
323
+ a.mycred-social-icon-instagram.i-text-admin:hover:after {
324
+ content: "Instagram";
325
+ }
326
+ .mycred-social-wrapper button a:focus{
327
+ color: #fff;
328
+ -webkit-box-shadow: none;
329
+ box-shadow: none;
330
+ }
331
+ .mycred-social-wrapper a {
332
+ color: white;
333
+ text-decoration: none;
334
+ }
335
+ .mycred-social-wrapper button {
336
+ min-width: 170px;
337
+ }
338
+
339
+ .mycred_socialshare_notice {
340
+ width: 100%;
341
+ background-color: #ffc10721;
342
+ padding: 5px;
343
+ color: #7c7c7c;
344
+ border: 1px solid #f5da87;
345
+ }
346
+
347
+ .mycred-social-wrapper a.social-share button{
348
+ padding: 10px 15px;
349
+ font-size: 18px;
350
+ text-align: center;
351
+ border: 0px;
352
+ white-space: nowrap;
353
+ }
354
+
355
+ @media (max-width:768px) {
356
+ .mycred-social-wrapper button.mycred-social-icons.mycred-social-icon-pinterest ,.mycred-social-wrapper button.mycred-social-icons.mycred-social-icon-facebook,
357
+ .mycred-social-wrapper button.mycred-social-icons.mycred-social-icon-twitter ,.mycred-social-wrapper button.mycred-social-icons.mycred-social-icon-linkedin,
358
+ .mycred-social-wrapper button.mycred-social-icons.mycred-social-icon-twitch ,.mycred-social-wrapper button.mycred-social-icons.mycred-social-icon-youtube, .mycred-social-wrapper button.mycred-social-icons.mycred-social-icon-instagram {
359
+ width: 100%;
360
+ display: block;
361
+ min-width: unset;
362
+ }
363
+ }
assets/css/tourguide.css CHANGED
@@ -19,6 +19,12 @@
19
  pointer-events: none;
20
  visibility: hidden;
21
  }
 
 
 
 
 
 
22
  .shepherd-element,
23
  .shepherd-element *,
24
  .shepherd-element :after,
@@ -34,13 +40,13 @@
34
  }
35
  .shepherd-arrow:before {
36
  content: "";
37
- transform: rotate(45deg);
38
  background: #fff;
39
  }
40
- .shepherd-element[data-popper-placement^="top"] > .shepherd-arrow {
41
  bottom: -10px;
42
- }
43
- .shepherd-element[data-popper-placement^="bottom"] > .shepherd-arrow {
44
  top: -10px;
45
  }
46
  .shepherd-element[data-popper-placement^="left"] > .shepherd-arrow {
@@ -48,7 +54,7 @@
48
  }
49
  .shepherd-element[data-popper-placement^="right"] > .shepherd-arrow {
50
  left: -10px;
51
- }
52
  .shepherd-element.shepherd-centered > .shepherd-arrow {
53
  opacity: 0;
54
  }
19
  pointer-events: none;
20
  visibility: hidden;
21
  }
22
+
23
+
24
+ .fs-tooltip-trigger {
25
+ visibility: visible;
26
+ }
27
+
28
  .shepherd-element,
29
  .shepherd-element *,
30
  .shepherd-element :after,
40
  }
41
  .shepherd-arrow:before {
42
  content: "";
43
+ transform: rotate(40deg);
44
  background: #fff;
45
  }
46
+ .shepherd-element[data-popper-placement^="top"] > .shepherd-arrow {
47
  bottom: -10px;
48
+ }
49
+ .shepherd-element[data-popper-placement^="bottom"] > .shepherd-arrow {
50
  top: -10px;
51
  }
52
  .shepherd-element[data-popper-placement^="left"] > .shepherd-arrow {
54
  }
55
  .shepherd-element[data-popper-placement^="right"] > .shepherd-arrow {
56
  left: -10px;
57
+ }
58
  .shepherd-element.shepherd-centered > .shepherd-arrow {
59
  opacity: 0;
60
  }
assets/images/addons/mycred-birthdays.jpg ADDED
Binary file
assets/images/addons/mycred-blocks.jpg ADDED
Binary file
assets/images/addons/mycred-bp-charges.jpg ADDED
Binary file
assets/images/addons/mycred-bp-group-leaderboards.jpg ADDED
Binary file
assets/images/addons/mycred-for-elementor.jpg ADDED
Binary file
assets/images/addons/mycred-h5p.jpg ADDED
Binary file
assets/images/addons/mycred-learndash.jpg ADDED
Binary file
assets/images/addons/mycred-notification-plus.jpg ADDED
Binary file
assets/images/addons/mycred-pacman.jpg ADDED
Binary file
assets/images/addons/mycred-social-share.jpg ADDED
Binary file
assets/images/addons/mycred-spin-wheel.jpg ADDED
Binary file
assets/images/addons/mycred-woocommerce-plus.jpg ADDED
Binary file
assets/images/default-point-type.png ADDED
Binary file
assets/images/treasures/badges.jpg ADDED
Binary file
assets/images/treasures/currency.jpg ADDED
Binary file
assets/images/treasures/fitness.jpg ADDED
Binary file
assets/images/treasures/gems.jpg ADDED
Binary file
assets/images/treasures/learning.jpg ADDED
Binary file
assets/images/treasures/rank.jpg ADDED
Binary file
assets/js/mycred-type-management.js CHANGED
@@ -5,6 +5,12 @@
5
  */
6
  jQuery(function($) {
7
 
 
 
 
 
 
 
8
  var wWidth = $(window).width();
9
  var dWidth = wWidth * 0.75;
10
 
@@ -127,6 +133,50 @@ jQuery(function($) {
127
 
128
  $(document).ready( function() {
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  if ( dWidth < 250 )
131
  dWidth = wWidth;
132
 
5
  */
6
  jQuery(function($) {
7
 
8
+
9
+ var ChangeDefaultImageButton = $( '#point-type-change-default-image' );
10
+
11
+ var LevelImageSelector;
12
+ var DefaultImageSelector;
13
+
14
  var wWidth = $(window).width();
15
  var dWidth = wWidth * 0.75;
16
 
133
 
134
  $(document).ready( function() {
135
 
136
+ // Set / Change Point Image Action
137
+ $( '#mycred-image-setup' ).on( 'click', '#point-type-change-default-image', function(e){
138
+
139
+ console.log( 'Change point type image button' );
140
+
141
+ var button = $(this);
142
+
143
+ var buttonDiv = $( '.point-image-buttons' );
144
+
145
+ fieldName = myCREDmanage.fieldName.replace( '[]', '' );
146
+
147
+ LevelImageSelector = wp.media.frames.file_frame = wp.media({
148
+ title : myCREDmanage.uploadtitle,
149
+ button : {
150
+ text : myCREDmanage.uploadbutton
151
+ },
152
+ multiple : false
153
+ });
154
+
155
+ // When a file is selected, grab the URL and set it as the text field's value
156
+ LevelImageSelector.on( 'select', function(){
157
+
158
+ attachment = LevelImageSelector.state().get('selection').first().toJSON();
159
+ if ( attachment.url != '' ) {
160
+
161
+ $( '.point-type-image-wrapper' ).fadeOut(function(){
162
+ $( '.point-type-image-wrapper' ).empty().removeClass( 'default-image dashicons' ).html( `<img src="${attachment.url}" alt="Point type image" \/><input type="hidden" name="${fieldName}[attachment_id]" value="${attachment.id}" \/>` ).fadeIn();
163
+ $( buttonDiv ).html( `
164
+ <button type="button" class="button button-secondary" id="point-type-change-default-image" >${myCREDmanage.changeImage}</button>
165
+ ` );
166
+ });
167
+
168
+ }
169
+
170
+ });
171
+
172
+ // Open the uploader dialog
173
+ LevelImageSelector.open();
174
+
175
+ });
176
+
177
+
178
+
179
+ // Point type ends
180
  if ( dWidth < 250 )
181
  dWidth = wWidth;
182
 
assets/js/shepherd.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"shepherd.js","sources":["../../node_modules/deepmerge/dist/cjs.js","../../src/js/utils/type-check.js","../../src/js/evented.js","../../src/js/utils/auto-bind.js","../../src/js/utils/bind.js","../../node_modules/@popperjs/core/lib/enums.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../node_modules/@popperjs/core/lib/utils/math.js","../../node_modules/@popperjs/core/lib/utils/within.js","../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../node_modules/@popperjs/core/lib/utils/debounce.js","../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../node_modules/@popperjs/core/lib/createPopper.js","../../node_modules/@popperjs/core/lib/popper.js","../../src/js/utils/popper-options.js","../../src/js/utils/general.js","../../node_modules/svelte/internal/index.mjs","../../src/js/components/shepherd-button.svelte","../../src/js/components/shepherd-footer.svelte","../../src/js/components/shepherd-cancel-icon.svelte","../../src/js/components/shepherd-title.svelte","../../src/js/components/shepherd-header.svelte","../../src/js/components/shepherd-text.svelte","../../src/js/components/shepherd-content.svelte","../../src/js/components/shepherd-element.svelte","../../node_modules/smoothscroll-polyfill/dist/smoothscroll.js","../../src/js/step.js","../../src/js/utils/cleanup.js","../../src/js/utils/overlay-path.js","../../src/js/components/shepherd-modal.svelte","../../src/js/tour.js","../../src/js/shepherd.js"],"sourcesContent":["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn target.propertyIsEnumerable(symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","/**\n * Checks if `value` is classified as an `Element`.\n * @param {*} value The param to check if it is an Element\n */\nexport function isElement(value) {\n return value instanceof Element;\n}\n\n/**\n * Checks if `value` is classified as an `HTMLElement`.\n * @param {*} value The param to check if it is an HTMLElement\n */\nexport function isHTMLElement(value) {\n return value instanceof HTMLElement;\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n * @param {*} value The param to check if it is a function\n */\nexport function isFunction(value) {\n return typeof value === 'function';\n}\n\n/**\n * Checks if `value` is classified as a `String` object.\n * @param {*} value The param to check if it is a string\n */\nexport function isString(value) {\n return typeof value === 'string';\n}\n\n/**\n * Checks if `value` is undefined.\n * @param {*} value The param to check if it is undefined\n */\nexport function isUndefined(value) {\n return value === undefined;\n}\n","import { isUndefined } from './utils/type-check';\n\nexport class Evented {\n on(event, handler, ctx, once = false) {\n if (isUndefined(this.bindings)) {\n this.bindings = {};\n }\n if (isUndefined(this.bindings[event])) {\n this.bindings[event] = [];\n }\n this.bindings[event].push({ handler, ctx, once });\n\n return this;\n }\n\n once(event, handler, ctx) {\n return this.on(event, handler, ctx, true);\n }\n\n off(event, handler) {\n if (isUndefined(this.bindings) ||\n isUndefined(this.bindings[event])) {\n return this;\n }\n\n if (isUndefined(handler)) {\n delete this.bindings[event];\n } else {\n this.bindings[event].forEach((binding, index) => {\n if (binding.handler === handler) {\n this.bindings[event].splice(index, 1);\n }\n });\n }\n\n return this;\n }\n\n trigger(event, ...args) {\n if (!isUndefined(this.bindings) && this.bindings[event]) {\n this.bindings[event].forEach((binding, index) => {\n const { ctx, handler, once } = binding;\n\n const context = ctx || this;\n\n handler.apply(context, args);\n\n if (once) {\n this.bindings[event].splice(index, 1);\n }\n });\n }\n\n return this;\n }\n}","/**\n * Binds all the methods on a JS Class to the `this` context of the class.\n * Adapted from https://github.com/sindresorhus/auto-bind\n * @param {object} self The `this` context of the class\n * @return {object} The `this` context of the class\n */\nexport default function autoBind(self) {\n const keys = Object.getOwnPropertyNames(self.constructor.prototype);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val = self[key];\n if (key !== 'constructor' && typeof val === 'function') {\n self[key] = val.bind(self);\n }\n }\n\n return self;\n}\n","import { isUndefined } from './type-check';\n\n/**\n * Sets up the handler to determine if we should advance the tour\n * @param {string} selector\n * @param {Step} step The step instance\n * @return {Function}\n * @private\n */\nfunction _setupAdvanceOnHandler(selector, step) {\n return (event) => {\n if (step.isOpen()) {\n const targetIsEl = step.el && event.currentTarget === step.el;\n const targetIsSelector = !isUndefined(selector) && event.currentTarget.matches(selector);\n\n if (targetIsSelector || targetIsEl) {\n step.tour.next();\n }\n }\n };\n}\n\n/**\n * Bind the event handler for advanceOn\n * @param {Step} step The step instance\n */\nexport function bindAdvance(step) {\n // An empty selector matches the step element\n const { event, selector } = step.options.advanceOn || {};\n if (event) {\n const handler = _setupAdvanceOnHandler(selector, step);\n\n // TODO: this should also bind/unbind on show/hide\n let el;\n try {\n el = document.querySelector(selector);\n } catch (e) {\n // TODO\n }\n if (!isUndefined(selector) && !el) {\n return console.error(`No element was found for the selector supplied to advanceOn: ${selector}`);\n } else if (el) {\n el.addEventListener(event, handler);\n step.on('destroy', () => {\n return el.removeEventListener(event, handler);\n });\n } else {\n document.body.addEventListener(event, handler, true);\n step.on('destroy', () => {\n return document.body.removeEventListener(event, handler, true);\n });\n }\n } else {\n return console.error('advanceOn was defined, but no event name was passed.');\n }\n}\n","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export default function getBoundingClientRect(element) {\n var rect = element.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n x: rect.left,\n y: rect.top\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n var currentNode = getParentNode(element);\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport default function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport within from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","import { top, left, right, bottom } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(round(x * dpr) / dpr) || 0,\n y: round(round(y * dpr) / dpr) || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets;\n\n var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,\n _ref3$x = _ref3.x,\n x = _ref3$x === void 0 ? 0 : _ref3$x,\n _ref3$y = _ref3.y,\n y = _ref3$y === void 0 ? 0 : _ref3$y;\n\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top) {\n sideY = bottom; // $FlowFixMe[prop-missing]\n\n y -= offsetParent[heightProp] - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left) {\n sideX = right; // $FlowFixMe[prop-missing]\n\n x -= offsetParent[widthProp] - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref4) {\n var state = _ref4.state,\n options = _ref4.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on <html>\n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nexport default function getViewportRect(element) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element) {\n var rect = getBoundingClientRect(element);\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var referenceElement = state.elements.reference;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);\n var referenceClientRect = getBoundingClientRect(referenceElement);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\";\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport within from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { max as mathMax, min as mathMin } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis || checkAltAxis) {\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = popperOffsets[mainAxis] + overflow[mainSide];\n var max = popperOffsets[mainAxis] - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;\n var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;\n\n if (checkMainAxis) {\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var _preventedOffset = within(tether ? mathMin(_min, tetherMin) : _min, _offset, tether ? mathMax(_max, tetherMax) : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\"; // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(options) {\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","function _getCenteredStylePopperModifier() {\n return [\n {\n name: 'applyStyles',\n fn({ state }) {\n Object.keys(state.elements).forEach((name) => {\n if (name !== 'popper') {\n return;\n }\n const style = {\n position: 'fixed',\n left: '50%',\n top: '50%',\n transform: 'translate(-50%, -50%)'\n };\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach((name) => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }\n },\n {\n name: 'computeStyles',\n options: {\n adaptive: false\n }\n }\n ];\n}\n\n/**\n * Generates the array of options for a tooltip that doesn't have a\n * target element in the DOM -- and thus is positioned in the center\n * of the view\n *\n * @param {Step} step The step instance\n * @return {Object} The final Popper options object\n */\nexport function makeCenteredPopper(step) {\n const centeredStylePopperModifier = _getCenteredStylePopperModifier();\n\n let popperOptions = {\n placement: 'top',\n strategy: 'fixed',\n modifiers: [\n {\n name: 'focusAfterRender',\n enabled: true,\n phase: 'afterWrite',\n fn() {\n setTimeout(() => {\n if (step.el) {\n step.el.focus();\n }\n }, 300);\n }\n }\n ]\n };\n\n popperOptions = {\n ...popperOptions,\n modifiers: Array.from(\n new Set([...popperOptions.modifiers, ...centeredStylePopperModifier])\n )\n };\n\n return popperOptions;\n}\n","import { createPopper } from '@popperjs/core';\nimport { isString } from './type-check';\nimport { makeCenteredPopper } from './popper-options';\n\n/**\n * Ensure class prefix ends in `-`\n * @param {string} prefix The prefix to prepend to the class names generated by nano-css\n * @return {string} The prefix ending in `-`\n */\nexport function normalizePrefix(prefix) {\n if (!isString(prefix) || prefix === '') {\n return '';\n }\n\n return prefix.charAt(prefix.length - 1) !== '-' ? `${prefix}-` : prefix;\n}\n\n/**\n * Checks if options.attachTo.element is a string, and if so, tries to find the element\n * @param {Step} step The step instance\n * @returns {{element, on}}\n * `element` is a qualified HTML Element\n * `on` is a string position value\n */\nexport function parseAttachTo(step) {\n const options = step.options.attachTo || {};\n const returnOpts = Object.assign({}, options);\n\n if (isString(options.element)) {\n // Can't override the element in user opts reference because we can't\n // guarantee that the element will exist in the future.\n try {\n returnOpts.element = document.querySelector(options.element);\n } catch (e) {\n // TODO\n }\n if (!returnOpts.element) {\n console.error(\n `The element for this Shepherd step was not found ${options.element}`\n );\n }\n }\n\n return returnOpts;\n}\n\n/**\n * Determines options for the tooltip and initializes\n * `step.tooltip` as a Popper instance.\n * @param {Step} step The step instance\n */\nexport function setupTooltip(step) {\n if (step.tooltip) {\n step.tooltip.destroy();\n }\n\n const attachToOptions = parseAttachTo(step);\n\n let target = attachToOptions.element;\n const popperOptions = getPopperOptions(attachToOptions, step);\n\n if (step.isCentered()) {\n target = document.body;\n const content = step.shepherdElementComponent.getElement();\n content.classList.add('shepherd-centered');\n }\n\n step.tooltip = createPopper(target, step.el, popperOptions);\n step.target = attachToOptions.element;\n\n return popperOptions;\n}\n\n/**\n * Create a unique id for steps, tours, modals, etc\n * @return {string}\n */\nexport function uuid() {\n let d = Date.now();\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n\n/**\n * Gets the `Popper` options from a set of base `attachTo` options\n * @param attachToOptions\n * @param {Step} step The step instance\n * @return {Object}\n * @private\n */\nexport function getPopperOptions(attachToOptions, step) {\n let popperOptions = {\n modifiers: [\n {\n name: 'preventOverflow',\n options: {\n altAxis: true\n }\n },\n {\n name: 'focusAfterRender',\n enabled: true,\n phase: 'afterWrite',\n fn() {\n setTimeout(() => {\n if (step.el) {\n step.el.focus();\n }\n }, 300);\n }\n }\n ],\n strategy: 'absolute'\n };\n\n if (step.isCentered()) {\n popperOptions = makeCenteredPopper(step);\n } else {\n popperOptions.placement = attachToOptions.on;\n }\n\n const defaultStepOptions =\n step.tour && step.tour.options && step.tour.options.defaultStepOptions;\n\n if (defaultStepOptions) {\n popperOptions = _mergeModifiers(defaultStepOptions, popperOptions);\n }\n\n popperOptions = _mergeModifiers(step.options, popperOptions);\n\n return popperOptions;\n}\n\nfunction _mergeModifiers(stepOptions, popperOptions) {\n if (stepOptions.popperOptions) {\n let mergedPopperOptions = Object.assign(\n {},\n popperOptions,\n stepOptions.popperOptions\n );\n\n if (\n stepOptions.popperOptions.modifiers &&\n stepOptions.popperOptions.modifiers.length > 0\n ) {\n const names = stepOptions.popperOptions.modifiers.map((mod) => mod.name);\n const filteredModifiers = popperOptions.modifiers.filter(\n (mod) => !names.includes(mod.name)\n );\n\n mergedPopperOptions.modifiers = Array.from(\n new Set([...filteredModifiers, ...stepOptions.popperOptions.modifiers])\n );\n }\n\n return mergedPopperOptions;\n }\n\n return popperOptions;\n}\n","function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\nfunction is_promise(value) {\n return value && typeof value === 'object' && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot_spread(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_spread_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_spread_changes_fn(dirty) | get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value = ret) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction detach(node) {\n node.parentNode.removeChild(node);\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction claim_element(nodes, name, attributes, svg) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeName === name) {\n let j = 0;\n const remove = [];\n while (j < node.attributes.length) {\n const attribute = node.attributes[j++];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n for (let k = 0; k < remove.length; k++) {\n node.removeAttribute(remove[k]);\n }\n return nodes.splice(i, 1)[0];\n }\n }\n return svg ? svg_element(name) : element(name);\n}\nfunction claim_text(nodes, data) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 3) {\n node.data = '' + data;\n return nodes.splice(i, 1)[0];\n }\n }\n return text(data);\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.wholeText !== data)\n text.data = data;\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n node.style.setProperty(key, value, important ? 'important' : '');\n}\nfunction select_option(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked') || select.options[0];\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, false, false, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nclass HtmlTag {\n constructor(anchor = null) {\n this.a = anchor;\n this.e = this.n = null;\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n this.e = element(target.nodeName);\n this.t = target;\n this.h(html);\n }\n this.i(anchor);\n }\n h(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.childNodes);\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(this.t, this.n[i], anchor);\n }\n }\n p(html) {\n this.d();\n this.h(html);\n this.i(this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\nfunction attribute_to_object(attributes) {\n const result = {};\n for (const attribute of attributes) {\n result[attribute.name] = attribute.value;\n }\n return result;\n}\nfunction get_custom_elements_slots(element) {\n const result = {};\n element.childNodes.forEach((node) => {\n result[node.slot || 'default'] = true;\n });\n return result;\n}\n\nconst active_docs = new Set();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = node.ownerDocument;\n active_docs.add(doc);\n const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);\n const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});\n if (!current_rules[name]) {\n current_rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n active_docs.forEach(doc => {\n const stylesheet = doc.__svelte_stylesheet;\n let i = stylesheet.cssRules.length;\n while (i--)\n stylesheet.deleteRule(i);\n doc.__svelte_rules = {};\n });\n active_docs.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error('Function called outside component initialization');\n return current_component;\n}\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail);\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n }\n };\n}\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n}\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\nfunction hasContext(key) {\n return get_current_component().$$.context.has(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n callbacks.slice().forEach(fn => fn(event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\nlet flushing = false;\nconst seen_callbacks = new Set();\nfunction flush() {\n if (flushing)\n return;\n flushing = true;\n do {\n // first, call beforeUpdate functions\n // and update components\n for (let i = 0; i < dirty_components.length; i += 1) {\n const component = dirty_components[i];\n set_current_component(component);\n update(component.$$);\n }\n set_current_component(null);\n dirty_components.length = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n flushing = false;\n seen_callbacks.clear();\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n let config = fn(node, params);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n delete_rule(node);\n if (is_function(config)) {\n config = config();\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n let config = fn(node, params);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n let config = fn(node, params);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = program.b - t;\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program || pending_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n if (info.blocks[i] === block) {\n info.blocks[i] = null;\n }\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n if (!info.hasCatch) {\n throw error;\n }\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n block.p(child_ctx, dirty);\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error('Cannot have duplicate keys in a keyed each');\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\n// source: https://html.spec.whatwg.org/multipage/indices.html\nconst boolean_attributes = new Set([\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'ismap',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n]);\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, classes_to_add) {\n const attributes = Object.assign({}, ...args);\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += ' ' + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += ' ' + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${String(value).replace(/\"/g, '&#34;').replace(/'/g, '&#39;')}\"`;\n }\n });\n return str;\n}\nconst escaped = {\n '\"': '&quot;',\n \"'\": '&#39;',\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;'\n};\nfunction escape(html) {\n return String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(parent_component ? parent_component.$$.context : []),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, options = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, options);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `\"${value}\"`}`}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : '';\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor) {\n const { fragment, on_mount, on_destroy, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = on_mount.map(run).filter(is_function);\n if (on_destroy) {\n on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: null,\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n before_update: [],\n after_update: [],\n context: new Map(parent_component ? parent_component.$$.context : []),\n // everything else\n callbacks: blank_object(),\n dirty,\n skip_bound: false\n };\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor);\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n };\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.32.1' }, detail)));\n}\nfunction append_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev('SvelteDOMRemove', { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {\n const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });\n else\n dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev('SvelteDOMSetProperty', { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev('SvelteDOMSetDataset', { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\n/**\n * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.\n */\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(\"'target' is a required option\");\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn('Component was already destroyed'); // eslint-disable-line no-console\n };\n }\n $capture_state() { }\n $inject_state() { }\n}\n/**\n * Base class to create strongly typed Svelte components.\n * This only exists for typing purposes and should be used in `.d.ts` files.\n *\n * ### Example:\n *\n * You have component library on npm called `component-library`, from which\n * you export a component called `MyComponent`. For Svelte+TypeScript users,\n * you want to provide typings. Therefore you create a `index.d.ts`:\n * ```ts\n * import { SvelteComponentTyped } from \"svelte\";\n * export class MyComponent extends SvelteComponentTyped<{foo: string}> {}\n * ```\n * Typing this makes it possible for IDEs like VS Code with the Svelte extension\n * to provide intellisense and to use the component like this in a Svelte file\n * with TypeScript:\n * ```svelte\n * <script lang=\"ts\">\n * \timport { MyComponent } from \"component-library\";\n * </script>\n * <MyComponent foo={'bar'} />\n * ```\n *\n * #### Why not make this part of `SvelteComponent(Dev)`?\n * Because\n * ```ts\n * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}\n * const component: typeof SvelteComponent = ASubclassOfSvelteComponent;\n * ```\n * will throw a type error, so we need to seperate the more strictly typed class.\n */\nclass SvelteComponentTyped extends SvelteComponentDev {\n constructor(options) {\n super(options);\n }\n}\nfunction loop_guard(timeout) {\n const start = Date.now();\n return () => {\n if (Date.now() - start > timeout) {\n throw new Error('Infinite loop detected');\n }\n };\n}\n\nexport { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteComponentTyped, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_component, claim_element, claim_space, claim_text, clear_loops, component_subscribe, compute_rest_props, compute_slots, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_custom_elements_slots, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, hasContext, has_prop, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, listen, listen_dev, loop, loop_guard, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, update_slot, update_slot_spread, validate_component, validate_each_argument, validate_each_keys, validate_slots, validate_store, xlink_attr };\n","<script>\n import { isFunction } from '../utils/type-check';\n\n export let config, step;\n let action, classes, disabled, label, secondary, text;\n\n $: {\n action = config.action ? config.action.bind(step.tour) : null;\n classes = config.classes;\n disabled = config.disabled ? getDisabled(config.disabled) : false;\n label = config.label;\n secondary = config.secondary;\n text = config.text;\n }\n\n function getDisabled(disabled) {\n if (isFunction(disabled)) {\n return disabled = disabled.call(step);\n }\n return disabled\n }\n\n</script>\n\n<style global>\n .shepherd-button {\n background: rgb(50, 136, 230);\n border: 0;\n border-radius: 3px;\n color: rgba(255, 255, 255, 0.75);\n cursor: pointer;\n margin-right: 0.5rem;\n padding: 0.5rem 1.5rem;\n transition: all 0.5s ease;\n }\n\n .shepherd-button:not(:disabled):hover {\n background: rgb(25, 111, 204);\n color: rgba(255, 255, 255, 0.75);\n }\n\n .shepherd-button.shepherd-button-secondary {\n background: rgb(241, 242, 243);\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-button.shepherd-button-secondary:not(:disabled):hover {\n background: rgb(214, 217, 219);\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-button:disabled {\n cursor: not-allowed;\n }\n</style>\n\n<button\n aria-label=\"{label ? label : null}\"\n class=\"{`${(classes || '')} shepherd-button ${(secondary ? 'shepherd-button-secondary' : '')}`}\"\n disabled={disabled}\n on:click={action}\n tabindex=\"0\"\n>\n {@html text}\n</button>\n","<script>\n import ShepherdButton from './shepherd-button.svelte';\n\n export let step;\n\n $: buttons = step.options.buttons;\n</script>\n\n<style global>\n .shepherd-footer {\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n display: flex;\n justify-content: flex-end;\n padding: 0 0.75rem 0.75rem;\n }\n\n .shepherd-footer .shepherd-button:last-child {\n margin-right: 0;\n }\n</style>\n\n<footer class=\"shepherd-footer\">\n {#if buttons}\n {#each buttons as config}\n <ShepherdButton\n {config}\n {step}\n />\n {/each}\n {/if}\n</footer>\n","<script>\n export let cancelIcon, step;\n\n /**\n * Add a click listener to the cancel link that cancels the tour\n */\n const handleCancelClick = (e) => {\n e.preventDefault();\n step.cancel();\n };\n</script>\n\n<style global>\n .shepherd-cancel-icon {\n background: transparent;\n border: none;\n color: rgba(128, 128, 128, 0.75);\n font-size: 2em;\n cursor: pointer;\n font-weight: normal;\n margin: 0;\n padding: 0;\n transition: color 0.5s ease;\n }\n\n .shepherd-cancel-icon:hover {\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-has-title .shepherd-content .shepherd-cancel-icon {\n color: rgba(128, 128, 128, 0.75);\n }\n\n .shepherd-has-title .shepherd-content .shepherd-cancel-icon:hover {\n color: rgba(0, 0, 0, 0.75);\n }\n</style>\n\n<button\n aria-label=\"{cancelIcon.label ? cancelIcon.label : 'Close Tour'}\"\n class=\"shepherd-cancel-icon\"\n on:click={handleCancelClick}\n type=\"button\"\n>\n <span aria-hidden=\"true\">&times;</span>\n</button>\n","<script>\n import { afterUpdate } from 'svelte';\n import { isFunction } from '../utils/type-check';\n \n export let labelId, element, title;\n \n afterUpdate(() => {\n if (isFunction(title)) {\n title = title();\n }\n \n element.innerHTML = title;\n });\n</script>\n\n<style global>\n .shepherd-title {\n color: rgba(0, 0, 0, 0.75);\n display: flex;\n font-size: 1rem;\n font-weight: normal;\n flex: 1 0 auto;\n margin: 0;\n padding: 0;\n }\n</style>\n\n<h3\n bind:this={element}\n id=\"{labelId}\"\n class=\"shepherd-title\"\n>\n</h3>\n","<script>\n import ShepherdCancelIcon from './shepherd-cancel-icon.svelte';\n import ShepherdTitle from './shepherd-title.svelte';\n\n export let labelId, step;\n let title, cancelIcon;\n\n $: {\n title = step.options.title;\n cancelIcon = step.options.cancelIcon;\n }\n</script>\n\n<style global>\n .shepherd-header {\n align-items: center;\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n display: flex;\n justify-content: flex-end;\n line-height: 2em;\n padding: 0.75rem 0.75rem 0;\n }\n\n .shepherd-has-title .shepherd-content .shepherd-header {\n background: #e6e6e6;\n padding: 1em;\n }\n</style>\n\n<header class=\"shepherd-header\">\n {#if title}\n <ShepherdTitle\n {labelId}\n {title}\n />\n {/if}\n\n {#if cancelIcon && cancelIcon.enabled}\n <ShepherdCancelIcon\n {cancelIcon}\n {step}\n />\n {/if}\n</header>\n","<script>\n import { afterUpdate } from 'svelte';\n import { isHTMLElement, isFunction } from '../utils/type-check';\n\n export let descriptionId, element, step;\n\n afterUpdate(() => {\n let { text } = step.options;\n\n if (isFunction(text)) {\n text = text.call(step);\n }\n\n if (isHTMLElement(text)) {\n element.appendChild(text);\n } else {\n element.innerHTML = text;\n }\n });\n</script>\n\n<style global>\n .shepherd-text {\n color: rgba(0, 0, 0, 0.75);\n font-size: 1rem;\n line-height: 1.3em;\n padding: 0.75em;\n }\n\n .shepherd-text p {\n margin-top: 0;\n }\n\n .shepherd-text p:last-child {\n margin-bottom: 0;\n }\n</style>\n\n<div\n bind:this={element}\n class=\"shepherd-text\"\n id=\"{descriptionId}\"\n>\n</div>\n\n","<script>\n import ShepherdFooter from './shepherd-footer.svelte';\n import ShepherdHeader from './shepherd-header.svelte';\n import ShepherdText from './shepherd-text.svelte';\n import { isUndefined } from '../utils/type-check.js';\n\n export let descriptionId, labelId, step;\n</script>\n\n<style global>\n .shepherd-content {\n border-radius: 5px;\n outline: none;\n padding: 0;\n }\n</style>\n\n<div\n class=\"shepherd-content\"\n>\n {#if !isUndefined(step.options.title) || (step.options.cancelIcon && step.options.cancelIcon.enabled)}\n <ShepherdHeader\n {labelId}\n {step}\n />\n {/if}\n\n {#if !isUndefined(step.options.text)}\n <ShepherdText\n {descriptionId}\n {step}\n />\n {/if}\n\n {#if Array.isArray(step.options.buttons) && step.options.buttons.length}\n <ShepherdFooter\n {step}\n />\n {/if}\n</div>\n","<script>\n import { onMount, afterUpdate } from 'svelte';\n import ShepherdContent from './shepherd-content.svelte';\n import { isUndefined, isString } from '../utils/type-check.js';\n\n const KEY_TAB = 9;\n const KEY_ESC = 27;\n const LEFT_ARROW = 37;\n const RIGHT_ARROW = 39;\n\n export let classPrefix, element, descriptionId, firstFocusableElement,\n focusableElements, labelId, lastFocusableElement, step, dataStepId;\n\n let hasCancelIcon, hasTitle, classes;\n\n $: {\n hasCancelIcon = step.options && step.options.cancelIcon && step.options.cancelIcon.enabled;\n hasTitle = step.options && step.options.title;\n }\n\n export const getElement = () => element;\n\n onMount(() => {\n // Get all elements that are focusable\n dataStepId = { [`data-${classPrefix}shepherd-step-id`]: step.id };\n focusableElements = element.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]');\n firstFocusableElement = focusableElements[0];\n lastFocusableElement = focusableElements[focusableElements.length - 1];\n });\n\n afterUpdate(() => {\n if(classes !== step.options.classes) {\n updateDynamicClasses();\n }\n });\n\n function updateDynamicClasses() {\n removeClasses(classes);\n classes = step.options.classes;\n addClasses(classes);\n }\n\n function removeClasses(classes) {\n if (isString(classes)) {\n const oldClasses = getClassesArray(classes);\n if (oldClasses.length) {\n element.classList.remove(...oldClasses);\n }\n }\n }\n\n function addClasses(classes) {\n if(isString(classes)) {\n const newClasses = getClassesArray(classes);\n if (newClasses.length) {\n element.classList.add(...newClasses);\n }\n }\n }\n\n function getClassesArray(classes) {\n return classes.split(' ').filter(className => !!className.length);\n }\n\n /**\n * Setup keydown events to allow closing the modal with ESC\n *\n * Borrowed from this great post! https://bitsofco.de/accessible-modal-dialog/\n *\n * @private\n */\n const handleKeyDown = (e) => {\n const { tour } = step;\n switch (e.keyCode) {\n case KEY_TAB:\n if (focusableElements.length === 0) {\n e.preventDefault();\n break;\n }\n // Backward tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement || document.activeElement.classList.contains('shepherd-element')) {\n e.preventDefault();\n lastFocusableElement.focus();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n e.preventDefault();\n firstFocusableElement.focus();\n }\n }\n break;\n case KEY_ESC:\n if (tour.options.exitOnEsc) {\n step.cancel();\n }\n break;\n case LEFT_ARROW:\n if (tour.options.keyboardNavigation) {\n tour.back();\n }\n break;\n case RIGHT_ARROW:\n if (tour.options.keyboardNavigation) {\n tour.next();\n }\n break;\n default:\n break;\n }\n };\n</script>\n\n<style global>\n .shepherd-element {\n background: #fff;\n border-radius: 5px;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);\n max-width: 400px;\n opacity: 0;\n outline: none;\n transition: opacity 0.3s, visibility 0.3s;\n visibility: hidden;\n width: 100%;\n z-index: 9999;\n }\n\n .shepherd-enabled.shepherd-element {\n opacity: 1;\n visibility: visible;\n }\n\n .shepherd-element[data-popper-reference-hidden]:not(.shepherd-centered) {\n opacity: 0;\n pointer-events: none;\n visibility: hidden;\n }\n\n .shepherd-element, .shepherd-element *,\n .shepherd-element *:after,\n .shepherd-element *:before {\n box-sizing: border-box;\n }\n\n .shepherd-arrow,\n .shepherd-arrow::before {\n position: absolute;\n width: 16px;\n height: 16px;\n z-index: -1;\n }\n\n .shepherd-arrow:before {\n content: '';\n transform: rotate(45deg);\n background: #fff ;\n }\n\n .shepherd-element[data-popper-placement^='top'] > .shepherd-arrow {\n bottom: -8px;\n }\n\n .shepherd-element[data-popper-placement^='bottom'] > .shepherd-arrow {\n top: -8px;\n }\n\n .shepherd-element[data-popper-placement^='left'] > .shepherd-arrow {\n right: -8px;\n }\n\n .shepherd-element[data-popper-placement^='right'] > .shepherd-arrow {\n left: -8px;\n }\n\n .shepherd-element.shepherd-centered > .shepherd-arrow {\n opacity: 0;\n }\n\n\n /**\n * Arrow on top of tooltip centered horizontally, with title color\n */\n .shepherd-element.shepherd-has-title[data-popper-placement^='bottom'] > .shepherd-arrow::before {\n background-color: #e6e6e6;\n }\n\n .shepherd-target-click-disabled.shepherd-enabled.shepherd-target,\n .shepherd-target-click-disabled.shepherd-enabled.shepherd-target * {\n pointer-events: none;\n }\n</style>\n\n<div\n aria-describedby={!isUndefined(step.options.text) ? descriptionId : null}\n aria-labelledby={step.options.title ? labelId : null}\n bind:this={element}\n class:shepherd-has-cancel-icon=\"{hasCancelIcon}\"\n class:shepherd-has-title=\"{hasTitle}\"\n class:shepherd-element=\"{true}\"\n {...dataStepId}\n on:keydown={handleKeyDown}\n role=\"dialog\"\n tabindex=\"0\"\n>\n {#if step.options.arrow && step.options.attachTo && step.options.attachTo.element && step.options.attachTo.on}\n <div class=\"shepherd-arrow\" data-popper-arrow></div>\n {/if}\n <ShepherdContent\n {descriptionId}\n {labelId}\n {step}\n />\n</div>\n","/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */\n(function () {\n 'use strict';\n\n // polyfill\n function polyfill() {\n // aliases\n var w = window;\n var d = document;\n\n // return if scroll behavior is supported and polyfill is not forced\n if (\n 'scrollBehavior' in d.documentElement.style &&\n w.__forceSmoothScrollPolyfill__ !== true\n ) {\n return;\n }\n\n // globals\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n // object gathering original scroll methods\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elementScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n // define timing method\n var now =\n w.performance && w.performance.now\n ? w.performance.now.bind(w.performance)\n : Date.now;\n\n /**\n * indicates if a the current browser is made by Microsoft\n * @method isMicrosoftBrowser\n * @param {String} userAgent\n * @returns {Boolean}\n */\n function isMicrosoftBrowser(userAgent) {\n var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];\n\n return new RegExp(userAgentPatterns.join('|')).test(userAgent);\n }\n\n /*\n * IE has rounding bug rounding down clientHeight and clientWidth and\n * rounding up scrollHeight and scrollWidth causing false positives\n * on hasScrollableSpace\n */\n var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} firstArg\n * @returns {Boolean}\n */\n function shouldBailOut(firstArg) {\n if (\n firstArg === null ||\n typeof firstArg !== 'object' ||\n firstArg.behavior === undefined ||\n firstArg.behavior === 'auto' ||\n firstArg.behavior === 'instant'\n ) {\n // first argument is not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError(\n 'behavior member of ScrollOptions ' +\n firstArg.behavior +\n ' is not a valid value for enumeration ScrollBehavior.'\n );\n }\n\n /**\n * indicates if an element has scrollable space in the provided axis\n * @method hasScrollableSpace\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function hasScrollableSpace(el, axis) {\n if (axis === 'Y') {\n return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;\n }\n\n if (axis === 'X') {\n return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;\n }\n }\n\n /**\n * indicates if an element has a scrollable overflow property in the axis\n * @method canOverflow\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function canOverflow(el, axis) {\n var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];\n\n return overflowValue === 'auto' || overflowValue === 'scroll';\n }\n\n /**\n * indicates if an element can be scrolled in either axis\n * @method isScrollable\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function isScrollable(el) {\n var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');\n var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');\n\n return isScrollableY || isScrollableX;\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n while (el !== d.body && isScrollable(el) === false) {\n el = el.parentNode || el.host;\n }\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n * @returns {undefined}\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window or element with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n // ORIGINAL METHODS OVERRIDES\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scroll.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object'\n ? arguments[0]\n : w.scrollX || w.pageXOffset,\n // use top prop, second argument if present or fallback to scrollY\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined\n ? arguments[1]\n : w.scrollY || w.pageYOffset\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : w.scrollX || w.pageXOffset,\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : w.scrollY || w.pageYOffset\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object' ? arguments[0] : 0,\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined ? arguments[1] : 0\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n // if one number is passed, throw error to match Firefox implementation\n if (typeof arguments[0] === 'number' && arguments[1] === undefined) {\n throw new SyntaxError('Value could not be converted');\n }\n\n original.elementScroll.call(\n this,\n // use left prop, first number argument or fallback to scrollLeft\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,\n // use top prop, second argument or fallback to scrollTop\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop\n );\n\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'undefined' ? this.scrollLeft : ~~left,\n typeof top === 'undefined' ? this.scrollTop : ~~top\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.elementScroll.call(\n this,\n arguments[0].left !== undefined\n ? ~~arguments[0].left + this.scrollLeft\n : ~~arguments[0] + this.scrollLeft,\n arguments[0].top !== undefined\n ? ~~arguments[0].top + this.scrollTop\n : ~~arguments[1] + this.scrollTop\n );\n\n return;\n }\n\n this.scroll({\n left: ~~arguments[0].left + this.scrollLeft,\n top: ~~arguments[0].top + this.scrollTop,\n behavior: arguments[0].behavior\n });\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n\n // reveal parent in viewport unless is fixed\n if (w.getComputedStyle(scrollableParent).position !== 'fixed') {\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n }\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }\n\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n // commonjs\n module.exports = { polyfill: polyfill };\n } else {\n // global\n polyfill();\n }\n\n}());\n","import merge from 'deepmerge';\nimport { Evented } from './evented.js';\nimport autoBind from './utils/auto-bind.js';\nimport { isElement, isHTMLElement, isFunction, isUndefined } from './utils/type-check.js';\nimport { bindAdvance } from './utils/bind.js';\nimport {\n setupTooltip,\n parseAttachTo,\n normalizePrefix,\n uuid\n} from './utils/general.js';\nimport ShepherdElement from './components/shepherd-element.svelte';\n\n// Polyfills\nimport smoothscroll from 'smoothscroll-polyfill';\nsmoothscroll.polyfill();\n\n/**\n * A class representing steps to be added to a tour.\n * @extends {Evented}\n */\nexport class Step extends Evented {\n /**\n * Create a step\n * @param {Tour} tour The tour for the step\n * @param {object} options The options for the step\n * @param {boolean} options.arrow Whether to display the arrow for the tooltip or not. Defaults to `true`.\n * @param {object} options.attachTo The element the step should be attached to on the page.\n * An object with properties `element` and `on`.\n *\n * ```js\n * const step = new Step(tour, {\n * attachTo: { element: '.some .selector-path', on: 'left' },\n * ...moreOptions\n * });\n * ```\n *\n * If you don’t specify an attachTo the element will appear in the middle of the screen.\n * If you omit the `on` portion of `attachTo`, the element will still be highlighted, but the tooltip will appear\n * in the middle of the screen, without an arrow pointing to the target.\n * @param {HTMLElement|string} options.attachTo.element An element selector string or a DOM element.\n * @param {string} options.attachTo.on The optional direction to place the Popper tooltip relative to the element.\n * - Possible string values: 'auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end'\n * @param {Object} options.advanceOn An action on the page which should advance shepherd to the next step.\n * It should be an object with a string `selector` and an `event` name\n * ```js\n * const step = new Step(tour, {\n * advanceOn: { selector: '.some .selector-path', event: 'click' },\n * ...moreOptions\n * });\n * ```\n * `event` doesn’t have to be an event inside the tour, it can be any event fired on any element on the page.\n * You can also always manually advance the Tour by calling `myTour.next()`.\n * @param {function} options.beforeShowPromise A function that returns a promise.\n * When the promise resolves, the rest of the `show` code for the step will execute.\n * @param {Object[]} options.buttons An array of buttons to add to the step. These will be rendered in a\n * footer below the main body text.\n * @param {function} options.buttons.button.action A function executed when the button is clicked on.\n * It is automatically bound to the `tour` the step is associated with, so things like `this.next` will\n * work inside the action.\n * You can use action to skip steps or navigate to specific steps, with something like:\n * ```js\n * action() {\n * return this.show('some_step_name');\n * }\n * ```\n * @param {string} options.buttons.button.classes Extra classes to apply to the `<a>`\n * @param {boolean} options.buttons.button.disabled Should the button be disabled?\n * @param {string} options.buttons.button.label The aria-label text of the button\n * @param {boolean} options.buttons.button.secondary If true, a shepherd-button-secondary class is applied to the button\n * @param {string} options.buttons.button.text The HTML text of the button\n * @param {boolean} options.canClickTarget A boolean, that when set to false, will set `pointer-events: none` on the target\n * @param {object} options.cancelIcon Options for the cancel icon\n * @param {boolean} options.cancelIcon.enabled Should a cancel “✕” be shown in the header of the step?\n * @param {string} options.cancelIcon.label The label to add for `aria-label`\n * @param {string} options.classes A string of extra classes to add to the step's content element.\n * @param {string} options.highlightClass An extra class to apply to the `attachTo` element when it is\n * highlighted (that is, when its step is active). You can then target that selector in your CSS.\n * @param {string} options.id The string to use as the `id` for the step.\n * @param {number} options.modalOverlayOpeningPadding An amount of padding to add around the modal overlay opening\n * @param {number} options.modalOverlayOpeningRadius An amount of border radius to add around the modal overlay opening\n * @param {object} options.popperOptions Extra options to pass to Popper\n * @param {boolean|Object} options.scrollTo Should the element be scrolled to when this step is shown? If true, uses the default `scrollIntoView`,\n * if an object, passes that object as the params to `scrollIntoView` i.e. `{behavior: 'smooth', block: 'center'}`\n * @param {function} options.scrollToHandler A function that lets you override the default scrollTo behavior and\n * define a custom action to do the scrolling, and possibly other logic.\n * @param {function} options.showOn A function that, when it returns `true`, will show the step.\n * If it returns false, the step will be skipped.\n * @param {string} options.text The text in the body of the step. It can be one of three types:\n * ```\n * - HTML string\n * - `HTMLElement` object\n * - `Function` to be executed when the step is built. It must return one the two options above.\n * ```\n * @param {string} options.title The step's title. It becomes an `h3` at the top of the step. It can be one of two types:\n * ```\n * - HTML string\n * - `Function` to be executed when the step is built. It must return HTML string.\n * ```\n * @param {object} options.when You can define `show`, `hide`, etc events inside `when`. For example:\n * ```js\n * when: {\n * show: function() {\n * window.scrollTo(0, 0);\n * }\n * }\n * ```\n * @return {Step} The newly created Step instance\n */\n constructor(tour, options = {}) {\n super(tour, options);\n this.tour = tour;\n this.classPrefix = this.tour.options\n ? normalizePrefix(this.tour.options.classPrefix)\n : '';\n this.styles = tour.styles;\n\n autoBind(this);\n\n this._setOptions(options);\n\n return this;\n }\n\n /**\n * Cancel the tour\n * Triggers the `cancel` event\n */\n cancel() {\n this.tour.cancel();\n this.trigger('cancel');\n }\n\n /**\n * Complete the tour\n * Triggers the `complete` event\n */\n complete() {\n this.tour.complete();\n this.trigger('complete');\n }\n\n /**\n * Remove the step, delete the step's element, and destroy the Popper instance for the step.\n * Triggers `destroy` event\n */\n destroy() {\n if (this.tooltip) {\n this.tooltip.destroy();\n this.tooltip = null;\n }\n\n if (isHTMLElement(this.el) && this.el.parentNode) {\n this.el.parentNode.removeChild(this.el);\n this.el = null;\n }\n\n this._updateStepTargetOnHide();\n\n this.trigger('destroy');\n }\n\n /**\n * Returns the tour for the step\n * @return {Tour} The tour instance\n */\n getTour() {\n return this.tour;\n }\n\n /**\n * Hide the step\n */\n hide() {\n this.tour.modal.hide();\n\n this.trigger('before-hide');\n\n if (this.el) {\n this.el.hidden = true;\n }\n\n this._updateStepTargetOnHide();\n\n this.trigger('hide');\n }\n\n /**\n * Checks if the step should be centered or not\n * @return {boolean} True if the step is centered\n */\n isCentered() {\n const attachToOptions = parseAttachTo(this);\n return !attachToOptions.element || !attachToOptions.on;\n }\n\n /**\n * Check if the step is open and visible\n * @return {boolean} True if the step is open and visible\n */\n isOpen() {\n return Boolean(this.el && !this.el.hidden);\n }\n\n /**\n * Wraps `_show` and ensures `beforeShowPromise` resolves before calling show\n * @return {*|Promise}\n */\n show() {\n if (isFunction(this.options.beforeShowPromise)) {\n const beforeShowPromise = this.options.beforeShowPromise();\n if (!isUndefined(beforeShowPromise)) {\n return beforeShowPromise.then(() => this._show());\n }\n }\n this._show();\n }\n\n /**\n * Updates the options of the step.\n *\n * @param {Object} options The options for the step\n */\n updateStepOptions(options) {\n Object.assign(this.options, options);\n\n if (this.shepherdElementComponent) {\n this.shepherdElementComponent.$set({ step: this });\n }\n }\n\n /**\n * Returns the element for the step\n * @return {HTMLElement|null|undefined} The element instance. undefined if it has never been shown, null if it has been destroyed\n */\n getElement() {\n return this.el;\n }\n\n /**\n * Returns the target for the step\n * @return {HTMLElement|null|undefined} The element instance. undefined if it has never been shown, null if query string has not been found\n */\n getTarget() {\n return this.target;\n }\n\n /**\n * Creates Shepherd element for step based on options\n *\n * @return {Element} The DOM element for the step tooltip\n * @private\n */\n _createTooltipContent() {\n const descriptionId = `${this.id}-description`;\n const labelId = `${this.id}-label`;\n\n this.shepherdElementComponent = new ShepherdElement({\n target: this.tour.options.stepsContainer || document.body,\n props: {\n classPrefix: this.classPrefix,\n descriptionId,\n labelId,\n step: this,\n styles: this.styles\n }\n });\n\n return this.shepherdElementComponent.getElement();\n }\n\n /**\n * If a custom scrollToHandler is defined, call that, otherwise do the generic\n * scrollIntoView call.\n *\n * @param {boolean|Object} scrollToOptions If true, uses the default `scrollIntoView`,\n * if an object, passes that object as the params to `scrollIntoView` i.e. `{ behavior: 'smooth', block: 'center' }`\n * @private\n */\n _scrollTo(scrollToOptions) {\n const { element } = parseAttachTo(this);\n\n if (isFunction(this.options.scrollToHandler)) {\n this.options.scrollToHandler(element);\n } else if (\n isElement(element) &&\n typeof element.scrollIntoView === 'function'\n ) {\n element.scrollIntoView(scrollToOptions);\n }\n }\n\n /**\n * _getClassOptions gets all possible classes for the step\n * @param {Object} stepOptions The step specific options\n * @returns {String} unique string from array of classes\n * @private\n */\n _getClassOptions(stepOptions) {\n const defaultStepOptions =\n this.tour && this.tour.options && this.tour.options.defaultStepOptions;\n const stepClasses = stepOptions.classes ? stepOptions.classes : '';\n const defaultStepOptionsClasses =\n defaultStepOptions && defaultStepOptions.classes\n ? defaultStepOptions.classes\n : '';\n const allClasses = [\n ...stepClasses.split(' '),\n ...defaultStepOptionsClasses.split(' ')\n ];\n const uniqClasses = new Set(allClasses);\n\n return Array.from(uniqClasses).join(' ').trim();\n }\n\n /**\n * Sets the options for the step, maps `when` to events, sets up buttons\n * @param {Object} options The options for the step\n * @private\n */\n _setOptions(options = {}) {\n let tourOptions =\n this.tour && this.tour.options && this.tour.options.defaultStepOptions;\n\n tourOptions = merge({}, tourOptions || {});\n\n this.options = Object.assign(\n {\n arrow: true\n },\n tourOptions,\n options\n );\n\n const { when } = this.options;\n\n this.options.classes = this._getClassOptions(options);\n\n this.destroy();\n this.id = this.options.id || `step-${uuid()}`;\n\n if (when) {\n Object.keys(when).forEach((event) => {\n this.on(event, when[event], this);\n });\n }\n }\n\n /**\n * Create the element and set up the Popper instance\n * @private\n */\n _setupElements() {\n if (!isUndefined(this.el)) {\n this.destroy();\n }\n\n this.el = this._createTooltipContent();\n\n if (this.options.advanceOn) {\n bindAdvance(this);\n }\n setupTooltip(this);\n }\n\n /**\n * Triggers `before-show`, generates the tooltip DOM content,\n * sets up a Popper instance for the tooltip, then triggers `show`.\n * @private\n */\n _show() {\n this.trigger('before-show');\n\n this._setupElements();\n\n if (!this.tour.modal) {\n this.tour._setupModal();\n }\n\n this.tour.modal.setupForStep(this);\n this._styleTargetElementForStep(this);\n this.el.hidden = false;\n\n // start scrolling to target before showing the step\n if (this.options.scrollTo) {\n setTimeout(() => {\n this._scrollTo(this.options.scrollTo);\n });\n }\n\n this.el.hidden = false;\n\n const content = this.shepherdElementComponent.getElement();\n const target = this.target || document.body;\n target.classList.add(`${this.classPrefix}shepherd-enabled`);\n target.classList.add(`${this.classPrefix}shepherd-target`);\n content.classList.add('shepherd-enabled');\n\n this.trigger('show');\n }\n\n /**\n * Modulates the styles of the passed step's target element, based on the step's options and\n * the tour's `modal` option, to visually emphasize the element\n *\n * @param step The step object that attaches to the element\n * @private\n */\n _styleTargetElementForStep(step) {\n const targetElement = step.target;\n\n if (!targetElement) {\n return;\n }\n\n if (step.options.highlightClass) {\n targetElement.classList.add(step.options.highlightClass);\n }\n\n if (step.options.canClickTarget === false) {\n targetElement.classList.add('shepherd-target-click-disabled');\n }\n }\n\n /**\n * When a step is hidden, remove the highlightClass and 'shepherd-enabled'\n * and 'shepherd-target' classes\n * @private\n */\n _updateStepTargetOnHide() {\n const target = this.target || document.body;\n\n if (this.options.highlightClass) {\n target.classList.remove(this.options.highlightClass);\n }\n\n target.classList.remove(\n 'shepherd-target-click-disabled',\n `${this.classPrefix}shepherd-enabled`,\n `${this.classPrefix}shepherd-target`\n );\n }\n}\n","/**\n * Cleanup the steps and set pointerEvents back to 'auto'\n * @param tour The tour object\n */\nexport function cleanupSteps(tour) {\n if (tour) {\n const { steps } = tour;\n\n steps.forEach((step) => {\n if (step.options && step.options.canClickTarget === false && step.options.attachTo) {\n if (step.target instanceof HTMLElement) {\n step.target.classList.remove('shepherd-target-click-disabled');\n }\n }\n });\n }\n}\n","/**\n * Generates the svg path data for a rounded rectangle overlay\n * @param {Object} dimension - Dimensions of rectangle.\n * @param {number} width - Width.\n * @param {number} height - Height.\n * @param {number} [x=0] - Offset from top left corner in x axis. default 0.\n * @param {number} [y=0] - Offset from top left corner in y axis. default 0.\n * @param {number} [r=0] - Corner Radius. Keep this smaller than half of width or height.\n * @returns {string} - Rounded rectangle overlay path data.\n */\nexport function makeOverlayPath({ width, height, x = 0, y = 0, r = 0 }) {\n const { innerWidth: w, innerHeight: h } = window;\n\n return `M${w},${h}\\\nH0\\\nV0\\\nH${w}\\\nV${h}\\\nZ\\\nM${x + r},${y}\\\na${r},${r},0,0,0-${r},${r}\\\nV${height + y - r}\\\na${r},${r},0,0,0,${r},${r}\\\nH${width + x - r}\\\na${r},${r},0,0,0,${r}-${r}\\\nV${y + r}\\\na${r},${r},0,0,0-${r}-${r}\\\nZ`;\n}\n","<script>\n import { uuid } from '../utils/general.js';\n import { makeOverlayPath } from '../utils/overlay-path.js';\n\n export let element, openingProperties;\n const guid = uuid();\n let modalIsVisible = false;\n let rafId = undefined;\n let pathDefinition;\n\n $: pathDefinition = makeOverlayPath(openingProperties);\n\n closeModalOpening();\n\n export const getElement = () => element;\n\n export function closeModalOpening() {\n openingProperties = {\n width: 0,\n height: 0,\n x: 0,\n y: 0,\n r: 0\n };\n }\n\n /**\n * Hide the modal overlay\n */\n export function hide() {\n modalIsVisible = false;\n\n // Ensure we cleanup all event listeners when we hide the modal\n _cleanupStepEventListeners();\n }\n\n /**\n * Uses the bounds of the element we want the opening overtop of to set the dimensions of the opening and position it\n * @param {Number} modalOverlayOpeningPadding An amount of padding to add around the modal overlay opening\n * @param {Number} modalOverlayOpeningRadius An amount of border radius to add around the modal overlay opening\n * @param {HTMLElement} scrollParent The scrollable parent of the target element\n * @param {HTMLElement} targetElement The element the opening will expose\n */\n export function positionModal(\n modalOverlayOpeningPadding = 0,\n modalOverlayOpeningRadius = 0,\n scrollParent,\n targetElement\n ) {\n if (targetElement) {\n const { y, height } = _getVisibleHeight(targetElement, scrollParent);\n const { x, width, left } = targetElement.getBoundingClientRect();\n\n // getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top\n openingProperties = {\n width: width + modalOverlayOpeningPadding * 2,\n height: height + modalOverlayOpeningPadding * 2,\n x: (x || left) - modalOverlayOpeningPadding,\n y: y - modalOverlayOpeningPadding,\n r: modalOverlayOpeningRadius\n };\n } else {\n closeModalOpening();\n }\n }\n\n /**\n * If modal is enabled, setup the svg mask opening and modal overlay for the step\n * @param {Step} step The step instance\n */\n export function setupForStep(step) {\n // Ensure we move listeners from the previous step, before we setup new ones\n _cleanupStepEventListeners();\n\n if (step.tour.options.useModalOverlay) {\n _styleForStep(step);\n show();\n } else {\n hide();\n }\n }\n\n /**\n * Show the modal overlay\n */\n export function show() {\n modalIsVisible = true;\n }\n\n const _preventModalBodyTouch = (e) => {\n e.preventDefault();\n };\n\n const _preventModalOverlayTouch = (e) => {\n e.stopPropagation();\n };\n\n /**\n * Add touchmove event listener\n * @private\n */\n function _addStepEventListeners() {\n // Prevents window from moving on touch.\n window.addEventListener('touchmove', _preventModalBodyTouch, {\n passive: false\n });\n }\n\n /**\n * Cancel the requestAnimationFrame loop and remove touchmove event listeners\n * @private\n */\n function _cleanupStepEventListeners() {\n if (rafId) {\n cancelAnimationFrame(rafId);\n rafId = undefined;\n }\n\n window.removeEventListener('touchmove', _preventModalBodyTouch, {\n passive: false\n });\n }\n\n /**\n * Style the modal for the step\n * @param {Step} step The step to style the opening for\n * @private\n */\n function _styleForStep(step) {\n const {\n modalOverlayOpeningPadding,\n modalOverlayOpeningRadius\n } = step.options;\n\n const scrollParent = _getScrollParent(step.target);\n\n // Setup recursive function to call requestAnimationFrame to update the modal opening position\n const rafLoop = () => {\n rafId = undefined;\n positionModal(\n modalOverlayOpeningPadding,\n modalOverlayOpeningRadius,\n scrollParent,\n step.target\n );\n rafId = requestAnimationFrame(rafLoop);\n };\n\n rafLoop();\n\n _addStepEventListeners();\n }\n\n /**\n * Find the closest scrollable parent element\n * @param {HTMLElement} element The target element\n * @returns {HTMLElement}\n * @private\n */\n function _getScrollParent(element) {\n if (!element) {\n return null;\n }\n\n const isHtmlElement = element instanceof HTMLElement;\n const overflowY =\n isHtmlElement && window.getComputedStyle(element).overflowY;\n const isScrollable = overflowY !== 'hidden' && overflowY !== 'visible';\n\n if (isScrollable && element.scrollHeight >= element.clientHeight) {\n return element;\n }\n\n return _getScrollParent(element.parentElement);\n }\n\n /**\n * Get the visible height of the target element relative to its scrollParent.\n * If there is no scroll parent, the height of the element is returned.\n *\n * @param {HTMLElement} element The target element\n * @param {HTMLElement} [scrollParent] The scrollable parent element\n * @returns {{y: number, height: number}}\n * @private\n */\n function _getVisibleHeight(element, scrollParent) {\n const elementRect = element.getBoundingClientRect();\n let top = elementRect.y || elementRect.top;\n let bottom = elementRect.bottom || top + elementRect.height;\n\n if (scrollParent) {\n const scrollRect = scrollParent.getBoundingClientRect();\n const scrollTop = scrollRect.y || scrollRect.top;\n const scrollBottom = scrollRect.bottom || scrollTop + scrollRect.height;\n\n top = Math.max(top, scrollTop);\n bottom = Math.min(bottom, scrollBottom);\n }\n\n const height = Math.max(bottom - top, 0); // Default to 0 if height is negative\n\n return { y: top, height };\n }\n</script>\n\n<svg\n bind:this={element}\n class={`${\n modalIsVisible ? 'shepherd-modal-is-visible' : ''\n } shepherd-modal-overlay-container`}\n on:touchmove={_preventModalOverlayTouch}\n>\n <path d={pathDefinition} />\n</svg>\n\n<style global>\n .shepherd-modal-overlay-container {\n -ms-filter: progid:dximagetransform.microsoft.gradient.alpha(Opacity=50);\n filter: alpha(opacity=50);\n height: 0;\n left: 0;\n opacity: 0;\n overflow: hidden;\n pointer-events: none;\n position: fixed;\n top: 0;\n transition: all 0.3s ease-out, height 0ms 0.3s, opacity 0.3s 0ms;\n width: 100vw;\n z-index: 9997;\n }\n\n .shepherd-modal-overlay-container.shepherd-modal-is-visible {\n height: 100vh;\n opacity: 0.5;\n transition: all 0.3s ease-out, height 0s 0s, opacity 0.3s 0s;\n }\n\n .shepherd-modal-overlay-container.shepherd-modal-is-visible path {\n pointer-events: all;\n }\n</style>\n","import { Evented } from './evented.js';\nimport { Step } from './step.js';\nimport autoBind from './utils/auto-bind.js';\nimport { isHTMLElement, isFunction, isString, isUndefined } from './utils/type-check.js';\nimport { cleanupSteps } from './utils/cleanup.js';\nimport { normalizePrefix, uuid } from './utils/general.js';\nimport ShepherdModal from './components/shepherd-modal.svelte';\n\nconst Shepherd = new Evented();\n\n/**\n * Class representing the site tour\n * @extends {Evented}\n */\nexport class Tour extends Evented {\n /**\n * @param {Object} options The options for the tour\n * @param {boolean} options.confirmCancel If true, will issue a `window.confirm` before cancelling\n * @param {string} options.confirmCancelMessage The message to display in the confirm dialog\n * @param {string} options.classPrefix The prefix to add to the `shepherd-enabled` and `shepherd-target` class names as well as the `data-shepherd-step-id`.\n * @param {Object} options.defaultStepOptions Default options for Steps ({@link Step#constructor}), created through `addStep`\n * @param {boolean} options.exitOnEsc Exiting the tour with the escape key will be enabled unless this is explicitly\n * set to false.\n * @param {boolean} options.keyboardNavigation Navigating the tour via left and right arrow keys will be enabled\n * unless this is explicitly set to false.\n * @param {HTMLElement} options.stepsContainer An optional container element for the steps.\n * If not set, the steps will be appended to `document.body`.\n * @param {HTMLElement} options.modalContainer An optional container element for the modal.\n * If not set, the modal will be appended to `document.body`.\n * @param {object[] | Step[]} options.steps An array of step options objects or Step instances to initialize the tour with\n * @param {string} options.tourName An optional \"name\" for the tour. This will be appended to the the tour's\n * dynamically generated `id` property -- which is also set on the `body` element as the `data-shepherd-active-tour` attribute\n * whenever the tour becomes active.\n * @param {boolean} options.useModalOverlay Whether or not steps should be placed above a darkened\n * modal overlay. If true, the overlay will create an opening around the target element so that it\n * can remain interactive\n * @returns {Tour}\n */\n constructor(options = {}) {\n super(options);\n\n autoBind(this);\n\n const defaultTourOptions = {\n exitOnEsc: true,\n keyboardNavigation: true\n };\n\n this.options = Object.assign({}, defaultTourOptions, options);\n this.classPrefix = normalizePrefix(this.options.classPrefix);\n this.steps = [];\n this.addSteps(this.options.steps);\n\n // Pass these events onto the global Shepherd object\n const events = ['active', 'cancel', 'complete', 'inactive', 'show', 'start'];\n events.map((event) => {\n ((e) => {\n this.on(e, (opts) => {\n opts = opts || {};\n opts.tour = this;\n Shepherd.trigger(e, opts);\n });\n })(event);\n });\n\n this._setTourID();\n\n return this;\n }\n\n /**\n * Adds a new step to the tour\n * @param {Object|Step} options An object containing step options or a Step instance\n * @param {number} index The optional index to insert the step at. If undefined, the step\n * is added to the end of the array.\n * @return {Step} The newly added step\n */\n addStep(options, index) {\n let step = options;\n\n if (!(step instanceof Step)) {\n step = new Step(this, step);\n } else {\n step.tour = this;\n }\n\n if (!isUndefined(index)) {\n this.steps.splice(index, 0, step);\n } else {\n this.steps.push(step);\n }\n\n return step;\n }\n\n /**\n * Add multiple steps to the tour\n * @param {Array<object> | Array<Step>} steps The steps to add to the tour\n */\n addSteps(steps) {\n if (Array.isArray(steps)) {\n steps.forEach((step) => {\n this.addStep(step);\n });\n }\n\n return this;\n }\n\n /**\n * Go to the previous step in the tour\n */\n back() {\n const index = this.steps.indexOf(this.currentStep);\n this.show(index - 1, false);\n }\n\n /**\n * Calls _done() triggering the 'cancel' event\n * If `confirmCancel` is true, will show a window.confirm before cancelling\n */\n cancel() {\n if (this.options.confirmCancel) {\n const cancelMessage = this.options.confirmCancelMessage || 'Are you sure you want to stop the tour?';\n const stopTour = window.confirm(cancelMessage);\n if (stopTour) {\n this._done('cancel');\n }\n } else {\n this._done('cancel');\n }\n }\n\n /**\n * Calls _done() triggering the `complete` event\n */\n complete() {\n this._done('complete');\n }\n\n /**\n * Gets the step from a given id\n * @param {Number|String} id The id of the step to retrieve\n * @return {Step} The step corresponding to the `id`\n */\n getById(id) {\n return this.steps.find((step) => {\n return step.id === id;\n });\n }\n\n /**\n * Gets the current step\n * @returns {Step|null}\n */\n getCurrentStep() {\n return this.currentStep;\n }\n\n /**\n * Hide the current step\n */\n hide() {\n const currentStep = this.getCurrentStep();\n\n if (currentStep) {\n return currentStep.hide();\n }\n }\n\n /**\n * Check if the tour is active\n * @return {boolean}\n */\n isActive() {\n return Shepherd.activeTour === this;\n }\n\n /**\n * Go to the next step in the tour\n * If we are at the end, call `complete`\n */\n next() {\n const index = this.steps.indexOf(this.currentStep);\n\n if (index === this.steps.length - 1) {\n this.complete();\n } else {\n this.show(index + 1, true);\n }\n }\n\n /**\n * Removes the step from the tour\n * @param {String} name The id for the step to remove\n */\n removeStep(name) {\n const current = this.getCurrentStep();\n\n // Find the step, destroy it and remove it from this.steps\n this.steps.some((step, i) => {\n if (step.id === name) {\n if (step.isOpen()) {\n step.hide();\n }\n\n step.destroy();\n this.steps.splice(i, 1);\n\n return true;\n }\n });\n\n if (current && current.id === name) {\n this.currentStep = undefined;\n\n // If we have steps left, show the first one, otherwise just cancel the tour\n this.steps.length ? this.show(0) : this.cancel();\n }\n }\n\n /**\n * Show a specific step in the tour\n * @param {Number|String} key The key to look up the step by\n * @param {Boolean} forward True if we are going forward, false if backward\n */\n show(key = 0, forward = true) {\n const step = isString(key) ? this.getById(key) : this.steps[key];\n\n if (step) {\n this._updateStateBeforeShow();\n\n const shouldSkipStep = isFunction(step.options.showOn) && !step.options.showOn();\n\n // If `showOn` returns false, we want to skip the step, otherwise, show the step like normal\n if (shouldSkipStep) {\n this._skipStep(step, forward);\n } else {\n this.trigger('show', {\n step,\n previous: this.currentStep\n });\n\n this.currentStep = step;\n step.show();\n }\n }\n }\n\n /**\n * Start the tour\n */\n start() {\n this.trigger('start');\n\n // Save the focused element before the tour opens\n this.focusedElBeforeOpen = document.activeElement;\n\n this.currentStep = null;\n\n this._setupModal();\n\n this._setupActiveTour();\n this.next();\n }\n\n /**\n * Called whenever the tour is cancelled or completed, basically anytime we exit the tour\n * @param {String} event The event name to trigger\n * @private\n */\n _done(event) {\n const index = this.steps.indexOf(this.currentStep);\n if (Array.isArray(this.steps)) {\n this.steps.forEach((step) => step.destroy());\n }\n\n cleanupSteps(this);\n\n this.trigger(event, { index });\n\n Shepherd.activeTour = null;\n this.trigger('inactive', { tour: this });\n\n if (this.modal) {\n this.modal.hide();\n }\n\n if (event === 'cancel' || event === 'complete') {\n if (this.modal) {\n const modalContainer = document.querySelector('.shepherd-modal-overlay-container');\n\n if (modalContainer) {\n modalContainer.remove();\n }\n }\n }\n\n // Focus the element that was focused before the tour started\n if (isHTMLElement(this.focusedElBeforeOpen)) {\n this.focusedElBeforeOpen.focus();\n }\n }\n\n /**\n * Make this tour \"active\"\n * @private\n */\n _setupActiveTour() {\n this.trigger('active', { tour: this });\n\n Shepherd.activeTour = this;\n }\n\n /**\n * _setupModal create the modal container and instance\n * @private\n */\n _setupModal() {\n this.modal = new ShepherdModal({\n target: this.options.modalContainer || document.body,\n props:\n {\n classPrefix: this.classPrefix,\n styles: this.styles\n }\n });\n }\n\n /**\n * Called when `showOn` evaluates to false, to skip the step\n * @param {Step} step The step to skip\n * @param {Boolean} forward True if we are going forward, false if backward\n * @private\n */\n _skipStep(step, forward) {\n const index = this.steps.indexOf(step);\n const nextIndex = forward ? index + 1 : index - 1;\n this.show(nextIndex, forward);\n }\n\n /**\n * Before showing, hide the current step and if the tour is not\n * already active, call `this._setupActiveTour`.\n * @private\n */\n _updateStateBeforeShow() {\n if (this.currentStep) {\n this.currentStep.hide();\n }\n\n if (!this.isActive()) {\n this._setupActiveTour();\n }\n }\n\n /**\n * Sets this.id to `${tourName}--${uuid}`\n * @private\n */\n _setTourID() {\n const tourName = this.options.tourName || 'tour';\n\n this.id = `${tourName}--${uuid()}`;\n }\n}\n\nexport { Shepherd };\n","import { Step } from './step.js';\nimport { Shepherd, Tour } from './tour.js';\n\nObject.assign(Shepherd, { Tour, Step });\n\nexport default Shepherd;\n"],"names":["isMergeableObject","value","isNonNullObject","isSpecial","stringValue","Object","prototype","toString","call","isReactElement","canUseSymbol","Symbol","for","REACT_ELEMENT_TYPE","$$typeof","emptyTarget","val","Array","isArray","cloneUnlessOtherwiseSpecified","options","clone","deepmerge","defaultArrayMerge","target","source","concat","map","element","getMergeFunction","key","customMerge","getEnumerableOwnPropertySymbols","getOwnPropertySymbols","filter","symbol","propertyIsEnumerable","getKeys","keys","propertyIsOnObject","object","property","_","propertyIsUnsafe","hasOwnProperty","mergeObject","destination","forEach","arrayMerge","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","all","deepmergeAll","array","Error","reduce","prev","next","deepmerge_1","isElement","Element","isHTMLElement","HTMLElement","isFunction","isString","isUndefined","undefined","Evented","on","event","handler","ctx","once","bindings","push","off","binding","index","splice","trigger","args","context","apply","autoBind","self","getOwnPropertyNames","constructor","i","length","bind","_setupAdvanceOnHandler","selector","step","isOpen","targetIsEl","el","currentTarget","targetIsSelector","matches","tour","bindAdvance","advanceOn","document","querySelector","e","console","error","addEventListener","removeEventListener","body","top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","acc","placement","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","getNodeName","nodeName","toLowerCase","getWindow","node","window","ownerDocument","defaultView","OwnElement","isShadowRoot","ShadowRoot","applyStyles","_ref","state","elements","name","style","styles","attributes","assign","removeAttribute","setAttribute","effect","_ref2","initialStyles","position","strategy","margin","arrow","styleProperties","attribute","enabled","phase","fn","requires","getBasePlacement","split","getBoundingClientRect","rect","width","height","x","y","getLayoutRect","clientRect","offsetWidth","offsetHeight","Math","abs","offsetLeft","offsetTop","contains","parent","child","rootNode","getRootNode","isSameNode","parentNode","host","getComputedStyle","isTableElement","indexOf","getDocumentElement","documentElement","getParentNode","assignedSlot","getTrueOffsetParent","offsetParent","getContainingBlock","isFirefox","navigator","userAgent","currentNode","css","transform","perspective","contain","willChange","getOffsetParent","getMainAxisFromPlacement","max","min","round","within","mathMax","mathMin","getFreshSideObject","mergePaddingObject","paddingObject","expandToHashMap","hashMap","toPaddingObject","padding","rects","_state$modifiersData$","arrowElement","popperOffsets","modifiersData","basePlacement","axis","isVertical","len","arrowRect","minProp","maxProp","endDiff","startDiff","arrowOffsetParent","clientSize","clientHeight","clientWidth","centerToReference","center","offset","axisProp","centerOffset","_options$element","requiresIfExists","unsetSides","roundOffsetsByDPR","win","dpr","devicePixelRatio","mapToStyles","_Object$assign2","popperRect","offsets","gpuAcceleration","adaptive","roundOffsets","_ref3","_ref3$x","_ref3$y","hasX","hasY","sideX","sideY","heightProp","widthProp","commonStyles","_Object$assign","computeStyles","_ref4","_options$gpuAccelerat","_options$adaptive","_options$roundOffsets","data","passive","instance","_options$scroll","scroll","_options$resize","resize","scrollParents","scrollParent","update","hash","getOppositePlacement","replace","matched","getOppositeVariationPlacement","getWindowScroll","scrollLeft","pageXOffset","scrollTop","pageYOffset","getWindowScrollBarX","getViewportRect","html","visualViewport","test","getDocumentRect","_element$ownerDocumen","winScroll","scrollWidth","scrollHeight","direction","isScrollParent","_getComputedStyle","overflow","overflowX","overflowY","getScrollParent","listScrollParents","list","isBody","updatedList","rectToClientRect","getInnerBoundingClientRect","clientTop","clientLeft","getClientRectFromMixedType","clippingParent","getClippingParents","canEscapeClipping","clipperElement","getClippingRect","boundary","rootBoundary","mainClippingParents","firstClippingParent","clippingRect","accRect","getVariation","computeOffsets","variation","commonX","commonY","mainAxis","detectOverflow","_options","_options$placement","_options$boundary","_options$rootBoundary","_options$elementConte","elementContext","_options$altBoundary","altBoundary","_options$padding","altContext","referenceElement","clippingClientRect","contextElement","referenceClientRect","popperClientRect","elementClientRect","overflowOffsets","offsetData","multiply","computeAutoPlacement","flipVariations","_options$allowedAutoP","allowedAutoPlacements","allPlacements","allowedPlacements","overflows","sort","a","b","getExpandedFallbackPlacements","oppositePlacement","flip","_skip","_options$mainAxis","checkMainAxis","_options$altAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","_options$flipVariatio","preferredPlacement","isBasePlacement","referenceRect","checksMap","Map","makeFallbackChecks","firstFittingPlacement","_basePlacement","isStartVariation","mainVariationSide","altVariationSide","checks","every","check","set","numberOfChecks","_loop","_i","fittingPlacement","find","get","slice","_ret","reset","getSideOffsets","preventedOffsets","isAnySideFullyClipped","some","side","hide","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","distanceAndSkiddingToXY","invertDistance","skidding","distance","_options$offset","_data$state$placement","getAltAxis","_options$tether","tether","_options$tetherOffset","tetherOffset","tetherOffsetValue","mainSide","altSide","additive","minLen","maxLen","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","clientOffset","offsetModifierValue","tetherMin","tetherMax","preventedOffset","_mainSide","_altSide","_offset","_min","_max","_preventedOffset","getHTMLElementScroll","getNodeScroll","getCompositeRect","elementOrVirtualElement","isFixed","isOffsetParentAnElement","order","modifiers","visited","Set","result","modifier","add","dep","has","depModifier","orderModifiers","orderedModifiers","debounce","pending","Promise","resolve","then","mergeByName","merged","current","existing","DEFAULT_OPTIONS","areValidElements","_len","arguments","_key","popperGenerator","generatorOptions","_generatorOptions","_generatorOptions$def","defaultModifiers","_generatorOptions$def2","defaultOptions","createPopper","effectCleanupFns","isDestroyed","setOptions","cleanupModifierEffects","m","runModifierEffects","forceUpdate","_state$elements","_state$orderedModifie","_state$orderedModifie2","destroy","onFirstUpdate","_ref3$options","cleanupFn","noopFn","eventListeners","_getCenteredStylePopperModifier","makeCenteredPopper","centeredStylePopperModifier","popperOptions","setTimeout","focus","from","normalizePrefix","prefix","charAt","parseAttachTo","attachTo","returnOpts","setupTooltip","tooltip","attachToOptions","getPopperOptions","isCentered","content","shepherdElementComponent","getElement","classList","uuid","d","Date","now","c","r","random","floor","defaultStepOptions","_mergeModifiers","stepOptions","mergedPopperOptions","names","mod","filteredModifiers","includes","noop","tar","src","k","run","blank_object","create","run_all","fns","is_function","thing","safe_not_equal","is_empty","obj","append","appendChild","insert","anchor","insertBefore","detach","removeChild","destroy_each","iterations","detaching","createElement","svg_element","createElementNS","text","createTextNode","space","empty","listen","attr","getAttribute","set_attributes","descriptors","getOwnPropertyDescriptors","__proto__","cssText","children","childNodes","toggle_class","toggle","current_component","set_current_component","component","get_current_component","onMount","$$","on_mount","afterUpdate","after_update","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","update_scheduled","schedule_update","flush","add_render_callback","flushing","seen_callbacks","pop","callback","clear","fragment","before_update","dirty","p","outroing","outros","group_outros","check_outros","transition_in","block","local","delete","transition_out","o","get_spread_update","levels","updates","to_null_out","accounted_for","$$scope","n","create_component","mount_component","on_destroy","new_on_destroy","destroy_component","make_dirty","fill","init","create_fragment","not_equal","props","parent_component","bound","callbacks","skip_bound","ready","ret","rest","hydrate","nodes","l","intro","SvelteComponent","$destroy","$on","type","$set","$$props","$$set","config","action","classes","disabled","label","secondary","getDisabled","$","buttons","cancelIcon","handleCancelClick","preventDefault","cancel","labelId","title","innerHTML","descriptionId","KEY_TAB","KEY_ESC","LEFT_ARROW","RIGHT_ARROW","getClassesArray","className","classPrefix","firstFocusableElement","focusableElements","lastFocusableElement","dataStepId","hasCancelIcon","hasTitle","id","querySelectorAll","updateDynamicClasses","removeClasses","addClasses","oldClasses","remove","newClasses","handleKeyDown","keyCode","shiftKey","activeElement","exitOnEsc","keyboardNavigation","back","polyfill","w","__forceSmoothScrollPolyfill__","SCROLL_TIME","original","scrollTo","scrollBy","elementScroll","scrollElement","scrollIntoView","performance","isMicrosoftBrowser","userAgentPatterns","RegExp","join","ROUNDING_TOLERANCE","ease","cos","PI","shouldBailOut","firstArg","behavior","TypeError","hasScrollableSpace","canOverflow","overflowValue","isScrollable","isScrollableY","isScrollableX","findScrollableParent","time","currentX","currentY","elapsed","startTime","startX","startY","method","scrollable","requestAnimationFrame","smoothScroll","scrollX","scrollY","SyntaxError","scrollableParent","parentRects","clientRects","module","smoothscroll","Step","_setOptions","complete","_updateStepTargetOnHide","getTour","modal","hidden","Boolean","show","beforeShowPromise","_show","updateStepOptions","getTarget","_createTooltipContent","ShepherdElement","stepsContainer","_scrollTo","scrollToOptions","scrollToHandler","_getClassOptions","stepClasses","defaultStepOptionsClasses","allClasses","uniqClasses","trim","tourOptions","merge","when","_setupElements","_setupModal","setupForStep","_styleTargetElementForStep","targetElement","highlightClass","canClickTarget","cleanupSteps","steps","makeOverlayPath","innerWidth","innerHeight","h","_getScrollParent","isHtmlElement","parentElement","_getVisibleHeight","elementRect","scrollRect","scrollBottom","openingProperties","modalIsVisible","rafId","pathDefinition","closeModalOpening","_cleanupStepEventListeners","positionModal","modalOverlayOpeningPadding","modalOverlayOpeningRadius","useModalOverlay","_styleForStep","_preventModalBodyTouch","_preventModalOverlayTouch","stopPropagation","_addStepEventListeners","cancelAnimationFrame","rafLoop","Shepherd","Tour","defaultTourOptions","addSteps","events","opts","_setTourID","addStep","currentStep","confirmCancel","cancelMessage","confirmCancelMessage","stopTour","confirm","_done","getById","getCurrentStep","isActive","activeTour","removeStep","forward","_updateStateBeforeShow","shouldSkipStep","showOn","_skipStep","previous","focusedElBeforeOpen","_setupActiveTour","modalContainer","ShepherdModal","nextIndex","tourName"],"mappings":";;;;;;;;CAEA,IAAIA,iBAAiB,G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AAI,EAAEsoB,WAAW,CAACtoB,IADT;CAETH,YAAAA,GAAG,EAAEyoB,WAAW,CAACzoB,GAFR;CAGTgnB,YAAAA,QAAQ,EAAE;CAHD,WAAX;CAKD;CACF,OAzCD;CA0CD;;CAED,IAAkE;;CAEhE0B,MAAAA,cAAA,GAAiB;CAAE/C,QAAAA,QAAQ,EAAEA;CAAZ,OAAjB;CACD;CAKF,GA/aA,GAAD;;;;CCcAgD,YAAY,CAAChD,QAAb;CAEA;CACA;CACA;CACA;;CACO,MAAMiD,IAAN,SAAmBvrB,OAAnB,CAA2B;CAChC;CACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACEmB,EAAAA,WAAW,CAACa,IAAD,EAAOhF,OAAO,GAAG,EAAjB,EAAqB;CAC9B,UAAMgF,IAAN,EAAYhF,OAAZ;CACA,SAAKgF,IAAL,GAAYA,IAAZ;CACA,SAAKglB,WAAL,GAAmB,KAAKhlB,IAAL,CAAUhF,OAAV,GACfsf,eAAe,CAAC,KAAKta,IAAL,CAAUhF,OAAV,CAAkBgqB,WAAnB,CADA,GAEf,EAFJ;CAGA,SAAK1hB,MAAL,GAActD,IAAI,CAACsD,MAAnB;CAEAtE,IAAAA,QAAQ,CAAC,IAAD,CAAR;;CAEA,SAAKwqB,WAAL,CAAiBxuB,OAAjB;;CAEA,WAAO,IAAP;CACD;CAED;CACF;CACA;CACA;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jvB,QAAQ,CAACO,IADnB;CAE7B4hB,MAAAA,KAAK,EACL;CACE0C,QAAAA,WAAW,EAAE,KAAKA,WADpB;CAEE1hB,QAAAA,MAAM,EAAE,KAAKA;CAFf;CAH6B,KAAlB,CAAb;CAQD;CAED;CACF;CACA;CACA;CACA;CACA;;;CACE0rB,EAAAA,SAAS,CAACvvB,IAAD,EAAOmvB,OAAP,EAAgB;CACvB,UAAMlwB,KAAK,GAAG,KAAKitB,KAAL,CAAWzlB,OAAX,CAAmBzG,IAAnB,CAAd;CACA,UAAM6vB,SAAS,GAAGV,OAAO,GAAGlwB,KAAK,GAAG,CAAX,GAAeA,KAAK,GAAG,CAAhD;CACA,SAAKqrB,IAAL,CAAUuF,SAAV,EAAqBV,OAArB;CACD;CAED;CACF;CACA;CACA;CACA;;;CACEC,EAAAA,sBAAsB,GAAG;CACvB,QAAI,KAAKb,WAAT,EAAsB;CACpB,WAAKA,WAAL,CAAiBna,IAAjB;CACD;;CAED,QAAI,CAAC,KAAK4a,QAAL,EAAL,EAAsB;CACpB,WAAKU,gBAAL;CACD;CACF;CAED;CACF;CACA;CACA;;;CACErB,EAAAA,UAAU,GAAG;CACX,UAAMyB,QAAQ,GAAG,KAAKv0B,OAAL,CAAau0B,QAAb,IAAyB,MAA1C;CAEA,SAAKhK,EAAL,GAAW,GAAEgK,QAAS,KAAIlU,IAAI,EAAG,EAAjC;CACD;;CA9V+B;;CCXlCphB,MAAM,CAACuJ,MAAP,CAAcgqB,QAAd,EAAwB;CAAEC,EAAAA,IAAF;CAAQlE,EAAAA;CAAR,CAAxB;;;;"}
1
+ {"version":3,"file":"shepherd.js","sources":["../../node_modules/deepmerge/dist/cjs.js","../../src/js/utils/type-check.js","../../src/js/evented.js","../../src/js/utils/auto-bind.js","../../src/js/utils/bind.js","../../node_modules/@popperjs/core/lib/enums.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../node_modules/@popperjs/core/lib/utils/math.js","../../node_modules/@popperjs/core/lib/utils/within.js","../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../node_modules/@popperjs/core/lib/utils/debounce.js","../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../node_modules/@popperjs/core/lib/createPopper.js","../../node_modules/@popperjs/core/lib/popper.js","../../src/js/utils/popper-options.js","../../src/js/utils/general.js","../../node_modules/svelte/internal/index.mjs","../../src/js/components/shepherd-button.svelte","../../src/js/components/shepherd-footer.svelte","../../src/js/components/shepherd-cancel-icon.svelte","../../src/js/components/shepherd-title.svelte","../../src/js/components/shepherd-header.svelte","../../src/js/components/shepherd-text.svelte","../../src/js/components/shepherd-content.svelte","../../src/js/components/shepherd-element.svelte","../../node_modules/smoothscroll-polyfill/dist/smoothscroll.js","../../src/js/step.js","../../src/js/utils/cleanup.js","../../src/js/utils/overlay-path.js","../../src/js/components/shepherd-modal.svelte","../../src/js/tour.js","../../src/js/shepherd.js"],"sourcesContent":["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn target.propertyIsEnumerable(symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","/**\n * Checks if `value` is classified as an `Element`.\n * @param {*} value The param to check if it is an Element\n */\nexport function isElement(value) {\n return value instanceof Element;\n}\n\n/**\n * Checks if `value` is classified as an `HTMLElement`.\n * @param {*} value The param to check if it is an HTMLElement\n */\nexport function isHTMLElement(value) {\n return value instanceof HTMLElement;\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n * @param {*} value The param to check if it is a function\n */\nexport function isFunction(value) {\n return typeof value === 'function';\n}\n\n/**\n * Checks if `value` is classified as a `String` object.\n * @param {*} value The param to check if it is a string\n */\nexport function isString(value) {\n return typeof value === 'string';\n}\n\n/**\n * Checks if `value` is undefined.\n * @param {*} value The param to check if it is undefined\n */\nexport function isUndefined(value) {\n return value === undefined;\n}\n","import { isUndefined } from './utils/type-check';\n\nexport class Evented {\n on(event, handler, ctx, once = false) {\n if (isUndefined(this.bindings)) {\n this.bindings = {};\n }\n if (isUndefined(this.bindings[event])) {\n this.bindings[event] = [];\n }\n this.bindings[event].push({ handler, ctx, once });\n\n return this;\n }\n\n once(event, handler, ctx) {\n return this.on(event, handler, ctx, true);\n }\n\n off(event, handler) {\n if (isUndefined(this.bindings) ||\n isUndefined(this.bindings[event])) {\n return this;\n }\n\n if (isUndefined(handler)) {\n delete this.bindings[event];\n } else {\n this.bindings[event].forEach((binding, index) => {\n if (binding.handler === handler) {\n this.bindings[event].splice(index, 1);\n }\n });\n }\n\n return this;\n }\n\n trigger(event, ...args) {\n if (!isUndefined(this.bindings) && this.bindings[event]) {\n this.bindings[event].forEach((binding, index) => {\n const { ctx, handler, once } = binding;\n\n const context = ctx || this;\n\n handler.apply(context, args);\n\n if (once) {\n this.bindings[event].splice(index, 1);\n }\n });\n }\n\n return this;\n }\n}","/**\n * Binds all the methods on a JS Class to the `this` context of the class.\n * Adapted from https://github.com/sindresorhus/auto-bind\n * @param {object} self The `this` context of the class\n * @return {object} The `this` context of the class\n */\nexport default function autoBind(self) {\n const keys = Object.getOwnPropertyNames(self.constructor.prototype);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val = self[key];\n if (key !== 'constructor' && typeof val === 'function') {\n self[key] = val.bind(self);\n }\n }\n\n return self;\n}\n","import { isUndefined } from './type-check';\n\n/**\n * Sets up the handler to determine if we should advance the tour\n * @param {string} selector\n * @param {Step} step The step instance\n * @return {Function}\n * @private\n */\nfunction _setupAdvanceOnHandler(selector, step) {\n return (event) => {\n if (step.isOpen()) {\n const targetIsEl = step.el && event.currentTarget === step.el;\n const targetIsSelector = !isUndefined(selector) && event.currentTarget.matches(selector);\n\n if (targetIsSelector || targetIsEl) {\n step.tour.next();\n }\n }\n };\n}\n\n/**\n * Bind the event handler for advanceOn\n * @param {Step} step The step instance\n */\nexport function bindAdvance(step) {\n // An empty selector matches the step element\n const { event, selector } = step.options.advanceOn || {};\n if (event) {\n const handler = _setupAdvanceOnHandler(selector, step);\n\n // TODO: this should also bind/unbind on show/hide\n let el;\n try {\n el = document.querySelector(selector);\n } catch (e) {\n // TODO\n }\n if (!isUndefined(selector) && !el) {\n return console.error(`No element was found for the selector supplied to advanceOn: ${selector}`);\n } else if (el) {\n el.addEventListener(event, handler);\n step.on('destroy', () => {\n return el.removeEventListener(event, handler);\n });\n } else {\n document.body.addEventListener(event, handler, true);\n step.on('destroy', () => {\n return document.body.removeEventListener(event, handler, true);\n });\n }\n } else {\n return console.error('advanceOn was defined, but no event name was passed.');\n }\n}\n","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export default function getBoundingClientRect(element) {\n var rect = element.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n x: rect.left,\n y: rect.top\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n var currentNode = getParentNode(element);\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport default function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport within from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","import { top, left, right, bottom } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(round(x * dpr) / dpr) || 0,\n y: round(round(y * dpr) / dpr) || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets;\n\n var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,\n _ref3$x = _ref3.x,\n x = _ref3$x === void 0 ? 0 : _ref3$x,\n _ref3$y = _ref3.y,\n y = _ref3$y === void 0 ? 0 : _ref3$y;\n\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top) {\n sideY = bottom; // $FlowFixMe[prop-missing]\n\n y -= offsetParent[heightProp] - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left) {\n sideX = right; // $FlowFixMe[prop-missing]\n\n x -= offsetParent[widthProp] - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref4) {\n var state = _ref4.state,\n options = _ref4.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on <html>\n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nexport default function getViewportRect(element) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element) {\n var rect = getBoundingClientRect(element);\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var referenceElement = state.elements.reference;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);\n var referenceClientRect = getBoundingClientRect(referenceElement);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\";\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport within from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { max as mathMax, min as mathMin } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis || checkAltAxis) {\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = popperOffsets[mainAxis] + overflow[mainSide];\n var max = popperOffsets[mainAxis] - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;\n var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;\n\n if (checkMainAxis) {\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var _preventedOffset = within(tether ? mathMin(_min, tetherMin) : _min, _offset, tether ? mathMax(_max, tetherMax) : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\"; // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(options) {\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","function _getCenteredStylePopperModifier() {\n return [\n {\n name: 'applyStyles',\n fn({ state }) {\n Object.keys(state.elements).forEach((name) => {\n if (name !== 'popper') {\n return;\n }\n const style = {\n position: 'fixed',\n left: '40%',\n top: '50%',\n transform: 'translate(-40%, -40%)'\n };\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach((name) => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }\n },\n {\n name: 'computeStyles',\n options: {\n adaptive: false\n }\n }\n ];\n}\n\n/**\n * Generates the array of options for a tooltip that doesn't have a\n * target element in the DOM -- and thus is positioned in the center\n * of the view\n *\n * @param {Step} step The step instance\n * @return {Object} The final Popper options object\n */\nexport function makeCenteredPopper(step) {\n const centeredStylePopperModifier = _getCenteredStylePopperModifier();\n\n let popperOptions = {\n placement: 'top',\n strategy: 'fixed',\n modifiers: [\n {\n name: 'focusAfterRender',\n enabled: true,\n phase: 'afterWrite',\n fn() {\n setTimeout(() => {\n if (step.el) {\n step.el.focus();\n }\n }, 300);\n }\n }\n ]\n };\n\n popperOptions = {\n ...popperOptions,\n modifiers: Array.from(\n new Set([...popperOptions.modifiers, ...centeredStylePopperModifier])\n )\n };\n\n return popperOptions;\n}\n","import { createPopper } from '@popperjs/core';\nimport { isString } from './type-check';\nimport { makeCenteredPopper } from './popper-options';\n\n/**\n * Ensure class prefix ends in `-`\n * @param {string} prefix The prefix to prepend to the class names generated by nano-css\n * @return {string} The prefix ending in `-`\n */\nexport function normalizePrefix(prefix) {\n if (!isString(prefix) || prefix === '') {\n return '';\n }\n\n return prefix.charAt(prefix.length - 1) !== '-' ? `${prefix}-` : prefix;\n}\n\n/**\n * Checks if options.attachTo.element is a string, and if so, tries to find the element\n * @param {Step} step The step instance\n * @returns {{element, on}}\n * `element` is a qualified HTML Element\n * `on` is a string position value\n */\nexport function parseAttachTo(step) {\n const options = step.options.attachTo || {};\n const returnOpts = Object.assign({}, options);\n\n if (isString(options.element)) {\n // Can't override the element in user opts reference because we can't\n // guarantee that the element will exist in the future.\n try {\n returnOpts.element = document.querySelector(options.element);\n } catch (e) {\n // TODO\n }\n if (!returnOpts.element) {\n console.error(\n `The element for this Shepherd step was not found ${options.element}`\n );\n }\n }\n\n return returnOpts;\n}\n\n/**\n * Determines options for the tooltip and initializes\n * `step.tooltip` as a Popper instance.\n * @param {Step} step The step instance\n */\nexport function setupTooltip(step) {\n if (step.tooltip) {\n step.tooltip.destroy();\n }\n\n const attachToOptions = parseAttachTo(step);\n\n let target = attachToOptions.element;\n const popperOptions = getPopperOptions(attachToOptions, step);\n\n if (step.isCentered()) {\n target = document.body;\n const content = step.shepherdElementComponent.getElement();\n content.classList.add('shepherd-centered');\n }\n\n step.tooltip = createPopper(target, step.el, popperOptions);\n step.target = attachToOptions.element;\n\n return popperOptions;\n}\n\n/**\n * Create a unique id for steps, tours, modals, etc\n * @return {string}\n */\nexport function uuid() {\n let d = Date.now();\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n\n/**\n * Gets the `Popper` options from a set of base `attachTo` options\n * @param attachToOptions\n * @param {Step} step The step instance\n * @return {Object}\n * @private\n */\nexport function getPopperOptions(attachToOptions, step) {\n let popperOptions = {\n modifiers: [\n {\n name: 'preventOverflow',\n options: {\n altAxis: true\n }\n },\n {\n name: 'focusAfterRender',\n enabled: true,\n phase: 'afterWrite',\n fn() {\n setTimeout(() => {\n if (step.el) {\n step.el.focus();\n }\n }, 300);\n }\n }\n ],\n strategy: 'absolute'\n };\n\n if (step.isCentered()) {\n popperOptions = makeCenteredPopper(step);\n } else {\n popperOptions.placement = attachToOptions.on;\n }\n\n const defaultStepOptions =\n step.tour && step.tour.options && step.tour.options.defaultStepOptions;\n\n if (defaultStepOptions) {\n popperOptions = _mergeModifiers(defaultStepOptions, popperOptions);\n }\n\n popperOptions = _mergeModifiers(step.options, popperOptions);\n\n return popperOptions;\n}\n\nfunction _mergeModifiers(stepOptions, popperOptions) {\n if (stepOptions.popperOptions) {\n let mergedPopperOptions = Object.assign(\n {},\n popperOptions,\n stepOptions.popperOptions\n );\n\n if (\n stepOptions.popperOptions.modifiers &&\n stepOptions.popperOptions.modifiers.length > 0\n ) {\n const names = stepOptions.popperOptions.modifiers.map((mod) => mod.name);\n const filteredModifiers = popperOptions.modifiers.filter(\n (mod) => !names.includes(mod.name)\n );\n\n mergedPopperOptions.modifiers = Array.from(\n new Set([...filteredModifiers, ...stepOptions.popperOptions.modifiers])\n );\n }\n\n return mergedPopperOptions;\n }\n\n return popperOptions;\n}\n","function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\nfunction is_promise(value) {\n return value && typeof value === 'object' && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot_spread(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_spread_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_spread_changes_fn(dirty) | get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value = ret) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction detach(node) {\n node.parentNode.removeChild(node);\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction claim_element(nodes, name, attributes, svg) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeName === name) {\n let j = 0;\n const remove = [];\n while (j < node.attributes.length) {\n const attribute = node.attributes[j++];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n for (let k = 0; k < remove.length; k++) {\n node.removeAttribute(remove[k]);\n }\n return nodes.splice(i, 1)[0];\n }\n }\n return svg ? svg_element(name) : element(name);\n}\nfunction claim_text(nodes, data) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 3) {\n node.data = '' + data;\n return nodes.splice(i, 1)[0];\n }\n }\n return text(data);\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.wholeText !== data)\n text.data = data;\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n node.style.setProperty(key, value, important ? 'important' : '');\n}\nfunction select_option(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked') || select.options[0];\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, false, false, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nclass HtmlTag {\n constructor(anchor = null) {\n this.a = anchor;\n this.e = this.n = null;\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n this.e = element(target.nodeName);\n this.t = target;\n this.h(html);\n }\n this.i(anchor);\n }\n h(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.childNodes);\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(this.t, this.n[i], anchor);\n }\n }\n p(html) {\n this.d();\n this.h(html);\n this.i(this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\nfunction attribute_to_object(attributes) {\n const result = {};\n for (const attribute of attributes) {\n result[attribute.name] = attribute.value;\n }\n return result;\n}\nfunction get_custom_elements_slots(element) {\n const result = {};\n element.childNodes.forEach((node) => {\n result[node.slot || 'default'] = true;\n });\n return result;\n}\n\nconst active_docs = new Set();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = node.ownerDocument;\n active_docs.add(doc);\n const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);\n const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});\n if (!current_rules[name]) {\n current_rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n active_docs.forEach(doc => {\n const stylesheet = doc.__svelte_stylesheet;\n let i = stylesheet.cssRules.length;\n while (i--)\n stylesheet.deleteRule(i);\n doc.__svelte_rules = {};\n });\n active_docs.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error('Function called outside component initialization');\n return current_component;\n}\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail);\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n }\n };\n}\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n}\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\nfunction hasContext(key) {\n return get_current_component().$$.context.has(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n callbacks.slice().forEach(fn => fn(event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\nlet flushing = false;\nconst seen_callbacks = new Set();\nfunction flush() {\n if (flushing)\n return;\n flushing = true;\n do {\n // first, call beforeUpdate functions\n // and update components\n for (let i = 0; i < dirty_components.length; i += 1) {\n const component = dirty_components[i];\n set_current_component(component);\n update(component.$$);\n }\n set_current_component(null);\n dirty_components.length = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n flushing = false;\n seen_callbacks.clear();\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n let config = fn(node, params);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n delete_rule(node);\n if (is_function(config)) {\n config = config();\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n let config = fn(node, params);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n let config = fn(node, params);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = program.b - t;\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program || pending_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n if (info.blocks[i] === block) {\n info.blocks[i] = null;\n }\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n if (!info.hasCatch) {\n throw error;\n }\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n block.p(child_ctx, dirty);\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error('Cannot have duplicate keys in a keyed each');\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\n// source: https://html.spec.whatwg.org/multipage/indices.html\nconst boolean_attributes = new Set([\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'ismap',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n]);\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, classes_to_add) {\n const attributes = Object.assign({}, ...args);\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += ' ' + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += ' ' + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${String(value).replace(/\"/g, '&#34;').replace(/'/g, '&#39;')}\"`;\n }\n });\n return str;\n}\nconst escaped = {\n '\"': '&quot;',\n \"'\": '&#39;',\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;'\n};\nfunction escape(html) {\n return String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(parent_component ? parent_component.$$.context : []),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, options = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, options);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `\"${value}\"`}`}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : '';\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor) {\n const { fragment, on_mount, on_destroy, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = on_mount.map(run).filter(is_function);\n if (on_destroy) {\n on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: null,\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n before_update: [],\n after_update: [],\n context: new Map(parent_component ? parent_component.$$.context : []),\n // everything else\n callbacks: blank_object(),\n dirty,\n skip_bound: false\n };\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor);\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n };\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.32.1' }, detail)));\n}\nfunction append_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev('SvelteDOMRemove', { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {\n const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });\n else\n dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev('SvelteDOMSetProperty', { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev('SvelteDOMSetDataset', { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\n/**\n * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.\n */\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(\"'target' is a required option\");\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn('Component was already destroyed'); // eslint-disable-line no-console\n };\n }\n $capture_state() { }\n $inject_state() { }\n}\n/**\n * Base class to create strongly typed Svelte components.\n * This only exists for typing purposes and should be used in `.d.ts` files.\n *\n * ### Example:\n *\n * You have component library on npm called `component-library`, from which\n * you export a component called `MyComponent`. For Svelte+TypeScript users,\n * you want to provide typings. Therefore you create a `index.d.ts`:\n * ```ts\n * import { SvelteComponentTyped } from \"svelte\";\n * export class MyComponent extends SvelteComponentTyped<{foo: string}> {}\n * ```\n * Typing this makes it possible for IDEs like VS Code with the Svelte extension\n * to provide intellisense and to use the component like this in a Svelte file\n * with TypeScript:\n * ```svelte\n * <script lang=\"ts\">\n * \timport { MyComponent } from \"component-library\";\n * </script>\n * <MyComponent foo={'bar'} />\n * ```\n *\n * #### Why not make this part of `SvelteComponent(Dev)`?\n * Because\n * ```ts\n * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}\n * const component: typeof SvelteComponent = ASubclassOfSvelteComponent;\n * ```\n * will throw a type error, so we need to seperate the more strictly typed class.\n */\nclass SvelteComponentTyped extends SvelteComponentDev {\n constructor(options) {\n super(options);\n }\n}\nfunction loop_guard(timeout) {\n const start = Date.now();\n return () => {\n if (Date.now() - start > timeout) {\n throw new Error('Infinite loop detected');\n }\n };\n}\n\nexport { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteComponentTyped, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_component, claim_element, claim_space, claim_text, clear_loops, component_subscribe, compute_rest_props, compute_slots, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_custom_elements_slots, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, hasContext, has_prop, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, listen, listen_dev, loop, loop_guard, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, update_slot, update_slot_spread, validate_component, validate_each_argument, validate_each_keys, validate_slots, validate_store, xlink_attr };\n","<script>\n import { isFunction } from '../utils/type-check';\n\n export let config, step;\n let action, classes, disabled, label, secondary, text;\n\n $: {\n action = config.action ? config.action.bind(step.tour) : null;\n classes = config.classes;\n disabled = config.disabled ? getDisabled(config.disabled) : false;\n label = config.label;\n secondary = config.secondary;\n text = config.text;\n }\n\n function getDisabled(disabled) {\n if (isFunction(disabled)) {\n return disabled = disabled.call(step);\n }\n return disabled\n }\n\n</script>\n\n<style global>\n .shepherd-button {\n background: rgb(50, 136, 230);\n border: 0;\n border-radius: 3px;\n color: rgba(255, 255, 255, 0.75);\n cursor: pointer;\n margin-right: 0.5rem;\n padding: 0.5rem 1.5rem;\n transition: all 0.5s ease;\n }\n\n .shepherd-button:not(:disabled):hover {\n background: rgb(25, 111, 204);\n color: rgba(255, 255, 255, 0.75);\n }\n\n .shepherd-button.shepherd-button-secondary {\n background: rgb(241, 242, 243);\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-button.shepherd-button-secondary:not(:disabled):hover {\n background: rgb(214, 217, 219);\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-button:disabled {\n cursor: not-allowed;\n }\n</style>\n\n<button\n aria-label=\"{label ? label : null}\"\n class=\"{`${(classes || '')} shepherd-button ${(secondary ? 'shepherd-button-secondary' : '')}`}\"\n disabled={disabled}\n on:click={action}\n tabindex=\"0\"\n>\n {@html text}\n</button>\n","<script>\n import ShepherdButton from './shepherd-button.svelte';\n\n export let step;\n\n $: buttons = step.options.buttons;\n</script>\n\n<style global>\n .shepherd-footer {\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n display: flex;\n justify-content: flex-end;\n padding: 0 0.75rem 0.75rem;\n }\n\n .shepherd-footer .shepherd-button:last-child {\n margin-right: 0;\n }\n</style>\n\n<footer class=\"shepherd-footer\">\n {#if buttons}\n {#each buttons as config}\n <ShepherdButton\n {config}\n {step}\n />\n {/each}\n {/if}\n</footer>\n","<script>\n export let cancelIcon, step;\n\n /**\n * Add a click listener to the cancel link that cancels the tour\n */\n const handleCancelClick = (e) => {\n e.preventDefault();\n step.cancel();\n };\n</script>\n\n<style global>\n .shepherd-cancel-icon {\n background: transparent;\n border: none;\n color: rgba(128, 128, 128, 0.75);\n font-size: 2em;\n cursor: pointer;\n font-weight: normal;\n margin: 0;\n padding: 0;\n transition: color 0.5s ease;\n }\n\n .shepherd-cancel-icon:hover {\n color: rgba(0, 0, 0, 0.75);\n }\n\n .shepherd-has-title .shepherd-content .shepherd-cancel-icon {\n color: rgba(128, 128, 128, 0.75);\n }\n\n .shepherd-has-title .shepherd-content .shepherd-cancel-icon:hover {\n color: rgba(0, 0, 0, 0.75);\n }\n</style>\n\n<button\n aria-label=\"{cancelIcon.label ? cancelIcon.label : 'Close Tour'}\"\n class=\"shepherd-cancel-icon\"\n on:click={handleCancelClick}\n type=\"button\"\n>\n <span aria-hidden=\"true\">&times;</span>\n</button>\n","<script>\n import { afterUpdate } from 'svelte';\n import { isFunction } from '../utils/type-check';\n \n export let labelId, element, title;\n \n afterUpdate(() => {\n if (isFunction(title)) {\n title = title();\n }\n \n element.innerHTML = title;\n });\n</script>\n\n<style global>\n .shepherd-title {\n color: rgba(0, 0, 0, 0.75);\n display: flex;\n font-size: 1rem;\n font-weight: normal;\n flex: 1 0 auto;\n margin: 0;\n padding: 0;\n }\n</style>\n\n<h3\n bind:this={element}\n id=\"{labelId}\"\n class=\"shepherd-title\"\n>\n</h3>\n","<script>\n import ShepherdCancelIcon from './shepherd-cancel-icon.svelte';\n import ShepherdTitle from './shepherd-title.svelte';\n\n export let labelId, step;\n let title, cancelIcon;\n\n $: {\n title = step.options.title;\n cancelIcon = step.options.cancelIcon;\n }\n</script>\n\n<style global>\n .shepherd-header {\n align-items: center;\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n display: flex;\n justify-content: flex-end;\n line-height: 2em;\n padding: 0.75rem 0.75rem 0;\n }\n\n .shepherd-has-title .shepherd-content .shepherd-header {\n background: #e6e6e6;\n padding: 1em;\n }\n</style>\n\n<header class=\"shepherd-header\">\n {#if title}\n <ShepherdTitle\n {labelId}\n {title}\n />\n {/if}\n\n {#if cancelIcon && cancelIcon.enabled}\n <ShepherdCancelIcon\n {cancelIcon}\n {step}\n />\n {/if}\n</header>\n","<script>\n import { afterUpdate } from 'svelte';\n import { isHTMLElement, isFunction } from '../utils/type-check';\n\n export let descriptionId, element, step;\n\n afterUpdate(() => {\n let { text } = step.options;\n\n if (isFunction(text)) {\n text = text.call(step);\n }\n\n if (isHTMLElement(text)) {\n element.appendChild(text);\n } else {\n element.innerHTML = text;\n }\n });\n</script>\n\n<style global>\n .shepherd-text {\n color: rgba(0, 0, 0, 0.75);\n font-size: 1rem;\n line-height: 1.3em;\n padding: 0.75em;\n }\n\n .shepherd-text p {\n margin-top: 0;\n }\n\n .shepherd-text p:last-child {\n margin-bottom: 0;\n }\n</style>\n\n<div\n bind:this={element}\n class=\"shepherd-text\"\n id=\"{descriptionId}\"\n>\n</div>\n\n","<script>\n import ShepherdFooter from './shepherd-footer.svelte';\n import ShepherdHeader from './shepherd-header.svelte';\n import ShepherdText from './shepherd-text.svelte';\n import { isUndefined } from '../utils/type-check.js';\n\n export let descriptionId, labelId, step;\n</script>\n\n<style global>\n .shepherd-content {\n border-radius: 5px;\n outline: none;\n padding: 0;\n }\n</style>\n\n<div\n class=\"shepherd-content\"\n>\n {#if !isUndefined(step.options.title) || (step.options.cancelIcon && step.options.cancelIcon.enabled)}\n <ShepherdHeader\n {labelId}\n {step}\n />\n {/if}\n\n {#if !isUndefined(step.options.text)}\n <ShepherdText\n {descriptionId}\n {step}\n />\n {/if}\n\n {#if Array.isArray(step.options.buttons) && step.options.buttons.length}\n <ShepherdFooter\n {step}\n />\n {/if}\n</div>\n","<script>\n import { onMount, afterUpdate } from 'svelte';\n import ShepherdContent from './shepherd-content.svelte';\n import { isUndefined, isString } from '../utils/type-check.js';\n\n const KEY_TAB = 9;\n const KEY_ESC = 27;\n const LEFT_ARROW = 37;\n const RIGHT_ARROW = 39;\n\n export let classPrefix, element, descriptionId, firstFocusableElement,\n focusableElements, labelId, lastFocusableElement, step, dataStepId;\n\n let hasCancelIcon, hasTitle, classes;\n\n $: {\n hasCancelIcon = step.options && step.options.cancelIcon && step.options.cancelIcon.enabled;\n hasTitle = step.options && step.options.title;\n }\n\n export const getElement = () => element;\n\n onMount(() => {\n // Get all elements that are focusable\n dataStepId = { [`data-${classPrefix}shepherd-step-id`]: step.id };\n focusableElements = element.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]');\n firstFocusableElement = focusableElements[0];\n lastFocusableElement = focusableElements[focusableElements.length - 1];\n });\n\n afterUpdate(() => {\n if(classes !== step.options.classes) {\n updateDynamicClasses();\n }\n });\n\n function updateDynamicClasses() {\n removeClasses(classes);\n classes = step.options.classes;\n addClasses(classes);\n }\n\n function removeClasses(classes) {\n if (isString(classes)) {\n const oldClasses = getClassesArray(classes);\n if (oldClasses.length) {\n element.classList.remove(...oldClasses);\n }\n }\n }\n\n function addClasses(classes) {\n if(isString(classes)) {\n const newClasses = getClassesArray(classes);\n if (newClasses.length) {\n element.classList.add(...newClasses);\n }\n }\n }\n\n function getClassesArray(classes) {\n return classes.split(' ').filter(className => !!className.length);\n }\n\n /**\n * Setup keydown events to allow closing the modal with ESC\n *\n * Borrowed from this great post! https://bitsofco.de/accessible-modal-dialog/\n *\n * @private\n */\n const handleKeyDown = (e) => {\n const { tour } = step;\n switch (e.keyCode) {\n case KEY_TAB:\n if (focusableElements.length === 0) {\n e.preventDefault();\n break;\n }\n // Backward tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement || document.activeElement.classList.contains('shepherd-element')) {\n e.preventDefault();\n lastFocusableElement.focus();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n e.preventDefault();\n firstFocusableElement.focus();\n }\n }\n break;\n case KEY_ESC:\n if (tour.options.exitOnEsc) {\n step.cancel();\n }\n break;\n case LEFT_ARROW:\n if (tour.options.keyboardNavigation) {\n tour.back();\n }\n break;\n case RIGHT_ARROW:\n if (tour.options.keyboardNavigation) {\n tour.next();\n }\n break;\n default:\n break;\n }\n };\n</script>\n\n<style global>\n .shepherd-element {\n background: #fff;\n border-radius: 5px;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);\n max-width: 400px;\n opacity: 0;\n outline: none;\n transition: opacity 0.3s, visibility 0.3s;\n visibility: hidden;\n width: 100%;\n z-index: 9999;\n }\n\n .shepherd-enabled.shepherd-element {\n opacity: 1;\n visibility: visible;\n }\n\n .shepherd-element[data-popper-reference-hidden]:not(.shepherd-centered) {\n opacity: 0;\n pointer-events: none;\n visibility: hidden;\n }\n\n .shepherd-element, .shepherd-element *,\n .shepherd-element *:after,\n .shepherd-element *:before {\n box-sizing: border-box;\n }\n\n .shepherd-arrow,\n .shepherd-arrow::before {\n position: absolute;\n width: 16px;\n height: 16px;\n z-index: -1;\n }\n\n .shepherd-arrow:before {\n content: '';\n transform: rotate(45deg);\n background: #fff ;\n }\n\n .shepherd-element[data-popper-placement^='top'] > .shepherd-arrow {\n bottom: -8px;\n }\n\n .shepherd-element[data-popper-placement^='bottom'] > .shepherd-arrow {\n top: -8px;\n }\n\n .shepherd-element[data-popper-placement^='left'] > .shepherd-arrow {\n right: -8px;\n }\n\n .shepherd-element[data-popper-placement^='right'] > .shepherd-arrow {\n left: -8px;\n }\n\n .shepherd-element.shepherd-centered > .shepherd-arrow {\n opacity: 0;\n }\n\n\n /**\n * Arrow on top of tooltip centered horizontally, with title color\n */\n .shepherd-element.shepherd-has-title[data-popper-placement^='bottom'] > .shepherd-arrow::before {\n background-color: #e6e6e6;\n }\n\n .shepherd-target-click-disabled.shepherd-enabled.shepherd-target,\n .shepherd-target-click-disabled.shepherd-enabled.shepherd-target * {\n pointer-events: none;\n }\n</style>\n\n<div\n aria-describedby={!isUndefined(step.options.text) ? descriptionId : null}\n aria-labelledby={step.options.title ? labelId : null}\n bind:this={element}\n class:shepherd-has-cancel-icon=\"{hasCancelIcon}\"\n class:shepherd-has-title=\"{hasTitle}\"\n class:shepherd-element=\"{true}\"\n {...dataStepId}\n on:keydown={handleKeyDown}\n role=\"dialog\"\n tabindex=\"0\"\n>\n {#if step.options.arrow && step.options.attachTo && step.options.attachTo.element && step.options.attachTo.on}\n <div class=\"shepherd-arrow\" data-popper-arrow></div>\n {/if}\n <ShepherdContent\n {descriptionId}\n {labelId}\n {step}\n />\n</div>\n","/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */\n(function () {\n 'use strict';\n\n // polyfill\n function polyfill() {\n // aliases\n var w = window;\n var d = document;\n\n // return if scroll behavior is supported and polyfill is not forced\n if (\n 'scrollBehavior' in d.documentElement.style &&\n w.__forceSmoothScrollPolyfill__ !== true\n ) {\n return;\n }\n\n // globals\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n // object gathering original scroll methods\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elementScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n // define timing method\n var now =\n w.performance && w.performance.now\n ? w.performance.now.bind(w.performance)\n : Date.now;\n\n /**\n * indicates if a the current browser is made by Microsoft\n * @method isMicrosoftBrowser\n * @param {String} userAgent\n * @returns {Boolean}\n */\n function isMicrosoftBrowser(userAgent) {\n var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];\n\n return new RegExp(userAgentPatterns.join('|')).test(userAgent);\n }\n\n /*\n * IE has rounding bug rounding down clientHeight and clientWidth and\n * rounding up scrollHeight and scrollWidth causing false positives\n * on hasScrollableSpace\n */\n var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} firstArg\n * @returns {Boolean}\n */\n function shouldBailOut(firstArg) {\n if (\n firstArg === null ||\n typeof firstArg !== 'object' ||\n firstArg.behavior === undefined ||\n firstArg.behavior === 'auto' ||\n firstArg.behavior === 'instant'\n ) {\n // first argument is not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError(\n 'behavior member of ScrollOptions ' +\n firstArg.behavior +\n ' is not a valid value for enumeration ScrollBehavior.'\n );\n }\n\n /**\n * indicates if an element has scrollable space in the provided axis\n * @method hasScrollableSpace\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function hasScrollableSpace(el, axis) {\n if (axis === 'Y') {\n return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;\n }\n\n if (axis === 'X') {\n return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;\n }\n }\n\n /**\n * indicates if an element has a scrollable overflow property in the axis\n * @method canOverflow\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function canOverflow(el, axis) {\n var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];\n\n return overflowValue === 'auto' || overflowValue === 'scroll';\n }\n\n /**\n * indicates if an element can be scrolled in either axis\n * @method isScrollable\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function isScrollable(el) {\n var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');\n var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');\n\n return isScrollableY || isScrollableX;\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n while (el !== d.body && isScrollable(el) === false) {\n el = el.parentNode || el.host;\n }\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n * @returns {undefined}\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window or element with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n // ORIGINAL METHODS OVERRIDES\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scroll.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object'\n ? arguments[0]\n : w.scrollX || w.pageXOffset,\n // use top prop, second argument if present or fallback to scrollY\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined\n ? arguments[1]\n : w.scrollY || w.pageYOffset\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : w.scrollX || w.pageXOffset,\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : w.scrollY || w.pageYOffset\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object' ? arguments[0] : 0,\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined ? arguments[1] : 0\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n // if one number is passed, throw error to match Firefox implementation\n if (typeof arguments[0] === 'number' && arguments[1] === undefined) {\n throw new SyntaxError('Value could not be converted');\n }\n\n original.elementScroll.call(\n this,\n // use left prop, first number argument or fallback to scrollLeft\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,\n // use top prop, second argument or fallback to scrollTop\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop\n );\n\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'undefined' ? this.scrollLeft : ~~left,\n typeof top === 'undefined' ? this.scrollTop : ~~top\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.elementScroll.call(\n this,\n arguments[0].left !== undefined\n ? ~~arguments[0].left + this.scrollLeft\n : ~~arguments[0] + this.scrollLeft,\n arguments[0].top !== undefined\n ? ~~arguments[0].top + this.scrollTop\n : ~~arguments[1] + this.scrollTop\n );\n\n return;\n }\n\n this.scroll({\n left: ~~arguments[0].left + this.scrollLeft,\n top: ~~arguments[0].top + this.scrollTop,\n behavior: arguments[0].behavior\n });\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n\n // reveal parent in viewport unless is fixed\n if (w.getComputedStyle(scrollableParent).position !== 'fixed') {\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n }\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }\n\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n // commonjs\n module.exports = { polyfill: polyfill };\n } else {\n // global\n polyfill();\n }\n\n}());\n","import merge from 'deepmerge';\nimport { Evented } from './evented.js';\nimport autoBind from './utils/auto-bind.js';\nimport { isElement, isHTMLElement, isFunction, isUndefined } from './utils/type-check.js';\nimport { bindAdvance } from './utils/bind.js';\nimport {\n setupTooltip,\n parseAttachTo,\n normalizePrefix,\n uuid\n} from './utils/general.js';\nimport ShepherdElement from './components/shepherd-element.svelte';\n\n// Polyfills\nimport smoothscroll from 'smoothscroll-polyfill';\nsmoothscroll.polyfill();\n\n/**\n * A class representing steps to be added to a tour.\n * @extends {Evented}\n */\nexport class Step extends Evented {\n /**\n * Create a step\n * @param {Tour} tour The tour for the step\n * @param {object} options The options for the step\n * @param {boolean} options.arrow Whether to display the arrow for the tooltip or not. Defaults to `true`.\n * @param {object} options.attachTo The element the step should be attached to on the page.\n * An object with properties `element` and `on`.\n *\n * ```js\n * const step = new Step(tour, {\n * attachTo: { element: '.some .selector-path', on: 'left' },\n * ...moreOptions\n * });\n * ```\n *\n * If you don’t specify an attachTo the element will appear in the middle of the screen.\n * If you omit the `on` portion of `attachTo`, the element will still be highlighted, but the tooltip will appear\n * in the middle of the screen, without an arrow pointing to the target.\n * @param {HTMLElement|string} options.attachTo.element An element selector string or a DOM element.\n * @param {string} options.attachTo.on The optional direction to place the Popper tooltip relative to the element.\n * - Possible string values: 'auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end'\n * @param {Object} options.advanceOn An action on the page which should advance shepherd to the next step.\n * It should be an object with a string `selector` and an `event` name\n * ```js\n * const step = new Step(tour, {\n * advanceOn: { selector: '.some .selector-path', event: 'click' },\n * ...moreOptions\n * });\n * ```\n * `event` doesn’t have to be an event inside the tour, it can be any event fired on any element on the page.\n * You can also always manually advance the Tour by calling `myTour.next()`.\n * @param {function} options.beforeShowPromise A function that returns a promise.\n * When the promise resolves, the rest of the `show` code for the step will execute.\n * @param {Object[]} options.buttons An array of buttons to add to the step. These will be rendered in a\n * footer below the main body text.\n * @param {function} options.buttons.button.action A function executed when the button is clicked on.\n * It is automatically bound to the `tour` the step is associated with, so things like `this.next` will\n * work inside the action.\n * You can use action to skip steps or navigate to specific steps, with something like:\n * ```js\n * action() {\n * return this.show('some_step_name');\n * }\n * ```\n * @param {string} options.buttons.button.classes Extra classes to apply to the `<a>`\n * @param {boolean} options.buttons.button.disabled Should the button be disabled?\n * @param {string} options.buttons.button.label The aria-label text of the button\n * @param {boolean} options.buttons.button.secondary If true, a shepherd-button-secondary class is applied to the button\n * @param {string} options.buttons.button.text The HTML text of the button\n * @param {boolean} options.canClickTarget A boolean, that when set to false, will set `pointer-events: none` on the target\n * @param {object} options.cancelIcon Options for the cancel icon\n * @param {boolean} options.cancelIcon.enabled Should a cancel “✕” be shown in the header of the step?\n * @param {string} options.cancelIcon.label The label to add for `aria-label`\n * @param {string} options.classes A string of extra classes to add to the step's content element.\n * @param {string} options.highlightClass An extra class to apply to the `attachTo` element when it is\n * highlighted (that is, when its step is active). You can then target that selector in your CSS.\n * @param {string} options.id The string to use as the `id` for the step.\n * @param {number} options.modalOverlayOpeningPadding An amount of padding to add around the modal overlay opening\n * @param {number} options.modalOverlayOpeningRadius An amount of border radius to add around the modal overlay opening\n * @param {object} options.popperOptions Extra options to pass to Popper\n * @param {boolean|Object} options.scrollTo Should the element be scrolled to when this step is shown? If true, uses the default `scrollIntoView`,\n * if an object, passes that object as the params to `scrollIntoView` i.e. `{behavior: 'smooth', block: 'center'}`\n * @param {function} options.scrollToHandler A function that lets you override the default scrollTo behavior and\n * define a custom action to do the scrolling, and possibly other logic.\n * @param {function} options.showOn A function that, when it returns `true`, will show the step.\n * If it returns false, the step will be skipped.\n * @param {string} options.text The text in the body of the step. It can be one of three types:\n * ```\n * - HTML string\n * - `HTMLElement` object\n * - `Function` to be executed when the step is built. It must return one the two options above.\n * ```\n * @param {string} options.title The step's title. It becomes an `h3` at the top of the step. It can be one of two types:\n * ```\n * - HTML string\n * - `Function` to be executed when the step is built. It must return HTML string.\n * ```\n * @param {object} options.when You can define `show`, `hide`, etc events inside `when`. For example:\n * ```js\n * when: {\n * show: function() {\n * window.scrollTo(0, 0);\n * }\n * }\n * ```\n * @return {Step} The newly created Step instance\n */\n constructor(tour, options = {}) {\n super(tour, options);\n this.tour = tour;\n this.classPrefix = this.tour.options\n ? normalizePrefix(this.tour.options.classPrefix)\n : '';\n this.styles = tour.styles;\n\n autoBind(this);\n\n this._setOptions(options);\n\n return this;\n }\n\n /**\n * Cancel the tour\n * Triggers the `cancel` event\n */\n cancel() {\n this.tour.cancel();\n this.trigger('cancel');\n }\n\n /**\n * Complete the tour\n * Triggers the `complete` event\n */\n complete() {\n this.tour.complete();\n this.trigger('complete');\n }\n\n /**\n * Remove the step, delete the step's element, and destroy the Popper instance for the step.\n * Triggers `destroy` event\n */\n destroy() {\n if (this.tooltip) {\n this.tooltip.destroy();\n this.tooltip = null;\n }\n\n if (isHTMLElement(this.el) && this.el.parentNode) {\n this.el.parentNode.removeChild(this.el);\n this.el = null;\n }\n\n this._updateStepTargetOnHide();\n\n this.trigger('destroy');\n }\n\n /**\n * Returns the tour for the step\n * @return {Tour} The tour instance\n */\n getTour() {\n return this.tour;\n }\n\n /**\n * Hide the step\n */\n hide() {\n this.tour.modal.hide();\n\n this.trigger('before-hide');\n\n if (this.el) {\n this.el.hidden = true;\n }\n\n this._updateStepTargetOnHide();\n\n this.trigger('hide');\n }\n\n /**\n * Checks if the step should be centered or not\n * @return {boolean} True if the step is centered\n */\n isCentered() {\n const attachToOptions = parseAttachTo(this);\n return !attachToOptions.element || !attachToOptions.on;\n }\n\n /**\n * Check if the step is open and visible\n * @return {boolean} True if the step is open and visible\n */\n isOpen() {\n return Boolean(this.el && !this.el.hidden);\n }\n\n /**\n * Wraps `_show` and ensures `beforeShowPromise` resolves before calling show\n * @return {*|Promise}\n */\n show() {\n if (isFunction(this.options.beforeShowPromise)) {\n const beforeShowPromise = this.options.beforeShowPromise();\n if (!isUndefined(beforeShowPromise)) {\n return beforeShowPromise.then(() => this._show());\n }\n }\n this._show();\n }\n\n /**\n * Updates the options of the step.\n *\n * @param {Object} options The options for the step\n */\n updateStepOptions(options) {\n Object.assign(this.options, options);\n\n if (this.shepherdElementComponent) {\n this.shepherdElementComponent.$set({ step: this });\n }\n }\n\n /**\n * Returns the element for the step\n * @return {HTMLElement|null|undefined} The element instance. undefined if it has never been shown, null if it has been destroyed\n */\n getElement() {\n return this.el;\n }\n\n /**\n * Returns the target for the step\n * @return {HTMLElement|null|undefined} The element instance. undefined if it has never been shown, null if query string has not been found\n */\n getTarget() {\n return this.target;\n }\n\n /**\n * Creates Shepherd element for step based on options\n *\n * @return {Element} The DOM element for the step tooltip\n * @private\n */\n _createTooltipContent() {\n const descriptionId = `${this.id}-description`;\n const labelId = `${this.id}-label`;\n\n this.shepherdElementComponent = new ShepherdElement({\n target: this.tour.options.stepsContainer || document.body,\n props: {\n classPrefix: this.classPrefix,\n descriptionId,\n labelId,\n step: this,\n styles: this.styles\n }\n });\n\n return this.shepherdElementComponent.getElement();\n }\n\n /**\n * If a custom scrollToHandler is defined, call that, otherwise do the generic\n * scrollIntoView call.\n *\n * @param {boolean|Object} scrollToOptions If true, uses the default `scrollIntoView`,\n * if an object, passes that object as the params to `scrollIntoView` i.e. `{ behavior: 'smooth', block: 'center' }`\n * @private\n */\n _scrollTo(scrollToOptions) {\n const { element } = parseAttachTo(this);\n\n if (isFunction(this.options.scrollToHandler)) {\n this.options.scrollToHandler(element);\n } else if (\n isElement(element) &&\n typeof element.scrollIntoView === 'function'\n ) {\n element.scrollIntoView(scrollToOptions);\n }\n }\n\n /**\n * _getClassOptions gets all possible classes for the step\n * @param {Object} stepOptions The step specific options\n * @returns {String} unique string from array of classes\n * @private\n */\n _getClassOptions(stepOptions) {\n const defaultStepOptions =\n this.tour && this.tour.options && this.tour.options.defaultStepOptions;\n const stepClasses = stepOptions.classes ? stepOptions.classes : '';\n const defaultStepOptionsClasses =\n defaultStepOptions && defaultStepOptions.classes\n ? defaultStepOptions.classes\n : '';\n const allClasses = [\n ...stepClasses.split(' '),\n ...defaultStepOptionsClasses.split(' ')\n ];\n const uniqClasses = new Set(allClasses);\n\n return Array.from(uniqClasses).join(' ').trim();\n }\n\n /**\n * Sets the options for the step, maps `when` to events, sets up buttons\n * @param {Object} options The options for the step\n * @private\n */\n _setOptions(options = {}) {\n let tourOptions =\n this.tour && this.tour.options && this.tour.options.defaultStepOptions;\n\n tourOptions = merge({}, tourOptions || {});\n\n this.options = Object.assign(\n {\n arrow: true\n },\n tourOptions,\n options\n );\n\n const { when } = this.options;\n\n this.options.classes = this._getClassOptions(options);\n\n this.destroy();\n this.id = this.options.id || `step-${uuid()}`;\n\n if (when) {\n Object.keys(when).forEach((event) => {\n this.on(event, when[event], this);\n });\n }\n }\n\n /**\n * Create the element and set up the Popper instance\n * @private\n */\n _setupElements() {\n if (!isUndefined(this.el)) {\n this.destroy();\n }\n\n this.el = this._createTooltipContent();\n\n if (this.options.advanceOn) {\n bindAdvance(this);\n }\n setupTooltip(this);\n }\n\n /**\n * Triggers `before-show`, generates the tooltip DOM content,\n * sets up a Popper instance for the tooltip, then triggers `show`.\n * @private\n */\n _show() {\n this.trigger('before-show');\n\n this._setupElements();\n\n if (!this.tour.modal) {\n this.tour._setupModal();\n }\n\n this.tour.modal.setupForStep(this);\n this._styleTargetElementForStep(this);\n this.el.hidden = false;\n\n // start scrolling to target before showing the step\n if (this.options.scrollTo) {\n setTimeout(() => {\n this._scrollTo(this.options.scrollTo);\n });\n }\n\n this.el.hidden = false;\n\n const content = this.shepherdElementComponent.getElement();\n const target = this.target || document.body;\n target.classList.add(`${this.classPrefix}shepherd-enabled`);\n target.classList.add(`${this.classPrefix}shepherd-target`);\n content.classList.add('shepherd-enabled');\n\n this.trigger('show');\n }\n\n /**\n * Modulates the styles of the passed step's target element, based on the step's options and\n * the tour's `modal` option, to visually emphasize the element\n *\n * @param step The step object that attaches to the element\n * @private\n */\n _styleTargetElementForStep(step) {\n const targetElement = step.target;\n\n if (!targetElement) {\n return;\n }\n\n if (step.options.highlightClass) {\n targetElement.classList.add(step.options.highlightClass);\n }\n\n if (step.options.canClickTarget === false) {\n targetElement.classList.add('shepherd-target-click-disabled');\n }\n }\n\n /**\n * When a step is hidden, remove the highlightClass and 'shepherd-enabled'\n * and 'shepherd-target' classes\n * @private\n */\n _updateStepTargetOnHide() {\n const target = this.target || document.body;\n\n if (this.options.highlightClass) {\n target.classList.remove(this.options.highlightClass);\n }\n\n target.classList.remove(\n 'shepherd-target-click-disabled',\n `${this.classPrefix}shepherd-enabled`,\n `${this.classPrefix}shepherd-target`\n );\n }\n}\n","/**\n * Cleanup the steps and set pointerEvents back to 'auto'\n * @param tour The tour object\n */\nexport function cleanupSteps(tour) {\n if (tour) {\n const { steps } = tour;\n\n steps.forEach((step) => {\n if (step.options && step.options.canClickTarget === false && step.options.attachTo) {\n if (step.target instanceof HTMLElement) {\n step.target.classList.remove('shepherd-target-click-disabled');\n }\n }\n });\n }\n}\n","/**\n * Generates the svg path data for a rounded rectangle overlay\n * @param {Object} dimension - Dimensions of rectangle.\n * @param {number} width - Width.\n * @param {number} height - Height.\n * @param {number} [x=0] - Offset from top left corner in x axis. default 0.\n * @param {number} [y=0] - Offset from top left corner in y axis. default 0.\n * @param {number} [r=0] - Corner Radius. Keep this smaller than half of width or height.\n * @returns {string} - Rounded rectangle overlay path data.\n */\nexport function makeOverlayPath({ width, height, x = 0, y = 0, r = 0 }) {\n const { innerWidth: w, innerHeight: h } = window;\n\n return `M${w},${h}\\\nH0\\\nV0\\\nH${w}\\\nV${h}\\\nZ\\\nM${x + r},${y}\\\na${r},${r},0,0,0-${r},${r}\\\nV${height + y - r}\\\na${r},${r},0,0,0,${r},${r}\\\nH${width + x - r}\\\na${r},${r},0,0,0,${r}-${r}\\\nV${y + r}\\\na${r},${r},0,0,0-${r}-${r}\\\nZ`;\n}\n","<script>\n import { uuid } from '../utils/general.js';\n import { makeOverlayPath } from '../utils/overlay-path.js';\n\n export let element, openingProperties;\n const guid = uuid();\n let modalIsVisible = false;\n let rafId = undefined;\n let pathDefinition;\n\n $: pathDefinition = makeOverlayPath(openingProperties);\n\n closeModalOpening();\n\n export const getElement = () => element;\n\n export function closeModalOpening() {\n openingProperties = {\n width: 0,\n height: 0,\n x: 0,\n y: 0,\n r: 0\n };\n }\n\n /**\n * Hide the modal overlay\n */\n export function hide() {\n modalIsVisible = false;\n\n // Ensure we cleanup all event listeners when we hide the modal\n _cleanupStepEventListeners();\n }\n\n /**\n * Uses the bounds of the element we want the opening overtop of to set the dimensions of the opening and position it\n * @param {Number} modalOverlayOpeningPadding An amount of padding to add around the modal overlay opening\n * @param {Number} modalOverlayOpeningRadius An amount of border radius to add around the modal overlay opening\n * @param {HTMLElement} scrollParent The scrollable parent of the target element\n * @param {HTMLElement} targetElement The element the opening will expose\n */\n export function positionModal(\n modalOverlayOpeningPadding = 0,\n modalOverlayOpeningRadius = 0,\n scrollParent,\n targetElement\n ) {\n if (targetElement) {\n const { y, height } = _getVisibleHeight(targetElement, scrollParent);\n const { x, width, left } = targetElement.getBoundingClientRect();\n\n // getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top\n openingProperties = {\n width: width + modalOverlayOpeningPadding * 2,\n height: height + modalOverlayOpeningPadding * 2,\n x: (x || left) - modalOverlayOpeningPadding,\n y: y - modalOverlayOpeningPadding,\n r: modalOverlayOpeningRadius\n };\n } else {\n closeModalOpening();\n }\n }\n\n /**\n * If modal is enabled, setup the svg mask opening and modal overlay for the step\n * @param {Step} step The step instance\n */\n export function setupForStep(step) {\n // Ensure we move listeners from the previous step, before we setup new ones\n _cleanupStepEventListeners();\n\n if (step.tour.options.useModalOverlay) {\n _styleForStep(step);\n show();\n } else {\n hide();\n }\n }\n\n /**\n * Show the modal overlay\n */\n export function show() {\n modalIsVisible = true;\n }\n\n const _preventModalBodyTouch = (e) => {\n e.preventDefault();\n };\n\n const _preventModalOverlayTouch = (e) => {\n e.stopPropagation();\n };\n\n /**\n * Add touchmove event listener\n * @private\n */\n function _addStepEventListeners() {\n // Prevents window from moving on touch.\n window.addEventListener('touchmove', _preventModalBodyTouch, {\n passive: false\n });\n }\n\n /**\n * Cancel the requestAnimationFrame loop and remove touchmove event listeners\n * @private\n */\n function _cleanupStepEventListeners() {\n if (rafId) {\n cancelAnimationFrame(rafId);\n rafId = undefined;\n }\n\n window.removeEventListener('touchmove', _preventModalBodyTouch, {\n passive: false\n });\n }\n\n /**\n * Style the modal for the step\n * @param {Step} step The step to style the opening for\n * @private\n */\n function _styleForStep(step) {\n const {\n modalOverlayOpeningPadding,\n modalOverlayOpeningRadius\n } = step.options;\n\n const scrollParent = _getScrollParent(step.target);\n\n // Setup recursive function to call requestAnimationFrame to update the modal opening position\n const rafLoop = () => {\n rafId = undefined;\n positionModal(\n modalOverlayOpeningPadding,\n modalOverlayOpeningRadius,\n scrollParent,\n step.target\n );\n rafId = requestAnimationFrame(rafLoop);\n };\n\n rafLoop();\n\n _addStepEventListeners();\n }\n\n /**\n * Find the closest scrollable parent element\n * @param {HTMLElement} element The target element\n * @returns {HTMLElement}\n * @private\n */\n function _getScrollParent(element) {\n if (!element) {\n return null;\n }\n\n const isHtmlElement = element instanceof HTMLElement;\n const overflowY =\n isHtmlElement && window.getComputedStyle(element).overflowY;\n const isScrollable = overflowY !== 'hidden' && overflowY !== 'visible';\n\n if (isScrollable && element.scrollHeight >= element.clientHeight) {\n return element;\n }\n\n return _getScrollParent(element.parentElement);\n }\n\n /**\n * Get the visible height of the target element relative to its scrollParent.\n * If there is no scroll parent, the height of the element is returned.\n *\n * @param {HTMLElement} element The target element\n * @param {HTMLElement} [scrollParent] The scrollable parent element\n * @returns {{y: number, height: number}}\n * @private\n */\n function _getVisibleHeight(element, scrollParent) {\n const elementRect = element.getBoundingClientRect();\n let top = elementRect.y || elementRect.top;\n let bottom = elementRect.bottom || top + elementRect.height;\n\n if (scrollParent) {\n const scrollRect = scrollParent.getBoundingClientRect();\n const scrollTop = scrollRect.y || scrollRect.top;\n const scrollBottom = scrollRect.bottom || scrollTop + scrollRect.height;\n\n top = Math.max(top, scrollTop);\n bottom = Math.min(bottom, scrollBottom);\n }\n\n const height = Math.max(bottom - top, 0); // Default to 0 if height is negative\n\n return { y: top, height };\n }\n</script>\n\n<svg\n bind:this={element}\n class={`${\n modalIsVisible ? 'shepherd-modal-is-visible' : ''\n } shepherd-modal-overlay-container`}\n on:touchmove={_preventModalOverlayTouch}\n>\n <path d={pathDefinition} />\n</svg>\n\n<style global>\n .shepherd-modal-overlay-container {\n -ms-filter: progid:dximagetransform.microsoft.gradient.alpha(Opacity=50);\n filter: alpha(opacity=50);\n height: 0;\n left: 0;\n opacity: 0;\n overflow: hidden;\n pointer-events: none;\n position: fixed;\n top: 0;\n transition: all 0.3s ease-out, height 0ms 0.3s, opacity 0.3s 0ms;\n width: 100vw;\n z-index: 9997;\n }\n\n .shepherd-modal-overlay-container.shepherd-modal-is-visible {\n height: 100vh;\n opacity: 0.5;\n transition: all 0.3s ease-out, height 0s 0s, opacity 0.3s 0s;\n }\n\n .shepherd-modal-overlay-container.shepherd-modal-is-visible path {\n pointer-events: all;\n }\n</style>\n","import { Evented } from './evented.js';\nimport { Step } from './step.js';\nimport autoBind from './utils/auto-bind.js';\nimport { isHTMLElement, isFunction, isString, isUndefined } from './utils/type-check.js';\nimport { cleanupSteps } from './utils/cleanup.js';\nimport { normalizePrefix, uuid } from './utils/general.js';\nimport ShepherdModal from './components/shepherd-modal.svelte';\n\nconst Shepherd = new Evented();\n\n/**\n * Class representing the site tour\n * @extends {Evented}\n */\nexport class Tour extends Evented {\n /**\n * @param {Object} options The options for the tour\n * @param {boolean} options.confirmCancel If true, will issue a `window.confirm` before cancelling\n * @param {string} options.confirmCancelMessage The message to display in the confirm dialog\n * @param {string} options.classPrefix The prefix to add to the `shepherd-enabled` and `shepherd-target` class names as well as the `data-shepherd-step-id`.\n * @param {Object} options.defaultStepOptions Default options for Steps ({@link Step#constructor}), created through `addStep`\n * @param {boolean} options.exitOnEsc Exiting the tour with the escape key will be enabled unless this is explicitly\n * set to false.\n * @param {boolean} options.keyboardNavigation Navigating the tour via left and right arrow keys will be enabled\n * unless this is explicitly set to false.\n * @param {HTMLElement} options.stepsContainer An optional container element for the steps.\n * If not set, the steps will be appended to `document.body`.\n * @param {HTMLElement} options.modalContainer An optional container element for the modal.\n * If not set, the modal will be appended to `document.body`.\n * @param {object[] | Step[]} options.steps An array of step options objects or Step instances to initialize the tour with\n * @param {string} options.tourName An optional \"name\" for the tour. This will be appended to the the tour's\n * dynamically generated `id` property -- which is also set on the `body` element as the `data-shepherd-active-tour` attribute\n * whenever the tour becomes active.\n * @param {boolean} options.useModalOverlay Whether or not steps should be placed above a darkened\n * modal overlay. If true, the overlay will create an opening around the target element so that it\n * can remain interactive\n * @returns {Tour}\n */\n constructor(options = {}) {\n super(options);\n\n autoBind(this);\n\n const defaultTourOptions = {\n exitOnEsc: true,\n keyboardNavigation: true\n };\n\n this.options = Object.assign({}, defaultTourOptions, options);\n this.classPrefix = normalizePrefix(this.options.classPrefix);\n this.steps = [];\n this.addSteps(this.options.steps);\n\n // Pass these events onto the global Shepherd object\n const events = ['active', 'cancel', 'complete', 'inactive', 'show', 'start'];\n events.map((event) => {\n ((e) => {\n this.on(e, (opts) => {\n opts = opts || {};\n opts.tour = this;\n Shepherd.trigger(e, opts);\n });\n })(event);\n });\n\n this._setTourID();\n\n return this;\n }\n\n /**\n * Adds a new step to the tour\n * @param {Object|Step} options An object containing step options or a Step instance\n * @param {number} index The optional index to insert the step at. If undefined, the step\n * is added to the end of the array.\n * @return {Step} The newly added step\n */\n addStep(options, index) {\n let step = options;\n\n if (!(step instanceof Step)) {\n step = new Step(this, step);\n } else {\n step.tour = this;\n }\n\n if (!isUndefined(index)) {\n this.steps.splice(index, 0, step);\n } else {\n this.steps.push(step);\n }\n\n return step;\n }\n\n /**\n * Add multiple steps to the tour\n * @param {Array<object> | Array<Step>} steps The steps to add to the tour\n */\n addSteps(steps) {\n if (Array.isArray(steps)) {\n steps.forEach((step) => {\n this.addStep(step);\n });\n }\n\n return this;\n }\n\n /**\n * Go to the previous step in the tour\n */\n back() {\n const index = this.steps.indexOf(this.currentStep);\n this.show(index - 1, false);\n }\n\n /**\n * Calls _done() triggering the 'cancel' event\n * If `confirmCancel` is true, will show a window.confirm before cancelling\n */\n cancel() {\n if (this.options.confirmCancel) {\n const cancelMessage = this.options.confirmCancelMessage || 'Are you sure you want to stop the tour?';\n const stopTour = window.confirm(cancelMessage);\n if (stopTour) {\n this._done('cancel');\n }\n } else {\n this._done('cancel');\n }\n }\n\n /**\n * Calls _done() triggering the `complete` event\n */\n complete() {\n this._done('complete');\n }\n\n /**\n * Gets the step from a given id\n * @param {Number|String} id The id of the step to retrieve\n * @return {Step} The step corresponding to the `id`\n */\n getById(id) {\n return this.steps.find((step) => {\n return step.id === id;\n });\n }\n\n /**\n * Gets the current step\n * @returns {Step|null}\n */\n getCurrentStep() {\n return this.currentStep;\n }\n\n /**\n * Hide the current step\n */\n hide() {\n const currentStep = this.getCurrentStep();\n\n if (currentStep) {\n return currentStep.hide();\n }\n }\n\n /**\n * Check if the tour is active\n * @return {boolean}\n */\n isActive() {\n return Shepherd.activeTour === this;\n }\n\n /**\n * Go to the next step in the tour\n * If we are at the end, call `complete`\n */\n next() {\n const index = this.steps.indexOf(this.currentStep);\n\n if (index === this.steps.length - 1) {\n this.complete();\n } else {\n this.show(index + 1, true);\n }\n }\n\n /**\n * Removes the step from the tour\n * @param {String} name The id for the step to remove\n */\n removeStep(name) {\n const current = this.getCurrentStep();\n\n // Find the step, destroy it and remove it from this.steps\n this.steps.some((step, i) => {\n if (step.id === name) {\n if (step.isOpen()) {\n step.hide();\n }\n\n step.destroy();\n this.steps.splice(i, 1);\n\n return true;\n }\n });\n\n if (current && current.id === name) {\n this.currentStep = undefined;\n\n // If we have steps left, show the first one, otherwise just cancel the tour\n this.steps.length ? this.show(0) : this.cancel();\n }\n }\n\n /**\n * Show a specific step in the tour\n * @param {Number|String} key The key to look up the step by\n * @param {Boolean} forward True if we are going forward, false if backward\n */\n show(key = 0, forward = true) {\n const step = isString(key) ? this.getById(key) : this.steps[key];\n\n if (step) {\n this._updateStateBeforeShow();\n\n const shouldSkipStep = isFunction(step.options.showOn) && !step.options.showOn();\n\n // If `showOn` returns false, we want to skip the step, otherwise, show the step like normal\n if (shouldSkipStep) {\n this._skipStep(step, forward);\n } else {\n this.trigger('show', {\n step,\n previous: this.currentStep\n });\n\n this.currentStep = step;\n step.show();\n }\n }\n }\n\n /**\n * Start the tour\n */\n start() {\n this.trigger('start');\n\n // Save the focused element before the tour opens\n this.focusedElBeforeOpen = document.activeElement;\n\n this.currentStep = null;\n\n this._setupModal();\n\n this._setupActiveTour();\n this.next();\n }\n\n /**\n * Called whenever the tour is cancelled or completed, basically anytime we exit the tour\n * @param {String} event The event name to trigger\n * @private\n */\n _done(event) {\n const index = this.steps.indexOf(this.currentStep);\n if (Array.isArray(this.steps)) {\n this.steps.forEach((step) => step.destroy());\n }\n\n cleanupSteps(this);\n\n this.trigger(event, { index });\n\n Shepherd.activeTour = null;\n this.trigger('inactive', { tour: this });\n\n if (this.modal) {\n this.modal.hide();\n }\n\n if (event === 'cancel' || event === 'complete') {\n if (this.modal) {\n const modalContainer = document.querySelector('.shepherd-modal-overlay-container');\n\n if (modalContainer) {\n modalContainer.remove();\n }\n }\n }\n\n // Focus the element that was focused before the tour started\n if (isHTMLElement(this.focusedElBeforeOpen)) {\n this.focusedElBeforeOpen.focus();\n }\n }\n\n /**\n * Make this tour \"active\"\n * @private\n */\n _setupActiveTour() {\n this.trigger('active', { tour: this });\n\n Shepherd.activeTour = this;\n }\n\n /**\n * _setupModal create the modal container and instance\n * @private\n */\n _setupModal() {\n this.modal = new ShepherdModal({\n target: this.options.modalContainer || document.body,\n props:\n {\n classPrefix: this.classPrefix,\n styles: this.styles\n }\n });\n }\n\n /**\n * Called when `showOn` evaluates to false, to skip the step\n * @param {Step} step The step to skip\n * @param {Boolean} forward True if we are going forward, false if backward\n * @private\n */\n _skipStep(step, forward) {\n const index = this.steps.indexOf(step);\n const nextIndex = forward ? index + 1 : index - 1;\n this.show(nextIndex, forward);\n }\n\n /**\n * Before showing, hide the current step and if the tour is not\n * already active, call `this._setupActiveTour`.\n * @private\n */\n _updateStateBeforeShow() {\n if (this.currentStep) {\n this.currentStep.hide();\n }\n\n if (!this.isActive()) {\n this._setupActiveTour();\n }\n }\n\n /**\n * Sets this.id to `${tourName}--${uuid}`\n * @private\n */\n _setTourID() {\n const tourName = this.options.tourName || 'tour';\n\n this.id = `${tourName}--${uuid()}`;\n }\n}\n\nexport { Shepherd };\n","import { Step } from './step.js';\nimport { Shepherd, Tour } from './tour.js';\n\nObject.assign(Shepherd, { Tour, Step });\n\nexport default Shepherd;\n"],"names":["isMergeableObject","value","isNonNullObject","isSpecial","stringValue","Object","prototype","toString","call","isReactElement","canUseSymbol","Symbol","for","REACT_ELEMENT_TYPE","$$typeof","emptyTarget","val","Array","isArray","cloneUnlessOtherwiseSpecified","options","clone","deepmerge","defaultArrayMerge","target","source","concat","map","element","getMergeFunction","key","customMerge","getEnumerableOwnPropertySymbols","getOwnPropertySymbols","filter","symbol","propertyIsEnumerable","getKeys","keys","propertyIsOnObject","object","property","_","propertyIsUnsafe","hasOwnProperty","mergeObject","destination","forEach","arrayMerge","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","all","deepmergeAll","array","Error","reduce","prev","next","deepmerge_1","isElement","Element","isHTMLElement","HTMLElement","isFunction","isString","isUndefined","undefined","Evented","on","event","handler","ctx","once","bindings","push","off","binding","index","splice","trigger","args","context","apply","autoBind","self","getOwnPropertyNames","constructor","i","length","bind","_setupAdvanceOnHandler","selector","step","isOpen","targetIsEl","el","currentTarget","targetIsSelector","matches","tour","bindAdvance","advanceOn","document","querySelector","e","console","error","addEventListener","removeEventListener","body","top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","acc","placement","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","getNodeName","nodeName","toLowerCase","getWindow","node","window","ownerDocument","defaultView","OwnElement","isShadowRoot","ShadowRoot","applyStyles","_ref","state","elements","name","style","styles","attributes","assign","removeAttribute","setAttribute","effect","_ref2","initialStyles","position","strategy","margin","arrow","styleProperties","attribute","enabled","phase","fn","requires","getBasePlacement","split","getBoundingClientRect","rect","width","height","x","y","getLayoutRect","clientRect","offsetWidth","offsetHeight","Math","abs","offsetLeft","offsetTop","contains","parent","child","rootNode","getRootNode","isSameNode","parentNode","host","getComputedStyle","isTableElement","indexOf","getDocumentElement","documentElement","getParentNode","assignedSlot","getTrueOffsetParent","offsetParent","getContainingBlock","isFirefox","navigator","userAgent","currentNode","css","transform","perspective","contain","willChange","getOffsetParent","getMainAxisFromPlacement","max","min","round","within","mathMax","mathMin","getFreshSideObject","mergePaddingObject","paddingObject","expandToHashMap","hashMap","toPaddingObject","padding","rects","_state$modifiersData$","arrowElement","popperOffsets","modifiersData","basePlacement","axis","isVertical","len","arrowRect","minProp","maxProp","endDiff","startDiff","arrowOffsetParent","clientSize","clientHeight","clientWidth","centerToReference","center","offset","axisProp","centerOffset","_options$element","requiresIfExists","unsetSides","roundOffsetsByDPR","win","dpr","devicePixelRatio","mapToStyles","_Object$assign2","popperRect","offsets","gpuAcceleration","adaptive","roundOffsets","_ref3","_ref3$x","_ref3$y","hasX","hasY","sideX","sideY","heightProp","widthProp","commonStyles","_Object$assign","computeStyles","_ref4","_options$gpuAccelerat","_options$adaptive","_options$roundOffsets","data","passive","instance","_options$scroll","scroll","_options$resize","resize","scrollParents","scrollParent","update","hash","getOppositePlacement","replace","matched","getOppositeVariationPlacement","getWindowScroll","scrollLeft","pageXOffset","scrollTop","pageYOffset","getWindowScrollBarX","getViewportRect","html","visualViewport","test","getDocumentRect","_element$ownerDocumen","winScroll","scrollWidth","scrollHeight","direction","isScrollParent","_getComputedStyle","overflow","overflowX","overflowY","getScrollParent","listScrollParents","list","isBody","updatedList","rectToClientRect","getInnerBoundingClientRect","clientTop","clientLeft","getClientRectFromMixedType","clippingParent","getClippingParents","canEscapeClipping","clipperElement","getClippingRect","boundary","rootBoundary","mainClippingParents","firstClippingParent","clippingRect","accRect","getVariation","computeOffsets","variation","commonX","commonY","mainAxis","detectOverflow","_options","_options$placement","_options$boundary","_options$rootBoundary","_options$elementConte","elementContext","_options$altBoundary","altBoundary","_options$padding","altContext","referenceElement","clippingClientRect","contextElement","referenceClientRect","popperClientRect","elementClientRect","overflowOffsets","offsetData","multiply","computeAutoPlacement","flipVariations","_options$allowedAutoP","allowedAutoPlacements","allPlacements","allowedPlacements","overflows","sort","a","b","getExpandedFallbackPlacements","oppositePlacement","flip","_skip","_options$mainAxis","checkMainAxis","_options$altAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","_options$flipVariatio","preferredPlacement","isBasePlacement","referenceRect","checksMap","Map","makeFallbackChecks","firstFittingPlacement","_basePlacement","isStartVariation","mainVariationSide","altVariationSide","checks","every","check","set","numberOfChecks","_loop","_i","fittingPlacement","find","get","slice","_ret","reset","getSideOffsets","preventedOffsets","isAnySideFullyClipped","some","side","hide","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","distanceAndSkiddingToXY","invertDistance","skidding","distance","_options$offset","_data$state$placement","getAltAxis","_options$tether","tether","_options$tetherOffset","tetherOffset","tetherOffsetValue","mainSide","altSide","additive","minLen","maxLen","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","clientOffset","offsetModifierValue","tetherMin","tetherMax","preventedOffset","_mainSide","_altSide","_offset","_min","_max","_preventedOffset","getHTMLElementScroll","getNodeScroll","getCompositeRect","elementOrVirtualElement","isFixed","isOffsetParentAnElement","order","modifiers","visited","Set","result","modifier","add","dep","has","depModifier","orderModifiers","orderedModifiers","debounce","pending","Promise","resolve","then","mergeByName","merged","current","existing","DEFAULT_OPTIONS","areValidElements","_len","arguments","_key","popperGenerator","generatorOptions","_generatorOptions","_generatorOptions$def","defaultModifiers","_generatorOptions$def2","defaultOptions","createPopper","effectCleanupFns","isDestroyed","setOptions","cleanupModifierEffects","m","runModifierEffects","forceUpdate","_state$elements","_state$orderedModifie","_state$orderedModifie2","destroy","onFirstUpdate","_ref3$options","cleanupFn","noopFn","eventListeners","_getCenteredStylePopperModifier","makeCenteredPopper","centeredStylePopperModifier","popperOptions","setTimeout","focus","from","normalizePrefix","prefix","charAt","parseAttachTo","attachTo","returnOpts","setupTooltip","tooltip","attachToOptions","getPopperOptions","isCentered","content","shepherdElementComponent","getElement","classList","uuid","d","Date","now","c","r","random","floor","defaultStepOptions","_mergeModifiers","stepOptions","mergedPopperOptions","names","mod","filteredModifiers","includes","noop","tar","src","k","run","blank_object","create","run_all","fns","is_function","thing","safe_not_equal","is_empty","obj","append","appendChild","insert","anchor","insertBefore","detach","removeChild","destroy_each","iterations","detaching","createElement","svg_element","createElementNS","text","createTextNode","space","empty","listen","attr","getAttribute","set_attributes","descriptors","getOwnPropertyDescriptors","__proto__","cssText","children","childNodes","toggle_class","toggle","current_component","set_current_component","component","get_current_component","onMount","$$","on_mount","afterUpdate","after_update","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","update_scheduled","schedule_update","flush","add_render_callback","flushing","seen_callbacks","pop","callback","clear","fragment","before_update","dirty","p","outroing","outros","group_outros","check_outros","transition_in","block","local","delete","transition_out","o","get_spread_update","levels","updates","to_null_out","accounted_for","$$scope","n","create_component","mount_component","on_destroy","new_on_destroy","destroy_component","make_dirty","fill","init","create_fragment","not_equal","props","parent_component","bound","callbacks","skip_bound","ready","ret","rest","hydrate","nodes","l","intro","SvelteComponent","$destroy","$on","type","$set","$$props","$$set","config","action","classes","disabled","label","secondary","getDisabled","$","buttons","cancelIcon","handleCancelClick","preventDefault","cancel","labelId","title","innerHTML","descriptionId","KEY_TAB","KEY_ESC","LEFT_ARROW","RIGHT_ARROW","getClassesArray","className","classPrefix","firstFocusableElement","focusableElements","lastFocusableElement","dataStepId","hasCancelIcon","hasTitle","id","querySelectorAll","updateDynamicClasses","removeClasses","addClasses","oldClasses","remove","newClasses","handleKeyDown","keyCode","shiftKey","activeElement","exitOnEsc","keyboardNavigation","back","polyfill","w","__forceSmoothScrollPolyfill__","SCROLL_TIME","original","scrollTo","scrollBy","elementScroll","scrollElement","scrollIntoView","performance","isMicrosoftBrowser","userAgentPatterns","RegExp","join","ROUNDING_TOLERANCE","ease","cos","PI","shouldBailOut","firstArg","behavior","TypeError","hasScrollableSpace","canOverflow","overflowValue","isScrollable","isScrollableY","isScrollableX","findScrollableParent","time","currentX","currentY","elapsed","startTime","startX","startY","method","scrollable","requestAnimationFrame","smoothScroll","scrollX","scrollY","SyntaxError","scrollableParent","parentRects","clientRects","module","smoothscroll","Step","_setOptions","complete","_updateStepTargetOnHide","getTour","modal","hidden","Boolean","show","beforeShowPromise","_show","updateStepOptions","getTarget","_createTooltipContent","ShepherdElement","stepsContainer","_scrollTo","scrollToOptions","scrollToHandler","_getClassOptions","stepClasses","defaultStepOptionsClasses","allClasses","uniqClasses","trim","tourOptions","merge","when","_setupElements","_setupModal","setupForStep","_styleTargetElementForStep","targetElement","highlightClass","canClickTarget","cleanupSteps","steps","makeOverlayPath","innerWidth","innerHeight","h","_getScrollParent","isHtmlElement","parentElement","_getVisibleHeight","elementRect","scrollRect","scrollBottom","openingProperties","modalIsVisible","rafId","pathDefinition","closeModalOpening","_cleanupStepEventListeners","positionModal","modalOverlayOpeningPadding","modalOverlayOpeningRadius","useModalOverlay","_styleForStep","_preventModalBodyTouch","_preventModalOverlayTouch","stopPropagation","_addStepEventListeners","cancelAnimationFrame","rafLoop","Shepherd","Tour","defaultTourOptions","addSteps","events","opts","_setTourID","addStep","currentStep","confirmCancel","cancelMessage","confirmCancelMessage","stopTour","confirm","_done","getById","getCurrentStep","isActive","activeTour","removeStep","forward","_updateStateBeforeShow","shouldSkipStep","showOn","_skipStep","previous","focusedElBeforeOpen","_setupActiveTour","modalContainer","ShepherdModal","nextIndex","tourName"],"mappings":";;;;;;;;CAEA,IAAIA,iBAAiB,GAAG,SAASA,iBAAT,CAA2BC,KAA3B,EAAkC;CACzD,SAAOC,eAAe,CAACD,KAAD,CAAf,IACH,CAACE,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nB,YAAAA,QAAQ,EAAE;CAHD,WAAX;CAKD;CACF,OAzCD;CA0CD;;CAED,IAAkE;;CAEhE0B,MAAAA,cAAA,GAAiB;CAAE/C,QAAAA,QAAQ,EAAEA;CAAZ,OAAjB;CACD;CAKF,GA/aA,GAAD;;;;CCcAgD,YAAY,CAAChD,QAAb;CAEA;CACA;CACA;CACA;;CACO,MAAMiD,IAAN,SAAmBvrB,OAAnB,CAA2B;CAChC;CACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACEmB,EAAAA,WAAW,CAACa,IAAD,EAAOhF,OAAO,GAAG,EAAjB,EAAqB;CAC9B,UAAMgF,IAAN,EAAYhF,OAAZ;CACA,SAAKgF,IAAL,GAAYA,IAAZ;CACA,SAAKglB,WAAL,GAAmB,KAAKhlB,IAAL,CAAUhF,OAAV,GACfsf,eAAe,CAAC,KAAKta,IAAL,CAAUhF,OAAV,CAAkBgqB,WAAnB,CADA,GAEf,EAFJ;CAGA,SAAK1hB,MAAL,GAActD,IAAI,CAACsD,MAAnB;CAEAtE,IAAAA,QAAQ,CAAC,IAAD,CAAR;;CAEA,SAAKwqB,WAAL,CAAiBxuB,OAAjB;;CAEA,WAAO,IAAP;CACD;CAED;CACF;CACA;CACA;;;CACEqpB,EAAAA,MAAM,GAAG;CACP,SAAKrkB,IAAL,CAAUqkB,MAAV;CACA,SAAKzlB,OAAL,CA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pB;CAEE1hB,QAAAA,MAAM,EAAE,KAAKA;CAFf;CAH6B,KAAlB,CAAb;CAQD;CAED;CACF;CACA;CACA;CACA;CACA;;;CACE0rB,EAAAA,SAAS,CAACvvB,IAAD,EAAOmvB,OAAP,EAAgB;CACvB,UAAMlwB,KAAK,GAAG,KAAKitB,KAAL,CAAWzlB,OAAX,CAAmBzG,IAAnB,CAAd;CACA,UAAM6vB,SAAS,GAAGV,OAAO,GAAGlwB,KAAK,GAAG,CAAX,GAAeA,KAAK,GAAG,CAAhD;CACA,SAAKqrB,IAAL,CAAUuF,SAAV,EAAqBV,OAArB;CACD;CAED;CACF;CACA;CACA;CACA;;;CACEC,EAAAA,sBAAsB,GAAG;CACvB,QAAI,KAAKb,WAAT,EAAsB;CACpB,WAAKA,WAAL,CAAiBna,IAAjB;CACD;;CAED,QAAI,CAAC,KAAK4a,QAAL,EAAL,EAAsB;CACpB,WAAKU,gBAAL;CACD;CACF;CAED;CACF;CACA;CACA;;;CACErB,EAAAA,UAAU,GAAG;CACX,UAAMyB,QAAQ,GAAG,KAAKv0B,OAAL,CAAau0B,QAAb,IAAyB,MAA1C;CAEA,SAAKhK,EAAL,GAAW,GAAEgK,QAAS,KAAIlU,IAAI,EAAG,EAAjC;CACD;;CA9V+B;;CCXlCphB,MAAM,CAACuJ,MAAP,CAAcgqB,QAAd,EAAwB;CAAEC,EAAAA,IAAF;CAAQlE,EAAAA;CAAR,CAAxB;;;;"}
assets/js/tourguide.min.js CHANGED
@@ -1,9 +1,7 @@
1
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Shepherd=e()}(this,function(){"use strict";var t=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var n=Object.prototype.toString.call(t);return"[object RegExp]"===n||"[object Date]"===n||function(t){return t.$$typeof===e}(t)}(t)};var e="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function o(t,e,o){return t.concat(e).map(function(t){return n(t,o)})}function r(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return t.propertyIsEnumerable(e)}):[]}(t))}function i(t,e){try{return e in t}catch(t){return!1}}function s(t,e,o){var s={};return o.isMergeableObject(t)&&r(t).forEach(function(e){s[e]=n(t[e],o)}),r(e).forEach(function(r){(function(t,e){return i(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,r)||(i(t,r)&&o.isMergeableObject(e[r])?s[r]=function(t,e){if(!e.customMerge)return a;var n=e.customMerge(t);return"function"==typeof n?n:a}(r,o)(t[r],e[r],o):s[r]=n(e[r],o))}),s}function a(e,r,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(r);return a===Array.isArray(e)?a?i.arrayMerge(e,r,i):s(e,r,i):n(r,i)}a.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,n){return a(t,n,e)},{})};var l=a;function c(t){return t instanceof HTMLElement}function p(t){return"function"==typeof t}function u(t){return"string"==typeof t}function f(t){return void 0===t}class d{on(t,e,n,o=!1){return f(this.bindings)&&(this.bindings={}),f(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:o}),this}once(t,e,n){return this.on(t,e,n,!0)}off(t,e){return f(this.bindings)||f(this.bindings[t])?this:(f(e)?delete this.bindings[t]:this.bindings[t].forEach((n,o)=>{n.handler===e&&this.bindings[t].splice(o,1)}),this)}trigger(t,...e){return!f(this.bindings)&&this.bindings[t]&&this.bindings[t].forEach((n,o)=>{const{ctx:r,handler:i,once:s}=n,a=r||this;i.apply(a,e),s&&this.bindings[t].splice(o,1)}),this}}function h(t){const e=Object.getOwnPropertyNames(t.constructor.prototype);for(let n=0;n<e.length;n++){const o=e[n],r=t[o];"constructor"!==o&&"function"==typeof r&&(t[o]=r.bind(t))}return t}function m(t){const{event:e,selector:n}=t.options.advanceOn||{};if(!e)return console.error("advanceOn was defined, but no event name was passed.");{const o=function(t,e){return n=>{if(e.isOpen()){const o=e.el&&n.currentTarget===e.el;(!f(t)&&n.currentTarget.matches(t)||o)&&e.tour.next()}}}(n,t);let r;try{r=document.querySelector(n)}catch(t){}if(!f(n)&&!r)return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);r?(r.addEventListener(e,o),t.on("destroy",()=>r.removeEventListener(e,o))):(document.body.addEventListener(e,o,!0),t.on("destroy",()=>document.body.removeEventListener(e,o,!0)))}}var g="top",b="bottom",y="right",v="left",x="auto",w=[g,b,y,v],$="start",O="end",E="clippingParents",S="viewport",T="popper",I="reference",j=w.reduce(function(t,e){return t.concat([e+"-"+$,e+"-"+O])},[]),_=[].concat(w,[x]).reduce(function(t,e){return t.concat([e,e+"-"+$,e+"-"+O])},[]),L=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function A(t){return t?(t.nodeName||"").toLowerCase():null}function M(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function k(t){return t instanceof M(t).Element||t instanceof Element}function C(t){return t instanceof M(t).HTMLElement||t instanceof HTMLElement}function P(t){return"undefined"!=typeof ShadowRoot&&(t instanceof M(t).ShadowRoot||t instanceof ShadowRoot)}var B={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},r=e.elements[t];C(r)&&A(r)&&(Object.assign(r.style,n),Object.keys(o).forEach(function(t){var e=o[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var o=e.elements[t],r=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});C(o)&&A(o)&&(Object.assign(o.style,i),Object.keys(r).forEach(function(t){o.removeAttribute(t)}))})}},requires:["computeStyles"]};function D(t){return t.split("-")[0]}function H(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function R(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function W(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&P(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function N(t){return M(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(A(t))>=0}function q(t){return((k(t)?t.ownerDocument:t.document)||window.document).documentElement}function V(t){return"html"===A(t)?t:t.assignedSlot||t.parentNode||(P(t)?t.host:null)||q(t)}function Y(t){return C(t)&&"fixed"!==N(t).position?t.offsetParent:null}function X(t){for(var e=M(t),n=Y(t);n&&F(n)&&"static"===N(n).position;)n=Y(n);return n&&("html"===A(n)||"body"===A(n)&&"static"===N(n).position)?e:n||function(t){for(var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=V(t);C(n)&&["html","body"].indexOf(A(n))<0;){var o=N(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function U(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var z=Math.max,Z=Math.min,K=Math.round;function G(t,e,n){return z(t,Z(e,n))}function J(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Q(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}var tt=function(t,e){return J("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Q(t,w))};var et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nt(t){var e,n=t.popper,o=t.popperRect,r=t.placement,i=t.offsets,s=t.position,a=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,p=!0===c?function(t){var e=t.x,n=t.y,o=window.devicePixelRatio||1;return{x:K(K(e*o+20)/o)||0,y:K(K(n*o)/o)||0}}(i):"function"==typeof c?c(i):i,u=p.x,f=void 0===u?0:u,d=p.y,h=void 0===d?0:d,m=i.hasOwnProperty("x"),x=i.hasOwnProperty("y"),w=v,$=g,O=window;if(l){var E=X(n),S="clientHeight",T="clientWidth";E===M(n)&&"static"!==N(E=q(n)).position&&(S="scrollHeight",T="scrollWidth"),E=E,r===g&&($=b,h-=E[S]-o.height,h*=a?1:-1),r===v&&(w=y,f-=E[T]-o.width,f*=a?1:-1)}var I,j=Object.assign({position:s},l&&et);return a?Object.assign({},j,((I={})[$]=x?"0":"",I[w]=m?"0":"",I.transform=(O.devicePixelRatio||1)<2?"translate("+f+"px, "+h+"px)":"translate3d("+f+"px, "+h+"px, 0)",I)):Object.assign({},j,((e={})[$]=x?h+"px":"",e[w]=m?f+"px":"",e.transform="",e))}var ot={passive:!0};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function it(t){return t.replace(/left|right|bottom|top/g,function(t){return rt[t]})}var st={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,function(t){return st[t]})}function lt(t){var e=M(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ct(t){return H(q(t)).left+lt(t).scrollLeft}function pt(t){var e=N(t),n=e.overflow,o=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function ut(t,e){var n;void 0===e&&(e=[]);var o=function t(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:C(e)&&pt(e)?e:t(V(e))}(t),r=o===(null==(n=t.ownerDocument)?void 0:n.body),i=M(o),s=r?[i].concat(i.visualViewport||[],pt(o)?o:[]):o,a=e.concat(s);return r?a:a.concat(ut(V(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function dt(t,e){return e===S?ft(function(t){var e=M(t),n=q(t),o=e.visualViewport,r=n.clientWidth,i=n.clientHeight,s=0,a=0;return o&&(r=o.width,i=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=o.offsetLeft,a=o.offsetTop)),{width:r,height:i,x:s+ct(t),y:a}}(t)):C(e)?function(t){var e=H(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):ft(function(t){var e,n=q(t),o=lt(t),r=null==(e=t.ownerDocument)?void 0:e.body,i=z(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=z(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+ct(t),l=-o.scrollTop;return"rtl"===N(r||n).direction&&(a+=z(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(q(t)))}function ht(t,e,n){var o="clippingParents"===e?function(t){var e=ut(V(t)),n=["absolute","fixed"].indexOf(N(t).position)>=0&&C(t)?X(t):t;return k(n)?e.filter(function(t){return k(t)&&W(t,n)&&"body"!==A(t)}):[]}(t):[].concat(e),r=[].concat(o,[n]),i=r[0],s=r.reduce(function(e,n){var o=dt(t,n);return e.top=z(o.top,e.top),e.right=Z(o.right,e.right),e.bottom=Z(o.bottom,e.bottom),e.left=z(o.left,e.left),e},dt(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function mt(t){return t.split("-")[1]}function gt(t){var e,n=t.reference,o=t.element,r=t.placement,i=r?D(r):null,s=r?mt(r):null,a=n.x+n.width/2-o.width/2,l=n.y+n.height/2-o.height/2;switch(i){case g:e={x:a,y:n.y-o.height};break;case b:e={x:a,y:n.y+n.height};break;case y:e={x:n.x+n.width,y:l};break;case v:e={x:n.x-o.width,y:l};break;default:e={x:n.x,y:n.y}}var c=i?U(i):null;if(null!=c){var p="y"===c?"height":"width";switch(s){case $:e[c]=e[c]-(n[p]/2-o[p]/2);break;case O:e[c]=e[c]+(n[p]/2-o[p]/2)}}return e}function bt(t,e){void 0===e&&(e={});var n=e,o=n.placement,r=void 0===o?t.placement:o,i=n.boundary,s=void 0===i?E:i,a=n.rootBoundary,l=void 0===a?S:a,c=n.elementContext,p=void 0===c?T:c,u=n.altBoundary,f=void 0!==u&&u,d=n.padding,h=void 0===d?0:d,m=J("number"!=typeof h?h:Q(h,w)),v=p===T?I:T,x=t.elements.reference,$=t.rects.popper,O=t.elements[f?v:p],j=ht(k(O)?O:O.contextElement||q(t.elements.popper),s,l),_=H(x),L=gt({reference:_,element:$,strategy:"absolute",placement:r}),A=ft(Object.assign({},$,L)),M=p===T?A:_,C={top:j.top-M.top+m.top,bottom:M.bottom-j.bottom+m.bottom,left:j.left-M.left+m.left,right:M.right-j.right+m.right},P=t.modifiersData.offset;if(p===T&&P){var B=P[r];Object.keys(C).forEach(function(t){var e=[y,b].indexOf(t)>=0?1:-1,n=[g,b].indexOf(t)>=0?"y":"x";C[t]+=B[n]*e})}return C}function yt(t,e){void 0===e&&(e={});var n=e,o=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?_:l,p=mt(o),u=p?a?j:j.filter(function(t){return mt(t)===p}):w,f=u.filter(function(t){return c.indexOf(t)>=0});0===f.length&&(f=u);var d=f.reduce(function(e,n){return e[n]=bt(t,{placement:n,boundary:r,rootBoundary:i,padding:s})[D(n)],e},{});return Object.keys(d).sort(function(t,e){return d[t]-d[e]})}function vt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function xt(t){return[g,y,b,v].some(function(e){return t[e]>=0})}function wt(t,e,n){void 0===n&&(n=!1);var o,r,i=q(e),s=H(t),a=C(e),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!n)&&(("body"!==A(e)||pt(i))&&(l=(o=e)!==M(o)&&C(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:lt(o)),C(e)?((c=H(e)).x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=ct(i))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function $t(t){var e=new Map,n=new Set,o=[];return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||function t(r){n.add(r.name),[].concat(r.requires||[],r.requiresIfExists||[]).forEach(function(o){if(!n.has(o)){var r=e.get(o);r&&t(r)}}),o.push(r)}(t)}),o}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function Et(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function St(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,o=void 0===n?[]:n,r=e.defaultOptions,i=void 0===r?Ot:r;return function(t,e,n){void 0===n&&(n=i);var r,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ot,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,p={state:a,setOptions:function(n){u(),a.options=Object.assign({},i,a.options,n),a.scrollParents={reference:k(t)?ut(t):t.contextElement?ut(t.contextElement):[],popper:ut(e)};var r,s,c=function(t){var e=$t(t);return L.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((r=[].concat(o,a.options.modifiers),s=r.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(s).map(function(t){return s[t]})));return a.orderedModifiers=c.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.name,n=t.options,o=void 0===n?{}:n,r=t.effect;if("function"==typeof r){var i=r({state:a,name:e,instance:p,options:o});l.push(i||function(){})}}),p.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(Et(e,n)){a.rects={reference:wt(e,X(n),"fixed"===a.options.strategy),popper:R(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var o=0;o<a.orderedModifiers.length;o++)if(!0!==a.reset){var r=a.orderedModifiers[o],i=r.fn,s=r.options,l=void 0===s?{}:s,u=r.name;"function"==typeof i&&(a=i({state:a,options:l,name:u,instance:p})||a)}else a.reset=!1,o=-1}}},update:(r=function(){return new Promise(function(t){p.forceUpdate(),t(a)})},function(){return s||(s=new Promise(function(t){Promise.resolve().then(function(){s=void 0,t(r())})})),s}),destroy:function(){u(),c=!0}};if(!Et(t,e))return p;function u(){l.forEach(function(t){return t()}),l=[]}return p.setOptions(n).then(function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)}),p}}var Tt=St({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,r=o.scroll,i=void 0===r||r,s=o.resize,a=void 0===s||s,l=M(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(t){t.addEventListener("scroll",n.update,ot)}),a&&l.addEventListener("resize",n.update,ot),function(){i&&c.forEach(function(t){t.removeEventListener("scroll",n.update,ot)}),a&&l.removeEventListener("resize",n.update,ot)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:D(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,nt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,nt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},B,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,r=n.offset,i=void 0===r?[0,0]:r,s=_.reduce(function(t,n){return t[n]=function(t,e,n){var o=D(t),r=[v,g].indexOf(o)>=0?-1:1,i="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*r,[v,y].indexOf(o)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,i),t},{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[o]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name;if(!e.modifiersData[o]._skip){for(var r=n.mainAxis,i=void 0===r||r,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,f=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,w=e.options.placement,O=D(w),E=l||(O!==w&&h?function(t){if(D(t)===x)return[];var e=it(t);return[at(t),e,at(e)]}(w):[it(w)]),S=[w].concat(E).reduce(function(t,n){return t.concat(D(n)===x?yt(e,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)},[]),T=e.rects.reference,I=e.rects.popper,j=new Map,_=!0,L=S[0],A=0;A<S.length;A++){var M=S[A],k=D(M),C=mt(M)===$,P=[g,b].indexOf(k)>=0,B=P?"width":"height",H=bt(e,{placement:M,boundary:p,rootBoundary:u,altBoundary:f,padding:c}),R=P?C?y:v:C?b:g;T[B]>I[B]&&(R=it(R));var W=it(R),N=[];if(i&&N.push(H[k]<=0),a&&N.push(H[R]<=0,H[W]<=0),N.every(function(t){return t})){L=M,_=!1;break}j.set(M,N)}if(_)for(var F=function(t){var e=S.find(function(e){var n=j.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return L=e,"break"},q=h?3:1;q>0&&"break"!==F(q);q--);e.placement!==L&&(e.modifiersData[o]._skip=!0,e.placement=L,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name,r=n.mainAxis,i=void 0===r||r,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,p=n.altBoundary,u=n.padding,f=n.tether,d=void 0===f||f,h=n.tetherOffset,m=void 0===h?0:h,x=bt(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:p}),w=D(e.placement),O=mt(e.placement),E=!O,S=U(w),T="x"===S?"y":"x",I=e.modifiersData.popperOffsets,j=e.rects.reference,_=e.rects.popper,L="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,A={x:0,y:0};if(I){if(i||a){var M="y"===S?g:v,k="y"===S?b:y,C="y"===S?"height":"width",P=I[S],B=I[S]+x[M],H=I[S]-x[k],W=d?-_[C]/2:0,N=O===$?j[C]:_[C],F=O===$?-_[C]:-j[C],q=e.elements.arrow,V=d&&q?R(q):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},K=Y[M],J=Y[k],Q=G(0,j[C],V[C]),tt=E?j[C]/2-W-Q-K-L:N-Q-K-L,et=E?-j[C]/2+W+Q+J+L:F+Q+J+L,nt=e.elements.arrow&&X(e.elements.arrow),ot=nt?"y"===S?nt.clientTop||0:nt.clientLeft||0:0,rt=e.modifiersData.offset?e.modifiersData.offset[e.placement][S]:0,it=I[S]+tt-rt-ot,st=I[S]+et-rt;if(i){var at=G(d?Z(B,it):B,P,d?z(H,st):H);I[S]=at,A[S]=at-P}if(a){var lt="x"===S?g:v,ct="x"===S?b:y,pt=I[T],ut=pt+x[lt],ft=pt-x[ct],dt=G(d?Z(ut,it):ut,pt,d?z(ft,st):ft);I[T]=dt,A[T]=dt-pt}}e.modifiersData[o]=A}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,o=t.name,r=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=D(n.placement),l=U(a),c=[v,y].indexOf(a)>=0?"height":"width";if(i&&s){var p=tt(r.padding,n),u=R(i),f="y"===l?g:v,d="y"===l?b:y,h=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],x=X(i),w=x?"y"===l?x.clientHeight||0:x.clientWidth||0:0,$=h/2-m/2,O=p[f],E=w-u[c]-p[d],S=w/2-u[c]/2+$,T=G(O,S,E),I=l;n.modifiersData[o]=((e={})[I]=T,e.centerOffset=T-S,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&W(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,s=bt(e,{elementContext:"reference"}),a=bt(e,{altBoundary:!0}),l=vt(s,o),c=vt(a,r,i),p=xt(l),u=xt(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}}]});function It(){return(It=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function jt(t){const e=[{name:"applyStyles",fn({state:t}){Object.keys(t.elements).forEach(e=>{if("popper"!==e)return;const n=t.attributes[e]||{},o=t.elements[e];Object.assign(o.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),Object.keys(n).forEach(t=>{const e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})})}},{name:"computeStyles",options:{adaptive:!1}}];let n={placement:"top",strategy:"fixed",modifiers:[{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{t.el&&t.el.focus()},300)}}]};return n=It({},n,{modifiers:Array.from(new Set([...n.modifiers,...e]))})}function _t(t){return u(t)&&""!==t?"-"!==t.charAt(t.length-1)?`${t}-`:t:""}function Lt(t){const e=t.options.attachTo||{},n=Object.assign({},e);if(u(e.element)){try{n.element=document.querySelector(e.element)}catch(t){}n.element||console.error(`The element for this Shepherd step was not found ${e.element}`)}return n}function At(t){t.tooltip&&t.tooltip.destroy();const e=Lt(t);let n=e.element;const o=function(t,e){let n={modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{e.el&&e.el.focus()},300)}}],strategy:"absolute"};e.isCentered()?n=jt(e):n.placement=t.on;const o=e.tour&&e.tour.options&&e.tour.options.defaultStepOptions;o&&(n=kt(o,n));return n=kt(e.options,n)}(e,t);if(t.isCentered()){n=document.body,t.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return t.tooltip=Tt(n,t.el,o),t.target=e.element,o}function Mt(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}function kt(t,e){if(t.popperOptions){let n=Object.assign({},e,t.popperOptions);if(t.popperOptions.modifiers&&t.popperOptions.modifiers.length>0){const o=t.popperOptions.modifiers.map(t=>t.name),r=e.modifiers.filter(t=>!o.includes(t.name));n.modifiers=Array.from(new Set([...r,...t.popperOptions.modifiers]))}return n}return e}function Ct(){}function Pt(t,e){for(const n in e)t[n]=e[n];return t}function Bt(t){return t()}function Dt(){return Object.create(null)}function Ht(t){t.forEach(Bt)}function Rt(t){return"function"==typeof t}function Wt(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function Nt(t,e){t.appendChild(e)}function Ft(t,e,n){t.insertBefore(e,n||null)}function qt(t){t.parentNode.removeChild(t)}function Vt(t){return document.createElement(t)}function Yt(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Xt(t){return document.createTextNode(t)}function Ut(){return Xt(" ")}function zt(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function Zt(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Kt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const o in e)null==e[o]?t.removeAttribute(o):"style"===o?t.style.cssText=e[o]:"__value"===o?t.value=t[o]=e[o]:n[o]&&n[o].set?t[o]=e[o]:Zt(t,o,e[o])}function Gt(t,e,n){t.classList[n?"add":"remove"](e)}let Jt;function Qt(t){Jt=t}function te(){if(!Jt)throw new Error("Function called outside component initialization");return Jt}function ee(t){te().$$.after_update.push(t)}const ne=[],oe=[],re=[],ie=[],se=Promise.resolve();let ae=!1;function le(t){re.push(t)}let ce=!1;const pe=new Set;function ue(){if(!ce){ce=!0;do{for(let t=0;t<ne.length;t+=1){const e=ne[t];Qt(e),fe(e.$$)}for(Qt(null),ne.length=0;oe.length;)oe.pop()();for(let t=0;t<re.length;t+=1){const e=re[t];pe.has(e)||(pe.add(e),e())}re.length=0}while(ne.length);for(;ie.length;)ie.pop()();ae=!1,ce=!1,pe.clear()}}function fe(t){if(null!==t.fragment){t.update(),Ht(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(le)}}const de=new Set;let he;function me(){he={r:0,c:[],p:he}}function ge(){he.r||Ht(he.c),he=he.p}function be(t,e){t&&t.i&&(de.delete(t),t.i(e))}function ye(t,e,n,o){if(t&&t.o){if(de.has(t))return;de.add(t),he.c.push(()=>{de.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}}function ve(t){t&&t.c()}function xe(t,e,n){const{fragment:o,on_mount:r,on_destroy:i,after_update:s}=t.$$;o&&o.m(e,n),le(()=>{const e=r.map(Bt).filter(Rt);i?i.push(...e):Ht(e),t.$$.on_mount=[]}),s.forEach(le)}function we(t,e){const n=t.$$;null!==n.fragment&&(Ht(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function $e(t,e){-1===t.$$.dirty[0]&&(ne.push(t),ae||(ae=!0,se.then(ue)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Oe(t,e,n,o,r,i,s=[-1]){const a=Jt;Qt(t);const l=t.$$={fragment:null,ctx:null,props:i,update:Ct,not_equal:r,bound:Dt(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:[]),callbacks:Dt(),dirty:s,skip_bound:!1};let c=!1;if(l.ctx=n?n(t,e.props||{},(e,n,...o)=>{const i=o.length?o[0]:n;return l.ctx&&r(l.ctx[e],l.ctx[e]=i)&&(!l.skip_bound&&l.bound[e]&&l.bound[e](i),c&&$e(t,e)),n}):[],l.update(),c=!0,Ht(l.before_update),l.fragment=!!o&&o(l.ctx),e.target){if(e.hydrate){const t=(p=e.target,Array.from(p.childNodes));l.fragment&&l.fragment.l(t),t.forEach(qt)}else l.fragment&&l.fragment.c();e.intro&&be(t.$$.fragment),xe(t,e.target,e.anchor),ue()}var p;Qt(a)}class Ee{$destroy(){we(this,1),this.$destroy=Ct}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Se(t){let e,n,o,r,i;return{c(){Zt(e=Vt("button"),"aria-label",n=t[3]?t[3]:null),Zt(e,"class",o=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`),e.disabled=t[2],Zt(e,"tabindex","0")},m(n,o){Ft(n,e,o),e.innerHTML=t[5],r||(i=zt(e,"click",function(){Rt(t[0])&&t[0].apply(this,arguments)}),r=!0)},p(r,[i]){t=r,32&i&&(e.innerHTML=t[5]),8&i&&n!==(n=t[3]?t[3]:null)&&Zt(e,"aria-label",n),18&i&&o!==(o=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`)&&Zt(e,"class",o),4&i&&(e.disabled=t[2])},i:Ct,o:Ct,d(t){t&&qt(e),r=!1,i()}}}function Te(t,e,n){let o,r,i,s,a,l,{config:c}=e,{step:u}=e;return t.$$set=(t=>{"config"in t&&n(6,c=t.config),"step"in t&&n(7,u=t.step)}),t.$$.update=(()=>{192&t.$$.dirty&&(n(0,o=c.action?c.action.bind(u.tour):null),n(1,r=c.classes),n(2,i=!!c.disabled&&function(t){return p(t)?t.call(u):t}(c.disabled)),n(3,s=c.label),n(4,a=c.secondary),n(5,l=c.text))}),[o,r,i,s,a,l,c,u]}class Ie extends Ee{constructor(t){super(),Oe(this,t,Te,Se,Wt,{config:6,step:7})}}function je(t,e,n){const o=t.slice();return o[2]=e[n],o}function _e(t){let e,n,o=t[1],r=[];for(let e=0;e<o.length;e+=1)r[e]=Le(je(t,o,e));const i=t=>ye(r[t],1,1,()=>{r[t]=null});return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=Xt("")},m(t,o){for(let e=0;e<r.length;e+=1)r[e].m(t,o);Ft(t,e,o),n=!0},p(t,n){if(3&n){let s;for(o=t[1],s=0;s<o.length;s+=1){const i=je(t,o,s);r[s]?(r[s].p(i,n),be(r[s],1)):(r[s]=Le(i),r[s].c(),be(r[s],1),r[s].m(e.parentNode,e))}for(me(),s=o.length;s<r.length;s+=1)i(s);ge()}},i(t){if(!n){for(let t=0;t<o.length;t+=1)be(r[t]);n=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)ye(r[t]);n=!1},d(t){!function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(r,t),t&&qt(e)}}}function Le(t){let e,n;return e=new Ie({props:{config:t[2],step:t[0]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};2&n&&(o.config=t[2]),1&n&&(o.step=t[0]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ae(t){let e,n,o=t[1]&&_e(t);return{c(){e=Vt("footer"),o&&o.c(),Zt(e,"class","shepherd-footer")},m(t,r){Ft(t,e,r),o&&o.m(e,null),n=!0},p(t,[n]){t[1]?o?(o.p(t,n),2&n&&be(o,1)):((o=_e(t)).c(),be(o,1),o.m(e,null)):o&&(me(),ye(o,1,1,()=>{o=null}),ge())},i(t){n||(be(o),n=!0)},o(t){ye(o),n=!1},d(t){t&&qt(e),o&&o.d()}}}function Me(t,e,n){let o,{step:r}=e;return t.$$set=(t=>{"step"in t&&n(0,r=t.step)}),t.$$.update=(()=>{1&t.$$.dirty&&n(1,o=r.options.buttons)}),[r,o]}class ke extends Ee{constructor(t){super(),Oe(this,t,Me,Ae,Wt,{step:0})}}function Ce(t){let e,n,o,r,i;return{c(){e=Vt("button"),(n=Vt("span")).textContent="×",Zt(n,"aria-hidden","true"),Zt(e,"aria-label",o=t[0].label?t[0].label:"Close Tour"),Zt(e,"class","shepherd-cancel-icon"),Zt(e,"type","button")},m(o,s){Ft(o,e,s),Nt(e,n),r||(i=zt(e,"click",t[1]),r=!0)},p(t,[n]){1&n&&o!==(o=t[0].label?t[0].label:"Close Tour")&&Zt(e,"aria-label",o)},i:Ct,o:Ct,d(t){t&&qt(e),r=!1,i()}}}function Pe(t,e,n){let{cancelIcon:o}=e,{step:r}=e;return t.$$set=(t=>{"cancelIcon"in t&&n(0,o=t.cancelIcon),"step"in t&&n(2,r=t.step)}),[o,t=>{t.preventDefault(),r.cancel()},r]}class Be extends Ee{constructor(t){super(),Oe(this,t,Pe,Ce,Wt,{cancelIcon:0,step:2})}}function De(t){let e;return{c(){Zt(e=Vt("h3"),"id",t[1]),Zt(e,"class","shepherd-title")},m(n,o){Ft(n,e,o),t[3](e)},p(t,[n]){2&n&&Zt(e,"id",t[1])},i:Ct,o:Ct,d(n){n&&qt(e),t[3](null)}}}function He(t,e,n){let{labelId:o}=e,{element:r}=e,{title:i}=e;return ee(()=>{p(i)&&n(2,i=i()),n(0,r.innerHTML=i,r)}),t.$$set=(t=>{"labelId"in t&&n(1,o=t.labelId),"element"in t&&n(0,r=t.element),"title"in t&&n(2,i=t.title)}),[r,o,i,function(t){oe[t?"unshift":"push"](()=>{n(0,r=t)})}]}class Re extends Ee{constructor(t){super(),Oe(this,t,He,De,Wt,{labelId:1,element:0,title:2})}}function We(t){let e,n;return e=new Re({props:{labelId:t[0],title:t[2]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};1&n&&(o.labelId=t[0]),4&n&&(o.title=t[2]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ne(t){let e,n;return e=new Be({props:{cancelIcon:t[3],step:t[1]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};8&n&&(o.cancelIcon=t[3]),2&n&&(o.step=t[1]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Fe(t){let e,n,o,r=t[2]&&We(t),i=t[3]&&t[3].enabled&&Ne(t);return{c(){e=Vt("header"),r&&r.c(),n=Ut(),i&&i.c(),Zt(e,"class","shepherd-header")},m(t,s){Ft(t,e,s),r&&r.m(e,null),Nt(e,n),i&&i.m(e,null),o=!0},p(t,[o]){t[2]?r?(r.p(t,o),4&o&&be(r,1)):((r=We(t)).c(),be(r,1),r.m(e,n)):r&&(me(),ye(r,1,1,()=>{r=null}),ge()),t[3]&&t[3].enabled?i?(i.p(t,o),8&o&&be(i,1)):((i=Ne(t)).c(),be(i,1),i.m(e,null)):i&&(me(),ye(i,1,1,()=>{i=null}),ge())},i(t){o||(be(r),be(i),o=!0)},o(t){ye(r),ye(i),o=!1},d(t){t&&qt(e),r&&r.d(),i&&i.d()}}}function qe(t,e,n){let o,r,{labelId:i}=e,{step:s}=e;return t.$$set=(t=>{"labelId"in t&&n(0,i=t.labelId),"step"in t&&n(1,s=t.step)}),t.$$.update=(()=>{2&t.$$.dirty&&(n(2,o=s.options.title),n(3,r=s.options.cancelIcon))}),[i,s,o,r]}class Ve extends Ee{constructor(t){super(),Oe(this,t,qe,Fe,Wt,{labelId:0,step:1})}}function Ye(t){let e;return{c(){Zt(e=Vt("div"),"class","shepherd-text"),Zt(e,"id",t[1])},m(n,o){Ft(n,e,o),t[3](e)},p(t,[n]){2&n&&Zt(e,"id",t[1])},i:Ct,o:Ct,d(n){n&&qt(e),t[3](null)}}}function Xe(t,e,n){let{descriptionId:o}=e,{element:r}=e,{step:i}=e;return ee(()=>{let{text:t}=i.options;p(t)&&(t=t.call(i)),c(t)?r.appendChild(t):n(0,r.innerHTML=t,r)}),t.$$set=(t=>{"descriptionId"in t&&n(1,o=t.descriptionId),"element"in t&&n(0,r=t.element),"step"in t&&n(2,i=t.step)}),[r,o,i,function(t){oe[t?"unshift":"push"](()=>{n(0,r=t)})}]}class Ue extends Ee{constructor(t){super(),Oe(this,t,Xe,Ye,Wt,{descriptionId:1,element:0,step:2})}}function ze(t){let e,n;return e=new Ve({props:{labelId:t[1],step:t[2]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};2&n&&(o.labelId=t[1]),4&n&&(o.step=t[2]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ze(t){let e,n;return e=new Ue({props:{descriptionId:t[0],step:t[2]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};1&n&&(o.descriptionId=t[0]),4&n&&(o.step=t[2]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ke(t){let e,n;return e=new ke({props:{step:t[2]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};4&n&&(o.step=t[2]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ge(t){let e,n,o,r,i=!f(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled,s=!f(t[2].options.text),a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length,l=i&&ze(t),c=s&&Ze(t),p=a&&Ke(t);return{c(){e=Vt("div"),l&&l.c(),n=Ut(),c&&c.c(),o=Ut(),p&&p.c(),Zt(e,"class","shepherd-content")},m(t,i){Ft(t,e,i),l&&l.m(e,null),Nt(e,n),c&&c.m(e,null),Nt(e,o),p&&p.m(e,null),r=!0},p(t,[r]){4&r&&(i=!f(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled),i?l?(l.p(t,r),4&r&&be(l,1)):((l=ze(t)).c(),be(l,1),l.m(e,n)):l&&(me(),ye(l,1,1,()=>{l=null}),ge()),4&r&&(s=!f(t[2].options.text)),s?c?(c.p(t,r),4&r&&be(c,1)):((c=Ze(t)).c(),be(c,1),c.m(e,o)):c&&(me(),ye(c,1,1,()=>{c=null}),ge()),4&r&&(a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length),a?p?(p.p(t,r),4&r&&be(p,1)):((p=Ke(t)).c(),be(p,1),p.m(e,null)):p&&(me(),ye(p,1,1,()=>{p=null}),ge())},i(t){r||(be(l),be(c),be(p),r=!0)},o(t){ye(l),ye(c),ye(p),r=!1},d(t){t&&qt(e),l&&l.d(),c&&c.d(),p&&p.d()}}}function Je(t,e,n){let{descriptionId:o}=e,{labelId:r}=e,{step:i}=e;return t.$$set=(t=>{"descriptionId"in t&&n(0,o=t.descriptionId),"labelId"in t&&n(1,r=t.labelId),"step"in t&&n(2,i=t.step)}),[o,r,i]}class Qe extends Ee{constructor(t){super(),Oe(this,t,Je,Ge,Wt,{descriptionId:0,labelId:1,step:2})}}function tn(t){let e;return{c(){Zt(e=Vt("div"),"class","shepherd-arrow"),Zt(e,"data-popper-arrow","")},m(t,n){Ft(t,e,n)},d(t){t&&qt(e)}}}function en(t){let e,n,o,r,i,s,a,l,c=t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on&&tn();o=new Qe({props:{descriptionId:t[2],labelId:t[3],step:t[4]}});let p=[{"aria-describedby":r=f(t[4].options.text)?null:t[2]},{"aria-labelledby":i=t[4].options.title?t[3]:null},t[1],{role:"dialog"},{tabindex:"0"}],u={};for(let t=0;t<p.length;t+=1)u=Pt(u,p[t]);return{c(){e=Vt("div"),c&&c.c(),n=Ut(),ve(o.$$.fragment),Kt(e,u),Gt(e,"shepherd-has-cancel-icon",t[5]),Gt(e,"shepherd-has-title",t[6]),Gt(e,"shepherd-element",!0)},m(r,i){Ft(r,e,i),c&&c.m(e,null),Nt(e,n),xe(o,e,null),t[13](e),s=!0,a||(l=zt(e,"keydown",t[7]),a=!0)},p(t,[a]){t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on?c||((c=tn()).c(),c.m(e,n)):c&&(c.d(1),c=null);const l={};4&a&&(l.descriptionId=t[2]),8&a&&(l.labelId=t[3]),16&a&&(l.step=t[4]),o.$set(l),Kt(e,u=function(t,e){const n={},o={},r={$$scope:1};let i=t.length;for(;i--;){const s=t[i],a=e[i];if(a){for(const t in s)t in a||(o[t]=1);for(const t in a)r[t]||(n[t]=a[t],r[t]=1);t[i]=a}else for(const t in s)r[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(p,[(!s||20&a&&r!==(r=f(t[4].options.text)?null:t[2]))&&{"aria-describedby":r},(!s||24&a&&i!==(i=t[4].options.title?t[3]:null))&&{"aria-labelledby":i},2&a&&t[1],{role:"dialog"},{tabindex:"0"}])),Gt(e,"shepherd-has-cancel-icon",t[5]),Gt(e,"shepherd-has-title",t[6]),Gt(e,"shepherd-element",!0)},i(t){s||(be(o.$$.fragment,t),s=!0)},o(t){ye(o.$$.fragment,t),s=!1},d(n){n&&qt(e),c&&c.d(),we(o),t[13](null),a=!1,l()}}}const nn=9,on=27,rn=37,sn=39;function an(t){return t.split(" ").filter(t=>!!t.length)}function ln(t,e,n){let o,r,i,{classPrefix:s}=e,{element:a}=e,{descriptionId:l}=e,{firstFocusableElement:c}=e,{focusableElements:p}=e,{labelId:f}=e,{lastFocusableElement:d}=e,{step:h}=e,{dataStepId:m}=e;var g;g=(()=>{n(1,m={[`data-${s}shepherd-step-id`]:h.id}),n(9,p=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=p[0]),n(10,d=p[p.length-1])}),te().$$.on_mount.push(g),ee(()=>{i!==h.options.classes&&(function(t){if(u(t)){const e=an(t);e.length&&a.classList.remove(...e)}}(i),function(t){if(u(t)){const e=an(t);e.length&&a.classList.add(...e)}}(i=h.options.classes))});return t.$$set=(t=>{"classPrefix"in t&&n(11,s=t.classPrefix),"element"in t&&n(0,a=t.element),"descriptionId"in t&&n(2,l=t.descriptionId),"firstFocusableElement"in t&&n(8,c=t.firstFocusableElement),"focusableElements"in t&&n(9,p=t.focusableElements),"labelId"in t&&n(3,f=t.labelId),"lastFocusableElement"in t&&n(10,d=t.lastFocusableElement),"step"in t&&n(4,h=t.step),"dataStepId"in t&&n(1,m=t.dataStepId)}),t.$$.update=(()=>{16&t.$$.dirty&&(n(5,o=h.options&&h.options.cancelIcon&&h.options.cancelIcon.enabled),n(6,r=h.options&&h.options.title))}),[a,m,l,f,h,o,r,t=>{const{tour:e}=h;switch(t.keyCode){case nn:if(0===p.length){t.preventDefault();break}t.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(t.preventDefault(),d.focus()):document.activeElement===d&&(t.preventDefault(),c.focus());break;case on:e.options.exitOnEsc&&h.cancel();break;case rn:e.options.keyboardNavigation&&e.back();break;case sn:e.options.keyboardNavigation&&e.next()}},c,p,d,s,()=>a,function(t){oe[t?"unshift":"push"](()=>{n(0,a=t)})}]}class cn extends Ee{constructor(t){super(),Oe(this,t,ln,en,Wt,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}var pn,un=(function(t,e){!function(){t.exports={polyfill:function(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style&&!0!==t.__forceSmoothScrollPolyfill__)){var n,o=t.HTMLElement||t.Element,r=468,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},s=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,a=(n=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):i.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var t=arguments[0].left,e=arguments[0].top;h.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(t){for(;t!==e.body&&!1===f(t);)t=t.parentNode||t.host;return t}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==e.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==t.getComputedStyle(n).position&&t.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(t,e){this.scrollLeft=t,this.scrollTop=e}function c(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(t,e){return"Y"===e?t.clientHeight+a<t.scrollHeight:"X"===e?t.clientWidth+a<t.scrollWidth:void 0}function u(e,n){var o=t.getComputedStyle(e,null)["overflow"+n];return"auto"===o||"scroll"===o}function f(t){var e=p(t,"Y")&&u(t,"Y"),n=p(t,"X")&&u(t,"X");return e||n}function d(e){var n,o,i,a,l=(s()-e.startTime)/r;a=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*a)),o=e.startX+(e.x-e.startX)*n,i=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,o,i),o===e.x&&i===e.y||t.requestAnimationFrame(d.bind(t,e))}function h(n,o,r){var a,c,p,u,f=s();n===e.body?(a=t,c=t.scrollX||t.pageXOffset,p=t.scrollY||t.pageYOffset,u=i.scroll):(a=n,c=n.scrollLeft,p=n.scrollTop,u=l),d({scrollable:a,method:u,startTime:f,startX:c,startY:p,x:o,y:r})}}}}()}(pn={exports:{}},pn.exports),pn.exports);un.polyfill,un.polyfill();class fn extends d{constructor(t,e={}){return super(t,e),this.tour=t,this.classPrefix=this.tour.options?_t(this.tour.options.classPrefix):"",this.styles=t.styles,h(this),this._setOptions(e),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),c(this.el)&&this.el.parentNode&&(this.el.parentNode.removeChild(this.el),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}isCentered(){const t=Lt(this);return!t.element||!t.on}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){if(p(this.options.beforeShowPromise)){const t=this.options.beforeShowPromise();if(!f(t))return t.then(()=>this._show())}this._show()}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const t=`${this.id}-description`,e=`${this.id}-label`;return this.shepherdElementComponent=new cn({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:e,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:e}=Lt(this);p(this.options.scrollToHandler)?this.options.scrollToHandler(e):e instanceof Element&&"function"==typeof e.scrollIntoView&&e.scrollIntoView(t)}_getClassOptions(t){const e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=t.classes?t.classes:"",o=e&&e.classes?e.classes:"",r=[...n.split(" "),...o.split(" ")],i=new Set(r);return Array.from(i).join(" ").trim()}_setOptions(t={}){let e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;e=l({},e||{}),this.options=Object.assign({arrow:!0},e,t);const{when:n}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||`step-${Mt()}`,n&&Object.keys(n).forEach(t=>{this.on(t,n[t],this)})}_setupElements(){f(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&m(this),At(this)}_show(){this.trigger("before-show"),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const t=this.shepherdElementComponent.getElement(),e=this.target||document.body;e.classList.add(`${this.classPrefix}shepherd-enabled`),e.classList.add(`${this.classPrefix}shepherd-target`),t.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(t){const e=t.target;e&&(t.options.highlightClass&&e.classList.add(t.options.highlightClass),!1===t.options.canClickTarget&&e.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const t=this.target||document.body;this.options.highlightClass&&t.classList.remove(this.options.highlightClass),t.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)}}function dn(t){let e,n,o,r,i;return{c(){e=Yt("svg"),Zt(n=Yt("path"),"d",t[2]),Zt(e,"class",o=`${t[1]?"shepherd-modal-is-visible":""} shepherd-modal-overlay-container`)},m(o,s){Ft(o,e,s),Nt(e,n),t[11](e),r||(i=zt(e,"touchmove",t[3]),r=!0)},p(t,[r]){4&r&&Zt(n,"d",t[2]),2&r&&o!==(o=`${t[1]?"shepherd-modal-is-visible":""} shepherd-modal-overlay-container`)&&Zt(e,"class",o)},i:Ct,o:Ct,d(n){n&&qt(e),t[11](null),r=!1,i()}}}function hn(t,e,n){let{element:o}=e,{openingProperties:r}=e;Mt();let i,s=!1,a=void 0;l();function l(){n(4,r={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,s=!1),d()}function p(t=0,e=0,o,i){if(i){const{y:s,height:a}=function(t,e){const n=t.getBoundingClientRect();let o=n.y||n.top,r=n.bottom||o+n.height;if(e){const t=e.getBoundingClientRect(),n=t.y||t.top,i=t.bottom||n+t.height;o=Math.max(o,n),r=Math.min(r,i)}return{y:o,height:Math.max(r-o,0)}}(i,o),{x:l,width:c,left:p}=i.getBoundingClientRect();n(4,r={width:c+2*t,height:a+2*t,x:(l||p)-t,y:s-t,r:e})}else l()}function u(){n(1,s=!0)}const f=t=>{t.preventDefault()};function d(){a&&(cancelAnimationFrame(a),a=void 0),window.removeEventListener("touchmove",f,{passive:!1})}return t.$$set=(t=>{"element"in t&&n(0,o=t.element),"openingProperties"in t&&n(4,r=t.openingProperties)}),t.$$.update=(()=>{16&t.$$.dirty&&n(2,i=function({width:t,height:e,x:n=0,y:o=0,r:r=0}){const{innerWidth:i,innerHeight:s}=window;return`M${i},${s}H0V0H${i}V${s}ZM${n+r},${o}a${r},${r},0,0,0-${r},${r}V${e+o-r}a${r},${r},0,0,0,${r},${r}H${t+n-r}a${r},${r},0,0,0,${r}-${r}V${o+r}a${r},${r},0,0,0-${r}-${r}Z`}(r))}),[o,s,i,t=>{t.stopPropagation()},r,()=>o,l,c,p,function(t){d(),t.tour.options.useModalOverlay?(function(t){const{modalOverlayOpeningPadding:e,modalOverlayOpeningRadius:n}=t.options,o=function t(e){if(!e)return null;const n=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==n&&"visible"!==n&&e.scrollHeight>=e.clientHeight?e:t(e.parentElement)}(t.target),r=()=>{a=void 0,p(e,n,o,t.target),a=requestAnimationFrame(r)};r(),window.addEventListener("touchmove",f,{passive:!1})}(t),u()):c()},u,function(t){oe[t?"unshift":"push"](()=>{n(0,o=t)})}]}class mn extends Ee{constructor(t){super(),Oe(this,t,hn,dn,Wt,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const gn=new d;return Object.assign(gn,{Tour:class extends d{constructor(t={}){return super(t),h(this),this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},t),this.classPrefix=_t(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map(t=>{(t=>{this.on(t,e=>{(e=e||{}).tour=this,gn.trigger(t,e)})})(t)}),this._setTourID(),this}addStep(t,e){let n=t;return n instanceof fn?n.tour=this:n=new fn(this,n),f(e)?this.steps.push(n):this.steps.splice(e,0,n),n}addSteps(t){return Array.isArray(t)&&t.forEach(t=>{this.addStep(t)}),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(t)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find(e=>e.id===t)}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return gn.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const e=this.getCurrentStep();this.steps.some((e,n)=>{if(e.id===t)return e.isOpen()&&e.hide(),e.destroy(),this.steps.splice(n,1),!0}),e&&e.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t=0,e=!0){const n=u(t)?this.getById(t):this.steps[t];n&&(this._updateStateBeforeShow(),p(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,e):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show()))}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(t){const e=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(t=>t.destroy()),function(t){if(t){const{steps:e}=t;e.forEach(t=>{t.options&&!1===t.options.canClickTarget&&t.options.attachTo&&t.target instanceof HTMLElement&&t.target.classList.remove("shepherd-target-click-disabled")})}}(this),this.trigger(t,{index:e}),gn.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===t||"complete"===t)&&this.modal){const t=document.querySelector(".shepherd-modal-overlay-container");t&&t.remove()}c(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),gn.activeTour=this}_setupModal(){this.modal=new mn({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(t,e){const n=this.steps.indexOf(t),o=e?n+1:n-1;this.show(o,e)}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const t=this.options.tourName||"tour";this.id=`${t}--${Mt()}`}},Step:fn}),gn});
2
  //# sourceMappingURL=shepherd.js.map
3
 
4
- let myTour = new Shepherd.Tour({
5
- // options here
6
- });
7
 
8
 
9
  var mycred_tour_data = [
@@ -12,7 +10,7 @@ var mycred_tour_data = [
12
  title: 'Singular'+ '<span class=num>1 of 6</span><span class="dashicons dashicons-dismiss cancel" onclick="myTour.cancel()"></span>',
13
  text: 'Admin can set the "Singular" point type label here.',
14
  attachTo: {
15
- element: '#mycred-setup-name-singular',
16
  on: 'bottom'
17
  },
18
  buttons: [
@@ -25,7 +23,7 @@ var mycred_tour_data = [
25
  title: 'Plural'+ '<span class=num>2 of 6</span><span class="dashicons dashicons-dismiss cancel" onclick="myTour.cancel()"></span>',
26
  text: 'Admin can set the "Plural" points type label here.',
27
  attachTo: {
28
- element: '#mycred-setup-name-plural',
29
  on: 'bottom'
30
  },
31
  buttons: [
@@ -40,10 +38,10 @@ var mycred_tour_data = [
40
  }
41
  ]},
42
  {
43
- title: 'Create Point-type'+ '<span class=num>3 of 6</span><span class="dashicons dashicons-dismiss cancel" onclick="myTour.cancel()"></span>',
44
- text: 'Click on the "Create Point Type" button to create the first point type.',
45
  attachTo: {
46
- element: '.button-large',
47
  on: 'bottom'
48
  },
49
  buttons: [
@@ -54,7 +52,11 @@ var mycred_tour_data = [
54
  },
55
  {
56
  text: 'Next',
57
- action: myTour.complete
 
 
 
 
58
  }
59
  ]},
60
  ],
@@ -112,10 +114,38 @@ var mycred_tour_data = [
112
  ]},
113
  ],
114
  ];
115
- if (typeof mycred_tour_guide !== 'undefined' && typeof mycred_tour_guide.step !== 'undefined') {
116
- myTour.addSteps( mycred_tour_data[ mycred_tour_guide.step - 1 ] );
117
- myTour.start();
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
 
121
  // Attach the touruide start evene to the button press
1
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Shepherd=e()}(this,function(){"use strict";var t=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var n=Object.prototype.toString.call(t);return"[object RegExp]"===n||"[object Date]"===n||function(t){return t.$$typeof===e}(t)}(t)};var e="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function o(t,e,o){return t.concat(e).map(function(t){return n(t,o)})}function r(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return t.propertyIsEnumerable(e)}):[]}(t))}function i(t,e){try{return e in t}catch(t){return!1}}function s(t,e,o){var s={};return o.isMergeableObject(t)&&r(t).forEach(function(e){s[e]=n(t[e],o)}),r(e).forEach(function(r){(function(t,e){return i(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,r)||(i(t,r)&&o.isMergeableObject(e[r])?s[r]=function(t,e){if(!e.customMerge)return a;var n=e.customMerge(t);return"function"==typeof n?n:a}(r,o)(t[r],e[r],o):s[r]=n(e[r],o))}),s}function a(e,r,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(r);return a===Array.isArray(e)?a?i.arrayMerge(e,r,i):s(e,r,i):n(r,i)}a.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,n){return a(t,n,e)},{})};var l=a;function c(t){return t instanceof HTMLElement}function p(t){return"function"==typeof t}function u(t){return"string"==typeof t}function f(t){return void 0===t}class d{on(t,e,n,o=!1){return f(this.bindings)&&(this.bindings={}),f(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:o}),this}once(t,e,n){return this.on(t,e,n,!0)}off(t,e){return f(this.bindings)||f(this.bindings[t])?this:(f(e)?delete this.bindings[t]:this.bindings[t].forEach((n,o)=>{n.handler===e&&this.bindings[t].splice(o,1)}),this)}trigger(t,...e){return!f(this.bindings)&&this.bindings[t]&&this.bindings[t].forEach((n,o)=>{const{ctx:r,handler:i,once:s}=n,a=r||this;i.apply(a,e),s&&this.bindings[t].splice(o,1)}),this}}function h(t){const e=Object.getOwnPropertyNames(t.constructor.prototype);for(let n=0;n<e.length;n++){const o=e[n],r=t[o];"constructor"!==o&&"function"==typeof r&&(t[o]=r.bind(t))}return t}function m(t){const{event:e,selector:n}=t.options.advanceOn||{};if(!e)return console.error("advanceOn was defined, but no event name was passed.");{const o=function(t,e){return n=>{if(e.isOpen()){const o=e.el&&n.currentTarget===e.el;(!f(t)&&n.currentTarget.matches(t)||o)&&e.tour.next()}}}(n,t);let r;try{r=document.querySelector(n)}catch(t){}if(!f(n)&&!r)return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);r?(r.addEventListener(e,o),t.on("destroy",()=>r.removeEventListener(e,o))):(document.body.addEventListener(e,o,!0),t.on("destroy",()=>document.body.removeEventListener(e,o,!0)))}}var g="top",b="bottom",y="right",v="left",x="auto",w=[g,b,y,v],$="start",O="end",E="clippingParents",S="viewport",T="popper",I="reference",j=w.reduce(function(t,e){return t.concat([e+"-"+$,e+"-"+O])},[]),_=[].concat(w,[x]).reduce(function(t,e){return t.concat([e,e+"-"+$,e+"-"+O])},[]),L=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function A(t){return t?(t.nodeName||"").toLowerCase():null}function M(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function k(t){return t instanceof M(t).Element||t instanceof Element}function C(t){return t instanceof M(t).HTMLElement||t instanceof HTMLElement}function P(t){return"undefined"!=typeof ShadowRoot&&(t instanceof M(t).ShadowRoot||t instanceof ShadowRoot)}var B={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},o=e.attributes[t]||{},r=e.elements[t];C(r)&&A(r)&&(Object.assign(r.style,n),Object.keys(o).forEach(function(t){var e=o[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var o=e.elements[t],r=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});C(o)&&A(o)&&(Object.assign(o.style,i),Object.keys(r).forEach(function(t){o.removeAttribute(t)}))})}},requires:["computeStyles"]};function D(t){return t.split("-")[0]}function H(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function R(t){var e=H(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function W(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&P(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function N(t){return M(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(A(t))>=0}function q(t){return((k(t)?t.ownerDocument:t.document)||window.document).documentElement}function V(t){return"html"===A(t)?t:t.assignedSlot||t.parentNode||(P(t)?t.host:null)||q(t)}function Y(t){return C(t)&&"fixed"!==N(t).position?t.offsetParent:null}function X(t){for(var e=M(t),n=Y(t);n&&F(n)&&"static"===N(n).position;)n=Y(n);return n&&("html"===A(n)||"body"===A(n)&&"static"===N(n).position)?e:n||function(t){for(var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=V(t);C(n)&&["html","body"].indexOf(A(n))<0;){var o=N(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||e&&"filter"===o.willChange||e&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||e}function U(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var z=Math.max,Z=Math.min,K=Math.round;function G(t,e,n){return z(t,Z(e,n))}function J(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Q(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}var tt=function(t,e){return J("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Q(t,w))};var et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nt(t){var e,n=t.popper,o=t.popperRect,r=t.placement,i=t.offsets,s=t.position,a=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,p=!0===c?function(t){var e=t.x,n=t.y,o=window.devicePixelRatio||1;return{x:K(K(e*o+20)/o)||0,y:K(K(n*o)/o)||0}}(i):"function"==typeof c?c(i):i,u=p.x,f=void 0===u?0:u,d=p.y,h=void 0===d?0:d,m=i.hasOwnProperty("x"),x=i.hasOwnProperty("y"),w=v,$=g,O=window;if(l){var E=X(n),S="clientHeight",T="clientWidth";E===M(n)&&"static"!==N(E=q(n)).position&&(S="scrollHeight",T="scrollWidth"),E=E,r===g&&($=b,h-=E[S]-o.height,h*=a?1:-1),r===v&&(w=y,f-=E[T]-o.width,f*=a?1:-1)}var I,j=Object.assign({position:s},l&&et);return a?Object.assign({},j,((I={})[$]=x?"0":"",I[w]=m?"0":"",I.transform=(O.devicePixelRatio||1)<2?"translate("+f+"px, "+h+"px)":"translate3d("+f+"px, "+h+"px, 0)",I)):Object.assign({},j,((e={})[$]=x?h+"px":"",e[w]=m?f+"px":"",e.transform="",e))}var ot={passive:!0};var rt={left:"right",right:"left",bottom:"top",top:"bottom"};function it(t){return t.replace(/left|right|bottom|top/g,function(t){return rt[t]})}var st={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,function(t){return st[t]})}function lt(t){var e=M(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ct(t){return H(q(t)).left+lt(t).scrollLeft}function pt(t){var e=N(t),n=e.overflow,o=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function ut(t,e){var n;void 0===e&&(e=[]);var o=function t(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:C(e)&&pt(e)?e:t(V(e))}(t),r=o===(null==(n=t.ownerDocument)?void 0:n.body),i=M(o),s=r?[i].concat(i.visualViewport||[],pt(o)?o:[]):o,a=e.concat(s);return r?a:a.concat(ut(V(s)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function dt(t,e){return e===S?ft(function(t){var e=M(t),n=q(t),o=e.visualViewport,r=n.clientWidth,i=n.clientHeight,s=0,a=0;return o&&(r=o.width,i=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=o.offsetLeft,a=o.offsetTop)),{width:r,height:i,x:s+ct(t),y:a}}(t)):C(e)?function(t){var e=H(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):ft(function(t){var e,n=q(t),o=lt(t),r=null==(e=t.ownerDocument)?void 0:e.body,i=z(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=z(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+ct(t),l=-o.scrollTop;return"rtl"===N(r||n).direction&&(a+=z(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(q(t)))}function ht(t,e,n){var o="clippingParents"===e?function(t){var e=ut(V(t)),n=["absolute","fixed"].indexOf(N(t).position)>=0&&C(t)?X(t):t;return k(n)?e.filter(function(t){return k(t)&&W(t,n)&&"body"!==A(t)}):[]}(t):[].concat(e),r=[].concat(o,[n]),i=r[0],s=r.reduce(function(e,n){var o=dt(t,n);return e.top=z(o.top,e.top),e.right=Z(o.right,e.right),e.bottom=Z(o.bottom,e.bottom),e.left=z(o.left,e.left),e},dt(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function mt(t){return t.split("-")[1]}function gt(t){var e,n=t.reference,o=t.element,r=t.placement,i=r?D(r):null,s=r?mt(r):null,a=n.x+n.width/2-o.width/2,l=n.y+n.height/2-o.height/2;switch(i){case g:e={x:a,y:n.y-o.height};break;case b:e={x:a,y:n.y+n.height};break;case y:e={x:n.x+n.width,y:l};break;case v:e={x:n.x-o.width,y:l};break;default:e={x:n.x,y:n.y}}var c=i?U(i):null;if(null!=c){var p="y"===c?"height":"width";switch(s){case $:e[c]=e[c]-(n[p]/2-o[p]/2);break;case O:e[c]=e[c]+(n[p]/2-o[p]/2)}}return e}function bt(t,e){void 0===e&&(e={});var n=e,o=n.placement,r=void 0===o?t.placement:o,i=n.boundary,s=void 0===i?E:i,a=n.rootBoundary,l=void 0===a?S:a,c=n.elementContext,p=void 0===c?T:c,u=n.altBoundary,f=void 0!==u&&u,d=n.padding,h=void 0===d?0:d,m=J("number"!=typeof h?h:Q(h,w)),v=p===T?I:T,x=t.elements.reference,$=t.rects.popper,O=t.elements[f?v:p],j=ht(k(O)?O:O.contextElement||q(t.elements.popper),s,l),_=H(x),L=gt({reference:_,element:$,strategy:"absolute",placement:r}),A=ft(Object.assign({},$,L)),M=p===T?A:_,C={top:j.top-M.top+m.top,bottom:M.bottom-j.bottom+m.bottom,left:j.left-M.left+m.left,right:M.right-j.right+m.right},P=t.modifiersData.offset;if(p===T&&P){var B=P[r];Object.keys(C).forEach(function(t){var e=[y,b].indexOf(t)>=0?1:-1,n=[g,b].indexOf(t)>=0?"y":"x";C[t]+=B[n]*e})}return C}function yt(t,e){void 0===e&&(e={});var n=e,o=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?_:l,p=mt(o),u=p?a?j:j.filter(function(t){return mt(t)===p}):w,f=u.filter(function(t){return c.indexOf(t)>=0});0===f.length&&(f=u);var d=f.reduce(function(e,n){return e[n]=bt(t,{placement:n,boundary:r,rootBoundary:i,padding:s})[D(n)],e},{});return Object.keys(d).sort(function(t,e){return d[t]-d[e]})}function vt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function xt(t){return[g,y,b,v].some(function(e){return t[e]>=0})}function wt(t,e,n){void 0===n&&(n=!1);var o,r,i=q(e),s=H(t),a=C(e),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!n)&&(("body"!==A(e)||pt(i))&&(l=(o=e)!==M(o)&&C(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:lt(o)),C(e)?((c=H(e)).x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=ct(i))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function $t(t){var e=new Map,n=new Set,o=[];return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||function t(r){n.add(r.name),[].concat(r.requires||[],r.requiresIfExists||[]).forEach(function(o){if(!n.has(o)){var r=e.get(o);r&&t(r)}}),o.push(r)}(t)}),o}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function Et(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function St(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,o=void 0===n?[]:n,r=e.defaultOptions,i=void 0===r?Ot:r;return function(t,e,n){void 0===n&&(n=i);var r,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ot,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,p={state:a,setOptions:function(n){u(),a.options=Object.assign({},i,a.options,n),a.scrollParents={reference:k(t)?ut(t):t.contextElement?ut(t.contextElement):[],popper:ut(e)};var r,s,c=function(t){var e=$t(t);return L.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((r=[].concat(o,a.options.modifiers),s=r.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(s).map(function(t){return s[t]})));return a.orderedModifiers=c.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.name,n=t.options,o=void 0===n?{}:n,r=t.effect;if("function"==typeof r){var i=r({state:a,name:e,instance:p,options:o});l.push(i||function(){})}}),p.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(Et(e,n)){a.rects={reference:wt(e,X(n),"fixed"===a.options.strategy),popper:R(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var o=0;o<a.orderedModifiers.length;o++)if(!0!==a.reset){var r=a.orderedModifiers[o],i=r.fn,s=r.options,l=void 0===s?{}:s,u=r.name;"function"==typeof i&&(a=i({state:a,options:l,name:u,instance:p})||a)}else a.reset=!1,o=-1}}},update:(r=function(){return new Promise(function(t){p.forceUpdate(),t(a)})},function(){return s||(s=new Promise(function(t){Promise.resolve().then(function(){s=void 0,t(r())})})),s}),destroy:function(){u(),c=!0}};if(!Et(t,e))return p;function u(){l.forEach(function(t){return t()}),l=[]}return p.setOptions(n).then(function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)}),p}}var Tt=St({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,r=o.scroll,i=void 0===r||r,s=o.resize,a=void 0===s||s,l=M(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(t){t.addEventListener("scroll",n.update,ot)}),a&&l.addEventListener("resize",n.update,ot),function(){i&&c.forEach(function(t){t.removeEventListener("scroll",n.update,ot)}),a&&l.removeEventListener("resize",n.update,ot)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=gt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:D(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,nt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,nt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},B,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,r=n.offset,i=void 0===r?[0,0]:r,s=_.reduce(function(t,n){return t[n]=function(t,e,n){var o=D(t),r=[v,g].indexOf(o)>=0?-1:1,i="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*r,[v,y].indexOf(o)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,i),t},{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[o]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name;if(!e.modifiersData[o]._skip){for(var r=n.mainAxis,i=void 0===r||r,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,f=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,w=e.options.placement,O=D(w),E=l||(O!==w&&h?function(t){if(D(t)===x)return[];var e=it(t);return[at(t),e,at(e)]}(w):[it(w)]),S=[w].concat(E).reduce(function(t,n){return t.concat(D(n)===x?yt(e,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)},[]),T=e.rects.reference,I=e.rects.popper,j=new Map,_=!0,L=S[0],A=0;A<S.length;A++){var M=S[A],k=D(M),C=mt(M)===$,P=[g,b].indexOf(k)>=0,B=P?"width":"height",H=bt(e,{placement:M,boundary:p,rootBoundary:u,altBoundary:f,padding:c}),R=P?C?y:v:C?b:g;T[B]>I[B]&&(R=it(R));var W=it(R),N=[];if(i&&N.push(H[k]<=0),a&&N.push(H[R]<=0,H[W]<=0),N.every(function(t){return t})){L=M,_=!1;break}j.set(M,N)}if(_)for(var F=function(t){var e=S.find(function(e){var n=j.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return L=e,"break"},q=h?3:1;q>0&&"break"!==F(q);q--);e.placement!==L&&(e.modifiersData[o]._skip=!0,e.placement=L,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name,r=n.mainAxis,i=void 0===r||r,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,p=n.altBoundary,u=n.padding,f=n.tether,d=void 0===f||f,h=n.tetherOffset,m=void 0===h?0:h,x=bt(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:p}),w=D(e.placement),O=mt(e.placement),E=!O,S=U(w),T="x"===S?"y":"x",I=e.modifiersData.popperOffsets,j=e.rects.reference,_=e.rects.popper,L="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,A={x:0,y:0};if(I){if(i||a){var M="y"===S?g:v,k="y"===S?b:y,C="y"===S?"height":"width",P=I[S],B=I[S]+x[M],H=I[S]-x[k],W=d?-_[C]/2:0,N=O===$?j[C]:_[C],F=O===$?-_[C]:-j[C],q=e.elements.arrow,V=d&&q?R(q):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},K=Y[M],J=Y[k],Q=G(0,j[C],V[C]),tt=E?j[C]/2-W-Q-K-L:N-Q-K-L,et=E?-j[C]/2+W+Q+J+L:F+Q+J+L,nt=e.elements.arrow&&X(e.elements.arrow),ot=nt?"y"===S?nt.clientTop||0:nt.clientLeft||0:0,rt=e.modifiersData.offset?e.modifiersData.offset[e.placement][S]:0,it=I[S]+tt-rt-ot,st=I[S]+et-rt;if(i){var at=G(d?Z(B,it):B,P,d?z(H,st):H);I[S]=at,A[S]=at-P}if(a){var lt="x"===S?g:v,ct="x"===S?b:y,pt=I[T],ut=pt+x[lt],ft=pt-x[ct],dt=G(d?Z(ut,it):ut,pt,d?z(ft,st):ft);I[T]=dt,A[T]=dt-pt}}e.modifiersData[o]=A}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,o=t.name,r=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=D(n.placement),l=U(a),c=[v,y].indexOf(a)>=0?"height":"width";if(i&&s){var p=tt(r.padding,n),u=R(i),f="y"===l?g:v,d="y"===l?b:y,h=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],x=X(i),w=x?"y"===l?x.clientHeight||0:x.clientWidth||0:0,$=h/2-m/2,O=p[f],E=w-u[c]-p[d],S=w/2-u[c]/2+$,T=G(O,S,E),I=l;n.modifiersData[o]=((e={})[I]=T,e.centerOffset=T-S,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=e.elements.popper.querySelector(o)))&&W(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,s=bt(e,{elementContext:"reference"}),a=bt(e,{altBoundary:!0}),l=vt(s,o),c=vt(a,r,i),p=xt(l),u=xt(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}}]});function It(){return(It=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function jt(t){const e=[{name:"applyStyles",fn({state:t}){Object.keys(t.elements).forEach(e=>{if("popper"!==e)return;const n=t.attributes[e]||{},o=t.elements[e];Object.assign(o.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),Object.keys(n).forEach(t=>{const e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})})}},{name:"computeStyles",options:{adaptive:!1}}];let n={placement:"top",strategy:"fixed",modifiers:[{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{t.el&&t.el.focus()},300)}}]};return n=It({},n,{modifiers:Array.from(new Set([...n.modifiers,...e]))})}function _t(t){return u(t)&&""!==t?"-"!==t.charAt(t.length-1)?`${t}-`:t:""}function Lt(t){const e=t.options.attachTo||{},n=Object.assign({},e);if(u(e.element)){try{n.element=document.querySelector(e.element)}catch(t){}n.element||console.error(`The element for this Shepherd step was not found ${e.element}`)}return n}function At(t){t.tooltip&&t.tooltip.destroy();const e=Lt(t);let n=e.element;const o=function(t,e){let n={modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{e.el&&e.el.focus()},300)}}],strategy:"absolute"};e.isCentered()?n=jt(e):n.placement=t.on;const o=e.tour&&e.tour.options&&e.tour.options.defaultStepOptions;o&&(n=kt(o,n));return n=kt(e.options,n)}(e,t);if(t.isCentered()){n=document.body,t.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return t.tooltip=Tt(n,t.el,o),t.target=e.element,o}function Mt(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}function kt(t,e){if(t.popperOptions){let n=Object.assign({},e,t.popperOptions);if(t.popperOptions.modifiers&&t.popperOptions.modifiers.length>0){const o=t.popperOptions.modifiers.map(t=>t.name),r=e.modifiers.filter(t=>!o.includes(t.name));n.modifiers=Array.from(new Set([...r,...t.popperOptions.modifiers]))}return n}return e}function Ct(){}function Pt(t,e){for(const n in e)t[n]=e[n];return t}function Bt(t){return t()}function Dt(){return Object.create(null)}function Ht(t){t.forEach(Bt)}function Rt(t){return"function"==typeof t}function Wt(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function Nt(t,e){t.appendChild(e)}function Ft(t,e,n){t.insertBefore(e,n||null)}function qt(t){t.parentNode.removeChild(t)}function Vt(t){return document.createElement(t)}function Yt(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Xt(t){return document.createTextNode(t)}function Ut(){return Xt(" ")}function zt(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function Zt(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Kt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const o in e)null==e[o]?t.removeAttribute(o):"style"===o?t.style.cssText=e[o]:"__value"===o?t.value=t[o]=e[o]:n[o]&&n[o].set?t[o]=e[o]:Zt(t,o,e[o])}function Gt(t,e,n){t.classList[n?"add":"remove"](e)}let Jt;function Qt(t){Jt=t}function te(){if(!Jt)throw new Error("Function called outside component initialization");return Jt}function ee(t){te().$$.after_update.push(t)}const ne=[],oe=[],re=[],ie=[],se=Promise.resolve();let ae=!1;function le(t){re.push(t)}let ce=!1;const pe=new Set;function ue(){if(!ce){ce=!0;do{for(let t=0;t<ne.length;t+=1){const e=ne[t];Qt(e),fe(e.$$)}for(Qt(null),ne.length=0;oe.length;)oe.pop()();for(let t=0;t<re.length;t+=1){const e=re[t];pe.has(e)||(pe.add(e),e())}re.length=0}while(ne.length);for(;ie.length;)ie.pop()();ae=!1,ce=!1,pe.clear()}}function fe(t){if(null!==t.fragment){t.update(),Ht(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(le)}}const de=new Set;let he;function me(){he={r:0,c:[],p:he}}function ge(){he.r||Ht(he.c),he=he.p}function be(t,e){t&&t.i&&(de.delete(t),t.i(e))}function ye(t,e,n,o){if(t&&t.o){if(de.has(t))return;de.add(t),he.c.push(()=>{de.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}}function ve(t){t&&t.c()}function xe(t,e,n){const{fragment:o,on_mount:r,on_destroy:i,after_update:s}=t.$$;o&&o.m(e,n),le(()=>{const e=r.map(Bt).filter(Rt);i?i.push(...e):Ht(e),t.$$.on_mount=[]}),s.forEach(le)}function we(t,e){const n=t.$$;null!==n.fragment&&(Ht(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function $e(t,e){-1===t.$$.dirty[0]&&(ne.push(t),ae||(ae=!0,se.then(ue)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Oe(t,e,n,o,r,i,s=[-1]){const a=Jt;Qt(t);const l=t.$$={fragment:null,ctx:null,props:i,update:Ct,not_equal:r,bound:Dt(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:[]),callbacks:Dt(),dirty:s,skip_bound:!1};let c=!1;if(l.ctx=n?n(t,e.props||{},(e,n,...o)=>{const i=o.length?o[0]:n;return l.ctx&&r(l.ctx[e],l.ctx[e]=i)&&(!l.skip_bound&&l.bound[e]&&l.bound[e](i),c&&$e(t,e)),n}):[],l.update(),c=!0,Ht(l.before_update),l.fragment=!!o&&o(l.ctx),e.target){if(e.hydrate){const t=(p=e.target,Array.from(p.childNodes));l.fragment&&l.fragment.l(t),t.forEach(qt)}else l.fragment&&l.fragment.c();e.intro&&be(t.$$.fragment),xe(t,e.target,e.anchor),ue()}var p;Qt(a)}class Ee{$destroy(){we(this,1),this.$destroy=Ct}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Se(t){let e,n,o,r,i;return{c(){Zt(e=Vt("button"),"aria-label",n=t[3]?t[3]:null),Zt(e,"class",o=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`),e.disabled=t[2],Zt(e,"tabindex","0")},m(n,o){Ft(n,e,o),e.innerHTML=t[5],r||(i=zt(e,"click",function(){Rt(t[0])&&t[0].apply(this,arguments)}),r=!0)},p(r,[i]){t=r,32&i&&(e.innerHTML=t[5]),8&i&&n!==(n=t[3]?t[3]:null)&&Zt(e,"aria-label",n),18&i&&o!==(o=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`)&&Zt(e,"class",o),4&i&&(e.disabled=t[2])},i:Ct,o:Ct,d(t){t&&qt(e),r=!1,i()}}}function Te(t,e,n){let o,r,i,s,a,l,{config:c}=e,{step:u}=e;return t.$$set=(t=>{"config"in t&&n(6,c=t.config),"step"in t&&n(7,u=t.step)}),t.$$.update=(()=>{192&t.$$.dirty&&(n(0,o=c.action?c.action.bind(u.tour):null),n(1,r=c.classes),n(2,i=!!c.disabled&&function(t){return p(t)?t.call(u):t}(c.disabled)),n(3,s=c.label),n(4,a=c.secondary),n(5,l=c.text))}),[o,r,i,s,a,l,c,u]}class Ie extends Ee{constructor(t){super(),Oe(this,t,Te,Se,Wt,{config:6,step:7})}}function je(t,e,n){const o=t.slice();return o[2]=e[n],o}function _e(t){let e,n,o=t[1],r=[];for(let e=0;e<o.length;e+=1)r[e]=Le(je(t,o,e));const i=t=>ye(r[t],1,1,()=>{r[t]=null});return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=Xt("")},m(t,o){for(let e=0;e<r.length;e+=1)r[e].m(t,o);Ft(t,e,o),n=!0},p(t,n){if(3&n){let s;for(o=t[1],s=0;s<o.length;s+=1){const i=je(t,o,s);r[s]?(r[s].p(i,n),be(r[s],1)):(r[s]=Le(i),r[s].c(),be(r[s],1),r[s].m(e.parentNode,e))}for(me(),s=o.length;s<r.length;s+=1)i(s);ge()}},i(t){if(!n){for(let t=0;t<o.length;t+=1)be(r[t]);n=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)ye(r[t]);n=!1},d(t){!function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(r,t),t&&qt(e)}}}function Le(t){let e,n;return e=new Ie({props:{config:t[2],step:t[0]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};2&n&&(o.config=t[2]),1&n&&(o.step=t[0]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ae(t){let e,n,o=t[1]&&_e(t);return{c(){e=Vt("footer"),o&&o.c(),Zt(e,"class","shepherd-footer")},m(t,r){Ft(t,e,r),o&&o.m(e,null),n=!0},p(t,[n]){t[1]?o?(o.p(t,n),2&n&&be(o,1)):((o=_e(t)).c(),be(o,1),o.m(e,null)):o&&(me(),ye(o,1,1,()=>{o=null}),ge())},i(t){n||(be(o),n=!0)},o(t){ye(o),n=!1},d(t){t&&qt(e),o&&o.d()}}}function Me(t,e,n){let o,{step:r}=e;return t.$$set=(t=>{"step"in t&&n(0,r=t.step)}),t.$$.update=(()=>{1&t.$$.dirty&&n(1,o=r.options.buttons)}),[r,o]}class ke extends Ee{constructor(t){super(),Oe(this,t,Me,Ae,Wt,{step:0})}}function Ce(t){let e,n,o,r,i;return{c(){e=Vt("button"),(n=Vt("span")).textContent="×",Zt(n,"aria-hidden","true"),Zt(e,"aria-label",o=t[0].label?t[0].label:"Close Tour"),Zt(e,"class","shepherd-cancel-icon"),Zt(e,"type","button")},m(o,s){Ft(o,e,s),Nt(e,n),r||(i=zt(e,"click",t[1]),r=!0)},p(t,[n]){1&n&&o!==(o=t[0].label?t[0].label:"Close Tour")&&Zt(e,"aria-label",o)},i:Ct,o:Ct,d(t){t&&qt(e),r=!1,i()}}}function Pe(t,e,n){let{cancelIcon:o}=e,{step:r}=e;return t.$$set=(t=>{"cancelIcon"in t&&n(0,o=t.cancelIcon),"step"in t&&n(2,r=t.step)}),[o,t=>{t.preventDefault(),r.cancel()},r]}class Be extends Ee{constructor(t){super(),Oe(this,t,Pe,Ce,Wt,{cancelIcon:0,step:2})}}function De(t){let e;return{c(){Zt(e=Vt("h3"),"id",t[1]),Zt(e,"class","shepherd-title")},m(n,o){Ft(n,e,o),t[3](e)},p(t,[n]){2&n&&Zt(e,"id",t[1])},i:Ct,o:Ct,d(n){n&&qt(e),t[3](null)}}}function He(t,e,n){let{labelId:o}=e,{element:r}=e,{title:i}=e;return ee(()=>{p(i)&&n(2,i=i()),n(0,r.innerHTML=i,r)}),t.$$set=(t=>{"labelId"in t&&n(1,o=t.labelId),"element"in t&&n(0,r=t.element),"title"in t&&n(2,i=t.title)}),[r,o,i,function(t){oe[t?"unshift":"push"](()=>{n(0,r=t)})}]}class Re extends Ee{constructor(t){super(),Oe(this,t,He,De,Wt,{labelId:1,element:0,title:2})}}function We(t){let e,n;return e=new Re({props:{labelId:t[0],title:t[2]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};1&n&&(o.labelId=t[0]),4&n&&(o.title=t[2]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ne(t){let e,n;return e=new Be({props:{cancelIcon:t[3],step:t[1]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};8&n&&(o.cancelIcon=t[3]),2&n&&(o.step=t[1]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Fe(t){let e,n,o,r=t[2]&&We(t),i=t[3]&&t[3].enabled&&Ne(t);return{c(){e=Vt("header"),r&&r.c(),n=Ut(),i&&i.c(),Zt(e,"class","shepherd-header")},m(t,s){Ft(t,e,s),r&&r.m(e,null),Nt(e,n),i&&i.m(e,null),o=!0},p(t,[o]){t[2]?r?(r.p(t,o),4&o&&be(r,1)):((r=We(t)).c(),be(r,1),r.m(e,n)):r&&(me(),ye(r,1,1,()=>{r=null}),ge()),t[3]&&t[3].enabled?i?(i.p(t,o),8&o&&be(i,1)):((i=Ne(t)).c(),be(i,1),i.m(e,null)):i&&(me(),ye(i,1,1,()=>{i=null}),ge())},i(t){o||(be(r),be(i),o=!0)},o(t){ye(r),ye(i),o=!1},d(t){t&&qt(e),r&&r.d(),i&&i.d()}}}function qe(t,e,n){let o,r,{labelId:i}=e,{step:s}=e;return t.$$set=(t=>{"labelId"in t&&n(0,i=t.labelId),"step"in t&&n(1,s=t.step)}),t.$$.update=(()=>{2&t.$$.dirty&&(n(2,o=s.options.title),n(3,r=s.options.cancelIcon))}),[i,s,o,r]}class Ve extends Ee{constructor(t){super(),Oe(this,t,qe,Fe,Wt,{labelId:0,step:1})}}function Ye(t){let e;return{c(){Zt(e=Vt("div"),"class","shepherd-text"),Zt(e,"id",t[1])},m(n,o){Ft(n,e,o),t[3](e)},p(t,[n]){2&n&&Zt(e,"id",t[1])},i:Ct,o:Ct,d(n){n&&qt(e),t[3](null)}}}function Xe(t,e,n){let{descriptionId:o}=e,{element:r}=e,{step:i}=e;return ee(()=>{let{text:t}=i.options;p(t)&&(t=t.call(i)),c(t)?r.appendChild(t):n(0,r.innerHTML=t,r)}),t.$$set=(t=>{"descriptionId"in t&&n(1,o=t.descriptionId),"element"in t&&n(0,r=t.element),"step"in t&&n(2,i=t.step)}),[r,o,i,function(t){oe[t?"unshift":"push"](()=>{n(0,r=t)})}]}class Ue extends Ee{constructor(t){super(),Oe(this,t,Xe,Ye,Wt,{descriptionId:1,element:0,step:2})}}function ze(t){let e,n;return e=new Ve({props:{labelId:t[1],step:t[2]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};2&n&&(o.labelId=t[1]),4&n&&(o.step=t[2]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ze(t){let e,n;return e=new Ue({props:{descriptionId:t[0],step:t[2]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};1&n&&(o.descriptionId=t[0]),4&n&&(o.step=t[2]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ke(t){let e,n;return e=new ke({props:{step:t[2]}}),{c(){ve(e.$$.fragment)},m(t,o){xe(e,t,o),n=!0},p(t,n){const o={};4&n&&(o.step=t[2]),e.$set(o)},i(t){n||(be(e.$$.fragment,t),n=!0)},o(t){ye(e.$$.fragment,t),n=!1},d(t){we(e,t)}}}function Ge(t){let e,n,o,r,i=!f(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled,s=!f(t[2].options.text),a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length,l=i&&ze(t),c=s&&Ze(t),p=a&&Ke(t);return{c(){e=Vt("div"),l&&l.c(),n=Ut(),c&&c.c(),o=Ut(),p&&p.c(),Zt(e,"class","shepherd-content")},m(t,i){Ft(t,e,i),l&&l.m(e,null),Nt(e,n),c&&c.m(e,null),Nt(e,o),p&&p.m(e,null),r=!0},p(t,[r]){4&r&&(i=!f(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled),i?l?(l.p(t,r),4&r&&be(l,1)):((l=ze(t)).c(),be(l,1),l.m(e,n)):l&&(me(),ye(l,1,1,()=>{l=null}),ge()),4&r&&(s=!f(t[2].options.text)),s?c?(c.p(t,r),4&r&&be(c,1)):((c=Ze(t)).c(),be(c,1),c.m(e,o)):c&&(me(),ye(c,1,1,()=>{c=null}),ge()),4&r&&(a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length),a?p?(p.p(t,r),4&r&&be(p,1)):((p=Ke(t)).c(),be(p,1),p.m(e,null)):p&&(me(),ye(p,1,1,()=>{p=null}),ge())},i(t){r||(be(l),be(c),be(p),r=!0)},o(t){ye(l),ye(c),ye(p),r=!1},d(t){t&&qt(e),l&&l.d(),c&&c.d(),p&&p.d()}}}function Je(t,e,n){let{descriptionId:o}=e,{labelId:r}=e,{step:i}=e;return t.$$set=(t=>{"descriptionId"in t&&n(0,o=t.descriptionId),"labelId"in t&&n(1,r=t.labelId),"step"in t&&n(2,i=t.step)}),[o,r,i]}class Qe extends Ee{constructor(t){super(),Oe(this,t,Je,Ge,Wt,{descriptionId:0,labelId:1,step:2})}}function tn(t){let e;return{c(){Zt(e=Vt("div"),"class","shepherd-arrow"),Zt(e,"data-popper-arrow","")},m(t,n){Ft(t,e,n)},d(t){t&&qt(e)}}}function en(t){let e,n,o,r,i,s,a,l,c=t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on&&tn();o=new Qe({props:{descriptionId:t[2],labelId:t[3],step:t[4]}});let p=[{"aria-describedby":r=f(t[4].options.text)?null:t[2]},{"aria-labelledby":i=t[4].options.title?t[3]:null},t[1],{role:"dialog"},{tabindex:"0"}],u={};for(let t=0;t<p.length;t+=1)u=Pt(u,p[t]);return{c(){e=Vt("div"),c&&c.c(),n=Ut(),ve(o.$$.fragment),Kt(e,u),Gt(e,"shepherd-has-cancel-icon",t[5]),Gt(e,"shepherd-has-title",t[6]),Gt(e,"shepherd-element",!0)},m(r,i){Ft(r,e,i),c&&c.m(e,null),Nt(e,n),xe(o,e,null),t[13](e),s=!0,a||(l=zt(e,"keydown",t[7]),a=!0)},p(t,[a]){t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on?c||((c=tn()).c(),c.m(e,n)):c&&(c.d(1),c=null);const l={};4&a&&(l.descriptionId=t[2]),8&a&&(l.labelId=t[3]),16&a&&(l.step=t[4]),o.$set(l),Kt(e,u=function(t,e){const n={},o={},r={$$scope:1};let i=t.length;for(;i--;){const s=t[i],a=e[i];if(a){for(const t in s)t in a||(o[t]=1);for(const t in a)r[t]||(n[t]=a[t],r[t]=1);t[i]=a}else for(const t in s)r[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(p,[(!s||20&a&&r!==(r=f(t[4].options.text)?null:t[2]))&&{"aria-describedby":r},(!s||24&a&&i!==(i=t[4].options.title?t[3]:null))&&{"aria-labelledby":i},2&a&&t[1],{role:"dialog"},{tabindex:"0"}])),Gt(e,"shepherd-has-cancel-icon",t[5]),Gt(e,"shepherd-has-title",t[6]),Gt(e,"shepherd-element",!0)},i(t){s||(be(o.$$.fragment,t),s=!0)},o(t){ye(o.$$.fragment,t),s=!1},d(n){n&&qt(e),c&&c.d(),we(o),t[13](null),a=!1,l()}}}const nn=9,on=27,rn=37,sn=39;function an(t){return t.split(" ").filter(t=>!!t.length)}function ln(t,e,n){let o,r,i,{classPrefix:s}=e,{element:a}=e,{descriptionId:l}=e,{firstFocusableElement:c}=e,{focusableElements:p}=e,{labelId:f}=e,{lastFocusableElement:d}=e,{step:h}=e,{dataStepId:m}=e;var g;g=(()=>{n(1,m={[`data-${s}shepherd-step-id`]:h.id}),n(9,p=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=p[0]),n(10,d=p[p.length-1])}),te().$$.on_mount.push(g),ee(()=>{i!==h.options.classes&&(function(t){if(u(t)){const e=an(t);e.length&&a.classList.remove(...e)}}(i),function(t){if(u(t)){const e=an(t);e.length&&a.classList.add(...e)}}(i=h.options.classes))});return t.$$set=(t=>{"classPrefix"in t&&n(11,s=t.classPrefix),"element"in t&&n(0,a=t.element),"descriptionId"in t&&n(2,l=t.descriptionId),"firstFocusableElement"in t&&n(8,c=t.firstFocusableElement),"focusableElements"in t&&n(9,p=t.focusableElements),"labelId"in t&&n(3,f=t.labelId),"lastFocusableElement"in t&&n(10,d=t.lastFocusableElement),"step"in t&&n(4,h=t.step),"dataStepId"in t&&n(1,m=t.dataStepId)}),t.$$.update=(()=>{16&t.$$.dirty&&(n(5,o=h.options&&h.options.cancelIcon&&h.options.cancelIcon.enabled),n(6,r=h.options&&h.options.title))}),[a,m,l,f,h,o,r,t=>{const{tour:e}=h;switch(t.keyCode){case nn:if(0===p.length){t.preventDefault();break}t.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(t.preventDefault(),d.focus()):document.activeElement===d&&(t.preventDefault(),c.focus());break;case on:e.options.exitOnEsc&&h.cancel();break;case rn:e.options.keyboardNavigation&&e.back();break;case sn:e.options.keyboardNavigation&&e.next()}},c,p,d,s,()=>a,function(t){oe[t?"unshift":"push"](()=>{n(0,a=t)})}]}class cn extends Ee{constructor(t){super(),Oe(this,t,ln,en,Wt,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}var pn,un=(function(t,e){!function(){t.exports={polyfill:function(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style&&!0!==t.__forceSmoothScrollPolyfill__)){var n,o=t.HTMLElement||t.Element,r=468,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},s=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,a=(n=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):i.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var t=arguments[0].left,e=arguments[0].top;h.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(t){for(;t!==e.body&&!1===f(t);)t=t.parentNode||t.host;return t}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==e.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==t.getComputedStyle(n).position&&t.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(t,e){this.scrollLeft=t,this.scrollTop=e}function c(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(t,e){return"Y"===e?t.clientHeight+a<t.scrollHeight:"X"===e?t.clientWidth+a<t.scrollWidth:void 0}function u(e,n){var o=t.getComputedStyle(e,null)["overflow"+n];return"auto"===o||"scroll"===o}function f(t){var e=p(t,"Y")&&u(t,"Y"),n=p(t,"X")&&u(t,"X");return e||n}function d(e){var n,o,i,a,l=(s()-e.startTime)/r;a=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*a)),o=e.startX+(e.x-e.startX)*n,i=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,o,i),o===e.x&&i===e.y||t.requestAnimationFrame(d.bind(t,e))}function h(n,o,r){var a,c,p,u,f=s();n===e.body?(a=t,c=t.scrollX||t.pageXOffset,p=t.scrollY||t.pageYOffset,u=i.scroll):(a=n,c=n.scrollLeft,p=n.scrollTop,u=l),d({scrollable:a,method:u,startTime:f,startX:c,startY:p,x:o,y:r})}}}}()}(pn={exports:{}},pn.exports),pn.exports);un.polyfill,un.polyfill();class fn extends d{constructor(t,e={}){return super(t,e),this.tour=t,this.classPrefix=this.tour.options?_t(this.tour.options.classPrefix):"",this.styles=t.styles,h(this),this._setOptions(e),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),c(this.el)&&this.el.parentNode&&(this.el.parentNode.removeChild(this.el),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}isCentered(){const t=Lt(this);return!t.element||!t.on}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){if(p(this.options.beforeShowPromise)){const t=this.options.beforeShowPromise();if(!f(t))return t.then(()=>this._show())}this._show()}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const t=`${this.id}-description`,e=`${this.id}-label`;return this.shepherdElementComponent=new cn({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:e,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:e}=Lt(this);p(this.options.scrollToHandler)?this.options.scrollToHandler(e):e instanceof Element&&"function"==typeof e.scrollIntoView&&e.scrollIntoView(t)}_getClassOptions(t){const e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=t.classes?t.classes:"",o=e&&e.classes?e.classes:"",r=[...n.split(" "),...o.split(" ")],i=new Set(r);return Array.from(i).join(" ").trim()}_setOptions(t={}){let e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;e=l({},e||{}),this.options=Object.assign({arrow:!0},e,t);const{when:n}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||`step-${Mt()}`,n&&Object.keys(n).forEach(t=>{this.on(t,n[t],this)})}_setupElements(){f(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&m(this),At(this)}_show(){this.trigger("before-show"),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const t=this.shepherdElementComponent.getElement(),e=this.target||document.body;e.classList.add(`${this.classPrefix}shepherd-enabled`),e.classList.add(`${this.classPrefix}shepherd-target`),t.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(t){const e=t.target;e&&(t.options.highlightClass&&e.classList.add(t.options.highlightClass),!1===t.options.canClickTarget&&e.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const t=this.target||document.body;this.options.highlightClass&&t.classList.remove(this.options.highlightClass),t.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)}}function dn(t){let e,n,o,r,i;return{c(){e=Yt("svg"),Zt(n=Yt("path"),"d",t[2]),Zt(e,"class",o=`${t[1]?"shepherd-modal-is-visible":""} shepherd-modal-overlay-container`)},m(o,s){Ft(o,e,s),Nt(e,n),t[11](e),r||(i=zt(e,"touchmove",t[3]),r=!0)},p(t,[r]){4&r&&Zt(n,"d",t[2]),2&r&&o!==(o=`${t[1]?"shepherd-modal-is-visible":""} shepherd-modal-overlay-container`)&&Zt(e,"class",o)},i:Ct,o:Ct,d(n){n&&qt(e),t[11](null),r=!1,i()}}}function hn(t,e,n){let{element:o}=e,{openingProperties:r}=e;Mt();let i,s=!1,a=void 0;l();function l(){n(4,r={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,s=!1),d()}function p(t=0,e=0,o,i){if(i){const{y:s,height:a}=function(t,e){const n=t.getBoundingClientRect();let o=n.y||n.top,r=n.bottom||o+n.height;if(e){const t=e.getBoundingClientRect(),n=t.y||t.top,i=t.bottom||n+t.height;o=Math.max(o,n),r=Math.min(r,i)}return{y:o,height:Math.max(r-o,0)}}(i,o),{x:l,width:c,left:p}=i.getBoundingClientRect();n(4,r={width:c+2*t,height:a+2*t,x:(l||p)-t,y:s-t,r:e})}else l()}function u(){n(1,s=!0)}const f=t=>{t.preventDefault()};function d(){a&&(cancelAnimationFrame(a),a=void 0),window.removeEventListener("touchmove",f,{passive:!1})}return t.$$set=(t=>{"element"in t&&n(0,o=t.element),"openingProperties"in t&&n(4,r=t.openingProperties)}),t.$$.update=(()=>{16&t.$$.dirty&&n(2,i=function({width:t,height:e,x:n=0,y:o=0,r:r=0}){const{innerWidth:i,innerHeight:s}=window;return`M${i},${s}H0V0H${i}V${s}ZM${n+r},${o}a${r},${r},0,0,0-${r},${r}V${e+o-r}a${r},${r},0,0,0,${r},${r}H${t+n-r}a${r},${r},0,0,0,${r}-${r}V${o+r}a${r},${r},0,0,0-${r}-${r}Z`}(r))}),[o,s,i,t=>{t.stopPropagation()},r,()=>o,l,c,p,function(t){d(),t.tour.options.useModalOverlay?(function(t){const{modalOverlayOpeningPadding:e,modalOverlayOpeningRadius:n}=t.options,o=function t(e){if(!e)return null;const n=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==n&&"visible"!==n&&e.scrollHeight>=e.clientHeight?e:t(e.parentElement)}(t.target),r=()=>{a=void 0,p(e,n,o,t.target),a=requestAnimationFrame(r)};r(),window.addEventListener("touchmove",f,{passive:!1})}(t),u()):c()},u,function(t){oe[t?"unshift":"push"](()=>{n(0,o=t)})}]}class mn extends Ee{constructor(t){super(),Oe(this,t,hn,dn,Wt,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const gn=new d;return Object.assign(gn,{Tour:class extends d{constructor(t={}){return super(t),h(this),this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},t),this.classPrefix=_t(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map(t=>{(t=>{this.on(t,e=>{(e=e||{}).tour=this,gn.trigger(t,e)})})(t)}),this._setTourID(),this}addStep(t,e){let n=t;return n instanceof fn?n.tour=this:n=new fn(this,n),f(e)?this.steps.push(n):this.steps.splice(e,0,n),n}addSteps(t){return Array.isArray(t)&&t.forEach(t=>{this.addStep(t)}),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(t)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find(e=>e.id===t)}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return gn.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const e=this.getCurrentStep();this.steps.some((e,n)=>{if(e.id===t)return e.isOpen()&&e.hide(),e.destroy(),this.steps.splice(n,1),!0}),e&&e.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t=0,e=!0){const n=u(t)?this.getById(t):this.steps[t];n&&(this._updateStateBeforeShow(),p(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,e):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show()))}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(t){const e=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(t=>t.destroy()),function(t){if(t){const{steps:e}=t;e.forEach(t=>{t.options&&!1===t.options.canClickTarget&&t.options.attachTo&&t.target instanceof HTMLElement&&t.target.classList.remove("shepherd-target-click-disabled")})}}(this),this.trigger(t,{index:e}),gn.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===t||"complete"===t)&&this.modal){const t=document.querySelector(".shepherd-modal-overlay-container");t&&t.remove()}c(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),gn.activeTour=this}_setupModal(){this.modal=new mn({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(t,e){const n=this.steps.indexOf(t),o=e?n+1:n-1;this.show(o,e)}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const t=this.options.tourName||"tour";this.id=`${t}--${Mt()}`}},Step:fn}),gn});
2
  //# sourceMappingURL=shepherd.js.map
3
 
4
+ let myTour = new Shepherd.Tour();
 
 
5
 
6
 
7
  var mycred_tour_data = [
10
  title: 'Singular'+ '<span class=num>1 of 6</span><span class="dashicons dashicons-dismiss cancel" onclick="myTour.cancel()"></span>',
11
  text: 'Admin can set the "Singular" point type label here.',
12
  attachTo: {
13
+ element: '#generalnamesingular',
14
  on: 'bottom'
15
  },
16
  buttons: [
23
  title: 'Plural'+ '<span class=num>2 of 6</span><span class="dashicons dashicons-dismiss cancel" onclick="myTour.cancel()"></span>',
24
  text: 'Admin can set the "Plural" points type label here.',
25
  attachTo: {
26
+ element: '#generalnameplural',
27
  on: 'bottom'
28
  },
29
  buttons: [
38
  }
39
  ]},
40
  {
41
+ title: 'Prefix'+ '<span class=num>3 of 6</span><span class="dashicons dashicons-dismiss cancel" onclick="myTour.cancel()"></span>',
42
+ text: 'Admin can set the "Prefix" point type label here.',
43
  attachTo: {
44
+ element: '#generalbefore',
45
  on: 'bottom'
46
  },
47
  buttons: [
52
  },
53
  {
54
  text: 'Next',
55
+ action: function () {
56
+ if ( mycred_tour_guide.step == 1 ) {
57
+ window.location.href = mycred_tour_guide.redirect_url;
58
+ }
59
+ }
60
  }
61
  ]},
62
  ],
114
  ]},
115
  ],
116
  ];
117
+
118
+ jQuery(function($) {
119
+
120
+ if ( typeof mycred_tour_guide !== 'undefined' && typeof mycred_tour_guide.step !== 'undefined' ) {
121
+
122
+ if ( mycred_tour_guide.step == 1 ) {
123
+
124
+ $('html, body').animate({
125
+ scrollTop: $("#accordion").offset().top
126
+ },1000);
127
+
128
+ $( "#accordion" ).accordion({ active: 0 });
129
+
130
+ }
131
+
132
+ myTour.addSteps( mycred_tour_data[ mycred_tour_guide.step - 1 ] );
133
+ myTour.start();
134
+
135
+ }
136
+
137
+ });
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
 
150
 
151
  // Attach the touruide start evene to the button press
assets/libs/parsecsv.lib.php CHANGED
@@ -223,9 +223,9 @@ class parseCSV {
223
 
224
  // walk specific depth finding posssible delimiter characters
225
  for ( $i=0; $i < $strlen; $i++ ) {
226
- $ch = $data{$i};
227
- $nch = ( isset($data{$i+1}) ) ? $data{$i+1} : false ;
228
- $pch = ( isset($data{$i-1}) ) ? $data{$i-1} : false ;
229
 
230
  // open and closing quotes
231
  if ( $ch == $enclosure && (!$enclosed || $nch != $enclosure) ) {
@@ -317,9 +317,9 @@ class parseCSV {
317
 
318
  // walk through each character
319
  for ( $i=0; $i < $strlen; $i++ ) {
320
- $ch = $data{$i};
321
- $nch = ( isset($data{$i+1}) ) ? $data{$i+1} : false ;
322
- $pch = ( isset($data{$i-1}) ) ? $data{$i-1} : false ;
323
 
324
  // open and closing quotes
325
  if ( $ch == $this->enclosure && (!$enclosed || $nch != $this->enclosure) ) {
@@ -560,7 +560,7 @@ class parseCSV {
560
  if ( $value !== null && $value != '' ) {
561
  $delimiter = preg_quote($this->delimiter, '/');
562
  $enclosure = preg_quote($this->enclosure, '/');
563
- if ( preg_match("/".$delimiter."|".$enclosure."|\n|\r/i", $value) || ($value{0} == ' ' || substr($value, -1) == ' ') ) {
564
  $value = str_replace($this->enclosure, $this->enclosure.$this->enclosure, $value);
565
  $value = $this->enclosure.$value.$this->enclosure;
566
  }
223
 
224
  // walk specific depth finding posssible delimiter characters
225
  for ( $i=0; $i < $strlen; $i++ ) {
226
+ $ch = $data[$i];
227
+ $nch = ( isset($data[$i+1]) ) ? $data[$i+1] : false ;
228
+ $pch = ( isset($data[$i-1]) ) ? $data[$i-1] : false ;
229
 
230
  // open and closing quotes
231
  if ( $ch == $enclosure && (!$enclosed || $nch != $enclosure) ) {
317
 
318
  // walk through each character
319
  for ( $i=0; $i < $strlen; $i++ ) {
320
+ $ch = $data[$i];
321
+ $nch = ( isset($data[$i+1]) ) ? $data[$i+1] : false ;
322
+ $pch = ( isset($data[$i-1]) ) ? $data[$i-1] : false ;
323
 
324
  // open and closing quotes
325
  if ( $ch == $this->enclosure && (!$enclosed || $nch != $this->enclosure) ) {
560
  if ( $value !== null && $value != '' ) {
561
  $delimiter = preg_quote($this->delimiter, '/');
562
  $enclosure = preg_quote($this->enclosure, '/');
563
+ if ( preg_match("/".$delimiter."|".$enclosure."|\n|\r/i", $value) || ($value[0] == ' ' || substr($value, -1) == ' ') ) {
564
  $value = str_replace($this->enclosure, $this->enclosure.$this->enclosure, $value);
565
  $value = $this->enclosure.$value.$this->enclosure;
566
  }
includes/classes/class.query-leaderboard.php CHANGED
@@ -499,8 +499,8 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
499
  if ( MYCRED_ENABLE_LOGGING && $this->args['total'] && $this->args['timeframe'] != '' ) {
500
 
501
  $position = $wpdb->get_var( $wpdb->prepare( "
502
- SELECT rank FROM (
503
- SELECT s.*, @rank := @rank + 1 rank FROM (
504
  SELECT l.user_id, sum( l.creds ) TotalPoints FROM {$mycred_log_table} l
505
  {$multisite_check}
506
  WHERE {$point_type_is} AND ( ( l.creds > 0 ) OR ( l.creds < 0 AND l.ref = 'manual' ) )
@@ -508,7 +508,7 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
508
  {$exclude_filter}
509
  {$exclude_user_filter}
510
  GROUP BY l.user_id
511
- ) s, (SELECT @rank := 0) init
512
  ORDER BY TotalPoints DESC, s.user_id ASC
513
  ) r
514
  WHERE user_id = %d", $point_type_values, $user_id ) );
@@ -536,14 +536,14 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
536
  }
537
 
538
  $position = $wpdb->get_var( $wpdb->prepare( "
539
- SELECT rank FROM (
540
- SELECT s.*, @rank := @rank + 1 rank FROM (
541
  SELECT l.user_id, l.meta_value AS Balance FROM {$wpdb->usermeta} l
542
  {$multisite_check}
543
  WHERE {$point_type_is}
544
  {$exclude_filter}
545
  {$exclude_user_filter}
546
- ) s, (SELECT @rank := 0) init
547
  ORDER BY Balance+0 DESC, s.user_id ASC
548
  ) r
549
  WHERE user_id = %d", $point_type_values, $user_id ) );
@@ -565,8 +565,8 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
565
  }
566
 
567
  $position = $wpdb->get_var( $wpdb->prepare( "
568
- SELECT rank FROM (
569
- SELECT s.*, @rank := @rank + 1 rank FROM (
570
  SELECT l.user_id, sum( l.creds ) TotalPoints FROM {$mycred_log_table} l
571
  {$multisite_check}
572
  WHERE {$point_type_is} AND ( ( l.creds > 0 ) OR ( l.creds < 0 AND l.ref = 'manual' ) )
@@ -575,7 +575,7 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
575
  {$exclude_filter}
576
  {$exclude_user_filter}
577
  GROUP BY l.user_id
578
- ) s, (SELECT @rank := 0) init
579
  ORDER BY TotalPoints DESC, s.user_id ASC
580
  ) r
581
  WHERE user_id = %d", $point_type_values, $reference_values, $user_id ) );
@@ -634,7 +634,7 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
634
 
635
  $value = $wpdb->get_var( $wpdb->prepare( "
636
  SELECT TotalPoints FROM (
637
- SELECT s.*, @rank := @rank + 1 rank FROM (
638
  SELECT l.user_id, sum( l.creds ) TotalPoints FROM {$mycred_log_table} l
639
  {$multisite_check}
640
  WHERE {$point_type_is} AND ( ( l.creds > 0 ) OR ( l.creds < 0 AND l.ref = 'manual' ) )
@@ -642,7 +642,7 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
642
  {$exclude_filter}
643
  {$exclude_user_filter}
644
  GROUP BY l.user_id
645
- ) s, (SELECT @rank := 0) init
646
  ORDER BY TotalPoints DESC, s.user_id ASC
647
  ) r
648
  WHERE user_id = %d", $point_type_values, $user_id ) );
@@ -671,13 +671,13 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
671
 
672
  $value = $wpdb->get_var( $wpdb->prepare( "
673
  SELECT Balance FROM (
674
- SELECT s.*, @rank := @rank + 1 rank FROM (
675
  SELECT l.user_id, l.meta_value AS Balance FROM {$wpdb->usermeta} l
676
  {$multisite_check}
677
  WHERE {$point_type_is}
678
  {$exclude_filter}
679
  {$exclude_user_filter}
680
- ) s, (SELECT @rank := 0) init
681
  ORDER BY Balance+0 DESC, s.user_id ASC
682
  ) r
683
  WHERE user_id = %d", $point_type_values, $user_id ) );
@@ -700,7 +700,7 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
700
 
701
  $value = $wpdb->get_var( $wpdb->prepare( "
702
  SELECT TotalPoints FROM (
703
- SELECT s.*, @rank := @rank + 1 rank FROM (
704
  SELECT l.user_id, sum( l.creds ) TotalPoints FROM {$mycred_log_table} l
705
  {$multisite_check}
706
  WHERE {$point_type_is} AND ( ( l.creds > 0 ) OR ( l.creds < 0 AND l.ref = 'manual' ) )
@@ -709,7 +709,7 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
709
  {$exclude_filter}
710
  {$exclude_user_filter}
711
  GROUP BY l.user_id
712
- ) s, (SELECT @rank := 0) init
713
  ORDER BY TotalPoints DESC, s.user_id ASC
714
  ) r
715
  WHERE user_id = %d", $point_type_values, $reference_values, $user_id ) );
499
  if ( MYCRED_ENABLE_LOGGING && $this->args['total'] && $this->args['timeframe'] != '' ) {
500
 
501
  $position = $wpdb->get_var( $wpdb->prepare( "
502
+ SELECT position FROM (
503
+ SELECT s.*, @position := @position + 1 position FROM (
504
  SELECT l.user_id, sum( l.creds ) TotalPoints FROM {$mycred_log_table} l
505
  {$multisite_check}
506
  WHERE {$point_type_is} AND ( ( l.creds > 0 ) OR ( l.creds < 0 AND l.ref = 'manual' ) )
508
  {$exclude_filter}
509
  {$exclude_user_filter}
510
  GROUP BY l.user_id
511
+ ) s, (SELECT @position := 0) init
512
  ORDER BY TotalPoints DESC, s.user_id ASC
513
  ) r
514
  WHERE user_id = %d", $point_type_values, $user_id ) );
536
  }
537
 
538
  $position = $wpdb->get_var( $wpdb->prepare( "
539
+ SELECT position FROM (
540
+ SELECT s.*, @position := @position + 1 position FROM (
541
  SELECT l.user_id, l.meta_value AS Balance FROM {$wpdb->usermeta} l
542
  {$multisite_check}
543
  WHERE {$point_type_is}
544
  {$exclude_filter}
545
  {$exclude_user_filter}
546
+ ) s, (SELECT @position := 0) init
547
  ORDER BY Balance+0 DESC, s.user_id ASC
548
  ) r
549
  WHERE user_id = %d", $point_type_values, $user_id ) );
565
  }
566
 
567
  $position = $wpdb->get_var( $wpdb->prepare( "
568
+ SELECT position FROM (
569
+ SELECT s.*, @position := @position + 1 position FROM (
570
  SELECT l.user_id, sum( l.creds ) TotalPoints FROM {$mycred_log_table} l
571
  {$multisite_check}
572
  WHERE {$point_type_is} AND ( ( l.creds > 0 ) OR ( l.creds < 0 AND l.ref = 'manual' ) )
575
  {$exclude_filter}
576
  {$exclude_user_filter}
577
  GROUP BY l.user_id
578
+ ) s, (SELECT @position := 0) init
579
  ORDER BY TotalPoints DESC, s.user_id ASC
580
  ) r
581
  WHERE user_id = %d", $point_type_values, $reference_values, $user_id ) );
634
 
635
  $value = $wpdb->get_var( $wpdb->prepare( "
636
  SELECT TotalPoints FROM (
637
+ SELECT s.*, @position := @position + 1 position FROM (
638
  SELECT l.user_id, sum( l.creds ) TotalPoints FROM {$mycred_log_table} l
639
  {$multisite_check}
640
  WHERE {$point_type_is} AND ( ( l.creds > 0 ) OR ( l.creds < 0 AND l.ref = 'manual' ) )
642
  {$exclude_filter}
643
  {$exclude_user_filter}
644
  GROUP BY l.user_id
645
+ ) s, (SELECT @position := 0) init
646
  ORDER BY TotalPoints DESC, s.user_id ASC
647
  ) r
648
  WHERE user_id = %d", $point_type_values, $user_id ) );
671
 
672
  $value = $wpdb->get_var( $wpdb->prepare( "
673
  SELECT Balance FROM (
674
+ SELECT s.*, @position := @position + 1 position FROM (
675
  SELECT l.user_id, l.meta_value AS Balance FROM {$wpdb->usermeta} l
676
  {$multisite_check}
677
  WHERE {$point_type_is}
678
  {$exclude_filter}
679
  {$exclude_user_filter}
680
+ ) s, (SELECT @position := 0) init
681
  ORDER BY Balance+0 DESC, s.user_id ASC
682
  ) r
683
  WHERE user_id = %d", $point_type_values, $user_id ) );
700
 
701
  $value = $wpdb->get_var( $wpdb->prepare( "
702
  SELECT TotalPoints FROM (
703
+ SELECT s.*, @position := @position + 1 position FROM (
704
  SELECT l.user_id, sum( l.creds ) TotalPoints FROM {$mycred_log_table} l
705
  {$multisite_check}
706
  WHERE {$point_type_is} AND ( ( l.creds > 0 ) OR ( l.creds < 0 AND l.ref = 'manual' ) )
709
  {$exclude_filter}
710
  {$exclude_user_filter}
711
  GROUP BY l.user_id
712
+ ) s, (SELECT @position := 0) init
713
  ORDER BY TotalPoints DESC, s.user_id ASC
714
  ) r
715
  WHERE user_id = %d", $point_type_values, $reference_values, $user_id ) );
includes/hooks/external/mycred-hook-woocommerce.php CHANGED
@@ -204,12 +204,22 @@ endif;
204
  /**
205
  * Save Reward Setup
206
  * @since 1.5
207
- * @version 1.0.1
208
  */
209
  if ( ! function_exists( 'mycred_woo_save_reward_settings' ) ) :
210
  function mycred_woo_save_reward_settings( $post_id ) {
211
-
212
- if ( ! isset( $_POST['mycred_reward'] ) || empty( $_POST['mycred_reward'] ) || mycred_get_post_type( $post_id ) != 'product' ) return;
 
 
 
 
 
 
 
 
 
 
213
 
214
  $new_setup = array();
215
  foreach ( $_POST['mycred_reward'] as $point_type => $setup ) {
204
  /**
205
  * Save Reward Setup
206
  * @since 1.5
207
+ * @version 2.0.0
208
  */
209
  if ( ! function_exists( 'mycred_woo_save_reward_settings' ) ) :
210
  function mycred_woo_save_reward_settings( $post_id ) {
211
+
212
+ //Works only for multisite
213
+ $override = ( is_multisite() && mycred_override_settings() && ! mycred_is_main_site() );
214
+
215
+ $post_type = '';
216
+
217
+ if( $override )
218
+ $post_type = get_post_type( $post_id );
219
+ else
220
+ $post_type = mycred_get_post_type( $post_id );
221
+
222
+ if ( ! isset( $_POST['mycred_reward'] ) || empty( $_POST['mycred_reward'] ) || $post_type != 'product' ) return;
223
 
224
  $new_setup = array();
225
  foreach ( $_POST['mycred_reward'] as $point_type => $setup ) {
includes/hooks/mycred-hook-referrals.php CHANGED
@@ -74,6 +74,7 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
74
  if ( function_exists( 'bp_is_active' ) && bp_is_active( 'xprofile' ) && $this->prefs['buddypress']['profile'] )
75
  add_action( 'bp_after_profile_loop_content', array( $this, 'buddypress_profile' ), $this->prefs['buddypress']['priority'] );
76
 
 
77
  // Hook into user activation
78
  if ( function_exists( 'buddypress' ) )
79
  add_action( 'mycred_bp_user_activated', array( $this, 'verified_signup' ) );
74
  if ( function_exists( 'bp_is_active' ) && bp_is_active( 'xprofile' ) && $this->prefs['buddypress']['profile'] )
75
  add_action( 'bp_after_profile_loop_content', array( $this, 'buddypress_profile' ), $this->prefs['buddypress']['priority'] );
76
 
77
+
78
  // Hook into user activation
79
  if ( function_exists( 'buddypress' ) )
80
  add_action( 'mycred_bp_user_activated', array( $this, 'verified_signup' ) );
includes/mycred-functions.php CHANGED
@@ -3358,6 +3358,8 @@ if ( ! function_exists( 'mycred_plugin_deactivation' ) ) :
3358
  wp_clear_scheduled_hook( 'mycred_banking_recurring_payout' );
3359
  wp_clear_scheduled_hook( 'mycred_banking_interest_compound' );
3360
  wp_clear_scheduled_hook( 'mycred_banking_interest_payout' );
 
 
3361
 
3362
  /**
3363
  * Runs when the plugin is deleted
@@ -3882,4 +3884,186 @@ if ( ! function_exists( 'mycred_get_addon_defaults' ) ) :
3882
  return apply_filters( 'mycred_get_addon_defaults', $settings, $addon );
3883
 
3884
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3885
  endif;
3358
  wp_clear_scheduled_hook( 'mycred_banking_recurring_payout' );
3359
  wp_clear_scheduled_hook( 'mycred_banking_interest_compound' );
3360
  wp_clear_scheduled_hook( 'mycred_banking_interest_payout' );
3361
+
3362
+ update_option( 'mycred_deactivated_on', time() );
3363
 
3364
  /**
3365
  * Runs when the plugin is deleted
3884
  return apply_filters( 'mycred_get_addon_defaults', $settings, $addon );
3885
 
3886
  }
3887
+ endif;
3888
+
3889
+ /**
3890
+ * Add submenu inside myCred main menu
3891
+ * @since 2.2
3892
+ * @version 1.0
3893
+ */
3894
+ if ( ! function_exists( 'mycred_add_main_submenu' ) ) :
3895
+ function mycred_add_main_submenu( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
3896
+
3897
+ $main_menu_slug = apply_filters( 'mycred_add_main_submenu_slug', MYCRED_MAIN_SLUG, compact(
3898
+ 'page_title',
3899
+ 'menu_title',
3900
+ 'capability',
3901
+ 'menu_slug',
3902
+ 'function',
3903
+ 'position'
3904
+ ));
3905
+
3906
+ return add_submenu_page( $main_menu_slug, $page_title, $menu_title, $capability, $menu_slug, $function, $position );
3907
+
3908
+ }
3909
+ endif;
3910
+
3911
+
3912
+ /**
3913
+ * Get Badge Rank Social Icons
3914
+ * @since 2.2
3915
+ * @version 1.0
3916
+ */
3917
+ if ( !function_exists( 'mycred_br_get_social_icons' ) ):
3918
+ function mycred_br_get_social_icons( $facebook_url = '', $twitter_url = '', $linkedin_url = '', $pinterest_url = '' )
3919
+ {
3920
+ $mycred = mycred();
3921
+
3922
+ $br_enable_fb = isset( $mycred->core["br_social_share"]["enable_fb"] ) && $mycred->core["br_social_share"]["enable_fb"] == '1' ? true : false;
3923
+ $br_enable_twitter = isset( $mycred->core["br_social_share"]["enable_twitter"] ) && $mycred->core["br_social_share"]["enable_twitter"] == '1' ? true : false;
3924
+ $br_enable_li = isset( $mycred->core["br_social_share"]["enable_li"] ) && $mycred->core["br_social_share"]["enable_li"] == '1' ? true : false;
3925
+ $br_enable_pt = isset( $mycred->core["br_social_share"]["enable_pt"] ) && $mycred->core["br_social_share"]["enable_pt"] == '1' ? true : false;
3926
+
3927
+ $content = '';
3928
+
3929
+ $content .= '<div class="clearfix">';
3930
+
3931
+ $br_socail_icon = isset( $mycred->core["br_social_share"]["button_style"] ) ? $mycred->core["br_social_share"]["button_style"] : '';
3932
+
3933
+ if( $br_socail_icon == 'button_style' )
3934
+ {
3935
+ if( $br_enable_fb )
3936
+ $content .= '
3937
+ <button class="mycred-social-icons mycred-social-icon-facebook"><a href="'.$facebook_url.'" target="_blank">facebook</a></button>';
3938
+ if( $br_enable_twitter )
3939
+ $content .= '
3940
+ <button class="mycred-social-icons mycred-social-icon-twitter"><a href="'.$twitter_url.'" target="_blank">twitter</a></button>';
3941
+ if( $br_enable_li )
3942
+ $content .= '
3943
+ <button class="mycred-social-icons mycred-social-icon-linkedin"><a href="'.$linkedin_url.'" target="_blank">linkedin</a></button>';
3944
+ if( $br_enable_pt )
3945
+ $content .= '
3946
+ <button class="mycred-social-icons mycred-social-icon-pinterest"><a href="'.$pinterest_url.'" target="_blank">pinterest</a></button>';
3947
+ }
3948
+
3949
+ if( $br_socail_icon == 'icon_style' )
3950
+ {
3951
+ if( $br_enable_fb )
3952
+ $content .= '
3953
+ <a href="'.$facebook_url.'" target="_blank" class="mycred-social-icons mycred-social-icon-facebook"></a>';
3954
+ if( $br_enable_twitter )
3955
+ $content .= '
3956
+ <a href="'.$twitter_url.'" target="_blank" class="mycred-social-icons mycred-social-icon-twitter"></a>';
3957
+ if( $br_enable_li )
3958
+ $content .= '
3959
+ <a href="'.$linkedin_url.'" target="_blank" class="mycred-social-icons mycred-social-icon-linkedin"></a>';
3960
+ if( $br_enable_pt )
3961
+ $content .= '
3962
+ <a href="'.$pinterest_url.'" target="_blank" class="mycred-social-icons mycred-social-icon-pinterest"></a>';
3963
+ }
3964
+
3965
+ if( $br_socail_icon == 'text_style' )
3966
+ {
3967
+ if( $br_enable_fb )
3968
+ $content .= '
3969
+ <button class="facebook social-text"><a href="'.$facebook_url.'" target="_blank">facebook</a></button>';
3970
+ if( $br_enable_twitter )
3971
+ $content .= '
3972
+ <button class="twitter social-text"><a href="'.$twitter_url.'" target="_blank">twitter</a></button>';
3973
+ if( $br_enable_li )
3974
+ $content .= '
3975
+ <button class="linkedin social-text"><a href="'.$linkedin_url.'" target="_blank">linkedin</a></button>';
3976
+ if( $br_enable_pt )
3977
+ $content .= '
3978
+ <button class="pinterest social-text"><a href="'.$pinterest_url.'" target="_blank">pinterest</a></button>';
3979
+ }
3980
+
3981
+ if( $br_socail_icon == 'icon_style_hover' )
3982
+ {
3983
+ if( $br_enable_fb )
3984
+ $content .= '
3985
+ <a href="'.$facebook_url.'" target="_blank" class="i-text-admin mycred-social-icons mycred-social-icon-facebook"></a>';
3986
+ if( $br_enable_twitter )
3987
+ $content .= '
3988
+ <a href="'.$twitter_url.'" target="_blank" class="i-text-admin mycred-social-icons mycred-social-icon-twitter"></a>';
3989
+ if( $br_enable_li )
3990
+ $content .= '
3991
+ <a href="'.$linkedin_url.'" target="_blank" class="i-text-admin mycred-social-icons mycred-social-icon-linkedin"></a>';
3992
+ if( $br_enable_pt )
3993
+ $content .= '
3994
+ <a href="'.$pinterest_url.'" target="_blank" class="i-text-admin mycred-social-icons mycred-social-icon-pinterest"></a>';
3995
+ }
3996
+
3997
+ $content .= '</div>';
3998
+
3999
+
4000
+ return $content;
4001
+ }
4002
+ endif;
4003
+
4004
+ /**
4005
+ * Upload default point image
4006
+ * @since 2.2
4007
+ * @version 1.1
4008
+ */
4009
+ if( !function_exists( 'mycred_upload_default_point_image' ) ):
4010
+ function mycred_upload_default_point_image()
4011
+ {
4012
+ $default_point_image = mycred_get_option( 'mycred_default_point_image' );
4013
+
4014
+ $image_url = wp_get_attachment_url( $default_point_image );
4015
+
4016
+ if( empty( $default_point_image ) || !$image_url )
4017
+ {
4018
+ $image_url = plugin_dir_path( __DIR__ ) . 'assets/images/default-point-type.png';
4019
+
4020
+ $upload_dir = wp_upload_dir();
4021
+
4022
+ $image_data = file_get_contents( $image_url );
4023
+
4024
+ $filename = basename( $image_url );
4025
+
4026
+ if ( wp_mkdir_p( $upload_dir['path'] ) )
4027
+ $file = $upload_dir['path'] . '/' . $filename;
4028
+ else
4029
+ $file = $upload_dir['basedir'] . '/' . $filename;
4030
+
4031
+
4032
+ file_put_contents( $file, $image_data );
4033
+
4034
+ $wp_filetype = wp_check_filetype( $filename, null );
4035
+
4036
+ $attachment = array(
4037
+ 'post_mime_type' => $wp_filetype['type'],
4038
+ 'post_title' => 'mycred_default_image',
4039
+ 'post_content' => '',
4040
+ 'post_status' => 'inherit'
4041
+ );
4042
+
4043
+ $attach_id = wp_insert_attachment( $attachment, $file );
4044
+
4045
+ $attach_data = wp_generate_attachment_metadata( $attach_id, $file );
4046
+
4047
+ wp_update_attachment_metadata( $attach_id, $attach_data );
4048
+
4049
+ mycred_update_option( 'mycred_default_point_image', $attach_id );
4050
+ }
4051
+ }
4052
+ endif;
4053
+
4054
+ /**
4055
+ * Gets default point image
4056
+ * @since 2.2
4057
+ * @version 1.1
4058
+ */
4059
+ if( !function_exists( 'mycred_get_default_point_image_id' ) ):
4060
+ function mycred_get_default_point_image_id()
4061
+ {
4062
+ $image_id = mycred_get_option( 'mycred_default_point_image' );
4063
+
4064
+ if( empty( $image_id ) )
4065
+ return false;
4066
+
4067
+ return $image_id;
4068
+ }
4069
  endif;
includes/mycred-install.php CHANGED
@@ -88,26 +88,10 @@ if ( ! class_exists( 'myCRED_Install' ) ) :
88
  */
89
  public static function activate() {
90
 
91
- $mycred = mycred();
92
 
93
- // Add general settings
94
- add_option( 'mycred_version', myCRED_VERSION );
95
- add_option( 'mycred_key', wp_generate_password( 12, true, true ) );
96
- add_option( 'mycred_pref_core', $mycred->defaults() );
97
-
98
- // Add add-ons settings
99
- add_option( 'mycred_pref_addons', array(
100
- 'installed' => array(),
101
- 'active' => array()
102
- ) );
103
-
104
- // Add hooks settings
105
- $option_id = apply_filters( 'mycred_option_id', 'mycred_pref_hooks' );
106
- add_option( $option_id, array(
107
- 'installed' => array(),
108
- 'active' => array(),
109
- 'hook_prefs' => array()
110
- ) );
111
 
112
  do_action( 'mycred_activation' );
113
 
@@ -217,7 +201,8 @@ if ( ! class_exists( 'myCRED_Install' ) ) :
217
  'mycred_eventsmanager_gateway_prefs',
218
  MYCRED_SLUG . '-cache-stats-keys',
219
  MYCRED_SLUG . '-cache-leaderboard-keys',
220
- MYCRED_SLUG . '-last-clear-stats'
 
221
  );
222
 
223
  $can_remove_hooks = self::remove_setting( 'hooks' );
88
  */
89
  public static function activate() {
90
 
91
+ require_once myCRED_INCLUDES_DIR . 'mycred-setup.php';
92
 
93
+ $setup = new myCRED_Setup();
94
+ $setup->load();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
  do_action( 'mycred_activation' );
97
 
201
  'mycred_eventsmanager_gateway_prefs',
202
  MYCRED_SLUG . '-cache-stats-keys',
203
  MYCRED_SLUG . '-cache-leaderboard-keys',
204
+ MYCRED_SLUG . '-last-clear-stats',
205
+ 'mycred_deactivated_on'
206
  );
207
 
208
  $can_remove_hooks = self::remove_setting( 'hooks' );
includes/mycred-main-menu.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'myCRED_VERSION' ) ) exit;
3
+
4
+ /**
5
+ * myCRED_Main_Menu class
6
+ * Manages myCred main menu WordPress admin area.
7
+ * @since 0.1
8
+ * @version 1.2
9
+ */
10
+ if ( ! class_exists( 'myCRED_Main_Menu' ) ):
11
+ class myCRED_Main_Menu {
12
+
13
+ /**
14
+ * Construct
15
+ * @since 0.1
16
+ * @version 1.0
17
+ */
18
+ function __construct( $modules ) {
19
+
20
+ global $mycred;
21
+
22
+ add_menu_page(
23
+ 'myCred',
24
+ 'myCred',
25
+ $mycred->get_point_editor_capability(),
26
+ MYCRED_MAIN_SLUG,
27
+ '',
28
+ 'dashicons-mycred'
29
+ );
30
+
31
+ mycred_add_main_submenu(
32
+ 'Settings',
33
+ 'Settings',
34
+ $mycred->get_point_editor_capability(),
35
+ MYCRED_MAIN_SLUG,
36
+ array( $modules['type'][ MYCRED_DEFAULT_TYPE_KEY ]['settings'], 'admin_page' )
37
+ );
38
+
39
+ global $pagenow;
40
+
41
+ if ( $pagenow == 'admin.php' && isset( $_GET['page'] ) && $_GET['page'] == 'mycred-main' ) {
42
+
43
+ $modules['type'][ MYCRED_DEFAULT_TYPE_KEY ]['settings']->scripts_and_styles();
44
+ $modules['type'][ MYCRED_DEFAULT_TYPE_KEY ]['settings']->settings_header();
45
+
46
+ wp_enqueue_style( 'mycred-admin' );
47
+ wp_enqueue_script( 'mycred-accordion' );
48
+
49
+ }
50
+
51
+ add_action( 'admin_menu', array( $this, 'add_submenu' ) );
52
+
53
+ }
54
+
55
+ public function add_submenu() {
56
+
57
+ mycred_add_main_submenu(
58
+ __( 'About', 'mycred' ),
59
+ __( 'About', 'mycred' ),
60
+ 'moderate_comments',
61
+ MYCRED_SLUG . '-about',
62
+ 'mycred_about_page'
63
+ );
64
+
65
+ mycred_add_main_submenu(
66
+ __( 'Suggestions', 'mycred' ),
67
+ __( 'Suggestions', 'mycred' ),
68
+ 'manage_options',
69
+ 'support-screen',
70
+ array( $this,'support_screen_function'),
71
+ 99
72
+ );
73
+
74
+ }
75
+
76
+ public function support_screen_function () {
77
+
78
+ $html = '
79
+ <div class="mycred_support_heading" style="margin: 5% 0 0.2% 86%; text-align:left; ">
80
+ <a href="https://mycred.me/support/" class="support_link" style="text-decoration:none; font-size:14px; line-height: 1.55; font-weight:400; text-align:center; margin:10px 0; transition-duration: .05s; transition-timing-function: ease-in-out; transition-property: border,background,color; color: #135e96; ">Contact Support</a>
81
+ </div>
82
+
83
+ <div class="mycred_iframe">
84
+ <iframe src="https://app.productstash.io/roadmaps/5f8d483c053518002b4441c4/public" height="900" width="90%" frameborder="0" scrolling="no" style="margin-left: 5%; text-decoration:none;"></iframe>
85
+ </div>';
86
+
87
+ echo $html;
88
+
89
+ }
90
+
91
+ }
92
+ endif;
includes/mycred-setup.php CHANGED
@@ -29,477 +29,55 @@ if ( ! class_exists( 'myCRED_Setup' ) ) :
29
  * @version 1.0
30
  */
31
  public function load() {
32
-
33
- add_action( 'admin_notices', array( $this, 'admin_notice' ) );
34
- add_action( 'admin_menu', array( $this, 'setup_menu' ) );
35
- add_action('current_screen', array( $this, 'menu_setup' ));
36
-
37
-
38
- add_action( 'wp_ajax_mycred-setup', array( $this, 'ajax_setup' ) );
39
-
40
- global $pagenow;
41
-
42
- if ( $pagenow == 'index.php' && isset( $_GET['page'] ) && $_GET['page'] == 'mycred-about' ) {
43
- remove_all_actions( 'admin_notices' );
44
- }
45
- }
46
-
47
- /**
48
- * Setup Setup Nag
49
- * @since 0.1
50
- * @version 1.0.1
51
- */
52
- public function admin_notice() {
53
-
54
- $screen = get_current_screen();
55
- if ( $screen->id == 'plugins_page_' . MYCRED_SLUG . '-setup&mycred_tour_guide=1' || ( isset( $_GET['action'] ) && $_GET['action'] === 'edit' ) || ! mycred_is_admin() ) return;
56
-
57
- echo '<div class="info notice notice-info"><p>' . sprintf( __( '%s needs your attention.', 'mycred' ), mycred_label() ) . ' <a href="' . admin_url( 'plugins.php?page=' . MYCRED_SLUG . '-setup' ) . '">' . __( 'Run Setup', 'mycred' ) . '</a></p></div>';
58
-
59
- }
60
-
61
- /**
62
- * Add Setup page under "Plugins"
63
- * @since 0.1
64
- * @version 1.0
65
- */
66
- public function setup_menu() {
67
-
68
- $page = add_submenu_page(
69
- 'plugins.php',
70
- __( 'myCred Setup', 'mycred' ),
71
- __( 'myCred Setup', 'mycred' ),
72
- 'manage_options',
73
- MYCRED_SLUG . '-setup',
74
- array( $this, 'setup_page' )
75
- );
76
-
77
- add_action( 'admin_print_styles-' . $page, array( $this, 'settings_header' ) );
78
-
79
- }
80
-
81
- /**
82
- * Setup Header
83
- * @since 0.1
84
- * @version 1.1
85
- */
86
- public function settings_header() {
87
-
88
- wp_enqueue_style( 'mycred-admin' );
89
- wp_enqueue_style( 'mycred-bootstrap-grid' );
90
- wp_enqueue_style( 'mycred-forms' );
91
 
92
- }
93
-
94
- /**
95
- * Setup Screen
96
- * Outputs the setup page.
97
- * @since 0.1
98
- * @version 1.2.1
99
- */
100
- public function setup_page() {
101
-
102
- $whitelabel = mycred_label();
103
-
104
- ?>
105
- <style type="text/css">
106
- #myCRED-wrap p { font-size: 13px; line-height: 17px; }
107
- #mycred-setup-completed, #mycred-setup-progress { padding-top: 48px; }
108
- #mycred-setup-completed h1, #mycred-setup-progress h1 { font-size: 3em; line-height: 3.2em; }
109
- pre { margin: 0 0 12px 0; padding: 10px; background-color: #dedede; }
110
- </style>
111
- <div class="wrap mycred-metabox" id="myCRED-wrap">
112
- <h1><?php printf( __( '%s Setup', 'mycred' ), $whitelabel ); ?></h1>
113
- <p><?php printf( __( 'Before you can begin using %s, you must setup your first point type. This includes what you want to call your points, how these points are presented and who has access to it.', 'mycred' ), $whitelabel ); ?></p>
114
- <form method="post" action="" class="form" id="mycred-setup-form">
115
-
116
- <div class="row">
117
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
118
- <h1><?php _e( 'Your First Point Type', 'mycred' ); ?></h1>
119
- </div>
120
- </div>
121
-
122
- <div id="mycred-form-content">
123
-
124
- <?php $this->new_point_type(); ?>
125
-
126
- <?php do_action( 'mycred_setup_after_form' ); ?>
127
-
128
- </div>
129
-
130
- <div id="mycred-advanced-setup-options" style="display: none;">
131
-
132
- <div class="row">
133
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
134
- <h1><?php _e( 'Advanced Settings', 'mycred' ); ?></h1>
135
- </div>
136
- </div>
137
-
138
- <div class="row">
139
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
140
- <h3><?php _e( 'Change Default Point Type Key', 'mycred' ); ?></h3>
141
- <pre>define( 'MYCRED_DEFAULT_TYPE_KEY', 'yourkey' );</pre>
142
- <p><span class="description"><?php _e( 'You can change the meta key used to store the default point type using the MYCRED_DEFAULT_TYPE_KEY constant. Copy the above code to your wp-config.php file to use.', 'mycred' ); ?></span></p>
143
- <p><span class="description"><?php _e( 'If you intend to change the default meta key, you should do so before continuing on in this setup!', 'mycred' ); ?></span></p>
144
- </div>
145
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
146
- <h3><?php _e( 'Whitelabel', 'mycred' ); ?></h3>
147
- <pre>define( 'MYCRED_DEFAULT_LABEL', 'SuperPoints' );</pre>
148
- <p><span class="description"><?php _e( 'You can re-label myCRED using the MYCRED_DEFAULT_LABEL constant. Copy the above code to your wp-config.php file to use.', 'mycred' ); ?></span></p>
149
- </div>
150
- </div>
151
-
152
- </div>
153
-
154
- <div class="row">
155
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
156
- <p><input type="submit" id="mycred-tour" class="button button-primary button-large" value="<?php _e( 'Create Point Type', 'mycred' ); ?>" /><button type="button" id="toggle-advanced-options" class="button button-secondary pull-right" data-hide="<?php _e( 'Hide', 'mycred' ); ?>" data-show="<?php _e( 'Advanced', 'mycred' ); ?>"><?php _e( 'Advanced', 'mycred' ); ?></button></p>
157
- </div>
158
- </div>
159
-
160
- </form>
161
- <div id="mycred-setup-progress" style="display: none;">
162
- <h1 class="text-center"><?php _e( 'Processing ...', 'mycred' ); ?></h1>
163
- </div>
164
- <div id="mycred-setup-completed" style="display: none;">
165
- <div class="row">
166
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
167
- <h1 class="text-center"><?php _e( 'Setup Complete!', 'mycred' ); ?></h1>
168
- <p class="text-center" style="font-weight: bold; color: green;"><?php _e( 'Congratulations! You are now ready to use myCRED. What\'s next?', 'mycred' ); ?></p>
169
- </div>
170
- </div>
171
- <div class="row">
172
- <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
173
- <h3><?php _e( 'Enabling Hooks', 'mycred' ); ?></h3>
174
- <p><span class="description"><?php _e( 'If you intend to give your users points for interacting with your website automatically, your next step should be to enable and setup the hooks you want to use.', 'mycred' ); ?></span></p>
175
- <p><a href="<?php echo esc_url( add_query_arg( array( 'page' => MYCRED_SLUG . '-hooks' ), admin_url( 'admin.php' ) ) ); ?>" class="button button-secondary"><?php _e( 'Setup Hooks', 'mycred' ); ?></a></p>
176
- </div>
177
- <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
178
- <h3><?php _e( 'Add-ons', 'mycred' ); ?></h3>
179
- <p><span class="description"><?php _e( 'If you want to use advanced features such as Transfers, Point Purchases etc. your next step should be to enable and setup your add-ons.', 'mycred' ); ?></span></p>
180
- <p><a href="<?php echo esc_url( add_query_arg( array( 'page' => MYCRED_SLUG . '-addons' ), admin_url( 'admin.php' ) ) ); ?>" class="button button-secondary"><?php _e( 'Setup Add-ons', 'mycred' ); ?></a></p>
181
- </div>
182
- <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
183
- <h3><?php _e( 'Adjust Settings', 'mycred' ); ?></h3>
184
- <p><span class="description"><?php _e( 'If you need to make further changes to your settings or add new point types, you can visit your default point type\'s settings.', 'mycred' ); ?></span></p>
185
- <p><a href="<?php echo esc_url( add_query_arg( array( 'page' => MYCRED_SLUG . '-settings' ), admin_url( 'admin.php' ) ) ); ?>" class="button button-secondary"><?php _e( 'View Settings', 'mycred' ); ?></a></p>
186
- </div>
187
- </div>
188
- </div>
189
- </div>
190
- <script type="text/javascript">
191
- jQuery(function($) {
192
-
193
- var mycred_tour_guide = {};
194
-
195
- $( '#toggle-advanced-options' ).click(function(){
196
-
197
- var hidelabel = $(this).data( 'hide' );
198
- var showlabel = $(this).data( 'show' );
199
-
200
- if ( ! $(this).hasClass( 'open' ) ) {
201
- $( '#mycred-advanced-setup-options' ).slideDown();
202
- $(this).text( hidelabel ).addClass( 'open' );
203
- }
204
- else {
205
- $( '#mycred-advanced-setup-options' ).slideUp();
206
- $(this).text( showlabel ).removeClass( 'open' );
207
- }
208
-
209
- });
210
-
211
- $( '#myCRED-wrap' ).on( 'submit', 'form#mycred-setup-form', function(e){
212
-
213
- var progressbox = $( '#mycred-setup-progress' );
214
- var completedbox = $( '#mycred-setup-completed' );
215
- var setupform = $(this);
216
-
217
- e.preventDefault();
218
-
219
- $.ajax({
220
- type : "POST",
221
- data : {
222
- action : 'mycred-setup',
223
- setup : $(this).serialize(),
224
- token : '<?php echo wp_create_nonce( 'mycred-run-setup' ); ?>'
225
- },
226
- dataType : "JSON",
227
- url : ajaxurl,
228
- beforeSend : function(){
229
-
230
- setupform.hide();
231
- progressbox.show();
232
-
233
- if ( $( '#toggle-advanced-options' ).hasClass( 'open' ) )
234
- $( '#toggle-advanced-options' ).click();
235
-
236
-
237
- },
238
- success : function( response ) {
239
-
240
- console.log( response );
241
-
242
- if ( response.success === undefined )
243
- location.reload();
244
-
245
- else {
246
-
247
- progressbox.hide();
248
-
249
- if ( response.success ) {
250
- window.location.href = '<?php echo admin_url('admin.php?page=mycred&mycred_tour_guide=2'); ?>';
251
- //completedbox.slideDown();
252
- setupform.remove();
253
- }
254
- else {
255
- $( '#mycred-form-content' ).empty().append( response.data );
256
- setupform.slideDown();
257
- }
258
-
259
- }
260
-
261
- }
262
- });
263
-
264
- });
265
-
266
- });
267
- </script>
268
-
269
- <?php
270
-
271
- }
272
-
273
- /**
274
- * New Point Type Form
275
- * @since 1.7
276
- * @version 1.1
277
- */
278
- protected function new_point_type( $posted = array() ) {
279
-
280
- $mycred = mycred();
281
- $posted = wp_parse_args( $posted, $mycred->defaults() );
282
-
283
- ?>
284
-
285
- <div class="row">
286
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
287
- <h3><?php _e( 'Labels', 'mycred' ); ?></h3>
288
- <div class="row">
289
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
290
- <div class="form-group">
291
- <label for="mycred-setup-name-singular"><?php _e( 'Singular', 'mycred' ); ?></label>
292
- <input type="text" name="first_type[name][singular]" id="mycred-setup-name-singular" placeholder="<?php _e( 'Required', 'mycred' ); ?>" class="form-control" value="<?php echo esc_attr( $posted['name']['singular'] ); ?>" />
293
- </div>
294
- </div>
295
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
296
- <div class="form-group">
297
- <label for="mycred-setup-name-plural"><?php _e( 'Plural', 'mycred' ); ?></label>
298
- <input type="text" name="first_type[name][plural]" id="mycred-setup-name-plural" placeholder="<?php _e( 'Required', 'mycred' ); ?>" class="form-control" value="<?php echo esc_attr( $posted['name']['plural'] ); ?>" />
299
- </div>
300
- </div>
301
- </div>
302
- <p><span class="description"><?php _e( 'These labels are used throughout the admin area and when presenting points to your users.', 'mycred' ); ?></span></p>
303
- </div>
304
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
305
- <h3><?php _e( 'Format', 'mycred' ); ?></h3>
306
- <div class="row">
307
- <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
308
- <div class="form-group">
309
- <label for="mycred-setup-before"><?php _e( 'Prefix', 'mycred' ); ?></label>
310
- <input type="text" name="first_type[before]" id="mycred-setup-before" class="form-control" value="<?php echo esc_attr( $posted['before'] ); ?>" />
311
- </div>
312
- </div>
313
- <div class="col-lg-5 col-md-5 col-sm-12 col-xs-12">
314
- <div class="form-group">
315
- <label for="mycred-setup-format-separators-thousand"><?php _e( 'Separators', 'mycred' ); ?></label>
316
- <div class="form-inline">
317
- <label>1</label> <input type="text" name="first_type[format][separators][thousand]" id="mycred-setup-format-separators-thousand" placeholder="," class="form-control" size="2" value="<?php echo esc_attr( $posted['format']['separators']['thousand'] ); ?>" /> <label>000</label> <input type="text" name="first_type[format][separators][decimal]" id="mycred-setup-format-separators-decimal" placeholder="." class="form-control" size="2" value="<?php echo esc_attr( $posted['format']['separators']['decimal'] ); ?>" /> <label>00</label>
318
- </div>
319
- </div>
320
- </div>
321
- <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
322
- <div class="form-group">
323
- <label for=""><?php _e( 'Decimals', 'mycred' ); ?></label>
324
- <input type="text" name="first_type[format][decimals]" id="mycred-setup-format-decimals" placeholder="0" class="form-control" value="<?php echo esc_attr( $posted['format']['decimals'] ); ?>" />
325
- </div>
326
- </div>
327
- <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
328
- <div class="form-group">
329
- <label for=""><?php _e( 'Suffix', 'mycred' ); ?></label>
330
- <input type="text" name="first_type[after]" id="mycred-setup-after" class="form-control" value="<?php echo esc_attr( $posted['after'] ); ?>" />
331
- </div>
332
- </div>
333
- </div>
334
- <p><span class="description"><?php _e( 'Set to decimals to zero if you prefer to use whole numbers.', 'mycred' ); ?></span></p>
335
- </div>
336
- </div>
337
-
338
- <div class="row">
339
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
340
- <h3><?php _e( 'Security', 'mycred' ); ?></h3>
341
- <div class="row">
342
- <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
343
- <div class="form-group">
344
- <label for="mycred-setup-caps-creds"><?php _e( 'Point Editors', 'mycred' ); ?></label>
345
- <input type="text" name="first_type[caps][creds]" id="mycred-setup-caps-creds" placeholder="<?php _e( 'Required', 'mycred' ); ?>" class="form-control" value="<?php echo esc_attr( $posted['caps']['creds'] ); ?>" />
346
- <p><span class="description"><?php _e( 'The capability of users who can edit balances.', 'mycred' ); ?></span></p>
347
- </div>
348
- </div>
349
- <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
350
- <div class="form-group">
351
- <label for="mycred-setup-caps-plugin"><?php _e( 'Point Administrators', 'mycred' ); ?></label>
352
- <input type="text" name="first_type[caps][plugin]" id="mycred-setup-caps-plugin" placeholder="<?php _e( 'Required', 'mycred' ); ?>" class="form-control" value="<?php echo esc_attr( $posted['caps']['plugin'] ); ?>" />
353
- <p><span class="description"><?php _e( 'The capability of users who can edit settings.', 'mycred' ); ?></span></p>
354
- </div>
355
- </div>
356
- <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
357
- <div class="form-group">
358
- <label for="mycred-setup-max"><?php _e( 'Max. Amount', 'mycred' ); ?></label>
359
- <input type="text" name="first_type[max]" id="mycred-setup-max" class="form-control" value="<?php echo esc_attr( $posted['max'] ); ?>" />
360
- <p><span class="description"><?php _e( 'The maximum amount allowed to be paid out in a single instance.', 'mycred' ); ?></span></p>
361
- </div>
362
- </div>
363
- <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
364
- <div class="form-group">
365
- <label for="mycred-setup-exclude-list"><?php _e( 'Exclude by User ID', 'mycred' ); ?></label>
366
- <input type="text" name="first_type[exclude][list]" id="mycred-setup-exclude-list" placeholder="<?php _e( 'Optional', 'mycred' ); ?>" class="form-control" value="<?php echo esc_attr( $posted['exclude']['list'] ); ?>" />
367
- <p><span class="description"><?php _e( 'Comma separated list of user IDs to exclude from using this point type.', 'mycred' ); ?></span></p>
368
- </div>
369
- <div class="form-group">
370
- <div class="checkbox">
371
- <label for="mycred-setup-exclude-cred-editors"><input type="checkbox" name="first_type[exclude][cred_editors]" id="mycred-setup-exclude-cred-editors"<?php checked( $posted['exclude']['cred_editors'], 1 ); ?> value="1" /> <?php _e( 'Exclude point editors', 'mycred' ); ?></label>
372
- </div>
373
- <div class="checkbox">
374
- <label for="mycred-setup-exclude-plugin-editors"><input type="checkbox" name="first_type[exclude][plugin_editors]" id="mycred-setup-exclude-plugin-editors"<?php checked( $posted['exclude']['plugin_editors'], 1 ); ?> value="1" /> <?php _e( 'Exclude point administrators', 'mycred' ); ?></label>
375
- </div>
376
- </div>
377
- </div>
378
- </div>
379
- </div>
380
- </div>
381
- <?php
382
 
383
  }
384
 
385
  /**
386
  * Process Setup Steps
387
  * @since 0.1
388
- * @version 1.2
389
  */
390
- public function ajax_setup() {
391
-
392
- // Security
393
- check_admin_referer( 'mycred-run-setup', 'token' );
394
-
395
- if ( ! current_user_can( 'manage_options' ) ) wp_send_json_error();
396
-
397
- parse_str( $_POST['setup'], $posted );
398
-
399
- $errors = array();
400
- $defaults = $this->core->defaults();
401
- $decimals = 0;
402
-
403
- if ( ! array_key_exists( 'first_type', $posted ) ) {
404
 
405
- ob_start();
406
-
407
- echo '<div class="info notice notice-info"><p>' . __( 'Please make sure you fill out all required fields!', 'mycred' ) . '</a></p></div>';
408
-
409
- $this->new_point_type( $defaults );
410
-
411
- $output = ob_get_contents();
412
- ob_end_clean();
413
-
414
- wp_send_json_error( $output );
415
-
416
- }
417
-
418
- $setup = mycred_apply_defaults( $defaults, $posted['first_type'] );
419
- $first_type = $defaults;
420
-
421
- $singular_name = sanitize_text_field( $setup['name']['singular'] );
422
- if ( empty( $singular_name ) )
423
- $errors[] = 'empty';
424
-
425
- elseif ( $singular_name != $first_type['name']['singular'] )
426
- $first_type['name']['singular'] = $singular_name;
427
-
428
- $plural_name = sanitize_text_field( $setup['name']['plural'] );
429
- if ( empty( $plural_name ) )
430
- $errors[] = 'empty';
431
-
432
- elseif ( $plural_name != $first_type['name']['plural'] )
433
- $first_type['name']['plural'] = $plural_name;
434
-
435
- $first_type['before'] = sanitize_text_field( $setup['before'] );
436
- $first_type['after'] = sanitize_text_field( $setup['after'] );
437
-
438
- $point_editor_cap = sanitize_key( $setup['caps']['creds'] );
439
- if ( empty( $point_editor_cap ) )
440
- $errors[] = 'empty';
441
-
442
- if ( $point_editor_cap != $first_type['caps']['creds'] )
443
- $first_type['caps']['creds'] = $point_editor_cap;
444
-
445
- $point_admin_cap = sanitize_key( $setup['caps']['plugin'] );
446
- if ( empty( $point_admin_cap ) )
447
- $errors[] = 'empty';
448
-
449
- if ( $point_admin_cap != $first_type['caps']['plugin'] )
450
- $first_type['caps']['plugin'] = $point_admin_cap;
451
-
452
- if ( absint( $setup['format']['decimals'] ) > 0 ) {
453
- $first_type['format']['type'] = 'decimal';
454
- $first_type['format']['decimals'] = absint( $setup['format']['decimals'] );
455
- $decimals = $first_type['format']['decimals'];
456
- }
457
-
458
- $errors = apply_filters( 'mycred_setup_errors', $errors, $posted );
459
-
460
- // Something went wrong
461
- if ( ! empty( $errors ) ) {
462
-
463
- ob_start();
464
-
465
- echo '<div class="info notice notice-info"><p>' . __( 'Please make sure you fill out all required fields!', 'mycred' ) . '</a></p></div>';
466
-
467
- $this->new_point_type( $setup );
468
-
469
- $output = ob_get_contents();
470
- ob_end_clean();
471
-
472
- wp_send_json_error( apply_filters( 'mycred_setup_error_output', $output, $posted ) );
473
-
474
- }
475
 
476
  // Save our first point type
477
  mycred_update_option( 'mycred_pref_core', $first_type );
478
 
 
 
479
  // Install database
480
  if ( ! function_exists( 'mycred_install_log' ) )
481
  require_once myCRED_INCLUDES_DIR . 'mycred-functions.php';
482
 
483
- mycred_install_log( $decimals, true );
484
 
485
  mycred_add_option( 'mycred_setup_completed', time() );
486
 
487
- // Return the good news
488
- wp_send_json_success();
489
-
490
  }
491
- public function menu_setup( $current_screen ){
492
-
493
- if ( $current_screen->id == 'plugins_page_mycred-setup' && ! isset( $_GET['mycred_tour_guide'] ) ){
494
- wp_redirect(
495
- add_query_arg(
496
- array('page'=>'mycred-setup', 'mycred_tour_guide' => 1),
497
- admin_url('plugins.php')
498
- )
499
- );
500
- exit;
501
- }
502
- }
503
-
504
  }
505
  endif;
29
  * @version 1.0
30
  */
31
  public function load() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
+ $this->setup_default_point_type();
34
+
35
+ // Add general settings
36
+ add_option( 'mycred_version', myCRED_VERSION );
37
+ add_option( 'mycred_key', wp_generate_password( 12, true, true ) );
38
+
39
+ require_once myCRED_MODULES_DIR . 'mycred-module-addons.php';
40
+ $addons_module = new myCRED_Addons_Module();
41
+ $installed_addons = $addons_module->get();
42
+
43
+ // Add add-ons settings
44
+ add_option( 'mycred_pref_addons', array(
45
+ 'installed' => $installed_addons,
46
+ 'active' => array_keys( $installed_addons )
47
+ ) );
48
+
49
+ // Add hooks settings
50
+ $option_id = apply_filters( 'mycred_option_id', 'mycred_pref_hooks' );
51
+ add_option( $option_id, array(
52
+ 'installed' => array(),
53
+ 'active' => array(),
54
+ 'hook_prefs' => array()
55
+ ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  }
58
 
59
  /**
60
  * Process Setup Steps
61
  * @since 0.1
62
+ * @version 1.3
63
  */
64
+ public function setup_default_point_type() {
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
+ $first_type = $this->core->defaults();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  // Save our first point type
69
  mycred_update_option( 'mycred_pref_core', $first_type );
70
 
71
+ mycred_upload_default_point_image();
72
+
73
  // Install database
74
  if ( ! function_exists( 'mycred_install_log' ) )
75
  require_once myCRED_INCLUDES_DIR . 'mycred-functions.php';
76
 
77
+ mycred_install_log( $first_type['format']['decimals'], true );
78
 
79
  mycred_add_option( 'mycred_setup_completed', time() );
80
 
 
 
 
81
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
83
  endif;
includes/mycred-uninstall.php CHANGED
@@ -12,7 +12,7 @@ if ( !class_exists( 'myCred_Uninstall_Settings' ) ):
12
  public function __construct()
13
  {
14
  add_action( 'mycred_after_core_prefs', array( $this, 'uninstall_settings' ) );
15
- add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 10, 3 );
16
  }
17
 
18
  /**
12
  public function __construct()
13
  {
14
  add_action( 'mycred_after_core_prefs', array( $this, 'uninstall_settings' ) );
15
+ add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 10, 3 );
16
  }
17
 
18
  /**
includes/mycred-walkthrough.php CHANGED
@@ -10,15 +10,19 @@ if ( ! defined( 'myCRED_VERSION' ) ) exit;
10
  */
11
  if ( ! class_exists( 'myCRED_walkthroug' ) ) :
12
  class myCRED_walkthroug {
 
 
13
  /**
14
  * Construct
15
  */
16
  public function __construct() {
17
 
18
  $this->core = mycred();
19
-
20
  add_action( 'wp_loaded', array( $this, 'load' ) );
 
21
  }
 
22
  /**
23
  * Load Class
24
  * @since 1.7
@@ -26,35 +30,44 @@ if ( ! class_exists( 'myCRED_walkthroug' ) ) :
26
  */
27
  public function load() {
28
 
29
- wp_register_style( 'mycred-tourguide-style', plugins_url( 'assets/css/tourguide.css', myCRED_THIS ), array(), myCRED_VERSION , 'all' );
 
30
  wp_register_script( 'mycred-tourguide-script', plugins_url( 'assets/js/tourguide.min.js',myCRED_THIS ), array( 'jquery' ), myCRED_VERSION , true );
31
 
32
- $step = intval( $_GET['mycred_tour_guide'] );
33
 
34
- $redirect_url = '';
35
 
36
- if( $step == 2 ) {
37
 
38
- $redirect_url = admin_url('admin.php?page=mycred-hooks&mycred_tour_guide=3');
39
 
40
- }
41
- else if( $step == 3 ){
42
 
43
- $redirect_url = admin_url('admin.php?page=mycred-addons&mycred_tour_guide=4');
 
44
 
45
- }
46
-
47
- wp_localize_script(
48
- 'mycred-tourguide-script',
49
- 'mycred_tour_guide',
50
- array(
51
- 'step' => $step,
52
- 'redirect_url' => $redirect_url
53
- )
54
- );
55
- wp_enqueue_script( 'mycred-tourguide-script' );
56
- wp_enqueue_style( 'mycred-tourguide-style' );
57
-
58
- }
59
- }
 
 
 
 
 
 
 
 
 
60
  endif;
10
  */
11
  if ( ! class_exists( 'myCRED_walkthroug' ) ) :
12
  class myCRED_walkthroug {
13
+
14
+
15
  /**
16
  * Construct
17
  */
18
  public function __construct() {
19
 
20
  $this->core = mycred();
21
+
22
  add_action( 'wp_loaded', array( $this, 'load' ) );
23
+
24
  }
25
+
26
  /**
27
  * Load Class
28
  * @since 1.7
30
  */
31
  public function load() {
32
 
33
+ wp_register_style( 'mycred-tourguide-style', plugins_url( 'assets/css/tourguide.css', myCRED_THIS ), array(), myCRED_VERSION , 'all' );
34
+
35
  wp_register_script( 'mycred-tourguide-script', plugins_url( 'assets/js/tourguide.min.js',myCRED_THIS ), array( 'jquery' ), myCRED_VERSION , true );
36
 
 
37
 
38
+ $step = intval($_GET['mycred_tour_guide']);
39
 
40
+ $redirect_url = '';
41
 
42
+ if( $step == 1 ) {
43
 
44
+ $redirect_url = admin_url('admin.php?page=mycred&mycred_tour_guide=2');
 
45
 
46
+ }
47
+ else if( $step == 2 ) {
48
 
49
+ $redirect_url = admin_url('admin.php?page=mycred-hooks&mycred_tour_guide=3');
50
+
51
+ }
52
+ else if( $step == 3 ){
53
+
54
+ $redirect_url = admin_url('admin.php?page=mycred-addons&mycred_tour_guide=4');
55
+
56
+ }
57
+
58
+ wp_localize_script(
59
+ 'mycred-tourguide-script',
60
+ 'mycred_tour_guide',
61
+ array(
62
+ 'step' => $step,
63
+ 'redirect_url' => $redirect_url
64
+ ),
65
+ );
66
+ wp_enqueue_script( 'mycred-tourguide-script' );
67
+
68
+
69
+ wp_enqueue_style( 'mycred-tourguide-style' );
70
+ }
71
+
72
+ }
73
  endif;
membership/mycred-connect-membership.php CHANGED
@@ -19,8 +19,12 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
19
  */
20
  public function __construct() {
21
  add_action( 'admin_menu', array( $this, 'mycred_membership_menu' ) );
 
 
22
  add_action( 'admin_init', array( $this, 'add_styles' ) );
23
  add_action( 'mycred_admin_init', array( $this, 'membership_addon_actions' ) );
 
 
24
  }
25
 
26
  function add_styles() {
@@ -30,15 +34,214 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
30
  if( isset($_GET['page']) && $_GET['page'] == 'mycred-membership' ) {
31
  wp_enqueue_style( 'mycred-bootstrap-grid' );
32
  }
 
 
 
 
 
 
 
 
33
 
34
  wp_enqueue_style('admin-subscription-css');
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  /**
38
  * Register membership menu
39
  */
40
  public function mycred_membership_menu() {
41
- add_submenu_page( 'mycred', 'Membership', 'Membership<span class="mycred-membership-menu-label">New</span>', 'manage_options', 'mycred-membership',array($this,'mycred_membership_callback'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
  /**
@@ -288,10 +491,109 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
288
  $addons = $this->get_membership_addons();
289
  ?>
290
  <style type="text/css">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
  .theme-browser .theme:focus, .theme-browser .theme:hover { cursor: default !important; }
292
  .theme-browser .theme:hover .more-details { opacity: 1; }
293
  .theme-browser .theme:hover a.more-details, .theme-browser .theme:hover a.more-details:hover { text-decoration: none; }
294
- .theme-browser .theme .theme-screenshot img { height: 100%; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  </style>
296
  <div class="theme-browser mmc-addons" >
297
  <?php
19
  */
20
  public function __construct() {
21
  add_action( 'admin_menu', array( $this, 'mycred_membership_menu' ) );
22
+ add_action( 'admin_menu', array( $this, 'mycred_treasures' ) );
23
+ add_action( 'admin_menu', array( $this, 'mycred_support' ) );
24
  add_action( 'admin_init', array( $this, 'add_styles' ) );
25
  add_action( 'mycred_admin_init', array( $this, 'membership_addon_actions' ) );
26
+
27
+ add_filter( 'admin_footer_text', array( $this,'mycred_admin_footer_text') );
28
  }
29
 
30
  function add_styles() {
34
  if( isset($_GET['page']) && $_GET['page'] == 'mycred-membership' ) {
35
  wp_enqueue_style( 'mycred-bootstrap-grid' );
36
  }
37
+
38
+ elseif( isset($_GET['page']) && $_GET['page'] == 'mycred-treasures' ) {
39
+ wp_enqueue_style( 'mycred-bootstrap-grid' );
40
+ }
41
+
42
+ elseif( isset($_GET['page']) && $_GET['page'] == 'mycred-support' ) {
43
+ wp_enqueue_style( 'mycred-bootstrap-grid' );
44
+ }
45
 
46
  wp_enqueue_style('admin-subscription-css');
47
  }
48
 
49
+ function mycred_admin_footer_text($footer_text) {
50
+ global $typenow;
51
+
52
+ if( isset($_GET['page']) && $_GET['page'] == 'mycred-support' ) {
53
+
54
+ $mycred_footer_text = sprintf( __( 'Thank you for being a <a href="%1$s" target="_blank">myCred </a>user! Please give your <a href="%2$s" target="_blank">%3$s</a> rating on WordPress.org', 'mycred' ),
55
+ 'https://mycred.me',
56
+ 'https://wordpress.org/support/plugin/mycred/reviews/?rate=5#new-post',
57
+ '&#9733;&#9733;&#9733;&#9733;&#9733;'
58
+ );
59
+
60
+ return str_replace( '</span>', '', $footer_text ) . ' | ' . $mycred_footer_text . '</span>';
61
+
62
+ }
63
+ else {
64
+
65
+ return $footer_text;
66
+
67
+ }
68
+ }
69
+
70
  /**
71
  * Register membership menu
72
  */
73
  public function mycred_membership_menu() {
74
+ mycred_add_main_submenu(
75
+ 'Membership',
76
+ 'Membership',
77
+ 'manage_options',
78
+ 'mycred-membership',
79
+ array( $this, 'mycred_membership_callback' )
80
+ );
81
+ }
82
+
83
+ /**
84
+ * Register membership menu
85
+ */
86
+ public function mycred_treasures() {
87
+ mycred_add_main_submenu(
88
+ 'Treasures',
89
+ 'Treasures',
90
+ 'manage_options',
91
+ 'mycred-treasures',
92
+ array( $this, 'mycred_treasures_callback' )
93
+ );
94
+ }
95
+
96
+ /**
97
+ * Register Help / Support menu
98
+ */
99
+ public function mycred_support() {
100
+ mycred_add_main_submenu(
101
+ 'Support',
102
+ 'Support',
103
+ 'manage_options',
104
+ 'mycred-support',
105
+ array( $this, 'mycred_support_callback' )
106
+ );
107
+ }
108
+
109
+ public function mycred_support_callback() {?>
110
+ <div class="wrap mycred-support-page-container">
111
+ <h1 class="wp-heading-inline">myCred Help and Support</h1>
112
+
113
+ <div class="mycred-support-page-content">
114
+
115
+ <h2>About myCred</h2>
116
+ <p>myCred is an intelligent and adaptive points management system that allows you to build and manage a broad range of digital rewards including points, ranks and, badges on your WordPress-powered website.</p>
117
+
118
+ <hr>
119
+
120
+ <h2>Documentation</h2>
121
+ <p>For complete information about myCred and its collection of add-ons, visit the <a target="_blank" href="http://codex.mycred.me/">official documentation</a>.</p>
122
+ <hr>
123
+
124
+ <h2>Help/Support</h2>
125
+ <p>Connect with us for support or feature enhancements - myCred Support Forums or <a target="_blank" href="https://objectsws.atlassian.net/servicedesk/customer/portal/7/group/7/create/46">Open a support ticket</a>.</p>
126
+ <hr>
127
+
128
+ <h2>Free add-ons</h2>
129
+ <p>Power your WordPress website with 30+ free add-ons for myCred - enhance your website's functionality with our free add-ons for store gateways, third-party bridges, and gamification. <a target="_blank" href="https://mycred.me/product-category/freebies/">Visit our complete collection</a>.</p>
130
+ <hr>
131
+
132
+ <h2>Premium add-ons</h2>
133
+ <p>Enjoy the best that myCred has to offer with our collection of premium add-ons that enable you to perform complex tasks such as buy or sell points in exchange for real money or create a points management system for your WooCommerce store. <a target="_blank" href="https://mycred.me/store/">View our premium add-ons</a>.</p>
134
+ <hr>
135
+
136
+ <h2>Customization</h2>
137
+ <p>If you need to build a custom feature, simply <a href="https://objectsws.atlassian.net/servicedesk/customer/portal/11/create/92">submit a request</a> on our myCred website.</p>
138
+
139
+ </div>
140
+
141
+
142
+ </div>
143
+ <?php
144
+ }
145
+
146
+ /**
147
+ * Treasures menu callback
148
+ */
149
+ public function mycred_treasures_callback() {?>
150
+ <div class="wrap" id="myCRED-wrap">
151
+ <div class="mycred-addon-outer">
152
+ <div class="myCRED-addon-heading">
153
+ <h1>Treasures </h1>
154
+ </div>
155
+ <div class="clear"></div>
156
+ </div>
157
+ <div class="theme-browser">
158
+ <div class="themes">
159
+ <div class="theme active mycred-treasure-pack">
160
+ <div class="mycred-treasure-pack-content">
161
+ <img src="<?php echo plugins_url( 'assets/images/treasures/badges.jpg', myCRED_THIS );?>" alt="Treasure Badges">
162
+ <h3>Badges</h3>
163
+ <p>40 unique and beautifully designed Badge designs available in Gold, Silver and Bronze.</p>
164
+ </div>
165
+ <div class="theme-id-container">
166
+ <h2 class="theme-name">Get Info</h2>
167
+ <div class="theme-actions">
168
+ <a href="https://mycred.me/treasure/badges/" target="_blank" class="button button-primary mycred-action">Get this Asset</a>
169
+ </div>
170
+ </div>
171
+ </div>
172
+ <div class="theme active mycred-treasure-pack">
173
+ <div class="mycred-treasure-pack-content">
174
+ <img src="<?php echo plugins_url( 'assets/images/treasures/rank.jpg', myCRED_THIS );?>" alt="Treasure Ranks">
175
+ <h3>Ranks</h3>
176
+ <p>40 unique and beautifully designed virtual Ranks are available in Red, Silver and Gold.</p>
177
+ </div>
178
+ <div class="theme-id-container">
179
+ <h2 class="theme-name">Get Info</h2>
180
+ <div class="theme-actions">
181
+ <a href="https://mycred.me/treasure/ranks/" target="_blank" class="button button-primary mycred-action">Get this Asset</a>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ <div class="theme active mycred-treasure-pack">
186
+ <div class="mycred-treasure-pack-content">
187
+ <img src="<?php echo plugins_url( 'assets/images/treasures/currency.jpg', myCRED_THIS );?>" alt="Treasure Currencies">
188
+ <h3>Currency</h3>
189
+ <p>17 unique and beautifully designed Currency designs available in Gold, Silver & Bronze.</p>
190
+ </div>
191
+ <div class="theme-id-container">
192
+ <h2 class="theme-name">Get Info</h2>
193
+ <div class="theme-actions">
194
+ <a href="https://mycred.me/treasure/currency/" target="_blank" class="button button-primary mycred-action">Get this Asset</a>
195
+ </div>
196
+ </div>
197
+ </div>
198
+ <div class="theme active mycred-treasure-pack">
199
+ <div class="mycred-treasure-pack-content">
200
+ <img src="<?php echo plugins_url( 'assets/images/treasures/learning.jpg', myCRED_THIS );?>" alt="Treasure Learning">
201
+ <h3>Learning</h3>
202
+ <p>30 unique and beautifully designed Learning icons are available in four different shapes.</p>
203
+ </div>
204
+ <div class="theme-id-container">
205
+ <h2 class="theme-name">Get Info</h2>
206
+ <div class="theme-actions">
207
+ <a href="https://mycred.me/treasure/learning/" target="_blank" class="button button-primary mycred-action">Get this Asset</a>
208
+ </div>
209
+ </div>
210
+ </div>
211
+ </div>
212
+ </div>
213
+ <div class="theme-browser">
214
+ <div class="themes">
215
+ <div class="theme active mycred-treasure-pack">
216
+ <div class="mycred-treasure-pack-content">
217
+ <img src="<?php echo plugins_url( 'assets/images/treasures/fitness.jpg', myCRED_THIS );?>" alt="Treasure Fitness">
218
+ <h3>Fitness</h3>
219
+ <p>30 unique and beautifully designed Fitness icons are available in three different shapes.</p>
220
+ </div>
221
+ <div class="theme-id-container">
222
+ <h2 class="theme-name">Get Info</h2>
223
+ <div class="theme-actions">
224
+ <a href="https://mycred.me/treasure/fitness/" target="_blank" class="button button-primary mycred-action">Get this Asset</a>
225
+ </div>
226
+ </div>
227
+ </div>
228
+ <div class="theme active mycred-treasure-pack">
229
+ <div class="mycred-treasure-pack-content">
230
+ <img src="<?php echo plugins_url( 'assets/images/treasures/gems.jpg', myCRED_THIS );?>" alt="Treasure Gems">
231
+ <h3>Gems</h3>
232
+ <p>500 unique and beautifully designed gem icons are available in four different shapes.</p>
233
+ </div>
234
+ <div class="theme-id-container">
235
+ <h2 class="theme-name">Get Info</h2>
236
+ <div class="theme-actions">
237
+ <a href="https://mycred.me/treasure/gems/" target="_blank" class="button button-primary mycred-action">Get this Asset</a>
238
+ </div>
239
+ </div>
240
+ </div>
241
+ </div>
242
+ </div>
243
+ </div>
244
+ <?php
245
  }
246
 
247
  /**
491
  $addons = $this->get_membership_addons();
492
  ?>
493
  <style type="text/css">
494
+ /*.theme-browser .theme:focus, .theme-browser .theme:hover { cursor: default !important; }*/
495
+ /*.theme-browser .theme:hover .more-details { opacity: 1; }*/
496
+ .theme-browser .theme:hover a.more-details, .theme-browser .theme:hover a.more-details:hover { text-decoration: none; }
497
+ .theme-browser .theme .theme-screenshot img { height: 100%; }
498
+
499
+ .theme-browser .theme .theme-screenshot1 img { height: 100%; }
500
+
501
+
502
+
503
+ .theme.active:hover {
504
+ background: #f0f0f1 !important;
505
+ color: #3c434a !important;
506
+ }
507
+
508
+
509
+ #myCRED-wrap > h1 { margin-bottom: 15px; }
510
  .theme-browser .theme:focus, .theme-browser .theme:hover { cursor: default !important; }
511
  .theme-browser .theme:hover .more-details { opacity: 1; }
512
  .theme-browser .theme:hover a.more-details, .theme-browser .theme:hover a.more-details:hover { text-decoration: none; }
513
+ .mycred-addons-switch {
514
+ position: relative;
515
+ display: inline-block;
516
+ width: 60px;
517
+ height: 34px;
518
+ }
519
+
520
+ /* Hide default HTML checkbox */
521
+ .mycred-addons-switch input {
522
+ opacity: 0;
523
+ width: 0;
524
+ height: 0;
525
+ }
526
+
527
+ /* The slider */
528
+ .slider {
529
+ position: absolute;
530
+ cursor: pointer;
531
+ top: 0;
532
+ left: 0;
533
+ right: 0;
534
+ bottom: 0;
535
+ background-color: #ccc;
536
+ -webkit-transition: .4s;
537
+ transition: .4s;
538
+ }
539
+
540
+ .slider:before {
541
+ position: absolute;
542
+ content: "";
543
+ height: 26px;
544
+ width: 26px;
545
+ left: 4px;
546
+ bottom: 4px;
547
+ background-color: white;
548
+ -webkit-transition: .4s;
549
+ transition: .4s;
550
+ }
551
+
552
+ input:checked + .slider {
553
+ background-color: lightgreen;
554
+ }
555
+
556
+ input:focus + .slider {
557
+ box-shadow: 0 0 1px lightgreen;
558
+ }
559
+
560
+ input:checked + .slider:before {
561
+ -webkit-transform: translateX(26px);
562
+ -ms-transform: translateX(26px);
563
+ transform: translateX(26px);
564
+ }
565
+
566
+ /* Rounded sliders */
567
+ .slider.round {
568
+ border-radius: 34px;
569
+ }
570
+
571
+ .slider.round:before {
572
+ border-radius: 50%;
573
+ }
574
+
575
+ .myCRED-addon-heading {
576
+ float: left;
577
+ }
578
+
579
+ .mycred-addon-switch {
580
+ float: right;
581
+ }
582
+
583
+ p.mycred-activate {
584
+ float: left;
585
+ margin: 7px 7px 0px 0px;
586
+ }
587
+ .clear{
588
+ clear: both;
589
+ }
590
+ .mycred-addon-outer {
591
+ padding: 10px 0;
592
+ }
593
+
594
+
595
+
596
+
597
  </style>
598
  <div class="theme-browser mmc-addons" >
599
  <?php
modules/mycred-module-addons.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  if ( ! defined( 'myCRED_VERSION' ) ) exit;
3
 
4
  /**
@@ -6,6 +7,7 @@ if ( ! defined( 'myCRED_VERSION' ) ) exit;
6
  * @since 0.1
7
  * @version 1.1.1
8
  */
 
9
  if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
10
  class myCRED_Addons_Module extends myCRED_Module {
11
 
@@ -27,7 +29,8 @@ if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
27
  ),
28
  'screen_id' => MYCRED_SLUG . '-addons',
29
  'accordion' => true,
30
- 'menu_pos' => 30
 
31
  ), $type );
32
 
33
  }
@@ -85,6 +88,42 @@ if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
85
 
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  }
89
 
90
  /**
@@ -343,15 +382,142 @@ if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
343
 
344
  $installed = $this->get( true );
345
 
 
346
  ?>
347
  <style type="text/css">
348
  #myCRED-wrap > h1 { margin-bottom: 15px; }
349
  .theme-browser .theme:focus, .theme-browser .theme:hover { cursor: default !important; }
350
  .theme-browser .theme:hover .more-details { opacity: 1; }
351
  .theme-browser .theme:hover a.more-details, .theme-browser .theme:hover a.more-details:hover { text-decoration: none; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  <div class="wrap" id="myCRED-wrap">
354
- <h1><?php _e( 'Add-ons', 'mycred' ); if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?> <a href="http://codex.mycred.me/chapter-iii/" class="page-title-action" target="_blank"><?php _e( 'Documentation', 'mycred' ); ?></a><?php endif; ?></h1>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  <?php
356
 
357
  // Messages
@@ -370,7 +536,163 @@ if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
370
  <div class="themes">
371
  <?php
372
 
373
- // Loop though installed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  if ( ! empty( $installed ) ) {
375
 
376
  foreach ( $installed as $key => $data ) {
@@ -409,14 +731,17 @@ if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
409
 
410
  <div class="theme-actions">
411
 
412
- <?php echo $this->activate_deactivate( $key ); ?>
413
 
414
  </div>
415
 
416
  </div>
417
 
418
  </div>
419
- <?php
 
 
 
420
 
421
  }
422
 
@@ -454,6 +779,20 @@ if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
454
 
455
  }
456
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  }
458
  endif;
459
 
@@ -493,3 +832,49 @@ if ( ! function_exists( 'get_mycred_addon_deactivation_url' ) ) :
493
 
494
  }
495
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+
3
  if ( ! defined( 'myCRED_VERSION' ) ) exit;
4
 
5
  /**
7
  * @since 0.1
8
  * @version 1.1.1
9
  */
10
+
11
  if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
12
  class myCRED_Addons_Module extends myCRED_Module {
13
 
29
  ),
30
  'screen_id' => MYCRED_SLUG . '-addons',
31
  'accordion' => true,
32
+ 'menu_pos' => 30,
33
+ 'main_menu' => true
34
  ), $type );
35
 
36
  }
88
 
89
  }
90
 
91
+ $this->all_activate_deactivate();
92
+ }
93
+
94
+
95
+ public function all_activate_deactivate() {
96
+
97
+ // Handle actions
98
+ if ( isset( $_GET['addon_all_action'] ) && isset( $_GET['_token'] ) && wp_verify_nonce( $_GET['_token'], 'mycred-activate-deactivate-addon') && $this->core->user_is_point_admin() ) {
99
+
100
+ $action = sanitize_text_field( $_GET['addon_all_action'] );
101
+
102
+ if ( $action == 'activate' ) {
103
+
104
+ $this->active = array_keys( $this->installed );
105
+
106
+ }
107
+ elseif ( $action == 'deactivate' ) {
108
+
109
+ $this->active = array();
110
+
111
+ }
112
+
113
+ $new_settings = array(
114
+ 'installed' => $this->installed,
115
+ 'active' => $this->active
116
+ );
117
+
118
+ mycred_update_option( 'mycred_pref_addons', $new_settings );
119
+
120
+ $url = add_query_arg( array( 'page' => MYCRED_SLUG . '-addons' ), admin_url( 'admin.php' ) );
121
+
122
+ wp_safe_redirect( $url );
123
+ exit;
124
+
125
+ }
126
+
127
  }
128
 
129
  /**
382
 
383
  $installed = $this->get( true );
384
 
385
+
386
  ?>
387
  <style type="text/css">
388
  #myCRED-wrap > h1 { margin-bottom: 15px; }
389
  .theme-browser .theme:focus, .theme-browser .theme:hover { cursor: default !important; }
390
  .theme-browser .theme:hover .more-details { opacity: 1; }
391
  .theme-browser .theme:hover a.more-details, .theme-browser .theme:hover a.more-details:hover { text-decoration: none; }
392
+ .mycred-addons-switch {
393
+ position: relative;
394
+ display: inline-block;
395
+ width: 60px;
396
+ height: 34px;
397
+ }
398
+
399
+ /* Hide default HTML checkbox */
400
+ .mycred-addons-switch input {
401
+ opacity: 0;
402
+ width: 0;
403
+ height: 0;
404
+ }
405
+
406
+ /* The slider */
407
+ .slider {
408
+ position: absolute;
409
+ cursor: pointer;
410
+ top: 0;
411
+ left: 0;
412
+ right: 0;
413
+ bottom: 0;
414
+ background-color: #ccc;
415
+ -webkit-transition: .4s;
416
+ transition: .4s;
417
+ }
418
+
419
+ .slider:before {
420
+ position: absolute;
421
+ content: "";
422
+ height: 26px;
423
+ width: 26px;
424
+ left: 4px;
425
+ bottom: 4px;
426
+ background-color: white;
427
+ -webkit-transition: .4s;
428
+ transition: .4s;
429
+ }
430
+
431
+ input:checked + .slider {
432
+ background-color: lightgreen;
433
+ }
434
+
435
+ input:focus + .slider {
436
+ box-shadow: 0 0 1px lightgreen;
437
+ }
438
+
439
+ input:checked + .slider:before {
440
+ -webkit-transform: translateX(26px);
441
+ -ms-transform: translateX(26px);
442
+ transform: translateX(26px);
443
+ }
444
+
445
+ /* Rounded sliders */
446
+ .slider.round {
447
+ border-radius: 34px;
448
+ }
449
+
450
+ .slider.round:before {
451
+ border-radius: 50%;
452
+ }
453
+
454
+ .myCRED-addon-heading {
455
+ float: left;
456
+ }
457
+
458
+ .mycred-addon-switch {
459
+ float: right;
460
+ }
461
+
462
+ p.mycred-activate {
463
+ float: left;
464
+ margin: 7px 7px 0px 0px;
465
+ }
466
+ .clear{
467
+ clear: both;
468
+ }
469
+ .mycred-addon-outer {
470
+ padding: 10px 0;
471
+ }
472
  </style>
473
+
474
+ <script type="text/javascript">
475
+ jQuery(document).ready(function(jQuery){
476
+ jQuery("#mycred-addons-checkbox").change(function(){
477
+ var check = jQuery("#mycred-addons-checkbox").is(":checked");
478
+ if ( check == true ){
479
+
480
+ window.location.href = jQuery('.mycred-addon-switch').attr("data-activation-url");
481
+
482
+ }else{
483
+ window.location.href = jQuery('.mycred-addon-switch').attr("data-deactivation-url");
484
+
485
+ }
486
+ });
487
+ });
488
+ </script>
489
+ <?php
490
+ $activate_url = get_mycred_all_addon_activation_url();
491
+ $deactivate_url = get_mycred_all_addon_deactivation_url();
492
+ $free_addons_url = get_mycred_addon_page_url('free_addons');
493
+ $premium_addons_url = get_mycred_addon_page_url('premium_addons');
494
+ ?>
495
  <div class="wrap" id="myCRED-wrap">
496
+ <div class="mycred-addon-outer">
497
+ <div class="myCRED-addon-heading">
498
+ <h1><?php _e( 'Add-ons', 'mycred' ); if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?> <a href="http://codex.mycred.me/chapter-iii/" class="page-title-action" target="_blank"><?php _e( 'Documentation', 'mycred' ); ?></a><?php endif; ?></h1>
499
+ </div>
500
+ <?php
501
+ if( !isset( $_GET['mycred_addons'] ) ){ ?>
502
+ <div class="mycred-addon-switch" data-activation-url="<?php echo $activate_url ?>" data-deactivation-url="<?php echo $deactivate_url ?>">
503
+ <!-- Rounded switch -->
504
+ <label for="mycred-addons-checkbox" class="mycred-addons-switch">
505
+ <input type="checkbox" name="mycred-addons-checkbox" id="mycred-addons-checkbox" <?php echo $this->check_all_addons() ? 'checked' : ''; ?> >
506
+ <span class="slider round"></span>
507
+ </label>
508
+ <p class="mycred-activate"><?php _e( 'Activate/Deactivate All Add-ons', 'mycred' ); ?> </p>
509
+ </div>
510
+ <?php } ?>
511
+
512
+ <div class="clear"></div>
513
+ <div class="addons-main-nav">
514
+ <h2 class="nav-tab-wrapper">
515
+ <a href="<?php echo admin_url('admin.php?page=mycred-addons') ?>" class="nav-tab <?php echo !isset( $_GET['mycred_addons'] ) ? 'nav-tab-active' : ''; ?>">Built-in Addons</a>
516
+ <a href="<?php echo $free_addons_url ?>" class="nav-tab <?php echo ( isset( $_GET['mycred_addons'] ) && $_GET['mycred_addons'] == 'free_addons' ) ? 'nav-tab-active' : ''; ?>">Free Addons</a>
517
+ <a href="<?php echo $premium_addons_url ?>" class="nav-tab <?php echo ( isset( $_GET['mycred_addons'] ) && $_GET['mycred_addons'] == 'premium_addons' ) ? 'nav-tab-active' : ''; ?>">Premium Addons</a>
518
+ </h2>
519
+ </div>
520
+ </div>
521
  <?php
522
 
523
  // Messages
536
  <div class="themes">
537
  <?php
538
 
539
+ if ( isset( $_GET['mycred_addons'] ) )
540
+ {
541
+ if ( $_GET['mycred_addons'] == 'free_addons' )
542
+ {
543
+ $free_addons = array();
544
+
545
+ // buyCRED Add-on
546
+ $free_addons['elementer'] = array(
547
+ 'name' => 'myCred Elementor',
548
+ 'addon_url' => 'https://wordpress.org/plugins/mycred-for-elementor/',
549
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-for-elementor.jpg', myCRED_THIS ),
550
+ );
551
+
552
+ // learndash Add-on
553
+ $free_addons['learndash'] = array(
554
+ 'name' => 'myCred learndash',
555
+ 'addon_url' => 'https://wordpress.org/plugins/mycred-learndash/',
556
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-learndash.jpg', myCRED_THIS ),
557
+ );
558
+
559
+ // birthday Add-on
560
+ $free_addons['birthday'] = array(
561
+ 'name' => 'myCred Birthdays',
562
+ 'addon_url' => 'https://wordpress.org/plugins/mycred-birthdays/',
563
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-birthdays.jpg', myCRED_THIS ),
564
+ );
565
+
566
+ // gutenberg Add-on
567
+ $free_addons['gutenberg'] = array(
568
+ 'name' => 'myCred – Gutenberg Blocks',
569
+ 'addon_url' => 'https://wordpress.org/plugins/mycred-blocks/',
570
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-blocks.jpg', myCRED_THIS ),
571
+ );
572
+
573
+ // H5p Add-on
574
+ $free_addons['h5p'] = array(
575
+ 'name' => 'myCred H5P',
576
+ 'addon_url' => 'https://wordpress.org/plugins/mycred-h5p/',
577
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-h5p.jpg', myCRED_THIS ),
578
+ );
579
+
580
+ // bp-group-leaderboard Add-on
581
+ $free_addons['bp_group_leaderboard'] = array(
582
+ 'name' => 'myCred BP Group Leaderboards',
583
+ 'addon_url' => 'https://wordpress.org/plugins/mycred-bp-group-leaderboards/',
584
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-bp-group-leaderboards.jpg', myCRED_THIS ),
585
+ );
586
+
587
+ foreach ( $free_addons as $key => $data ) {
588
+ ?>
589
+
590
+ <?php if ( $data['screenshot'] != '' ) : ?>
591
+ <div class="theme inactive" tabindex="0" aria-describedby="badges-action badges-name">
592
+
593
+ <div class="theme-screenshot">
594
+ <img src="<?php echo $data['screenshot']; ?>" width="384px" height="288px" alt="">
595
+ </div>
596
+
597
+ <div class="theme-id-container">
598
+
599
+ <h2 class="theme-name" id="badges-name"><?php echo $data['name']; ?></h2>
600
+
601
+ <div class="theme-actions">
602
+
603
+ <a href="<?php echo $data['addon_url']; ?>" title="Install" target="_blank" class="button button-primary mycred-action badges">Install</a>
604
+ </div>
605
+
606
+ </div>
607
+
608
+ </div>
609
+
610
+ <?php endif; ?>
611
+
612
+ <?php
613
+ }
614
+ echo '<div class="theme add-new-theme"><a href="https://mycred.me/product-category/freebies/" target="_blank"><div class="theme-screenshot"><span></span></div><h2 class="theme-name">Add More Free Add-ons</h2></a></div><br class="clear" />';
615
+ }
616
+
617
+ if ( $_GET['mycred_addons'] == 'premium_addons' )
618
+ {
619
+ $premium_addons = array();
620
+
621
+ // buyCRED Add-on
622
+ $premium_addons['mycred_woocommerce_plus'] = array(
623
+ 'name' => 'myCred WooCommerce Plus',
624
+ 'addon_url' => 'https://mycred.me/store/mycred-woocommerce-plus/',
625
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-woocommerce-plus.jpg', myCRED_THIS ),
626
+ );
627
+
628
+ // learndash Add-on
629
+ $premium_addons['social_share'] = array(
630
+ 'name' => 'myCred Social Share',
631
+ 'addon_url' => 'https://mycred.me/store/mycred-social-share-add-on/',
632
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-social-share.jpg', myCRED_THIS ),
633
+ );
634
+
635
+ // birthday Add-on
636
+ $premium_addons['spin_wheel'] = array(
637
+ 'name' => 'myCred Spin Wheel',
638
+ 'addon_url' => 'https://mycred.me/store/wheel-of-fortune-add-on/',
639
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-spin-wheel.jpg', myCRED_THIS ),
640
+ );
641
+
642
+ // gutenberg Add-on
643
+ $premium_addons['bp_charges'] = array(
644
+ 'name' => 'myCred BP Charges',
645
+ 'addon_url' => 'https://mycred.me/store/mycred-bp-charges/',
646
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-bp-charges.jpg', myCRED_THIS ),
647
+ );
648
+
649
+ // H5p Add-on
650
+ $premium_addons['arcade_game'] = array(
651
+ 'name' => 'myCred Arcade Game',
652
+ 'addon_url' => 'https://mycred.me/store/mycred-pacman/',
653
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-pacman.jpg', myCRED_THIS ),
654
+ );
655
+
656
+ // bp-group-leaderboard Add-on
657
+ $premium_addons['notification_plus'] = array(
658
+ 'name' => 'myCred Notifications Plus',
659
+ 'addon_url' => 'https://mycred.me/store/notifications-plus-add-on/',
660
+ 'screenshot' => plugins_url( 'assets/images/addons/mycred-notification-plus.jpg', myCRED_THIS ),
661
+ );
662
+
663
+ foreach ( $premium_addons as $key => $data ) {
664
+ ?>
665
+
666
+ <?php if ( $data['screenshot'] != '' ) : ?>
667
+ <div class="theme inactive" tabindex="0" aria-describedby="badges-action badges-name">
668
+
669
+ <div class="theme-screenshot">
670
+ <img src="<?php echo $data['screenshot']; ?>" width="384px" height="288px" alt="">
671
+ </div>
672
+
673
+ <div class="theme-id-container">
674
+
675
+ <h2 class="theme-name" id="badges-name"><?php echo $data['name']; ?></h2>
676
+
677
+ <div class="theme-actions">
678
+
679
+ <a href="<?php echo $data['addon_url']; ?>" title="Install" target="_blank" class="button button-primary mycred-action badges">Install</a>
680
+ </div>
681
+
682
+ </div>
683
+
684
+ </div>
685
+
686
+ <?php endif; ?>
687
+
688
+ <?php
689
+ }
690
+ echo '<div class="theme add-new-theme"><a href="https://mycred.me/store/" target="_blank"><div class="theme-screenshot"><span></span></div><h2 class="theme-name">Add More Premium Add-ons</h2></a></div><br class="clear" />';
691
+ }
692
+ }
693
+ else
694
+ {
695
+ // Loop though installed
696
  if ( ! empty( $installed ) ) {
697
 
698
  foreach ( $installed as $key => $data ) {
731
 
732
  <div class="theme-actions">
733
 
734
+ <?php echo $this->activate_deactivate( $key ); ?>
735
 
736
  </div>
737
 
738
  </div>
739
 
740
  </div>
741
+ <?php
742
+ }
743
+
744
+
745
 
746
  }
747
 
779
 
780
  }
781
 
782
+ public function check_all_addons( ) {
783
+
784
+ $all_addons = count($this->installed);
785
+ $active_addons = count($this->active);
786
+
787
+ if($all_addons == $active_addons){
788
+
789
+ return true;
790
+
791
+ }else{
792
+
793
+ return false;
794
+ }
795
+ }
796
  }
797
  endif;
798
 
832
 
833
  }
834
  endif;
835
+
836
+
837
+
838
+
839
+ if ( ! function_exists( 'get_mycred_all_addon_activation_url' ) ) :
840
+ function get_mycred_all_addon_activation_url()
841
+ {
842
+
843
+ $args = array(
844
+ 'page' => MYCRED_SLUG . '-addons',
845
+ 'addon_all_action' => 'activate',
846
+ '_token' => wp_create_nonce( 'mycred-activate-deactivate-addon' )
847
+ );
848
+
849
+ return esc_url( add_query_arg( $args, admin_url( 'admin.php' ) ) );
850
+
851
+ }
852
+ endif;
853
+
854
+
855
+ if ( ! function_exists( 'get_mycred_all_addon_deactivation_url' ) ) :
856
+ function get_mycred_all_addon_deactivation_url( ) {
857
+
858
+ $args = array(
859
+ 'page' => MYCRED_SLUG . '-addons',
860
+ 'addon_all_action' => 'deactivate',
861
+ '_token' => wp_create_nonce( 'mycred-activate-deactivate-addon' )
862
+ );
863
+
864
+ return esc_url( add_query_arg( $args, admin_url( 'admin.php' ) ) );
865
+
866
+ }
867
+ endif;
868
+
869
+ if ( ! function_exists( 'get_mycred_addon_page_url' ) ) :
870
+ function get_mycred_addon_page_url( $addon_type ) {
871
+
872
+ $args = array(
873
+ 'page' => MYCRED_SLUG . '-addons',
874
+ 'mycred_addons' => $addon_type,
875
+ );
876
+
877
+ return esc_url( add_query_arg( $args, admin_url( 'admin.php' ) ) );
878
+
879
+ }
880
+ endif;
modules/mycred-module-br-social-share.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'myCRED_VERSION' ) ) exit;
3
+
4
+ /**
5
+ * myCRED_Module_Social_Share class
6
+ * @since 2.2
7
+ * @version 1.0
8
+ */
9
+ if ( ! class_exists( 'myCRED_Module_OB_Social_Share' ) ) :
10
+ class myCRED_Module_BR_Social_Share extends myCRED_Module
11
+ {
12
+ /**
13
+ * Construct
14
+ * @since 2.2
15
+ * @version 1.0
16
+ */
17
+ public function __construct( $type = MYCRED_DEFAULT_TYPE_KEY ) {
18
+
19
+ parent::__construct( 'myCRED_Module_BR_Social_Share', array(
20
+ 'module_name' => 'br_social_share',
21
+ 'defaults' => array(
22
+ 'enable_open_badge_ss' => 0,
23
+ 'facebook' => '1',
24
+ 'twitter' => '1',
25
+ 'linkedin' => '1',
26
+ 'pinterest' => '1',
27
+ 'button_style' => 'button_style',
28
+ 'enable_fb' => '1',
29
+ 'enable_twitter' => '1',
30
+ 'enable_li' => '1',
31
+ 'enable_pt' => '1'
32
+ ),
33
+ 'accordion' => false,
34
+ 'register' => false,
35
+ 'add_to_core' => true
36
+ ), $type );
37
+
38
+ }
39
+
40
+ /**
41
+ * Load
42
+ * @since 2.2
43
+ * @version 1.0
44
+ */
45
+ public function load()
46
+ {
47
+ add_action( 'mycred_admin_after_badges_settings', array( $this, 'after_general_settings' ), 20 );
48
+ add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 80, 3 );
49
+ }
50
+
51
+ /**
52
+ * Settings Page
53
+ * @since 2.2
54
+ * @version 1.0
55
+ */
56
+ public function after_general_settings( $mycred = NULL )
57
+ {
58
+ $settings = $this->br_social_share;
59
+
60
+ ?>
61
+ <div class="row">
62
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
63
+ <div class="form-group">
64
+ <div class="checkbox" style="padding-top: 4px;">
65
+ <label for="<?php echo $this->field_id( 'enable_open_badge_ss' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_open_badge_ss' ) ?>" id="<?php echo $this->field_id( 'enable_open_badge_ss' ) ?>" <?php checked( $settings['enable_open_badge_ss'], 1 ); ?> value="1">Enable Open Badge Social Sharing</label>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
70
+ <div class="form-group">
71
+ <div class="checkbox" style="padding-top: 4px;">
72
+ <label for="<?php echo $this->field_id( 'enable_fb' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_fb' ) ?>" id="<?php echo $this->field_id( 'enable_fb' ) ?>" <?php checked( $settings['enable_fb'], 1 ); ?> value="1">Show Faceebook button</label>
73
+ </div>
74
+ </div>
75
+ <div class="form-group">
76
+ <div class="checkbox" style="padding-top: 4px;">
77
+ <label for="<?php echo $this->field_id( 'enable_twitter' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_twitter' ) ?>" id="<?php echo $this->field_id( 'enable_twitter' ) ?>" <?php checked( $settings['enable_twitter'], 1 ); ?> value="1">Show Twitter button</label>
78
+ </div>
79
+ </div>
80
+ <div class="form-group">
81
+ <div class="checkbox" style="padding-top: 4px;">
82
+ <label for="<?php echo $this->field_id( 'enable_li' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_li' ) ?>" id="<?php echo $this->field_id( 'enable_li' ) ?>" <?php checked( $settings['enable_li'], 1 ); ?> value="1">Show LinkedIn button</label>
83
+ </div>
84
+ </div>
85
+ <div class="form-group">
86
+ <div class="checkbox" style="padding-top: 4px;">
87
+ <label for="<?php echo $this->field_id( 'enable_pt' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_pt' ) ?>" id="<?php echo $this->field_id( 'enable_pt' ) ?>" <?php checked( $settings['enable_pt'], 1 ); ?> value="1">Show Pinterest button</label>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
92
+ <h3>Social Sharing button style</h3>
93
+ <div class="clearfix">
94
+ <input type="radio" name="<?php echo $this->field_name( 'button_style' ) ?>" <?php echo $this->is_checked( 'button_style' ) ? 'checked' : ''; ?> value="button_style">Button Style<br>
95
+ <button class="mycred-social-icons mycred-social-icon-facebook"><a href="javascript:void(0)">facebook</a></button>
96
+ <button class="mycred-social-icons mycred-social-icon-twitter"><a href="javascript:void(0)">twitter</a></button>
97
+ <button class="mycred-social-icons mycred-social-icon-linkedin"><a href="javascript:void(0)">linkedin</a></button>
98
+ <button class="mycred-social-icons mycred-social-icon-pinterest"><a href="javascript:void(0)">pinterest</a></button>
99
+ </div>
100
+ <div class="clearfix">
101
+ <input type="radio" name="<?php echo $this->field_name( 'button_style' ) ?>" <?php echo $this->is_checked( 'icon_style' ) ? 'checked' : ''; ?> value="icon_style">Icon Style<br>
102
+ <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-facebook"></a>
103
+ <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-twitter"></a>
104
+ <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-linkedin"></a>
105
+ <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-pinterest"></a>
106
+ </div>
107
+ <div class="clearfix">
108
+ <input type="radio" name="<?php echo $this->field_name( 'button_style' ) ?>" <?php echo $this->is_checked( 'text_style' ) ? 'checked' : ''; ?> value="text_style">Text Style<br>
109
+ <button class="facebook social-text"><a href="javascript:void(0)">facebook</a></button>
110
+ <button class="twitter social-text"><a href="javascript:void(0)">twitter</a></button>
111
+ <button class="linkedin social-text"><a href="javascript:void(0)">linkedin</a></button>
112
+ <button class="pinterest social-text"><a href="javascript:void(0)">pinterest</a></button>
113
+ </div>
114
+ <div class="clearfix">
115
+ <input type="radio" name="<?php echo $this->field_name( 'button_style' ) ?>" <?php echo $this->is_checked( 'icon_style_hover' ) ? 'checked' : ''; ?> value="icon_style_hover">Icon / text on-hover style<br>
116
+ <a href="javascript:void(0)" class="i-text-admin mycred-social-icons mycred-social-icon-facebook"></a>
117
+ <a href="javascript:void(0)" class="i-text-admin mycred-social-icons mycred-social-icon-twitter"></a>
118
+ <a href="javascript:void(0)" class="i-text-admin mycred-social-icons mycred-social-icon-linkedin"></a>
119
+ <a href="javascript:void(0)" class="i-text-admin mycred-social-icons mycred-social-icon-pinterest"></a>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ <?php
124
+ }
125
+
126
+ public function is_checked( $key )
127
+ {
128
+ if( $this->br_social_share['button_style'] == $key )
129
+ return true;
130
+ return false;
131
+ }
132
+
133
+ public function sanitize_extra_settings( $new_data, $data, $core )
134
+ {
135
+ $new_data['br_social_share']['enable_open_badge_ss'] = ( isset( $data['br_social_share']['enable_open_badge_ss'] ) ) ? $data['br_social_share']['enable_open_badge_ss'] : '0';
136
+
137
+ $new_data['br_social_share']['button_style'] = ( isset( $data['br_social_share']['button_style'] ) ) ? $data['br_social_share']['button_style'] : 'button_style';
138
+
139
+ $new_data['br_social_share']['enable_fb'] = ( isset( $data['br_social_share']['enable_fb'] ) ) ? $data['br_social_share']['enable_fb'] : '0';
140
+
141
+ $new_data['br_social_share']['enable_twitter'] = ( isset( $data['br_social_share']['enable_twitter'] ) ) ? $data['br_social_share']['enable_twitter'] : '0';
142
+
143
+ $new_data['br_social_share']['enable_li'] = ( isset( $data['br_social_share']['enable_li'] ) ) ? $data['br_social_share']['enable_li'] : '0';
144
+
145
+ $new_data['br_social_share']['enable_pt'] = ( isset( $data['br_social_share']['enable_pt'] ) ) ? $data['br_social_share']['enable_pt'] : '0';
146
+
147
+ return apply_filters( 'mycred_brss_sanitize_settings', $new_data, $data, $core );
148
+ }
149
+ }
150
+ endif;
151
+
152
+ add_action( 'wp_loaded', 'mycred_load_br_social_share');
153
+
154
+ if( !function_exists( 'mycred_load_br_social_share' ) ):
155
+ function mycred_load_br_social_share()
156
+ {
157
+ //Activate only if badges active
158
+ if( class_exists( 'myCRED_Badge' ) )
159
+ {
160
+ $mycred_open_badge_socail_share = new myCRED_Module_BR_Social_Share();
161
+ $mycred_open_badge_socail_share->load();
162
+ }
163
+ }
164
+ endif;
165
+
modules/mycred-module-caching.php CHANGED
@@ -250,7 +250,7 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
250
  public function after_general_settings( $mycred = NULL ) {
251
 
252
  ?>
253
- <h4><span class="dashicons dashicons-admin-tools static"></span><?php _e( 'Optimization', 'mycred' ); ?></h4>
254
  <div class="body" style="display:none;">
255
 
256
  <?php if ( $this->mycred_type == MYCRED_DEFAULT_TYPE_KEY ) : ?>
@@ -348,7 +348,7 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
348
  $this->clear_cache( 'leaderboards' );
349
  }
350
 
351
- $new_data['caching']['autodelete'] = absint( $data['caching']['autodelete'] );
352
 
353
  return $new_data;
354
 
250
  public function after_general_settings( $mycred = NULL ) {
251
 
252
  ?>
253
+ <h4 <?php echo get_current_screen()->base != 'toplevel_page_mycred-main' ? '' : 'style="display:none"';?>><span class="dashicons dashicons-admin-tools static"></span><?php _e( 'Optimization', 'mycred' ); ?></h4>
254
  <div class="body" style="display:none;">
255
 
256
  <?php if ( $this->mycred_type == MYCRED_DEFAULT_TYPE_KEY ) : ?>
348
  $this->clear_cache( 'leaderboards' );
349
  }
350
 
351
+ $new_data['caching']['autodelete'] = isset( $data['caching']['autodelete'] ) ? absint( $data['caching']['autodelete'] ) : 'off';
352
 
353
  return $new_data;
354
 
modules/mycred-module-hooks.php CHANGED
@@ -292,7 +292,7 @@ if ( ! class_exists( 'myCRED_Hooks_Module' ) ) :
292
  #sidebar-active .widget-inside form .widget-control-actions { padding-top: 12px; border-top: 1px dashed #dedede; margin-top: 12px; }
293
  .form .radio { margin-bottom: 12px; }
294
  </style>
295
- <div class="wrap">
296
  <h1><?php _e( 'Hooks', 'mycred' ); if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?> <a href="http://codex.mycred.me/chapter-ii/setup-hooks/" class="page-title-action" target="_blank"><?php _e( 'Documentation', 'mycred' ); ?></a><?php endif; ?></h1>
297
  <div class="widget-liquid-left">
298
  <div id="widgets-left">
292
  #sidebar-active .widget-inside form .widget-control-actions { padding-top: 12px; border-top: 1px dashed #dedede; margin-top: 12px; }
293
  .form .radio { margin-bottom: 12px; }
294
  </style>
295
+ <div class="wrap" id="myCRED-wrap">
296
  <h1><?php _e( 'Hooks', 'mycred' ); if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?> <a href="http://codex.mycred.me/chapter-ii/setup-hooks/" class="page-title-action" target="_blank"><?php _e( 'Documentation', 'mycred' ); ?></a><?php endif; ?></h1>
297
  <div class="widget-liquid-left">
298
  <div id="widgets-left">
modules/mycred-module-settings.php CHANGED
@@ -1,6 +1,10 @@
1
  <?php
2
  if ( ! defined( 'myCRED_VERSION' ) ) exit;
3
 
 
 
 
 
4
  /**
5
  * myCRED_Settings_Module class
6
  * @since 0.1
@@ -24,7 +28,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
24
  ),
25
  'screen_id' => MYCRED_SLUG . '-settings',
26
  'accordion' => true,
27
- 'menu_pos' => 998
28
  ), $type );
29
 
30
  }
@@ -55,6 +59,8 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
55
  */
56
  public function module_admin_init() {
57
 
 
 
58
  if ( isset( $_GET['do'] ) && $_GET['do'] == 'export' )
59
  $this->load_export();
60
 
@@ -231,6 +237,31 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
231
 
232
  }
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  /**
235
  * Update Log Cred Format Action
236
  * Will attempt to modify the myCRED log's cred column format.
@@ -352,6 +383,9 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
352
  */
353
  public function scripts_and_styles() {
354
 
 
 
 
355
  wp_register_script(
356
  'mycred-type-management',
357
  plugins_url( 'assets/js/mycred-type-management.js', myCRED_THIS ),
@@ -365,7 +399,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
365
  * Settings Header
366
  * Inserts the export styling
367
  * @since 1.3
368
- * @version 1.2.2
369
  */
370
  public function settings_header() {
371
 
@@ -424,18 +458,25 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
424
  'mycred-type-management',
425
  'myCREDmanage',
426
  array(
427
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
428
- 'token' => wp_create_nonce( 'mycred-management-actions' ),
429
- 'cache' => wp_create_nonce( 'mycred-clear-cache' ),
430
- 'working' => esc_attr__( 'Processing...', 'mycred' ),
431
- 'confirm_log' => esc_attr__( 'Warning! All entries in your log will be permanently removed! This can not be undone!', 'mycred' ),
432
- 'confirm_clean' => esc_attr__( 'All log entries belonging to deleted users will be permanently deleted! This can not be undone!', 'mycred' ),
433
- 'confirm_reset' => esc_attr__( 'Warning! All user balances will be set to zero! This can not be undone!', 'mycred' ),
434
- 'done' => esc_attr__( 'Done!', 'mycred' ),
435
- 'export_close' => esc_attr__( 'Close', 'mycred' ),
436
- 'export_title' => $mycred->template_tags_general( esc_attr__( 'Export %singular% Balances', 'mycred' ) ),
437
- 'decimals' => esc_attr__( 'In order to adjust the number of decimal places you want to use we must update your log. It is highly recommended that you backup your current log before continuing!', 'mycred' )
438
- )
 
 
 
 
 
 
 
439
  );
440
  wp_enqueue_script( 'mycred-type-management' );
441
 
@@ -517,6 +558,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
517
  $general = $this->general;
518
  $action_hook = ( ! $this->is_main_type ) ? $this->mycred_type : '';
519
  $delete_user = ( isset( $this->core->delete_user ) ) ? $this->core->delete_user : 0;
 
520
 
521
  // Social Media Links
522
  $social = array();
@@ -539,7 +581,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
539
  <?php settings_fields( $this->settings_name ); ?>
540
 
541
  <div class="list-items expandable-li" id="accordion">
542
- <h4><span class="dashicons dashicons-admin-settings static"></span><label><?php _e( 'Core Settings', 'mycred' ); ?></label></h4>
543
  <div class="body" style="display:none;">
544
 
545
  <div class="row">
@@ -643,7 +685,46 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
643
  </div>
644
  </div>
645
 
646
- <div class="row">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
648
  <h3><?php _e( 'Other Settings', 'mycred' ); ?></h3>
649
  <div class="form-group">
@@ -666,7 +747,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
666
  $reset_block = true;
667
 
668
  ?>
669
- <h4><span class="dashicons dashicons-dashboard static"></span><label><?php _e( 'Management', 'mycred' ); ?></label></h4>
670
  <div class="body" style="display:none;">
671
 
672
  <div class="row">
@@ -726,7 +807,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
726
 
727
  <?php
728
 
729
- if ( isset( $this->mycred_type ) && $this->mycred_type == MYCRED_DEFAULT_TYPE_KEY ) :
730
 
731
  ?>
732
  <h4><span class="dashicons dashicons-star-filled static"></span><label><?php _e( 'Point Types', 'mycred' ); ?></label></h4>
@@ -805,11 +886,16 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
805
  </div>
806
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
807
  <div class="form-group">
808
- <label for="mycred-new-ctype-key-label"><?php _e( 'Label', 'mycred' ); ?></label>
 
 
 
 
 
 
809
  <input type="text" id="mycred-new-ctype-key-label" name="mycred_pref_core[types][new][label]" placeholder="<?php _e( 'Required', 'mycred' ); ?>" value="" class="form-control" />
810
  </div>
811
  </div>
812
- <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"></div>
813
  </div>
814
  <p id="mycred-ctype-warning">
815
  <strong><?php _e( 'Note This meta key must be in lowercase and only contain letters or underscore. All other characters will be deleted! make sure to add some unique prefix to this meta key to avoid any conflicts in database.', 'mycred' ); ?> <a href="https://codex.mycred.me/chapter-i/points/"><?php _e( 'Read More', 'mycred' )?></a></strong>
@@ -821,7 +907,13 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
821
 
822
  ?>
823
 
824
- <?php do_action( 'mycred_after_core_prefs' . $action_hook, $this ); ?>
 
 
 
 
 
 
825
 
826
  </div>
827
 
@@ -933,6 +1025,24 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
933
 
934
  $types[ $key ] = sanitize_text_field( $data['label'] );
935
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
936
  }
937
 
938
  }
@@ -1022,10 +1132,14 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
1022
  }
1023
 
1024
  }
1025
-
 
1026
  // User deletions
1027
  $new_data['delete_user'] = ( isset( $post['delete_user'] ) ) ? $post['delete_user'] : 0;
1028
 
 
 
 
1029
  $action_hook = '';
1030
  if ( ! $this->is_main_type )
1031
  $action_hook = $this->mycred_type;
@@ -1036,3 +1150,4 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
1036
 
1037
  }
1038
  endif;
 
1
  <?php
2
  if ( ! defined( 'myCRED_VERSION' ) ) exit;
3
 
4
+ define( 'myCRED_Settings', __FILE__ );
5
+
6
+ define( 'myCRED_Settings_VERSION', '1.3' );
7
+
8
  /**
9
  * myCRED_Settings_Module class
10
  * @since 0.1
28
  ),
29
  'screen_id' => MYCRED_SLUG . '-settings',
30
  'accordion' => true,
31
+ 'menu_pos' => 100
32
  ), $type );
33
 
34
  }
59
  */
60
  public function module_admin_init() {
61
 
62
+
63
+
64
  if ( isset( $_GET['do'] ) && $_GET['do'] == 'export' )
65
  $this->load_export();
66
 
237
 
238
  }
239
 
240
+
241
+ /**
242
+ * Get Point Image
243
+ * @since 2.2
244
+ * @version 1.0
245
+ */
246
+ public function get_point_image( $attachment_id, $point_type_field ) {
247
+
248
+ $image = false;
249
+
250
+ if ( $attachment_id > 0 ) {
251
+
252
+ $_image = wp_get_attachment_url( $attachment_id );
253
+
254
+ if ( strlen( $_image ) > 5 )
255
+ {
256
+ $image = "<img src='$_image' alt='Point Type image' /><input type='hidden' name='$point_type_field' value='{$attachment_id}' />";
257
+ }
258
+
259
+ }
260
+
261
+ return $image;
262
+
263
+ }
264
+
265
  /**
266
  * Update Log Cred Format Action
267
  * Will attempt to modify the myCRED log's cred column format.
383
  */
384
  public function scripts_and_styles() {
385
 
386
+
387
+ wp_enqueue_media();
388
+
389
  wp_register_script(
390
  'mycred-type-management',
391
  plugins_url( 'assets/js/mycred-type-management.js', myCRED_THIS ),
399
  * Settings Header
400
  * Inserts the export styling
401
  * @since 1.3
402
+ * @version 1.2.3
403
  */
404
  public function settings_header() {
405
 
458
  'mycred-type-management',
459
  'myCREDmanage',
460
  array(
461
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
462
+ 'token' => wp_create_nonce( 'mycred-management-actions' ),
463
+ 'cache' => wp_create_nonce( 'mycred-clear-cache' ),
464
+ 'working' => esc_attr__( 'Processing...', 'mycred' ),
465
+ 'confirm_log' => esc_attr__( 'Warning! All entries in your log will be permanently removed! This can not be undone!', 'mycred' ),
466
+ 'confirm_clean' => esc_attr__( 'All log entries belonging to deleted users will be permanently deleted! This can not be undone!', 'mycred' ),
467
+ 'confirm_reset' => esc_attr__( 'Warning! All user balances will be set to zero! This can not be undone!', 'mycred' ),
468
+ 'imagelabel' => esc_js( sprintf( '%s {{image}}', __( 'Level', 'mycred' ) ) ),
469
+ 'setImage' => esc_js( __( 'Set Image', 'mycred' ) ),
470
+ 'set_featured_image' => __( 'Set Default Point Type image', 'mycred' ),
471
+ 'changeImage' => esc_js( __( 'Change Image', 'mycred' ) ),
472
+ 'uploadtitle' => esc_js( esc_attr__( 'Point Type Image', 'mycred' ) ),
473
+ 'uploadbutton' => esc_js( esc_attr__( 'Use as Image', 'mycred' ) ),
474
+ 'done' => esc_attr__( 'Done!', 'mycred' ),
475
+ 'export_close' => esc_attr__( 'Close', 'mycred' ),
476
+ 'export_title' => $mycred->template_tags_general( esc_attr__( 'Export %singular% Balances', 'mycred' ) ),
477
+ 'decimals' => esc_attr__( 'In order to adjust the number of decimal places you want to use we must update your log. It is highly recommended that you backup your current log before continuing!', 'mycred' ),
478
+ 'fieldName' => $this->field_name()
479
+ )
480
  );
481
  wp_enqueue_script( 'mycred-type-management' );
482
 
558
  $general = $this->general;
559
  $action_hook = ( ! $this->is_main_type ) ? $this->mycred_type : '';
560
  $delete_user = ( isset( $this->core->delete_user ) ) ? $this->core->delete_user : 0;
561
+ $main_screen = ( get_current_screen()->base == 'toplevel_page_mycred-main' );
562
 
563
  // Social Media Links
564
  $social = array();
581
  <?php settings_fields( $this->settings_name ); ?>
582
 
583
  <div class="list-items expandable-li" id="accordion">
584
+ <h4 <?php echo !$main_screen ? '' : 'style="display:none"';?>><span class="dashicons dashicons-admin-settings static"></span><label><?php _e( 'Core Settings', 'mycred' ); ?></label></h4>
585
  <div class="body" style="display:none;">
586
 
587
  <div class="row">
685
  </div>
686
  </div>
687
 
688
+
689
+ <div class="row mycred-image-level">
690
+
691
+ <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
692
+ <div id="mycred-image-setup" class="default-image-wrapper">
693
+
694
+ <h3><?php _e( 'Point Type Image', 'mycred' ); ?></h3>
695
+
696
+
697
+ <div class="point-type-image">
698
+ <div class="point-type-image-wrapper image-wrapper">
699
+ <?php
700
+
701
+ $attachment_id = mycred_get_default_point_image_id();
702
+
703
+ $image_url = wp_get_attachment_url( $attachment_id );
704
+
705
+ if( property_exists( $this->core, 'attachment_id' ) && $this->get_point_image( $this->core->attachment_id , $this->field_name( 'attachment_id' )) )
706
+ echo $this->get_point_image( $this->core->attachment_id , $this->field_name( 'attachment_id' ));
707
+ elseif( !$attachment_id )
708
+ {
709
+ ?>
710
+ <div class="default-image-wrapper image-wrapper empty dashicons">
711
+ </div>
712
+ <?php
713
+ }
714
+ else
715
+ {
716
+ echo "<img src='{$image_url}' />";
717
+ echo "<input type='hidden' value='{$attachment_id}' name='".$this->field_name( 'attachment_id' )."' />";
718
+ }
719
+ ?>
720
+ </div>
721
+ <div class="point-image-buttons">
722
+ <button type="button" class="button button-secondary" id="point-type-change-default-image"><?php _e( 'Change Image', 'mycred' ) ?></button>
723
+ </div>
724
+ </div>
725
+ </div>
726
+ </div>
727
+
728
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
729
  <h3><?php _e( 'Other Settings', 'mycred' ); ?></h3>
730
  <div class="form-group">
747
  $reset_block = true;
748
 
749
  ?>
750
+ <h4 <?php echo !$main_screen ? '' : 'style="display:none"';?>><span class="dashicons dashicons-dashboard static"></span><label><?php _e( 'Management', 'mycred' ); ?></label></h4>
751
  <div class="body" style="display:none;">
752
 
753
  <div class="row">
807
 
808
  <?php
809
 
810
+ if ( $main_screen ) :
811
 
812
  ?>
813
  <h4><span class="dashicons dashicons-star-filled static"></span><label><?php _e( 'Point Types', 'mycred' ); ?></label></h4>
886
  </div>
887
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
888
  <div class="form-group">
889
+ <label for="mycred-new-ctype-key-label"><?php _e( 'Singular', 'mycred' ); ?></label>
890
+ <input type="text" id="mycred-new-ctype-key-singular" name="mycred_pref_core[types][new][singular]" placeholder="<?php _e( 'Required', 'mycred' ); ?>" value="" class="form-control" />
891
+ </div>
892
+ </div>
893
+ <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
894
+ <div class="form-group">
895
+ <label for="mycred-new-ctype-key-label"><?php _e( 'Plural', 'mycred' ); ?></label>
896
  <input type="text" id="mycred-new-ctype-key-label" name="mycred_pref_core[types][new][label]" placeholder="<?php _e( 'Required', 'mycred' ); ?>" value="" class="form-control" />
897
  </div>
898
  </div>
 
899
  </div>
900
  <p id="mycred-ctype-warning">
901
  <strong><?php _e( 'Note This meta key must be in lowercase and only contain letters or underscore. All other characters will be deleted! make sure to add some unique prefix to this meta key to avoid any conflicts in database.', 'mycred' ); ?> <a href="https://codex.mycred.me/chapter-i/points/"><?php _e( 'Read More', 'mycred' )?></a></strong>
907
 
908
  ?>
909
 
910
+ <div class="mycred-after-core-prefs" <?php echo $main_screen ? '' : 'style="display:none"';?> >
911
+ <?php do_action( 'mycred_after_core_prefs' . $action_hook, $this ); ?>
912
+ </div>
913
+
914
+ <div class="mycred-type-prefs" <?php echo !$main_screen ? '' : 'style="display:none"';?>>
915
+ <?php do_action( 'mycred_type_prefs' . $action_hook, $this ); ?>
916
+ </div>
917
 
918
  </div>
919
 
1025
 
1026
  $types[ $key ] = sanitize_text_field( $data['label'] );
1027
 
1028
+ $type_settings = mycred_get_option( 'mycred_pref_core_' . $key );
1029
+
1030
+ if ( $key !== MYCRED_DEFAULT_TYPE_KEY && empty( $type_settings ) ) {
1031
+
1032
+ if ( empty( $data['singular'] ) )
1033
+ $data['singular'] = $types[ $key ];
1034
+
1035
+ $mycred = mycred();
1036
+ $new_type_defaults = $mycred->defaults();
1037
+ $new_type_defaults['cred_id'] = $key;
1038
+ $new_type_defaults['name']['singular'] = sanitize_text_field( $data['singular'] );
1039
+ $new_type_defaults['name']['plural'] = $types[ $key ];
1040
+
1041
+ mycred_update_option( 'mycred_pref_core_' . $key , $new_type_defaults );
1042
+
1043
+ mycred_upload_default_point_image();
1044
+ }
1045
+
1046
  }
1047
 
1048
  }
1132
  }
1133
 
1134
  }
1135
+
1136
+
1137
  // User deletions
1138
  $new_data['delete_user'] = ( isset( $post['delete_user'] ) ) ? $post['delete_user'] : 0;
1139
 
1140
+ //Point type image
1141
+ $new_data['attachment_id'] = isset( $post['attachment_id'] ) ? $post['attachment_id'] : 0;
1142
+
1143
  $action_hook = '';
1144
  if ( ! $this->is_main_type )
1145
  $action_hook = $this->mycred_type;
1150
 
1151
  }
1152
  endif;
1153
+
mycred.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: myCred
4
  * Plugin URI: https://mycred.me
5
  * Description: An adaptive points management system for WordPress powered websites.
6
- * Version: 2.1.1
7
  * Tags: point, credit, loyalty program, engagement, reward, woocommerce rewards
8
  * Author: myCred
9
  * Author URI: https://mycred.me
10
  * Author Email: support@mycred.me
11
  * Requires at least: WP 4.8
12
- * Tested up to: WP 5.7.2
13
  * Text Domain: mycred
14
  * Domain Path: /lang
15
  * License: GPLv2 or later
@@ -20,7 +20,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
20
  final class myCRED_Core {
21
 
22
  // Plugin Version
23
- public $version = '2.1.1';
24
 
25
  // Instnace
26
  protected static $_instance = NULL;
@@ -54,14 +54,14 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
54
  * @since 1.7
55
  * @version 1.0
56
  */
57
- public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.1' ); }
58
 
59
  /**
60
  * Not allowed
61
  * @since 1.7
62
  * @version 1.0
63
  */
64
- public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.1' ); }
65
 
66
  /**
67
  * Get
@@ -82,7 +82,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
82
  if ( ! defined( $name ) )
83
  define( $name, $value );
84
  elseif ( ! $definable && defined( $name ) )
85
- _doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '2.1' );
86
  }
87
 
88
  /**
@@ -94,7 +94,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
94
  if ( file_exists( $required_file ) )
95
  require_once $required_file;
96
  else
97
- _doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '2.1' );
98
  }
99
 
100
  /**
@@ -118,6 +118,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
118
  // Register plugin hooks
119
  register_activation_hook( myCRED_THIS, 'mycred_plugin_activation' );
120
  register_deactivation_hook( myCRED_THIS, 'mycred_plugin_deactivation' );
 
121
 
122
  // If myCRED is ready to be used
123
  if ( is_mycred_ready() ) {
@@ -129,29 +130,11 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
129
 
130
  }
131
 
132
- // We need to run the setup
133
- else {
134
-
135
- // Load translation and register assets for the setup
136
- add_action( 'init', array( $this, 'load_plugin_textdomain' ), 10 );
137
- add_action( 'init', array( $this, 'register_assets' ), 20 );
138
- add_filter( 'mycred_maybe_install_db', '__return_false' );
139
-
140
- // Load the setup module
141
- $this->file( myCRED_INCLUDES_DIR . 'mycred-setup.php' );
142
-
143
- $setup = new myCRED_Setup();
144
- $setup->load();
145
-
146
- }
147
-
148
  // Plugin Related
149
  add_filter( 'plugin_action_links_mycred/mycred.php', array( $this, 'plugin_links' ), 10, 4 );
150
  add_filter( 'plugin_row_meta', array( $this, 'plugin_description_links' ), 10, 2 );
151
- add_action( 'admin_menu', array( $this, 'plugin_about_page' ), 10 );
152
  add_filter( 'pre_http_request', array( $this, 'handle_license_request' ), 10, 3 );
153
  add_filter( 'http_request_args', array( $this, 'license_request_args' ), 10, 2 );
154
- add_action( 'admin_menu', array( $this,'mycred_add_sub_menu_page'));
155
 
156
  }
157
 
@@ -167,6 +150,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
167
  $this->define( 'myCRED_VERSION', $this->version );
168
  $this->define( 'myCRED_DB_VERSION', '1.0' );
169
  $this->define( 'MYCRED_SLUG', 'mycred' );
 
170
  $this->define( 'MYCRED_DEFAULT_LABEL', 'myCRED' );
171
  $this->define( 'MYCRED_DEFAULT_TYPE_KEY', 'mycred_default' );
172
  $this->define( 'MYCRED_SHOW_PREMIUM_ADDONS', true );
@@ -202,12 +186,19 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
202
  }
203
 
204
  public function myc_fs() {
 
205
  global $myc_fs;
206
 
207
  if ( ! isset( $myc_fs ) ) {
208
  // Include Freemius SDK.
209
  $this->file( myCRED_ROOT_DIR . '/freemius/start.php' );
210
 
 
 
 
 
 
 
211
  $myc_fs = fs_dynamic_init(
212
  array(
213
  'id' => '6028',
@@ -219,7 +210,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
219
  'has_paid_plans' => false,
220
  'menu' => array(
221
  'slug' => 'mycred',
222
- 'first-path' => 'index.php?page=mycred-about',
223
  'account' => false,
224
  'contact' => false,
225
  'support' => false,
@@ -230,12 +221,13 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
230
  }
231
 
232
  return $myc_fs;
 
233
  }
234
 
235
  /**
236
  * Include Plugin Files
237
  * @since 1.7
238
- * @version 1.1
239
  */
240
  public function includes() {
241
 
@@ -258,20 +250,21 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
258
  $this->file( myCRED_INCLUDES_DIR . 'mycred-protect.php' );
259
  $this->file( myCRED_INCLUDES_DIR . 'mycred-about.php' );
260
  $this->file( myCRED_INCLUDES_DIR . 'mycred-nav-menu.php' );
261
-
262
  if( isset ( $_GET['mycred_tour_guide'] ) ){
263
 
264
  $this->file( myCRED_INCLUDES_DIR . 'mycred-walkthrough.php' );
265
  $walkthrough = new myCRED_walkthroug();
266
 
267
  }
268
-
269
  // If myCRED has been setup and is ready to begin
270
  if ( mycred_is_installed() ) {
271
 
272
  // myCRED Subscription
273
  $this->file( myCRED_MEMBERSHIP_DIR . 'subscription-functions.php' );
274
  $this->file( myCRED_MEMBERSHIP_DIR . 'mycred-connect-membership.php' );
 
275
 
276
  // Modules
277
  $this->file( myCRED_MODULES_DIR . 'mycred-module-addons.php' );
@@ -280,6 +273,8 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
280
  $this->file( myCRED_MODULES_DIR . 'mycred-module-log.php' );
281
  $this->file( myCRED_MODULES_DIR . 'mycred-module-export.php' );
282
  $this->file( myCRED_MODULES_DIR . 'mycred-module-management.php' );
 
 
283
  $this->file( myCRED_MODULES_DIR . 'mycred-module-caching.php' );
284
 
285
  //Uninstall Settings
@@ -618,10 +613,12 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
618
 
619
  }
620
 
 
 
621
  /**
622
  * Register Assets
623
  * @since 1.7
624
- * @version 1.0
625
  */
626
  public function register_assets() {
627
 
@@ -634,6 +631,10 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
634
  wp_register_style( 'mycred-forms', plugins_url( 'assets/css/mycred-forms.css', myCRED_THIS ), array(), $this->version, 'all' );
635
  wp_register_style( 'mycred-select2-style', plugins_url( 'assets/css/select2.css', myCRED_THIS ), array(), $this->version, 'all' );
636
 
 
 
 
 
637
  // Scripts
638
  wp_register_script( 'mycred-send-points', plugins_url( 'assets/js/send.js', myCRED_THIS ), array( 'jquery' ), $this->version, true );
639
  wp_register_script( 'mycred-accordion', plugins_url( 'assets/js/mycred-accordion.js', myCRED_THIS ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-accordion' ), $this->version );
@@ -710,7 +711,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
710
  * Front Enqueue Before
711
  * Enqueues scripts and styles that must run before content is loaded.
712
  * @since 1.7
713
- * @version 1.0
714
  */
715
  public function enqueue_front_before() {
716
 
@@ -718,6 +719,9 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
718
  if ( apply_filters( 'mycred_remove_widget_css', false ) === false )
719
  wp_enqueue_style( 'mycred-front' );
720
 
 
 
 
721
  // Let others play
722
  do_action( 'mycred_front_enqueue' );
723
 
@@ -763,11 +767,12 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
763
  /**
764
  * Admin Enqueue
765
  * @since 1.7
766
- * @version 1.1
767
  */
768
  public function enqueue_admin_before() {
769
 
770
- wp_enqueue_script( 'mycred-admin', plugins_url( 'assets/js/admin.js', myCRED_THIS ), '', myCRED_VERSION );
 
771
 
772
  // Let others play
773
  do_action( 'mycred_admin_enqueue' );
@@ -821,6 +826,11 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
821
  if ( defined( 'WP_LOAD_IMPORTERS' ) )
822
  $this->register_importers();
823
 
 
 
 
 
 
824
  // Let others play
825
  do_action( 'mycred_admin_init' );
826
  }
@@ -898,6 +908,8 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
898
  if ( version_compare( $wp_version, '3.8', '<' ) )
899
  $menu_icon = '';
900
 
 
 
901
  // Add skeleton menus for each point type so modules can
902
  // insert their content under each of these menus
903
  foreach ( $this->point_types as $type_id => $title ) {
@@ -927,40 +939,6 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
927
 
928
  }
929
 
930
-
931
- function mycred_add_sub_menu_page( $mycred ) {
932
-
933
- add_submenu_page(
934
- MYCRED_SLUG,
935
- 'Support',
936
- 'Support',
937
- 'manage_options',
938
- 'support-screen',
939
- array( $this,'support_screen_function')
940
- );
941
-
942
- }
943
-
944
- function support_screen_function () {
945
-
946
- $html = '
947
-
948
- <div class="mycred_support_heading" style="margin: 5% 0 0.2% 86%; text-align:left; ">
949
-
950
- <a href="https://mycred.me/support/" class="support_link" style="text-decoration:none; font-size:14px; line-height: 1.55; font-weight:400; text-align:center; margin:10px 0; transition-duration: .05s; transition-timing-function: ease-in-out; transition-property: border,background,color; color: #135e96; ">Contact Support</a>
951
-
952
- </div>
953
-
954
- <div class="mycred_iframe">
955
-
956
- <iframe src="https://app.productstash.io/roadmaps/5f8d483c053518002b4441c4/public" height="900" width="90%" frameborder="0" scrolling="no" style="margin-left: 5%; text-decoration:none;"></iframe>
957
-
958
- </div>';
959
-
960
- echo $html;
961
-
962
- }
963
-
964
  /**
965
  * Toolbar
966
  * @since 1.7
@@ -1113,9 +1091,8 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
1113
  public function plugin_links( $actions, $plugin_file, $plugin_data, $context ) {
1114
 
1115
  // Link to Setup
1116
- if ( ! mycred_is_installed() )
1117
- $actions['_setup'] = '<a href="' . admin_url( 'plugins.php?page=' . MYCRED_SLUG . '-setup' ) . '">' . __( 'Setup', 'mycred' ) . '</a>';
1118
- else
1119
  $actions['_settings'] = '<a href="' . admin_url( 'admin.php?page=' . MYCRED_SLUG . '-settings' ) . '" >' . __( 'Settings', 'mycred' ) . '</a>';
1120
 
1121
  ksort( $actions );
@@ -1185,25 +1162,6 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
1185
  return $parsed_args;
1186
  }
1187
 
1188
- /**
1189
- * Plugin About Menu
1190
- * @since 2.0
1191
- * @version 1.0
1192
- */
1193
- public function plugin_about_page() {
1194
-
1195
- $name = mycred_label( true );
1196
-
1197
- add_dashboard_page(
1198
- sprintf( __( 'About %s', 'mycred' ), $name ),
1199
- sprintf( __( 'About %s', 'mycred' ), $name ),
1200
- 'moderate_comments',
1201
- MYCRED_SLUG . '-about',
1202
- 'mycred_about_page'
1203
- );
1204
-
1205
- }
1206
-
1207
  }
1208
  endif;
1209
 
3
  * Plugin Name: myCred
4
  * Plugin URI: https://mycred.me
5
  * Description: An adaptive points management system for WordPress powered websites.
6
+ * Version: 2.2
7
  * Tags: point, credit, loyalty program, engagement, reward, woocommerce rewards
8
  * Author: myCred
9
  * Author URI: https://mycred.me
10
  * Author Email: support@mycred.me
11
  * Requires at least: WP 4.8
12
+ * Tested up to: WP 5.8
13
  * Text Domain: mycred
14
  * Domain Path: /lang
15
  * License: GPLv2 or later
20
  final class myCRED_Core {
21
 
22
  // Plugin Version
23
+ public $version = '2.2';
24
 
25
  // Instnace
26
  protected static $_instance = NULL;
54
  * @since 1.7
55
  * @version 1.0
56
  */
57
+ public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.2' ); }
58
 
59
  /**
60
  * Not allowed
61
  * @since 1.7
62
  * @version 1.0
63
  */
64
+ public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.2' ); }
65
 
66
  /**
67
  * Get
82
  if ( ! defined( $name ) )
83
  define( $name, $value );
84
  elseif ( ! $definable && defined( $name ) )
85
+ _doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '2.2' );
86
  }
87
 
88
  /**
94
  if ( file_exists( $required_file ) )
95
  require_once $required_file;
96
  else
97
+ _doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '2.2' );
98
  }
99
 
100
  /**
118
  // Register plugin hooks
119
  register_activation_hook( myCRED_THIS, 'mycred_plugin_activation' );
120
  register_deactivation_hook( myCRED_THIS, 'mycred_plugin_deactivation' );
121
+ register_uninstall_hook( myCRED_THIS, 'mycred_plugin_uninstall' );
122
 
123
  // If myCRED is ready to be used
124
  if ( is_mycred_ready() ) {
130
 
131
  }
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  // Plugin Related
134
  add_filter( 'plugin_action_links_mycred/mycred.php', array( $this, 'plugin_links' ), 10, 4 );
135
  add_filter( 'plugin_row_meta', array( $this, 'plugin_description_links' ), 10, 2 );
 
136
  add_filter( 'pre_http_request', array( $this, 'handle_license_request' ), 10, 3 );
137
  add_filter( 'http_request_args', array( $this, 'license_request_args' ), 10, 2 );
 
138
 
139
  }
140
 
150
  $this->define( 'myCRED_VERSION', $this->version );
151
  $this->define( 'myCRED_DB_VERSION', '1.0' );
152
  $this->define( 'MYCRED_SLUG', 'mycred' );
153
+ $this->define( 'MYCRED_MAIN_SLUG', 'mycred-main' );
154
  $this->define( 'MYCRED_DEFAULT_LABEL', 'myCRED' );
155
  $this->define( 'MYCRED_DEFAULT_TYPE_KEY', 'mycred_default' );
156
  $this->define( 'MYCRED_SHOW_PREMIUM_ADDONS', true );
186
  }
187
 
188
  public function myc_fs() {
189
+
190
  global $myc_fs;
191
 
192
  if ( ! isset( $myc_fs ) ) {
193
  // Include Freemius SDK.
194
  $this->file( myCRED_ROOT_DIR . '/freemius/start.php' );
195
 
196
+ $redirect_path = 'admin.php?page=mycred-settings&mycred_tour_guide=1';
197
+
198
+ if ( mycred_get_option( 'mycred_deactivated_on', false ) != false ) {
199
+ $redirect_path = 'admin.php?page=mycred-main';
200
+ }
201
+
202
  $myc_fs = fs_dynamic_init(
203
  array(
204
  'id' => '6028',
210
  'has_paid_plans' => false,
211
  'menu' => array(
212
  'slug' => 'mycred',
213
+ 'first-path' => $redirect_path,
214
  'account' => false,
215
  'contact' => false,
216
  'support' => false,
221
  }
222
 
223
  return $myc_fs;
224
+
225
  }
226
 
227
  /**
228
  * Include Plugin Files
229
  * @since 1.7
230
+ * @version 1.2
231
  */
232
  public function includes() {
233
 
250
  $this->file( myCRED_INCLUDES_DIR . 'mycred-protect.php' );
251
  $this->file( myCRED_INCLUDES_DIR . 'mycred-about.php' );
252
  $this->file( myCRED_INCLUDES_DIR . 'mycred-nav-menu.php' );
253
+
254
  if( isset ( $_GET['mycred_tour_guide'] ) ){
255
 
256
  $this->file( myCRED_INCLUDES_DIR . 'mycred-walkthrough.php' );
257
  $walkthrough = new myCRED_walkthroug();
258
 
259
  }
260
+
261
  // If myCRED has been setup and is ready to begin
262
  if ( mycred_is_installed() ) {
263
 
264
  // myCRED Subscription
265
  $this->file( myCRED_MEMBERSHIP_DIR . 'subscription-functions.php' );
266
  $this->file( myCRED_MEMBERSHIP_DIR . 'mycred-connect-membership.php' );
267
+ $this->file( myCRED_INCLUDES_DIR . 'mycred-main-menu.php' );
268
 
269
  // Modules
270
  $this->file( myCRED_MODULES_DIR . 'mycred-module-addons.php' );
273
  $this->file( myCRED_MODULES_DIR . 'mycred-module-log.php' );
274
  $this->file( myCRED_MODULES_DIR . 'mycred-module-export.php' );
275
  $this->file( myCRED_MODULES_DIR . 'mycred-module-management.php' );
276
+ $this->file( myCRED_MODULES_DIR . 'mycred-module-br-social-share.php' );
277
+ $this->file( myCRED_MODULES_DIR . 'mycred-module-management.php' );
278
  $this->file( myCRED_MODULES_DIR . 'mycred-module-caching.php' );
279
 
280
  //Uninstall Settings
613
 
614
  }
615
 
616
+
617
+
618
  /**
619
  * Register Assets
620
  * @since 1.7
621
+ * @version 1.1
622
  */
623
  public function register_assets() {
624
 
631
  wp_register_style( 'mycred-forms', plugins_url( 'assets/css/mycred-forms.css', myCRED_THIS ), array(), $this->version, 'all' );
632
  wp_register_style( 'mycred-select2-style', plugins_url( 'assets/css/select2.css', myCRED_THIS ), array(), $this->version, 'all' );
633
 
634
+ //Badge, Rank Social Share Sheets
635
+ wp_register_style( 'mycred-social-share-icons', plugins_url( 'assets/css/mycred-social-icons.css', myCRED_THIS ), array(), $this->version, 'all' );
636
+ wp_register_style( 'mycred-social-share-style', plugins_url( 'assets/css/mycred-social-share.css', myCRED_THIS ), array(), $this->version, 'all' );
637
+
638
  // Scripts
639
  wp_register_script( 'mycred-send-points', plugins_url( 'assets/js/send.js', myCRED_THIS ), array( 'jquery' ), $this->version, true );
640
  wp_register_script( 'mycred-accordion', plugins_url( 'assets/js/mycred-accordion.js', myCRED_THIS ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-accordion' ), $this->version );
711
  * Front Enqueue Before
712
  * Enqueues scripts and styles that must run before content is loaded.
713
  * @since 1.7
714
+ * @version 1.1
715
  */
716
  public function enqueue_front_before() {
717
 
719
  if ( apply_filters( 'mycred_remove_widget_css', false ) === false )
720
  wp_enqueue_style( 'mycred-front' );
721
 
722
+ wp_enqueue_style( 'mycred-social-share-icons' );
723
+ wp_enqueue_style( 'mycred-social-share-style' );
724
+
725
  // Let others play
726
  do_action( 'mycred_front_enqueue' );
727
 
767
  /**
768
  * Admin Enqueue
769
  * @since 1.7
770
+ * @version 1.2
771
  */
772
  public function enqueue_admin_before() {
773
 
774
+ wp_enqueue_style( 'mycred-social-share-icons' );
775
+ wp_enqueue_style( 'mycred-social-share-style' );
776
 
777
  // Let others play
778
  do_action( 'mycred_admin_enqueue' );
826
  if ( defined( 'WP_LOAD_IMPORTERS' ) )
827
  $this->register_importers();
828
 
829
+ global $pagenow;
830
+ if ( $pagenow == 'admin.php' && isset( $_GET['page'] ) && $_GET['page'] == 'mycred-about' ) {
831
+ remove_all_actions( 'admin_notices' );
832
+ }
833
+
834
  // Let others play
835
  do_action( 'mycred_admin_init' );
836
  }
908
  if ( version_compare( $wp_version, '3.8', '<' ) )
909
  $menu_icon = '';
910
 
911
+ $main_menu = new myCRED_Main_Menu( $this->modules );
912
+
913
  // Add skeleton menus for each point type so modules can
914
  // insert their content under each of these menus
915
  foreach ( $this->point_types as $type_id => $title ) {
939
 
940
  }
941
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
942
  /**
943
  * Toolbar
944
  * @since 1.7
1091
  public function plugin_links( $actions, $plugin_file, $plugin_data, $context ) {
1092
 
1093
  // Link to Setup
1094
+ if ( !mycred_is_installed() )
1095
+
 
1096
  $actions['_settings'] = '<a href="' . admin_url( 'admin.php?page=' . MYCRED_SLUG . '-settings' ) . '" >' . __( 'Settings', 'mycred' ) . '</a>';
1097
 
1098
  ksort( $actions );
1162
  return $parsed_args;
1163
  }
1164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1165
  }
1166
  endif;
1167
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: mycred,wpexpertsio
3
  Tags: badges, gamification, loyalty, points, rewards
4
  Requires at least: 4.8
5
- Tested up to: 5.7.2
6
  Stable tag: 2.1.1
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
@@ -30,12 +30,6 @@ myCred allows **THREE different ways** through which you can award your users:
30
 
31
  * **Badges -** Boost your users’ participation by rewarding them for their exceptional performance.
32
 
33
- **myCred Beta v2.2**
34
-
35
- myCred Beta v2.2 focuses on improving the overall user interface, single badge page layout, point-type image, and social media sharing for a better user experience and operational eficiency.
36
-
37
- Read more about myCred v2.2 in these [release notes](https://mycred.me/blog/mycred-2-2-beta-release/).
38
-
39
  = BECOME A VIP MEMBER OF THE MYCRED MEMBERSHIP CLUB =
40
 
41
  Join the myCred membership club today and take advantage of premium services that include priority customer support and hundreds of add-ons at a super-saver price - Save 30% on all 3-year plans!
@@ -220,7 +214,6 @@ myCred is integrated with a large number of popular learning management systems,
220
  - [myCred BP Group Leaderboards](https://www.mycred.me/store/mycred-bp-group-leaderboards/)
221
  - [myCred for WP-Pro-Quiz](https://www.mycred.me/store/mycred-for-wp-pro-quiz/)
222
  - [myCred for Rating Form](https://www.mycred.me/store/mycred-for-rating-form/)
223
- - [myCred - Buddyboss Integration](https://wordpress.org/plugins/mycred-buddyboss)
224
  [Explore to find out more...](https://www.mycred.me/product-category/freebies/)
225
 
226
 
@@ -311,6 +304,9 @@ You can find a list of [frequently asked questions](https://mycred.me/about/faq/
311
 
312
  == Upgrade Notice ==
313
 
 
 
 
314
  = 2.1.1 =
315
  New features and Bug fixes.
316
 
@@ -401,6 +397,25 @@ Bug fixes release.
401
 
402
  == Changelog ==
403
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  = 2.1.1 =
405
  NEW - Introduced new template tags %badge_image%, %badge_title%, %rank_image% and %rank_title% for myCred email notification addon.
406
  NEW - Added support for cashCred payment email in myCred email notification addon.
2
  Contributors: mycred,wpexpertsio
3
  Tags: badges, gamification, loyalty, points, rewards
4
  Requires at least: 4.8
5
+ Tested up to: 5.8
6
  Stable tag: 2.1.1
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
30
 
31
  * **Badges -** Boost your users’ participation by rewarding them for their exceptional performance.
32
 
 
 
 
 
 
 
33
  = BECOME A VIP MEMBER OF THE MYCRED MEMBERSHIP CLUB =
34
 
35
  Join the myCred membership club today and take advantage of premium services that include priority customer support and hundreds of add-ons at a super-saver price - Save 30% on all 3-year plans!
214
  - [myCred BP Group Leaderboards](https://www.mycred.me/store/mycred-bp-group-leaderboards/)
215
  - [myCred for WP-Pro-Quiz](https://www.mycred.me/store/mycred-for-wp-pro-quiz/)
216
  - [myCred for Rating Form](https://www.mycred.me/store/mycred-for-rating-form/)
 
217
  [Explore to find out more...](https://www.mycred.me/product-category/freebies/)
218
 
219
 
304
 
305
  == Upgrade Notice ==
306
 
307
+ = 2.2 =
308
+ New features and Bug fixes.
309
+
310
  = 2.1.1 =
311
  New features and Bug fixes.
312
 
397
 
398
  == Changelog ==
399
 
400
+ = 2.2 =
401
+ NEW - On plugin activation, the default point type will be created automatically.
402
+ NEW - Added new template tags in email notification for transfer events.
403
+ NEW - Now user can upload a point-type image.
404
+ NEW - By default, all built-in add-ons are enabled.
405
+ NEW - Introduced a enable/disable all addons button.
406
+ NEW - Added tabs in myCred addons page.
407
+ NEW - Moved general settings and menus into the newly introduced “myCred” main menu.
408
+ NEW - Users can share their achieved Badges on social media.
409
+ FIX - Backend logs are not being exported whether the export raw/formatted log option is set.
410
+ FIX - Incorrect achieved badge level image in [mycred_badges] shortcode.
411
+ FIX - In the Ranks list page All/Published/Trash links not working properly.
412
+ FIX - Unable to revoke badge from the User profile page.
413
+ FIX - Added some security validations in the transfer form.
414
+ FIX - MYSQL 8 syntax error in the leaderboard.
415
+ FIX - Added compatibility with BuddyPress version 8.0.
416
+ Tweak - When a user deletes the log of buy_content, the sales count does not get updated. So, we have Introduced the "Update Sales Count" button in the settings.
417
+ TWEAK - Improve new point type creation form setting
418
+
419
  = 2.1.1 =
420
  NEW - Introduced new template tags %badge_image%, %badge_title%, %rank_image% and %rank_title% for myCred email notification addon.
421
  NEW - Added support for cashCred payment email in myCred email notification addon.