Google Analytics - Version 3.0.0

Version Description

  • 02-Jan-2020
  • New : Code refactoring.
  • New : Various security checks and validation for POST variables.
  • New : Implementing Multisite Multi-Network in the Pro Version.
  • New : Implementing Permissions Control in the Pro Version.
Download this release

Release Info

Developer amribrahim
Plugin Icon 128x128 Google Analytics
Version 3.0.0
Comparing to
See all releases

Code changes from version 2.0.7 to 3.0.0

core/exception.class.php CHANGED
@@ -23,7 +23,7 @@ class ErrorHandler {
23
  if (self::$debugMode){
24
  self::$errors["debug"] = $debug;
25
  }
26
- header('Content-Type: application/json');
27
  echo json_encode(self::$errors, JSON_FORCE_OBJECT);
28
  exit();
29
  }
23
  if (self::$debugMode){
24
  self::$errors["debug"] = $debug;
25
  }
26
+ header('Content-Type: application/json; charset=utf-8');
27
  echo json_encode(self::$errors, JSON_FORCE_OBJECT);
28
  exit();
29
  }
core/lrgawidget.class.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace Lara\Widgets\GoogleAnalytics;
4
  use Lara\Utils\Google\GoogleAnalyticsAPI as GoogleAnalyticsAPI;
5
  use Lara\Utils\Common\registryStore as registryStore;
 
6
 
7
  /**
8
  * @package Google Analytics by Lara
@@ -139,7 +140,7 @@ class lrgawidget{
139
  $this->calculateTotalsFor = "ga:pageviews";
140
  $this->doCall(false);
141
 
142
- if (is_array($this->results['rows']) && !empty($this->results['rows'])){
143
  @array_walk($this->results['rows'], array($this, 'preparePagesOutput'));
144
  }
145
 
@@ -202,13 +203,14 @@ class lrgawidget{
202
  $this->jsonOutput();
203
  }
204
 
205
-
206
  public function getProfiles(){
207
  $this->refreshToken();
208
  $this->results = $this->gapi->getAccounts();
209
  $this->output['all_accounts'] = $this->results['items'];
210
  $this->results = $this->gapi->getProfiles(array('fields' => 'items(id,timezone)'));
211
  $this->output['all_profiles'] = $this->results['items'];
 
 
212
  $this->output['current_selected'] = array("account_id" => $this->getSetting('account_id'),
213
  "property_id" => $this->getSetting('property_id'),
214
  "profile_id" => $this->getSetting('profile_id'),
@@ -244,11 +246,58 @@ class lrgawidget{
244
  }
245
 
246
 
247
- public function setProfileID($account_id, $property_id, $profile_id, $profile_timezone){
248
- $this->saveSetting(array('account_id' => $account_id,
249
- 'property_id' => $property_id,
250
- 'profile_id' => $profile_id,
251
- 'profile_timezone' => $profile_timezone));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  $this->purgeCache();
253
  $this->jsonOutput();
254
  }
@@ -336,7 +385,7 @@ class lrgawidget{
336
  $this->output['end'] = $this->getSetting('end_date');
337
  $this->output['status'] = "done";
338
  echo json_encode($this->output, true);
339
- }else{ echo json_encode($this->errors); }
340
 
341
  exit();
342
  }
3
  namespace Lara\Widgets\GoogleAnalytics;
4
  use Lara\Utils\Google\GoogleAnalyticsAPI as GoogleAnalyticsAPI;
5
  use Lara\Utils\Common\registryStore as registryStore;
6
+ use Lara\Utils\Common as Common;
7
 
8
  /**
9
  * @package Google Analytics by Lara
140
  $this->calculateTotalsFor = "ga:pageviews";
141
  $this->doCall(false);
142
 
143
+ if (!empty($this->results['rows']) && is_array($this->results['rows'])){
144
  @array_walk($this->results['rows'], array($this, 'preparePagesOutput'));
145
  }
146
 
203
  $this->jsonOutput();
204
  }
205
 
 
206
  public function getProfiles(){
207
  $this->refreshToken();
208
  $this->results = $this->gapi->getAccounts();
209
  $this->output['all_accounts'] = $this->results['items'];
210
  $this->results = $this->gapi->getProfiles(array('fields' => 'items(id,timezone)'));
211
  $this->output['all_profiles'] = $this->results['items'];
212
+ $this->store->saveCache($this->cachePrefix, md5('all_accounts'.$this->getSetting('access_token'))."_output", $this->output);
213
+
214
  $this->output['current_selected'] = array("account_id" => $this->getSetting('account_id'),
215
  "property_id" => $this->getSetting('property_id'),
216
  "profile_id" => $this->getSetting('profile_id'),
246
  }
247
 
248
 
249
+ public function setProfileID($account_id, $property_id, $profile_id, $profile_timezone, $enable_universal_tracking){
250
+ $data = $this->store->getCache($this->cachePrefix, md5('all_accounts'.$this->getSetting('access_token'))."_output", $this->cacheTime);
251
+ $selectedProfile = array();
252
+
253
+ if (!empty($data['all_accounts']) && is_array($data['all_accounts'])){
254
+ foreach ($data['all_accounts'] as $account){
255
+ if ($account['id'] == $account_id){
256
+ $selectedProfile['account_id'] = $account['id'];
257
+ foreach ($account['webProperties'] as $webProperty){
258
+ if ($webProperty['id'] == $property_id){
259
+ $selectedProfile['property_id'] = $webProperty['id'];
260
+ foreach ($webProperty['profiles'] as $profile){
261
+ if ($profile['id'] == $profile_id){
262
+ $selectedProfile['profile_id'] = $profile['id'];
263
+ break;
264
+ }
265
+ }
266
+ break;
267
+ }
268
+ }
269
+ break;
270
+ }
271
+ }
272
+ }
273
+
274
+ if (!empty($data['all_profiles']) && is_array($data['all_profiles'])){
275
+ foreach ($data['all_profiles'] as $profileTm){
276
+ if ($profileTm['id'] == $profile_id){
277
+ $selectedProfile['profile_timezone'] = $profileTm['timezone'];
278
+ break;
279
+ }
280
+ }
281
+ }
282
+
283
+
284
+ if(empty($selectedProfile['account_id'])){$this->errors[] = "Invalid account_id";}
285
+ if(empty($selectedProfile['property_id'])){$this->errors[] = "Invalid property_id";}
286
+ if(empty($selectedProfile['profile_id'])){$this->errors[] = "Invalid profile_id";}
287
+ if(empty($selectedProfile['profile_timezone'])){$this->errors[] = "Invalid profile_timezone";}
288
+ if (empty($this->errors)){
289
+ $this->saveSetting(array('account_id' => $selectedProfile['account_id'],
290
+ 'property_id' => $selectedProfile['property_id'],
291
+ 'profile_id' => $selectedProfile['profile_id'],
292
+ 'profile_timezone' => $selectedProfile['profile_timezone']));
293
+
294
+ if($enable_universal_tracking === "on"){
295
+ $this->saveSetting(array('enable_universal_tracking' => 'on'));
296
+ }else{
297
+ $this->saveSetting(array('enable_universal_tracking' => 'off'));
298
+ }
299
+ }
300
+
301
  $this->purgeCache();
302
  $this->jsonOutput();
303
  }
385
  $this->output['end'] = $this->getSetting('end_date');
386
  $this->output['status'] = "done";
387
  echo json_encode($this->output, true);
388
+ }else{ Common\ErrorHandler::FatalError("Fatal Error","Something went wrong .. please contact an administrator",100001,$this->errors); }
389
 
390
  exit();
391
  }
core/lrgawidget.handler.php CHANGED
@@ -14,7 +14,7 @@ use Lara\Utils\Common as Common;
14
  if (!defined("ABSPATH"))
15
  die("This file cannot be accessed directly");
16
 
17
- require("exception.class.php");
18
 
19
  if (isset($lrdata['action']) && !empty($lrperm)){
20
 
@@ -23,14 +23,14 @@ if (isset($lrdata['action']) && !empty($lrperm)){
23
  require("GoogleAnalyticsAPI.class.php");
24
  require("lrgawidget.class.php");
25
 
26
-
 
 
 
27
  $call = new GoogleAnalytics\lrgawidget($lrperm);
28
  $call->setSystemTimeZone(get_option('timezone_string'));
29
 
30
  $call->setDateRange(date('Y-m-d', strtotime('-1 month')), date('Y-m-d'));
31
- if (in_array("lrgawidget_perm_admin", $lrperm["permissions"])){
32
- Common\ErrorHandler::setDebugMode(true);
33
- }
34
 
35
  switch ($lrdata['action']) {
36
  case "getAuthURL":
@@ -46,7 +46,7 @@ if (isset($lrdata['action']) && !empty($lrperm)){
46
  else{ Common\ErrorHandler::FatalError("You don't have permission to access this tab!");}
47
  break;
48
  case "setProfileID":
49
- if (in_array("lrgawidget_perm_admin", $lrperm["permissions"])){ $call->setProfileID($lrdata['account_id'],$lrdata['property_id'],$lrdata['profile_id'], $lrdata['profile_timezone']);}
50
  else{ Common\ErrorHandler::FatalError("You don't have permission to access this tab!");}
51
  break;
52
  case "settingsReset":
14
  if (!defined("ABSPATH"))
15
  die("This file cannot be accessed directly");
16
 
17
+ require_once("exception.class.php");
18
 
19
  if (isset($lrdata['action']) && !empty($lrperm)){
20
 
23
  require("GoogleAnalyticsAPI.class.php");
24
  require("lrgawidget.class.php");
25
 
26
+ if (in_array("lrgawidget_perm_admin", $lrperm["permissions"])){
27
+ Common\ErrorHandler::setDebugMode(true);
28
+ }
29
+
30
  $call = new GoogleAnalytics\lrgawidget($lrperm);
31
  $call->setSystemTimeZone(get_option('timezone_string'));
32
 
33
  $call->setDateRange(date('Y-m-d', strtotime('-1 month')), date('Y-m-d'));
 
 
 
34
 
35
  switch ($lrdata['action']) {
36
  case "getAuthURL":
46
  else{ Common\ErrorHandler::FatalError("You don't have permission to access this tab!");}
47
  break;
48
  case "setProfileID":
49
+ if (in_array("lrgawidget_perm_admin", $lrperm["permissions"])){ $call->setProfileID($lrdata['account_id'],$lrdata['property_id'],$lrdata['profile_id'], $lrdata['profile_timezone'], @$lrdata['enable_universal_tracking']);}
50
  else{ Common\ErrorHandler::FatalError("You don't have permission to access this tab!");}
51
  break;
52
  case "settingsReset":
core/lrgawidget.permissions.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Lara\Utils\Common;
4
+ use Lara\Utils\Common as Common;
5
+ use Lara\Utils\Common\WPHelperFunctions as WPHelperFunctions;
6
+
7
+ /**
8
+ * @package Google Analytics by Lara
9
+ * @author Amr M. Ibrahim <mailamr@gmail.com>
10
+ * @link https://www.xtraorbit.com/
11
+ * @copyright Copyright (c) WHMCSAdminTheme 2016 - 2017
12
+ */
13
+
14
+ if (!defined("ABSPATH"))
15
+ die("This file cannot be accessed directly");
16
+
17
+ require_once("exception.class.php");
18
+
19
+ class permissions{
20
+ private $laraStockPermissions;
21
+ private $userPermissions;
22
+ private $userRoles;
23
+ private $output = array();
24
+ private $errors = array();
25
+
26
+ function __construct(){
27
+ $this->laraStockPermissions = array(
28
+ array( "id" => "permissions",
29
+ "name" => "Permissions",
30
+ "icon" => "fa-key",
31
+ "permissions" => array(array("name" => "lrgawidget_perm_perm", "label" => "Super Administrator [Change Permissions]"),
32
+ array("name" => "lrgawidget_perm_admin", "label" => "Administrator [Change Settings]")
33
+ )
34
+ ),
35
+ array( "id" => "tabs",
36
+ "name" => "Tabs",
37
+ "icon" => "fa-bar-chart",
38
+ "permissions" => array(array("name" => "lrgawidget_perm_sessions", "label" => "View Sessions"),
39
+ array("name" => "lrgawidget_perm_daterange","label" => "Change Date Range"),
40
+ array("name" => "lrgawidget_perm_realtime", "label" => "Real Time"),
41
+ array("name" => "lrgawidget_perm_countries","label" => "View Countries"),
42
+ array("name" => "lrgawidget_perm_browsers", "label" => "View Browsers"),
43
+ array("name" => "lrgawidget_perm_languages","label" => "View Languages"),
44
+ array("name" => "lrgawidget_perm_os", "label" => "View Operating Systems"),
45
+ array("name" => "lrgawidget_perm_devices", "label" => "View Devices"),
46
+ array("name" => "lrgawidget_perm_screenres","label" => "View Screen Resolutions"),
47
+ array("name" => "lrgawidget_perm_keywords", "label" => "View Keywords"),
48
+ array("name" => "lrgawidget_perm_sources", "label" => "View Sources"),
49
+ array("name" => "lrgawidget_perm_pages", "label" => "View Pages")
50
+ )
51
+ )
52
+ );
53
+
54
+ $this->userRoles = array("administrator");
55
+ $this->userPermissions = array("lrgawidget_perm_perm");
56
+ }
57
+
58
+ private function getRoles(){
59
+ global $wp_roles;
60
+ $currentRoles = array();
61
+ $roles = $wp_roles->roles;
62
+ foreach ($roles as $role => $properties){
63
+ $currentRoles[] = array('id' => $role, 'name' => $properties['name']);
64
+ }
65
+ return $currentRoles;
66
+ }
67
+
68
+ public function getCurrentBlogRolesPermissions(){
69
+ if (in_array("lrgawidget_perm_perm", $this->userPermissions)){
70
+ $return = array();
71
+ $return['group_permissions'] = $this->laraStockPermissions;
72
+ $return['roles'] = $this->getRoles();
73
+
74
+ foreach ($return['roles'] as $role) {
75
+ $return['role_permissions'][$role['id']] = array();
76
+ }
77
+ $this->output = $return;
78
+ }else{$this->errors[] = "You don't have permission to access this page";}
79
+ $this->jsonOutput();
80
+ }
81
+
82
+ private function jsonOutput(){
83
+ header('Content-Type: application/json; charset=utf-8');
84
+ if (empty($this->errors)){
85
+ $this->output['status'] = "done";
86
+ echo json_encode($this->output, true);
87
+ }else{
88
+ if(in_array("administrator", $this->userRoles)){Common\ErrorHandler::setDebugMode(true);}
89
+ Common\ErrorHandler::FatalError("Fatal Error","Couldn't get or set widget permissions .. please contact an administrator",10001,$this->errors);
90
+ }
91
+ exit();
92
+ }
93
+
94
+ }
95
+
96
+ ?>
core/storage.class.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace Lara\Utils\Common;
4
 
5
  use Lara\Utils\Common as Common;
 
6
 
7
  /**
8
  * @package Google Analytics by Lara
@@ -15,11 +16,13 @@ if (!defined("ABSPATH"))
15
  die("This file cannot be accessed directly");
16
 
17
  class registryStore{
18
-
19
  function __construct(){
20
- session_start();
 
 
21
  }
22
-
23
  public function set($name, $value=""){
24
  global $wpdb;
25
 
@@ -27,10 +30,13 @@ class registryStore{
27
  elseif (!empty($name)){
28
  try{
29
  $exists = $wpdb->get_results( "SELECT * FROM `".lrgawidget_plugin_table."` WHERE `name` = '".$name."'",ARRAY_A );
 
30
  if (!empty($exists)){
31
  $wpdb->update( lrgawidget_plugin_table, array('value' => $value), array('name' => $name));
 
32
  }else{
33
  $wpdb->insert( lrgawidget_plugin_table, array( 'name' => $name, 'value' => $value));
 
34
  }
35
  } catch (\Exception $e) {
36
  Common\ErrorHandler::FatalError("cannot save ".$name." returned error: ". $e->getMessage());
@@ -45,6 +51,7 @@ class registryStore{
45
  if (!empty($name)){
46
  try{
47
  $wpdb->delete( lrgawidget_plugin_table, array('name' => $name) );
 
48
  } catch (\Exception $e) {
49
  Common\ErrorHandler::FatalError("cannot delete ".$name." returned error: ". $e->getMessage());
50
  }
@@ -56,6 +63,7 @@ class registryStore{
56
 
57
  $allSettings = array();
58
  $settings = $wpdb->get_results ( "SELECT `name`, `value` FROM `".lrgawidget_plugin_table."`", ARRAY_A );
 
59
  if (!empty($settings)){
60
  foreach ($settings as $setting) {
61
  $allSettings[$setting['name']] = $setting['value'];
@@ -75,6 +83,7 @@ class registryStore{
75
 
76
  try{
77
  $wpdb->query("TRUNCATE TABLE `".lrgawidget_plugin_table."`");
 
78
  } catch (\Exception $e) {
79
  Common\ErrorHandler::FatalError("cannot empty table, returned error: ". $e->getMessage());
80
  }
@@ -82,7 +91,7 @@ class registryStore{
82
  foreach ($_SESSION as $key => $value) {
83
  if(preg_match('/^lrgatmp_/s', $key)){
84
  unset($_SESSION[$key]);
85
- };
86
  }
87
  }
88
 
3
  namespace Lara\Utils\Common;
4
 
5
  use Lara\Utils\Common as Common;
6
+ use Lara\Utils\Common\WPHelperFunctions as WPHelperFunctions;
7
 
8
  /**
9
  * @package Google Analytics by Lara
16
  die("This file cannot be accessed directly");
17
 
18
  class registryStore{
19
+
20
  function __construct(){
21
+ if (!session_id()){
22
+ session_start();
23
+ }
24
  }
25
+
26
  public function set($name, $value=""){
27
  global $wpdb;
28
 
30
  elseif (!empty($name)){
31
  try{
32
  $exists = $wpdb->get_results( "SELECT * FROM `".lrgawidget_plugin_table."` WHERE `name` = '".$name."'",ARRAY_A );
33
+ if (!empty($wpdb->last_error)){Common\ErrorHandler::FatalError("Fatal Error","DataBase Error .. please contact an administrator",10002,$wpdb->last_error);}
34
  if (!empty($exists)){
35
  $wpdb->update( lrgawidget_plugin_table, array('value' => $value), array('name' => $name));
36
+ if (!empty($wpdb->last_error)){Common\ErrorHandler::FatalError("Fatal Error","DataBase Error .. please contact an administrator",10003,$wpdb->last_error);}
37
  }else{
38
  $wpdb->insert( lrgawidget_plugin_table, array( 'name' => $name, 'value' => $value));
39
+ if (!empty($wpdb->last_error)){Common\ErrorHandler::FatalError("Fatal Error","DataBase Error .. please contact an administrator",10004,$wpdb->last_error);}
40
  }
41
  } catch (\Exception $e) {
42
  Common\ErrorHandler::FatalError("cannot save ".$name." returned error: ". $e->getMessage());
51
  if (!empty($name)){
52
  try{
53
  $wpdb->delete( lrgawidget_plugin_table, array('name' => $name) );
54
+ if (!empty($wpdb->last_error)){Common\ErrorHandler::FatalError("Fatal Error","DataBase Error .. please contact an administrator",10005,$wpdb->last_error);}
55
  } catch (\Exception $e) {
56
  Common\ErrorHandler::FatalError("cannot delete ".$name." returned error: ". $e->getMessage());
57
  }
63
 
64
  $allSettings = array();
65
  $settings = $wpdb->get_results ( "SELECT `name`, `value` FROM `".lrgawidget_plugin_table."`", ARRAY_A );
66
+ if (!empty($wpdb->last_error)){Common\ErrorHandler::FatalError("Fatal Error","DataBase Error .. please contact an administrator",10006,$wpdb->last_error);}
67
  if (!empty($settings)){
68
  foreach ($settings as $setting) {
69
  $allSettings[$setting['name']] = $setting['value'];
83
 
84
  try{
85
  $wpdb->query("TRUNCATE TABLE `".lrgawidget_plugin_table."`");
86
+ if (!empty($wpdb->last_error)){Common\ErrorHandler::FatalError("Fatal Error","DataBase Error .. please contact an administrator",10007,$wpdb->last_error);}
87
  } catch (\Exception $e) {
88
  Common\ErrorHandler::FatalError("cannot empty table, returned error: ". $e->getMessage());
89
  }
91
  foreach ($_SESSION as $key => $value) {
92
  if(preg_match('/^lrgatmp_/s', $key)){
93
  unset($_SESSION[$key]);
94
+ }
95
  }
96
  }
97
 
core/wp.helper.functions.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Lara\Utils\Common;
4
+
5
+ /**
6
+ * @package Google Analytics by Lara
7
+ * @author Amr M. Ibrahim <mailamr@gmail.com>
8
+ * @link https://www.xtraorbit.com/
9
+ * @copyright Copyright (c) WHMCSAdminTheme 2016 - 2017
10
+ */
11
+
12
+ if (!defined("ABSPATH"))
13
+ die("This file cannot be accessed directly");
14
+
15
+ class WPHelperFunctions {
16
+
17
+ private static $initialized = false;
18
+ private static $user_id;
19
+ private static $blog_options = array();
20
+
21
+ public static function initInstance() {
22
+
23
+ if (self::$initialized){
24
+ return;
25
+ }
26
+
27
+ if (!session_id()){
28
+ session_start();
29
+ }
30
+
31
+ if (is_admin()){
32
+ self::update_plugin();
33
+ }
34
+
35
+ self::$user_id = self::current_user_id();
36
+ self::$blog_options = self::blog_options();
37
+ self::$initialized = true;
38
+ }
39
+
40
+ private static function update_plugin(){
41
+
42
+ $version = get_network_option(1,lrgawidget_plugin_prefiex.'version', '1.0');
43
+ if (version_compare($version, lrgawidget_plugin_version, '<')){
44
+ if (version_compare($version, '3.0.0', '<')){
45
+ global $wpdb;
46
+
47
+ $old_settings = array();
48
+ $results = $wpdb->get_results ( "SELECT `name`, `value` FROM `".lrgawidget_plugin_table."`", ARRAY_A );
49
+ if (!empty($results)){
50
+ foreach ($results as $setting) {
51
+ $old_settings[$setting['name']] = $setting['value'];
52
+ }
53
+ }
54
+
55
+ $property_id = get_option('lrgawidget_property_id',"");
56
+ if ( (!empty($property_id) && !self::is_analytics($property_id)) || (!empty($old_settings['property_id']) && !self::is_analytics($old_settings['property_id'])) ){
57
+ $wpdb->query("TRUNCATE TABLE `".lrgawidget_plugin_table."`");
58
+ foreach ($_SESSION as $key => $value) {
59
+ if(preg_match('/^lrgatmp_/s', $key)){
60
+ unset($_SESSION[$key]);
61
+ }
62
+ }
63
+ $property_id = "";
64
+ $old_settings = array();
65
+ }
66
+
67
+ if (!empty($property_id) && self::is_analytics($property_id)) {
68
+ $wpdb->insert( lrgawidget_plugin_table, array( 'name' => 'enable_universal_tracking', 'value' => 'on'));
69
+ }else{
70
+ if(!empty($old_settings)){
71
+ $wpdb->insert( lrgawidget_plugin_table, array( 'name' => 'enable_universal_tracking', 'value' => 'off'));
72
+ }
73
+ }
74
+ delete_option('lrgawidget_property_id');
75
+ }
76
+
77
+ if (!is_multisite()){
78
+ update_option(lrgawidget_plugin_prefiex.'version', lrgawidget_plugin_version, 'yes' );
79
+ }else{
80
+ update_network_option(1, lrgawidget_plugin_prefiex.'version', lrgawidget_plugin_version );
81
+ }
82
+ }
83
+ }
84
+
85
+ private static function current_user_id(){
86
+ return get_current_user_id();
87
+ }
88
+
89
+ public static function get_current_user_id(){
90
+ return self::$user_id;
91
+ }
92
+
93
+ private static function blog_options(){
94
+ global $wpdb;
95
+ $options = array();
96
+ $results = $wpdb->get_results ( "SELECT `name`, `value` FROM `".lrgawidget_plugin_table."`", ARRAY_A );
97
+ if (empty($wpdb->last_error) && !empty($results)){
98
+ foreach ($results as $option) {
99
+ $options[$option['name']] = $option['value'];
100
+ }
101
+ }
102
+ return $options;
103
+ }
104
+
105
+ public static function get_blog_option($option){
106
+ $value = "";
107
+ if(!empty(self::$blog_options[$option])){
108
+ $value = sanitize_text_field(self::$blog_options[$option]);
109
+ }
110
+ return $value;
111
+ }
112
+
113
+ public static function get_current_user_option($option){
114
+ return sanitize_text_field(get_user_option($option, self::$user_id));
115
+ }
116
+
117
+ public static function update_current_user_option($option, $value){
118
+ update_user_option(self::$user_id, $option, $value);
119
+ }
120
+
121
+ public static function is_analytics($str){
122
+ return (bool) preg_match('/^ua-\d{4,20}(-\d{1,10})?$/i', $str);
123
+ }
124
+
125
+ public static function get_ga_code(){
126
+ $enable_universal_tracking = self::get_blog_option('enable_universal_tracking');
127
+ if ($enable_universal_tracking === "on"){
128
+ $property_id = self::get_blog_option('property_id');
129
+ if (!current_user_can('edit_posts') && !empty($property_id) && self::is_analytics($property_id)){
130
+ ?>
131
+ <!-- Lara's Google Analytics - https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/ -->
132
+ <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $property_id ?>"></script>
133
+ <script>
134
+ window.dataLayer = window.dataLayer || [];
135
+ function gtag(){dataLayer.push(arguments);}
136
+ gtag('js', new Date());
137
+ gtag('config', '<?php echo $property_id ?>', { 'anonymize_ip': true });
138
+ </script>
139
+ <?php
140
+ }
141
+ }
142
+ }
143
+ }
144
+ add_action('init', 'Lara\Utils\Common\WPHelperFunctions::initInstance');
145
+ ?>
dist/css/lrgalite-main.css CHANGED
@@ -8860,6 +8860,10 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:las
8860
  margin-bottom: 0px;
8861
  }
8862
 
 
 
 
 
8863
  #lrgawidget_sessions_tab #lrga-xologoholder {
8864
  position: absolute;
8865
  top: 295px;
@@ -8878,4 +8882,91 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:las
8878
  display: block;
8879
  opacity: 0.85;
8880
  transition: opacity 0.5s ease;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8881
  }
8860
  margin-bottom: 0px;
8861
  }
8862
 
8863
+ .lrgawidget_realtime_dpbar .progress div {
8864
+ line-height: 150% !important;
8865
+ }
8866
+
8867
  #lrgawidget_sessions_tab #lrga-xologoholder {
8868
  position: absolute;
8869
  top: 295px;
8882
  display: block;
8883
  opacity: 0.85;
8884
  transition: opacity 0.5s ease;
8885
+ }
8886
+
8887
+ /* Component: Options grid */
8888
+
8889
+ .lrgawidget_permissions .lroptions-checkbox-grid div { display: block; float: left; width: 30%; }
8890
+ .lrgawidget_permissions .lroptions-checkbox-grid label { font-weight: normal; }
8891
+ .lrgawidget_permissions .lroptions-checkbox-grid input { margin: 0px 5px 0px 0px !important; }
8892
+ .lrgawidget_permissions .nav-stacked > li.active > a,.lrgawidget_permissions .nav-stacked > li.active > a:hover { background: transparent; border-top: 0px; border-left-color: #3c8dbc; color: #fff; background-color: #337ab7;}
8893
+
8894
+
8895
+ .lrgawidget_permissions .switch {
8896
+ position: relative;
8897
+ display: inline-block;
8898
+ width: 90px;
8899
+ height: 20px;
8900
+ }
8901
+
8902
+ .lrgawidget_permissions .switch input {display:none;}
8903
+
8904
+ .lrgawidget_permissions .slider {
8905
+ position: absolute;
8906
+ cursor: pointer;
8907
+ top: 0;
8908
+ left: 0;
8909
+ right: 0;
8910
+ bottom: 0;
8911
+ background-color: #eee;
8912
+ -webkit-transition: .4s;
8913
+ transition: .4s;
8914
+
8915
+ }
8916
+
8917
+ .lrgawidget_permissions .slider:before {
8918
+ position: absolute;
8919
+ content: "";
8920
+ height: 10px;
8921
+ width: 26px;
8922
+ left: 4px;
8923
+ bottom: 4px;
8924
+ background-color: white;
8925
+ -webkit-transition: .4s;
8926
+ transition: .4s;
8927
+
8928
+ }
8929
+
8930
+ .lrgawidget_permissions input:checked + .slider {
8931
+ background-color: #428bca;
8932
+ }
8933
+
8934
+ .lrgawidget_permissions input:focus + .slider {
8935
+ box-shadow: 0 0 1px #2196F3;
8936
+ }
8937
+
8938
+ .lrgawidget_permissions input:checked + .slider:before {
8939
+ -webkit-transform: translateX(26px);
8940
+ -ms-transform: translateX(26px);
8941
+ transform: translateX(55px);
8942
+ }
8943
+
8944
+ /*------ ADDED CSS ---------*/
8945
+ .lrgawidget_permissions .slider:after
8946
+ {
8947
+ content:'OFF';
8948
+ color: white;
8949
+ display: block;
8950
+ position: absolute;
8951
+ transform: translate(-50%,-50%);
8952
+ top: 50%;
8953
+ left: 50%;
8954
+ font-size: 10px;
8955
+ font-family: Verdana, sans-serif;
8956
+ }
8957
+
8958
+ .lrgawidget_permissions input:checked + .slider:after
8959
+ {
8960
+ content:'ON';
8961
+ }
8962
+
8963
+ .lrga_bs select {
8964
+ max-width: initial !important;
8965
+ -webkit-appearance: menulist !important;
8966
+ -moz-appearance: menulist !important;
8967
+ appearance: menulist !important;
8968
+ }
8969
+
8970
+ .lrga_bs select:hover {
8971
+ color: initial !important;
8972
  }
dist/css/lrgawidget.css CHANGED
@@ -1874,6 +1874,10 @@
1874
  margin-bottom: 0px;
1875
  }
1876
 
 
 
 
 
1877
  #lrgawidget_sessions_tab #lrga-xologoholder {
1878
  position: absolute;
1879
  top: 295px;
@@ -1892,4 +1896,91 @@
1892
  display: block;
1893
  opacity: 0.85;
1894
  transition: opacity 0.5s ease;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1895
  }
1874
  margin-bottom: 0px;
1875
  }
1876
 
1877
+ .lrgawidget_realtime_dpbar .progress div {
1878
+ line-height: 150% !important;
1879
+ }
1880
+
1881
  #lrgawidget_sessions_tab #lrga-xologoholder {
1882
  position: absolute;
1883
  top: 295px;
1896
  display: block;
1897
  opacity: 0.85;
1898
  transition: opacity 0.5s ease;
1899
+ }
1900
+
1901
+ /* Component: Options grid */
1902
+
1903
+ .lrgawidget_permissions .lroptions-checkbox-grid div { display: block; float: left; width: 30%; }
1904
+ .lrgawidget_permissions .lroptions-checkbox-grid label { font-weight: normal; }
1905
+ .lrgawidget_permissions .lroptions-checkbox-grid input { margin: 0px 5px 0px 0px !important; }
1906
+ .lrgawidget_permissions .nav-stacked > li.active > a,.lrgawidget_permissions .nav-stacked > li.active > a:hover { background: transparent; border-top: 0px; border-left-color: #3c8dbc; color: #fff; background-color: #337ab7;}
1907
+
1908
+
1909
+ .lrgawidget_permissions .switch {
1910
+ position: relative;
1911
+ display: inline-block;
1912
+ width: 90px;
1913
+ height: 20px;
1914
+ }
1915
+
1916
+ .lrgawidget_permissions .switch input {display:none;}
1917
+
1918
+ .lrgawidget_permissions .slider {
1919
+ position: absolute;
1920
+ cursor: pointer;
1921
+ top: 0;
1922
+ left: 0;
1923
+ right: 0;
1924
+ bottom: 0;
1925
+ background-color: #eee;
1926
+ -webkit-transition: .4s;
1927
+ transition: .4s;
1928
+
1929
+ }
1930
+
1931
+ .lrgawidget_permissions .slider:before {
1932
+ position: absolute;
1933
+ content: "";
1934
+ height: 10px;
1935
+ width: 26px;
1936
+ left: 4px;
1937
+ bottom: 4px;
1938
+ background-color: white;
1939
+ -webkit-transition: .4s;
1940
+ transition: .4s;
1941
+
1942
+ }
1943
+
1944
+ .lrgawidget_permissions input:checked + .slider {
1945
+ background-color: #428bca;
1946
+ }
1947
+
1948
+ .lrgawidget_permissions input:focus + .slider {
1949
+ box-shadow: 0 0 1px #2196F3;
1950
+ }
1951
+
1952
+ .lrgawidget_permissions input:checked + .slider:before {
1953
+ -webkit-transform: translateX(26px);
1954
+ -ms-transform: translateX(26px);
1955
+ transform: translateX(55px);
1956
+ }
1957
+
1958
+ /*------ ADDED CSS ---------*/
1959
+ .lrgawidget_permissions .slider:after
1960
+ {
1961
+ content:'OFF';
1962
+ color: white;
1963
+ display: block;
1964
+ position: absolute;
1965
+ transform: translate(-50%,-50%);
1966
+ top: 50%;
1967
+ left: 50%;
1968
+ font-size: 10px;
1969
+ font-family: Verdana, sans-serif;
1970
+ }
1971
+
1972
+ .lrgawidget_permissions input:checked + .slider:after
1973
+ {
1974
+ content:'ON';
1975
+ }
1976
+
1977
+ .lrga_bs select {
1978
+ max-width: initial !important;
1979
+ -webkit-appearance: menulist !important;
1980
+ -moz-appearance: menulist !important;
1981
+ appearance: menulist !important;
1982
+ }
1983
+
1984
+ .lrga_bs select:hover {
1985
+ color: initial !important;
1986
  }
dist/img/xo_payments.png CHANGED
Binary file
dist/js/lrgalite-main.js CHANGED
@@ -519,12 +519,13 @@ $(document).ready(function(){
519
  e.preventDefault();
520
  lrWidgetSettings($("#lrgawidget-setProfileID").serializeArray()).done(function (data, textStatus, jqXHR) {
521
  if (data.status == "done"){
522
- $("#lrgawidget a[data-target^='#lrgawidget_']:eq(1)").click();
523
  }
524
  })
525
  });
526
 
527
  $('#lrga-wizard').on('changed.fu.wizard', function (evt, data) {
 
528
  if ($("[data-step="+data.step+"]").attr("data-name") == "lrga-profile"){
529
  lrWidgetSettings({action: "getProfiles"}).done(function (data, textStatus, jqXHR) {
530
  if (data.status == "done"){
@@ -534,6 +535,7 @@ $(document).ready(function(){
534
  lrgaAccounts = data.all_accounts;
535
  lrgaProfiles = data.all_profiles;
536
  populateViews();
 
537
  setup = false;
538
  }
539
  })
@@ -933,8 +935,55 @@ function drawMainGraph(){
933
  }
934
 
935
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
936
  $(document).ready(function(){
937
 
 
 
 
 
 
938
  dateRange = {start : moment().subtract(29, 'days').format('YYYY-MM-DD'), end : moment().format('YYYY-MM-DD')};
939
 
940
  $('#lrgawidget_reportrange').html(moment(dateRange.start).format('MMMM D, YYYY') + ' - ' + moment(dateRange.end).format('MMMM D, YYYY'));
@@ -959,6 +1008,8 @@ $(document).ready(function(){
959
  $("#lrga-wizard .steps li").removeClass("complete");
960
  $("[data-lrgawidget-reset]").show();
961
  }
 
 
962
  }else if (this.hash == "#lrgawidget_sessions_tab"){
963
  drawMainGraph();
964
  }else if (this.hash == "#lrgawidget_browsers_tab"){
519
  e.preventDefault();
520
  lrWidgetSettings($("#lrgawidget-setProfileID").serializeArray()).done(function (data, textStatus, jqXHR) {
521
  if (data.status == "done"){
522
+ $("#lrgawidget a[data-target^='#lrgawidget_']:eq(0)").click();
523
  }
524
  })
525
  });
526
 
527
  $('#lrga-wizard').on('changed.fu.wizard', function (evt, data) {
528
+ $("#lrgawidget-save-settings").prop('disabled',true);
529
  if ($("[data-step="+data.step+"]").attr("data-name") == "lrga-profile"){
530
  lrWidgetSettings({action: "getProfiles"}).done(function (data, textStatus, jqXHR) {
531
  if (data.status == "done"){
535
  lrgaAccounts = data.all_accounts;
536
  lrgaProfiles = data.all_profiles;
537
  populateViews();
538
+ $("#lrgawidget-save-settings").prop('disabled',false);
539
  setup = false;
540
  }
541
  })
935
  }
936
 
937
 
938
+ function setOptionsGrid(){
939
+ $('.lroptions-checkbox-grid[data-lr-roleid="administrator"][data-lr-groupid="permissions"]').find('input:checkbox').prop('checked',true).prop("disabled", true);
940
+ $('.lrgawidget_permissions_switch[data-lr-roleid="administrator"][data-lr-groupid="permissions"]').prop('checked',true).prop("disabled", true);
941
+ $('.lrgawidget_permissions_switch[data-lr-roleid="administrator"][data-lr-groupid="tabs"]').prop('checked',true).change();
942
+ }
943
+
944
+ function getPermissions(){
945
+ lrWidgetSettings({action : "getPermissions"}).done(function (data, textStatus, jqXHR) {
946
+ if (data.status == "done" ){
947
+ if (debug){console.log(data)};
948
+ var rolesHTML = "";
949
+ var permissionsHTML = "";
950
+ $.each(data.roles, function( i, role ){
951
+ rolesHTML += '<li><a href="#lrrole_'+role.id+'" data-toggle="pill"><i class="fa fa-users fa-fw"></i>'+role.name+'</a></li>';
952
+ permissionsHTML += '<div class="tab-pane" id="lrrole_'+role.id+'">';
953
+ $.each(data.group_permissions, function( y, group ){
954
+ permissionsHTML += '<div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title"><i class="fa '+group.icon+'"></i> '+group.name+'</h3> <input type="hidden" name="lrperms['+role.id+'][]" value="'+group.id+'"> <span class="pull-right"> <label class="switch"> <input type="checkbox" class="lrgawidget_permissions_switch" data-lr-roleid="'+role.id+'" data-lr-groupid="'+group.id+'"> <div class="slider "></div> </label> </span> </div> <div class="box-body lroptions-checkbox-grid" data-lr-roleid="'+role.id+'" data-lr-groupid="'+group.id+'">';
955
+ $.each(group.permissions, function( x, permission ){
956
+ var checked = "";
957
+ if($.inArray(permission.name, data.role_permissions[role.id] ) !== -1){
958
+ checked = "checked";
959
+ }
960
+ permissionsHTML += ' <div> <label><input '+checked+' name="lrperms['+role.id+'][]" type="checkbox" value="'+permission.name+'"> '+permission.label+'</label> </div>';
961
+ });
962
+
963
+ permissionsHTML += ' </div> </div>';
964
+ });
965
+
966
+ permissionsHTML += '</div>';
967
+ });
968
+ $("#lrgawidget_permissions_roles").html(rolesHTML);
969
+ $("#lrgawidget_permissions_list").html(permissionsHTML);
970
+ $('#lrgawidget_permissions_roles a:first').tab('show');
971
+ $(".lrgawidget_permissions_switch").change(function(){
972
+ $('.lroptions-checkbox-grid[data-lr-roleid="'+$(this).data("lr-roleid")+'"][data-lr-groupid="'+$(this).data("lr-groupid")+'"]').find('input:checkbox').prop('checked',this.checked).prop("disabled", !this.checked);
973
+ });
974
+ setOptionsGrid();
975
+ }
976
+ });
977
+
978
+ }
979
+
980
  $(document).ready(function(){
981
 
982
+ $("#lrgawidget_permissions_form").submit(function(e) {
983
+ e.preventDefault();
984
+ $('#lrgawidget a[data-target="#lrgawidget_gopro_tab"]').tab('show');
985
+ });
986
+
987
  dateRange = {start : moment().subtract(29, 'days').format('YYYY-MM-DD'), end : moment().format('YYYY-MM-DD')};
988
 
989
  $('#lrgawidget_reportrange').html(moment(dateRange.start).format('MMMM D, YYYY') + ' - ' + moment(dateRange.end).format('MMMM D, YYYY'));
1008
  $("#lrga-wizard .steps li").removeClass("complete");
1009
  $("[data-lrgawidget-reset]").show();
1010
  }
1011
+ }else if (this.hash == "#lrgawidget_permissions_tab"){
1012
+ getPermissions();
1013
  }else if (this.hash == "#lrgawidget_sessions_tab"){
1014
  drawMainGraph();
1015
  }else if (this.hash == "#lrgawidget_browsers_tab"){
dist/js/lrgawidget.js CHANGED
@@ -239,12 +239,13 @@ $(document).ready(function(){
239
  e.preventDefault();
240
  lrWidgetSettings($("#lrgawidget-setProfileID").serializeArray()).done(function (data, textStatus, jqXHR) {
241
  if (data.status == "done"){
242
- $("#lrgawidget a[data-target^='#lrgawidget_']:eq(1)").click();
243
  }
244
  })
245
  });
246
 
247
  $('#lrga-wizard').on('changed.fu.wizard', function (evt, data) {
 
248
  if ($("[data-step="+data.step+"]").attr("data-name") == "lrga-profile"){
249
  lrWidgetSettings({action: "getProfiles"}).done(function (data, textStatus, jqXHR) {
250
  if (data.status == "done"){
@@ -254,6 +255,7 @@ $(document).ready(function(){
254
  lrgaAccounts = data.all_accounts;
255
  lrgaProfiles = data.all_profiles;
256
  populateViews();
 
257
  setup = false;
258
  }
259
  })
@@ -653,8 +655,55 @@ function drawMainGraph(){
653
  }
654
 
655
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
656
  $(document).ready(function(){
657
 
 
 
 
 
 
658
  dateRange = {start : moment().subtract(29, 'days').format('YYYY-MM-DD'), end : moment().format('YYYY-MM-DD')};
659
 
660
  $('#lrgawidget_reportrange').html(moment(dateRange.start).format('MMMM D, YYYY') + ' - ' + moment(dateRange.end).format('MMMM D, YYYY'));
@@ -679,6 +728,8 @@ $(document).ready(function(){
679
  $("#lrga-wizard .steps li").removeClass("complete");
680
  $("[data-lrgawidget-reset]").show();
681
  }
 
 
682
  }else if (this.hash == "#lrgawidget_sessions_tab"){
683
  drawMainGraph();
684
  }else if (this.hash == "#lrgawidget_browsers_tab"){
239
  e.preventDefault();
240
  lrWidgetSettings($("#lrgawidget-setProfileID").serializeArray()).done(function (data, textStatus, jqXHR) {
241
  if (data.status == "done"){
242
+ $("#lrgawidget a[data-target^='#lrgawidget_']:eq(0)").click();
243
  }
244
  })
245
  });
246
 
247
  $('#lrga-wizard').on('changed.fu.wizard', function (evt, data) {
248
+ $("#lrgawidget-save-settings").prop('disabled',true);
249
  if ($("[data-step="+data.step+"]").attr("data-name") == "lrga-profile"){
250
  lrWidgetSettings({action: "getProfiles"}).done(function (data, textStatus, jqXHR) {
251
  if (data.status == "done"){
255
  lrgaAccounts = data.all_accounts;
256
  lrgaProfiles = data.all_profiles;
257
  populateViews();
258
+ $("#lrgawidget-save-settings").prop('disabled',false);
259
  setup = false;
260
  }
261
  })
655
  }
656
 
657
 
658
+ function setOptionsGrid(){
659
+ $('.lroptions-checkbox-grid[data-lr-roleid="administrator"][data-lr-groupid="permissions"]').find('input:checkbox').prop('checked',true).prop("disabled", true);
660
+ $('.lrgawidget_permissions_switch[data-lr-roleid="administrator"][data-lr-groupid="permissions"]').prop('checked',true).prop("disabled", true);
661
+ $('.lrgawidget_permissions_switch[data-lr-roleid="administrator"][data-lr-groupid="tabs"]').prop('checked',true).change();
662
+ }
663
+
664
+ function getPermissions(){
665
+ lrWidgetSettings({action : "getPermissions"}).done(function (data, textStatus, jqXHR) {
666
+ if (data.status == "done" ){
667
+ if (debug){console.log(data)};
668
+ var rolesHTML = "";
669
+ var permissionsHTML = "";
670
+ $.each(data.roles, function( i, role ){
671
+ rolesHTML += '<li><a href="#lrrole_'+role.id+'" data-toggle="pill"><i class="fa fa-users fa-fw"></i>'+role.name+'</a></li>';
672
+ permissionsHTML += '<div class="tab-pane" id="lrrole_'+role.id+'">';
673
+ $.each(data.group_permissions, function( y, group ){
674
+ permissionsHTML += '<div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title"><i class="fa '+group.icon+'"></i> '+group.name+'</h3> <input type="hidden" name="lrperms['+role.id+'][]" value="'+group.id+'"> <span class="pull-right"> <label class="switch"> <input type="checkbox" class="lrgawidget_permissions_switch" data-lr-roleid="'+role.id+'" data-lr-groupid="'+group.id+'"> <div class="slider "></div> </label> </span> </div> <div class="box-body lroptions-checkbox-grid" data-lr-roleid="'+role.id+'" data-lr-groupid="'+group.id+'">';
675
+ $.each(group.permissions, function( x, permission ){
676
+ var checked = "";
677
+ if($.inArray(permission.name, data.role_permissions[role.id] ) !== -1){
678
+ checked = "checked";
679
+ }
680
+ permissionsHTML += ' <div> <label><input '+checked+' name="lrperms['+role.id+'][]" type="checkbox" value="'+permission.name+'"> '+permission.label+'</label> </div>';
681
+ });
682
+
683
+ permissionsHTML += ' </div> </div>';
684
+ });
685
+
686
+ permissionsHTML += '</div>';
687
+ });
688
+ $("#lrgawidget_permissions_roles").html(rolesHTML);
689
+ $("#lrgawidget_permissions_list").html(permissionsHTML);
690
+ $('#lrgawidget_permissions_roles a:first').tab('show');
691
+ $(".lrgawidget_permissions_switch").change(function(){
692
+ $('.lroptions-checkbox-grid[data-lr-roleid="'+$(this).data("lr-roleid")+'"][data-lr-groupid="'+$(this).data("lr-groupid")+'"]').find('input:checkbox').prop('checked',this.checked).prop("disabled", !this.checked);
693
+ });
694
+ setOptionsGrid();
695
+ }
696
+ });
697
+
698
+ }
699
+
700
  $(document).ready(function(){
701
 
702
+ $("#lrgawidget_permissions_form").submit(function(e) {
703
+ e.preventDefault();
704
+ $('#lrgawidget a[data-target="#lrgawidget_gopro_tab"]').tab('show');
705
+ });
706
+
707
  dateRange = {start : moment().subtract(29, 'days').format('YYYY-MM-DD'), end : moment().format('YYYY-MM-DD')};
708
 
709
  $('#lrgawidget_reportrange').html(moment(dateRange.start).format('MMMM D, YYYY') + ' - ' + moment(dateRange.end).format('MMMM D, YYYY'));
728
  $("#lrga-wizard .steps li").removeClass("complete");
729
  $("[data-lrgawidget-reset]").show();
730
  }
731
+ }else if (this.hash == "#lrgawidget_permissions_tab"){
732
+ getPermissions();
733
  }else if (this.hash == "#lrgawidget_sessions_tab"){
734
  drawMainGraph();
735
  }else if (this.hash == "#lrgawidget_browsers_tab"){
dist/plugins/daterangepicker/moment.min.js CHANGED
@@ -1,7 +1,6 @@
1
  //! moment.js
2
- //! version : 2.12.0
3
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
  //! license : MIT
5
  //! momentjs.com
6
- !function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Zc.apply(null,arguments)}function b(a){Zc=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return Ia(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a);a._isValid=!(isNaN(a._d.getTime())||!(b.overflow<0)||b.empty||b.invalidMonth||b.invalidWeekday||b.nullInput||b.invalidFormat||b.userInvalidated),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(NaN);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a){return void 0===a}function n(a,b){var c,d,e;if(m(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),m(b._i)||(a._i=b._i),m(b._f)||(a._f=b._f),m(b._l)||(a._l=b._l),m(b._strict)||(a._strict=b._strict),m(b._tzm)||(a._tzm=b._tzm),m(b._isUTC)||(a._isUTC=b._isUTC),m(b._offset)||(a._offset=b._offset),m(b._pf)||(a._pf=j(b)),m(b._locale)||(a._locale=b._locale),$c.length>0)for(c in $c)d=$c[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),_c===!1&&(_c=!0,a.updateOffset(this),_c=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function u(a,b){var c=!0;return g(function(){return c&&(t(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function v(a,b){ad[a]||(t(b),ad[a]=!0)}function w(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function x(a){return"[object Object]"===Object.prototype.toString.call(a)}function y(a){var b,c;for(c in a)b=a[c],w(b)?this[c]=b:this["_"+c]=b;this._config=a,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function z(a,b){var c,d=g({},a);for(c in b)f(b,c)&&(x(a[c])&&x(b[c])?(d[c]={},g(d[c],a[c]),g(d[c],b[c])):null!=b[c]?d[c]=b[c]:delete d[c]);return d}function A(a){null!=a&&this.set(a)}function B(a){return a?a.toLowerCase().replace("_","-"):a}function C(a){for(var b,c,d,e,f=0;f<a.length;){for(e=B(a[f]).split("-"),b=e.length,c=B(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=D(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function D(a){var b=null;if(!cd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=bd._abbr,require("./locale/"+a),E(b)}catch(c){}return cd[a]}function E(a,b){var c;return a&&(c=m(b)?H(a):F(a,b),c&&(bd=c)),bd._abbr}function F(a,b){return null!==b?(b.abbr=a,null!=cd[a]?(v("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),b=z(cd[a]._config,b)):null!=b.parentLocale&&(null!=cd[b.parentLocale]?b=z(cd[b.parentLocale]._config,b):v("parentLocaleUndefined","specified parentLocale is not defined yet")),cd[a]=new A(b),E(a),cd[a]):(delete cd[a],null)}function G(a,b){if(null!=b){var c;null!=cd[a]&&(b=z(cd[a]._config,b)),c=new A(b),c.parentLocale=cd[a],cd[a]=c,E(a)}else null!=cd[a]&&(null!=cd[a].parentLocale?cd[a]=cd[a].parentLocale:null!=cd[a]&&delete cd[a]);return cd[a]}function H(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return bd;if(!c(a)){if(b=D(a))return b;a=[a]}return C(a)}function I(){return Object.keys(cd)}function J(a,b){var c=a.toLowerCase();dd[c]=dd[c+"s"]=dd[b]=a}function K(a){return"string"==typeof a?dd[a]||dd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)f(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(b,c){return function(d){return null!=d?(O(this,b,d),a.updateOffset(this,c),this):N(this,b)}}function N(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function O(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function P(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=K(a),w(this[a]))return this[a](b);return this}function Q(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function R(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(hd[a]=e),b&&(hd[b[0]]=function(){return Q(e.apply(this,arguments),b[1],b[2])}),c&&(hd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function S(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function T(a){var b,c,d=a.match(ed);for(b=0,c=d.length;c>b;b++)hd[d[b]]?d[b]=hd[d[b]]:d[b]=S(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function U(a,b){return a.isValid()?(b=V(b,a.localeData()),gd[b]=gd[b]||T(b),gd[b](a)):a.localeData().invalidDate()}function V(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(fd.lastIndex=0;d>=0&&fd.test(a);)a=a.replace(fd,c),fd.lastIndex=0,d-=1;return a}function W(a,b,c){zd[a]=w(b)?b:function(a,d){return a&&c?c:b}}function X(a,b){return f(zd,a)?zd[a](b._strict,b._locale):new RegExp(Y(a))}function Y(a){return Z(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function Z(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;c<a.length;c++)Ad[a[c]]=d}function _(a,b){$(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function aa(a,b,c){null!=b&&f(Ad,a)&&Ad[a](b,c._a,c,a)}function ba(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function ca(a,b){return c(this._months)?this._months[a.month()]:this._months[Kd.test(b)?"format":"standalone"][a.month()]}function da(a,b){return c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[Kd.test(b)?"format":"standalone"][a.month()]}function ea(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function fa(a,b){var c;if(!a.isValid())return a;if("string"==typeof b)if(/^\d+$/.test(b))b=r(b);else if(b=a.localeData().monthsParse(b),"number"!=typeof b)return a;return c=Math.min(a.date(),ba(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ga(b){return null!=b?(fa(this,b),a.updateOffset(this,!0),this):N(this,"Month")}function ha(){return ba(this.year(),this.month())}function ia(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ka.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ja(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ka.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ka(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=Z(d[b]),e[b]=Z(e[b]),f[b]=Z(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function la(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[Cd]<0||c[Cd]>11?Cd:c[Dd]<1||c[Dd]>ba(c[Bd],c[Cd])?Dd:c[Ed]<0||c[Ed]>24||24===c[Ed]&&(0!==c[Fd]||0!==c[Gd]||0!==c[Hd])?Ed:c[Fd]<0||c[Fd]>59?Fd:c[Gd]<0||c[Gd]>59?Gd:c[Hd]<0||c[Hd]>999?Hd:-1,j(a)._overflowDayOfYear&&(Bd>b||b>Dd)&&(b=Dd),j(a)._overflowWeeks&&-1===b&&(b=Id),j(a)._overflowWeekday&&-1===b&&(b=Jd),j(a).overflow=b),a}function ma(a){var b,c,d,e,f,g,h=a._i,i=Pd.exec(h)||Qd.exec(h);if(i){for(j(a).iso=!0,b=0,c=Sd.length;c>b;b++)if(Sd[b][1].exec(i[1])){e=Sd[b][0],d=Sd[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Td.length;c>b;b++)if(Td[b][1].exec(i[3])){f=(i[2]||" ")+Td[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Rd.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),Ba(a)}else a._isValid=!1}function na(b){var c=Ud.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ma(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function oa(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function pa(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function qa(a){return ra(a)?366:365}function ra(a){return a%4===0&&a%100!==0||a%400===0}function sa(){return ra(this.year())}function ta(a,b,c){var d=7+b-c,e=(7+pa(a,0,d).getUTCDay()-b)%7;return-e+d-1}function ua(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ta(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=qa(f)+j):j>qa(a)?(f=a+1,g=j-qa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function va(a,b,c){var d,e,f=ta(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+wa(e,b,c)):g>wa(a.year(),b,c)?(d=g-wa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function wa(a,b,c){var d=ta(a,b,c),e=ta(a+1,b,c);return(qa(a)-d+e)/7}function xa(a,b,c){return null!=a?a:null!=b?b:c}function ya(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function za(a){var b,c,d,e,f=[];if(!a._d){for(d=ya(a),a._w&&null==a._a[Dd]&&null==a._a[Cd]&&Aa(a),a._dayOfYear&&(e=xa(a._a[Bd],d[Bd]),a._dayOfYear>qa(e)&&(j(a)._overflowDayOfYear=!0),c=pa(e,0,a._dayOfYear),a._a[Cd]=c.getUTCMonth(),a._a[Dd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[Ed]&&0===a._a[Fd]&&0===a._a[Gd]&&0===a._a[Hd]&&(a._nextDay=!0,a._a[Ed]=0),a._d=(a._useUTC?pa:oa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ed]=24)}}function Aa(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=xa(b.GG,a._a[Bd],va(Ja(),1,4).year),d=xa(b.W,1),e=xa(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=xa(b.gg,a._a[Bd],va(Ja(),f,g).year),d=xa(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>wa(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=ua(c,d,e,f,g),a._a[Bd]=h.year,a._dayOfYear=h.dayOfYear)}function Ba(b){if(b._f===a.ISO_8601)return void ma(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=V(b._f,b._locale).match(ed)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(X(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),hd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),aa(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[Ed]<=12&&b._a[Ed]>0&&(j(b).bigHour=void 0),b._a[Ed]=Ca(b._locale,b._a[Ed],b._meridiem),za(b),la(b)}function Ca(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function Da(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],Ba(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function Ea(a){if(!a._d){var b=L(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),za(a)}}function Fa(a){var b=new o(la(Ga(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ga(a){var b=a._i,e=a._f;return a._locale=a._locale||H(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(la(b)):(c(e)?Da(a):e?Ba(a):d(b)?a._d=b:Ha(a),k(a)||(a._d=null),a))}function Ha(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?na(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),za(b)):"object"==typeof f?Ea(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ia(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Fa(f)}function Ja(a,b,c,d){return Ia(a,b,c,d,!1)}function Ka(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ja();for(d=b[0],e=1;e<b.length;++e)(!b[e].isValid()||b[e][a](d))&&(d=b[e]);return d}function La(){var a=[].slice.call(arguments,0);return Ka("isBefore",a)}function Ma(){var a=[].slice.call(arguments,0);return Ka("isAfter",a)}function Na(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=H(),this._bubble()}function Oa(a){return a instanceof Na}function Pa(a,b){R(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+Q(~~(a/60),2)+b+Q(~~a%60,2)})}function Qa(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Zd)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Ra(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ja(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ja(b).local()}function Sa(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ta(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=Qa(wd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Sa(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?ib(this,cb(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Sa(this):null!=b?this:NaN}function Ua(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Va(a){return this.utcOffset(0,a)}function Wa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Sa(this),"m")),this}function Xa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Qa(vd,this._i)),this}function Ya(a){return this.isValid()?(a=a?Ja(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function Za(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function $a(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ga(a),a._a){var b=a._isUTC?h(a._a):Ja(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function _a(){return this.isValid()?!this._isUTC:!1}function ab(){return this.isValid()?this._isUTC:!1}function bb(){return this.isValid()?this._isUTC&&0===this._offset:!1}function cb(a,b){var c,d,e,g=a,h=null;return Oa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=$d.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[Dd])*c,h:r(h[Ed])*c,m:r(h[Fd])*c,s:r(h[Gd])*c,ms:r(h[Hd])*c}):(h=_d.exec(a))?(c="-"===h[1]?-1:1,g={y:db(h[2],c),M:db(h[3],c),w:db(h[4],c),d:db(h[5],c),h:db(h[6],c),m:db(h[7],c),s:db(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=fb(Ja(g.from),Ja(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Na(g),Oa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function db(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function eb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function fb(a,b){var c;return a.isValid()&&b.isValid()?(b=Ra(b,a),a.isBefore(b)?c=eb(a,b):(c=eb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function gb(a){return 0>a?-1*Math.round(-1*a):Math.round(a)}function hb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(v(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=cb(c,d),ib(this,e,a),this}}function ib(b,c,d,e){var f=c._milliseconds,g=gb(c._days),h=gb(c._months);b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&O(b,"Date",N(b,"Date")+g*d),h&&fa(b,N(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function jb(a,b){var c=a||Ja(),d=Ra(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(w(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ja(c)))}function kb(){return new o(this)}function lb(a,b){var c=p(a)?a:Ja(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b)):!1}function mb(a,b){var c=p(a)?a:Ja(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c):!1}function nb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ob(a,b){var c,d=p(a)?a:Ja(a);return this.isValid()&&d.isValid()?(b=K(b||"millisecond"),"millisecond"===b?+this===+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))):!1}function pb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function qb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function rb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ra(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=sb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function sb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function tb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ub(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?w(Date.prototype.toISOString)?this.toDate().toISOString():U(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):U(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function vb(b){var c=U(this,b||a.defaultFormat);return this.localeData().postformat(c)}function wb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ja(a).isValid())?cb({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function xb(a){return this.from(Ja(),a)}function yb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ja(a).isValid())?cb({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function zb(a){return this.to(Ja(),a)}function Ab(a){var b;return void 0===a?this._locale._abbr:(b=H(a),null!=b&&(this._locale=b),this)}function Bb(){return this._locale}function Cb(a){switch(a=K(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function Db(a){return a=K(a),void 0===a||"millisecond"===a?this:this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")}function Eb(){return+this._d-6e4*(this._offset||0)}function Fb(){return Math.floor(+this/1e3)}function Gb(){return this._offset?new Date(+this):this._d}function Hb(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function Ib(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function Jb(){return this.isValid()?this.toISOString():null}function Kb(){return k(this)}function Lb(){return g({},j(this))}function Mb(){return j(this).overflow}function Nb(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ob(a,b){R(0,[a,a.length],0,b)}function Pb(a){return Tb.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Qb(a){return Tb.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Rb(){return wa(this.year(),1,4)}function Sb(){var a=this.localeData()._week;return wa(this.year(),a.dow,a.doy)}function Tb(a,b,c,d,e){var f;return null==a?va(this,d,e).year:(f=wa(a,d,e),b>f&&(b=f),Ub.call(this,a,b,c,d,e))}function Ub(a,b,c,d,e){var f=ua(a,b,c,d,e),g=pa(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Vb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Wb(a){return va(a,this._week.dow,this._week.doy).week}function Xb(){return this._week.dow}function Yb(){return this._week.doy}function Zb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function $b(a){var b=va(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function _b(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function ac(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function bc(a){return this._weekdaysShort[a.day()]}function cc(a){return this._weekdaysMin[a.day()]}function dc(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ja([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function ec(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=_b(a,this.localeData()),this.add(a-b,"d")):b}function fc(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function gc(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function hc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ic(){return this.hours()%12||12}function jc(a,b){R(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function kc(a,b){return b._meridiemParse}function lc(a){return"p"===(a+"").toLowerCase().charAt(0)}function mc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function nc(a,b){b[Hd]=r(1e3*("0."+a))}function oc(){return this._isUTC?"UTC":""}function pc(){return this._isUTC?"Coordinated Universal Time":""}function qc(a){return Ja(1e3*a)}function rc(){return Ja.apply(null,arguments).parseZone()}function sc(a,b,c){var d=this._calendar[a];return w(d)?d.call(b,c):d}function tc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function uc(){return this._invalidDate}function vc(a){return this._ordinal.replace("%d",a)}function wc(a){return a}function xc(a,b,c,d){var e=this._relativeTime[c];return w(e)?e(a,b,c,d):e.replace(/%d/i,a)}function yc(a,b){var c=this._relativeTime[a>0?"future":"past"];return w(c)?c(b):c.replace(/%s/i,b)}function zc(a,b,c,d){var e=H(),f=h().set(d,b);return e[c](f,a)}function Ac(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return zc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=zc(a,f,c,e);return g}function Bc(a,b){return Ac(a,b,"months",12,"month")}function Cc(a,b){return Ac(a,b,"monthsShort",12,"month")}function Dc(a,b){return Ac(a,b,"weekdays",7,"day")}function Ec(a,b){return Ac(a,b,"weekdaysShort",7,"day")}function Fc(a,b){return Ac(a,b,"weekdaysMin",7,"day")}function Gc(){var a=this._data;return this._milliseconds=xe(this._milliseconds),this._days=xe(this._days),this._months=xe(this._months),a.milliseconds=xe(a.milliseconds),a.seconds=xe(a.seconds),a.minutes=xe(a.minutes),a.hours=xe(a.hours),a.months=xe(a.months),a.years=xe(a.years),this}function Hc(a,b,c,d){var e=cb(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Ic(a,b){return Hc(this,a,b,1)}function Jc(a,b){return Hc(this,a,b,-1)}function Kc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Lc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Kc(Nc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Mc(g)),h+=e,g-=Kc(Nc(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Mc(a){return 4800*a/146097}function Nc(a){return 146097*a/4800}function Oc(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Mc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Nc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Pc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Qc(a){return function(){return this.as(a)}}function Rc(a){return a=K(a),this[a+"s"]()}function Sc(a){return function(){return this._data[a]}}function Tc(){return q(this.days()/7)}function Uc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Vc(a,b,c){var d=cb(a).abs(),e=Ne(d.as("s")),f=Ne(d.as("m")),g=Ne(d.as("h")),h=Ne(d.as("d")),i=Ne(d.as("M")),j=Ne(d.as("y")),k=e<Oe.s&&["s",e]||1>=f&&["m"]||f<Oe.m&&["mm",f]||1>=g&&["h"]||g<Oe.h&&["hh",g]||1>=h&&["d"]||h<Oe.d&&["dd",h]||1>=i&&["M"]||i<Oe.M&&["MM",i]||1>=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Uc.apply(null,k)}function Wc(a,b){return void 0===Oe[a]?!1:void 0===b?Oe[a]:(Oe[a]=b,!0)}function Xc(a){var b=this.localeData(),c=Vc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Yc(){var a,b,c,d=Pe(this._milliseconds)/1e3,e=Pe(this._days),f=Pe(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Zc,$c=a.momentProperties=[],_c=!1,ad={};a.suppressDeprecationWarnings=!1;var bd,cd={},dd={},ed=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,fd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,gd={},hd={},id=/\d/,jd=/\d\d/,kd=/\d{3}/,ld=/\d{4}/,md=/[+-]?\d{6}/,nd=/\d\d?/,od=/\d\d\d\d?/,pd=/\d\d\d\d\d\d?/,qd=/\d{1,3}/,rd=/\d{1,4}/,sd=/[+-]?\d{1,6}/,td=/\d+/,ud=/[+-]?\d+/,vd=/Z|[+-]\d\d:?\d\d/gi,wd=/Z|[+-]\d\d(?::?\d\d)?/gi,xd=/[+-]?\d+(\.\d{1,3})?/,yd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,zd={},Ad={},Bd=0,Cd=1,Dd=2,Ed=3,Fd=4,Gd=5,Hd=6,Id=7,Jd=8;R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),R("MMMM",0,0,function(a){return this.localeData().months(this,a)}),J("month","M"),W("M",nd),W("MM",nd,jd),W("MMM",function(a,b){return b.monthsShortRegex(a)}),W("MMMM",function(a,b){return b.monthsRegex(a)}),$(["M","MM"],function(a,b){b[Cd]=r(a)-1}),$(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[Cd]=e:j(c).invalidMonth=a});var Kd=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ld="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Md="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Nd=yd,Od=yd,Pd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Qd=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Rd=/Z|[+-]\d\d(?::?\d\d)?/,Sd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Td=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ud=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=u("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),R("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),J("year","y"),W("Y",ud),W("YY",nd,jd),W("YYYY",rd,ld),W("YYYYY",sd,md),W("YYYYYY",sd,md),$(["YYYYY","YYYYYY"],Bd),$("YYYY",function(b,c){c[Bd]=2===b.length?a.parseTwoDigitYear(b):r(b);
7
- }),$("YY",function(b,c){c[Bd]=a.parseTwoDigitYear(b)}),$("Y",function(a,b){b[Bd]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Vd=M("FullYear",!1);a.ISO_8601=function(){};var Wd=u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ja.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Xd=u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ja.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Yd=function(){return Date.now?Date.now():+new Date};Pa("Z",":"),Pa("ZZ",""),W("Z",wd),W("ZZ",wd),$(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Qa(wd,a)});var Zd=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var $d=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,_d=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;cb.fn=Na.prototype;var ae=hb(1,"add"),be=hb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ce=u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ob("gggg","weekYear"),Ob("ggggg","weekYear"),Ob("GGGG","isoWeekYear"),Ob("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),W("G",ud),W("g",ud),W("GG",nd,jd),W("gg",nd,jd),W("GGGG",rd,ld),W("gggg",rd,ld),W("GGGGG",sd,md),W("ggggg",sd,md),_(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),_(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),R("Q",0,"Qo","quarter"),J("quarter","Q"),W("Q",id),$("Q",function(a,b){b[Cd]=3*(r(a)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),W("w",nd),W("ww",nd,jd),W("W",nd),W("WW",nd,jd),_(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var de={dow:0,doy:6};R("D",["DD",2],"Do","date"),J("date","D"),W("D",nd),W("DD",nd,jd),W("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),$(["D","DD"],Dd),$("Do",function(a,b){b[Dd]=r(a.match(nd)[0],10)});var ee=M("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),R("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),R("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),W("d",nd),W("e",nd),W("E",nd),W("dd",yd),W("ddd",yd),W("dddd",yd),_(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),_(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var fe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ge="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),he="Su_Mo_Tu_We_Th_Fr_Sa".split("_");R("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),W("DDD",qd),W("DDDD",kd),$(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,ic),R("hmm",0,0,function(){return""+ic.apply(this)+Q(this.minutes(),2)}),R("hmmss",0,0,function(){return""+ic.apply(this)+Q(this.minutes(),2)+Q(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+Q(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+Q(this.minutes(),2)+Q(this.seconds(),2)}),jc("a",!0),jc("A",!1),J("hour","h"),W("a",kc),W("A",kc),W("H",nd),W("h",nd),W("HH",nd,jd),W("hh",nd,jd),W("hmm",od),W("hmmss",pd),W("Hmm",od),W("Hmmss",pd),$(["H","HH"],Ed),$(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),$(["h","hh"],function(a,b,c){b[Ed]=r(a),j(c).bigHour=!0}),$("hmm",function(a,b,c){var d=a.length-2;b[Ed]=r(a.substr(0,d)),b[Fd]=r(a.substr(d)),j(c).bigHour=!0}),$("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Ed]=r(a.substr(0,d)),b[Fd]=r(a.substr(d,2)),b[Gd]=r(a.substr(e)),j(c).bigHour=!0}),$("Hmm",function(a,b,c){var d=a.length-2;b[Ed]=r(a.substr(0,d)),b[Fd]=r(a.substr(d))}),$("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Ed]=r(a.substr(0,d)),b[Fd]=r(a.substr(d,2)),b[Gd]=r(a.substr(e))});var ie=/[ap]\.?m?\.?/i,je=M("Hours",!0);R("m",["mm",2],0,"minute"),J("minute","m"),W("m",nd),W("mm",nd,jd),$(["m","mm"],Fd);var ke=M("Minutes",!1);R("s",["ss",2],0,"second"),J("second","s"),W("s",nd),W("ss",nd,jd),$(["s","ss"],Gd);var le=M("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),W("S",qd,id),W("SS",qd,jd),W("SSS",qd,kd);var me;for(me="SSSS";me.length<=9;me+="S")W(me,td);for(me="S";me.length<=9;me+="S")$(me,nc);var ne=M("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var oe=o.prototype;oe.add=ae,oe.calendar=jb,oe.clone=kb,oe.diff=rb,oe.endOf=Db,oe.format=vb,oe.from=wb,oe.fromNow=xb,oe.to=yb,oe.toNow=zb,oe.get=P,oe.invalidAt=Mb,oe.isAfter=lb,oe.isBefore=mb,oe.isBetween=nb,oe.isSame=ob,oe.isSameOrAfter=pb,oe.isSameOrBefore=qb,oe.isValid=Kb,oe.lang=ce,oe.locale=Ab,oe.localeData=Bb,oe.max=Xd,oe.min=Wd,oe.parsingFlags=Lb,oe.set=P,oe.startOf=Cb,oe.subtract=be,oe.toArray=Hb,oe.toObject=Ib,oe.toDate=Gb,oe.toISOString=ub,oe.toJSON=Jb,oe.toString=tb,oe.unix=Fb,oe.valueOf=Eb,oe.creationData=Nb,oe.year=Vd,oe.isLeapYear=sa,oe.weekYear=Pb,oe.isoWeekYear=Qb,oe.quarter=oe.quarters=Vb,oe.month=ga,oe.daysInMonth=ha,oe.week=oe.weeks=Zb,oe.isoWeek=oe.isoWeeks=$b,oe.weeksInYear=Sb,oe.isoWeeksInYear=Rb,oe.date=ee,oe.day=oe.days=ec,oe.weekday=fc,oe.isoWeekday=gc,oe.dayOfYear=hc,oe.hour=oe.hours=je,oe.minute=oe.minutes=ke,oe.second=oe.seconds=le,oe.millisecond=oe.milliseconds=ne,oe.utcOffset=Ta,oe.utc=Va,oe.local=Wa,oe.parseZone=Xa,oe.hasAlignedHourOffset=Ya,oe.isDST=Za,oe.isDSTShifted=$a,oe.isLocal=_a,oe.isUtcOffset=ab,oe.isUtc=bb,oe.isUTC=bb,oe.zoneAbbr=oc,oe.zoneName=pc,oe.dates=u("dates accessor is deprecated. Use date instead.",ee),oe.months=u("months accessor is deprecated. Use month instead",ga),oe.years=u("years accessor is deprecated. Use year instead",Vd),oe.zone=u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ua);var pe=oe,qe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},re={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},se="Invalid date",te="%d",ue=/\d{1,2}/,ve={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},we=A.prototype;we._calendar=qe,we.calendar=sc,we._longDateFormat=re,we.longDateFormat=tc,we._invalidDate=se,we.invalidDate=uc,we._ordinal=te,we.ordinal=vc,we._ordinalParse=ue,we.preparse=wc,we.postformat=wc,we._relativeTime=ve,we.relativeTime=xc,we.pastFuture=yc,we.set=y,we.months=ca,we._months=Ld,we.monthsShort=da,we._monthsShort=Md,we.monthsParse=ea,we._monthsRegex=Od,we.monthsRegex=ja,we._monthsShortRegex=Nd,we.monthsShortRegex=ia,we.week=Wb,we._week=de,we.firstDayOfYear=Yb,we.firstDayOfWeek=Xb,we.weekdays=ac,we._weekdays=fe,we.weekdaysMin=cc,we._weekdaysMin=he,we.weekdaysShort=bc,we._weekdaysShort=ge,we.weekdaysParse=dc,we.isPM=lc,we._meridiemParse=ie,we.meridiem=mc,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=u("moment.lang is deprecated. Use moment.locale instead.",E),a.langData=u("moment.langData is deprecated. Use moment.localeData instead.",H);var xe=Math.abs,ye=Qc("ms"),ze=Qc("s"),Ae=Qc("m"),Be=Qc("h"),Ce=Qc("d"),De=Qc("w"),Ee=Qc("M"),Fe=Qc("y"),Ge=Sc("milliseconds"),He=Sc("seconds"),Ie=Sc("minutes"),Je=Sc("hours"),Ke=Sc("days"),Le=Sc("months"),Me=Sc("years"),Ne=Math.round,Oe={s:45,m:45,h:22,d:26,M:11},Pe=Math.abs,Qe=Na.prototype;Qe.abs=Gc,Qe.add=Ic,Qe.subtract=Jc,Qe.as=Oc,Qe.asMilliseconds=ye,Qe.asSeconds=ze,Qe.asMinutes=Ae,Qe.asHours=Be,Qe.asDays=Ce,Qe.asWeeks=De,Qe.asMonths=Ee,Qe.asYears=Fe,Qe.valueOf=Pc,Qe._bubble=Lc,Qe.get=Rc,Qe.milliseconds=Ge,Qe.seconds=He,Qe.minutes=Ie,Qe.hours=Je,Qe.days=Ke,Qe.weeks=Tc,Qe.months=Le,Qe.years=Me,Qe.humanize=Xc,Qe.toISOString=Yc,Qe.toString=Yc,Qe.toJSON=Yc,Qe.locale=Ab,Qe.localeData=Bb,Qe.toIsoString=u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yc),Qe.lang=ce,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",ud),W("X",xd),$("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),$("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.12.0",b(Ja),a.fn=pe,a.min=La,a.max=Ma,a.now=Yd,a.utc=h,a.unix=qc,a.months=Bc,a.isDate=d,a.locale=E,a.invalid=l,a.duration=cb,a.isMoment=p,a.weekdays=Dc,a.parseZone=rc,a.localeData=H,a.isDuration=Oa,a.monthsShort=Cc,a.weekdaysMin=Fc,a.defineLocale=F,a.updateLocale=G,a.locales=I,a.weekdaysShort=Ec,a.normalizeUnits=K,a.relativeTimeThreshold=Wc,a.prototype=pe;var Re=a;return Re});
1
  //! moment.js
2
+ //! version : 2.23.0
3
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
  //! license : MIT
5
  //! momentjs.com
6
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Ot(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function p(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function v(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function S(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function D(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=D(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&k(e[s])!==k(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function b(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function H(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function R(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function C(e){var t,n,s={};for(n in e)m(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var F={};function L(e,t){F[e]=t}function U(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return U(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=x(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=x(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(de(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function de(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),d(n)&&(s=function(e,t){t[n]=k(e)}),t=0;t<e.length;t++)he[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,pe=4,ve=5,we=6,Me=7,Se=8;function De(e){return ke(e)?366:365}function ke(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),H("year","y"),L("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):k(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(be(this,t,e),c.updateOffset(this,n),this):xe(this,t)}}function xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function be(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&ke(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?ke(e)?29:28:31-s%7%2}Ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),H("month","M"),L("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=k(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,He="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!d(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ce(this,e),c.updateOffset(this,!0),this):xe(this,"Month")}var Le=ae;var Ue=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=de(s[t]),i[t]=de(i[t]);for(t=0;t<24;t++)r[t]=de(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return a=o<=0?De(r=e-1)+o:o>De(e)?(r=e+1,o-De(e)):(r=e,o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),L("week",5),L("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=k(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),H("hour","h"),L("hour",13),ue("a",Ke),ue("A",Ke),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\.?m?\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(e){var t=null;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,require("./locale/"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),et._abbr}function ut(e,t){if(null===t)return delete st[e],null;var n,s=nt;if(t.abbr=e,null!=st[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=rt(e[r]).split("-")).length,n=(n=rt(e[r+1]))?n.split("-"):null;0<t;){if(s=at(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[pe]||0!==n[ve]||0!==n[we])?ge:n[pe]<0||59<n[pe]?pe:n[ve]<0||59<n[ve]?ve:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=Se),g(e).overflow=t),e}function ht(e,t,n){return null!=e?e:null!=t?t:n}function ct(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ht(t.GG,e._a[me],Ie(Tt(),1,4).year),s=ht(t.W,1),((i=ht(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(Tt(),r,a);n=ht(t.gg,e._a[me],l.year),s=ht(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],gt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||" ")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),kt(e)}else e._isValid=!1}var wt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=wt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=Mt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&Ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function kt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,d=l.length,h=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),h+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(he,a)&&he[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=d-h,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ct(e),dt(e)}else Dt(e);else vt(e)}function Yt(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||lt(e._l),null===r||void 0===a&&""===r?v({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),S(r)?new M(dt(r)):(h(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],kt(t),p(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?kt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):h(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(vt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ct(t)):u(n)?function(e){if(!e._d){var t=C(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ct(e)}}(t):d(n)?t._d=new Date(n):c.createFromInputFallback(t),p(e)||(e._d=null),e))}function Ot(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Yt(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Tt(e,t,n,s){return Ot(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),bt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:v()});function Pt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=C(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Wt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Wt.length;++s)if(e[Wt[s]]){if(n)return!1;parseFloat(e[Wt[s]])!==k(e[Wt[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=lt(),this._bubble()}function Rt(e){return e instanceof Ht}function Ct(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+U(~~(e/60),2)+n+U(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ut(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Ut(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+k(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Nt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(S(e)||h(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):Tt(e).local()}function Gt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Vt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var Et=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,It=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function At(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=Et.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:k(a[ye])*n,h:k(a[ge])*n,m:k(a[pe])*n,s:k(a[ve])*n,ms:k(Ct(1e3*a[we]))*n}):(a=It.exec(e))?(n="-"===a[1]?-1:1,r={y:jt(a[2],n),M:jt(a[3],n),w:jt(a[4],n),d:jt(a[5],n),h:jt(a[6],n),m:jt(a[7],n),s:jt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Nt(t,e),e.isBefore(t)?n=Zt(e,t):((n=Zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function zt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,At(e="string"==typeof e?+e:e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ct(t._days),a=Ct(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,xe(e,"Month")+a*n),r&&be(e,"Date",xe(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}At.fn=Ht.prototype,At.invalid=function(){return At(NaN)};var qt=zt(1,"add"),Jt=zt(-1,"subtract");function Bt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xt=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}function en(e,t){I(0,[e,e.length],0,t)}function tn(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),en("gggg","weekYear"),en("ggggg","weekYear"),en("GGGG","isoWeekYear"),en("GGGGG","isoWeekYear"),H("weekYear","gg"),H("isoWeekYear","GG"),L("weekYear",1),L("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=k(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),H("quarter","Q"),L("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(k(e)-1)}),I("D",["DD",2],"Do","date"),H("date","D"),L("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=k(e.match(B)[0])});var nn=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),H("dayOfYear","DDD"),L("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=k(e)}),I("m",["mm",2],0,"minute"),H("minute","m"),L("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],pe);var sn=Te("Minutes",!1);I("s",["ss",2],0,"second"),H("second","s"),L("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],ve);var rn,an=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),H("millisecond","ms"),L("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),rn="SSSS";rn.length<=9;rn+="S")ue(rn,ne);function on(e,t){t[we]=k(1e3*("0."+e))}for(rn="S";rn.length<=9;rn+="S")ce(rn,on);var un=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var ln=M.prototype;function dn(e){return e}ln.add=qt,ln.calendar=function(e,t){var n=e||Tt(),s=Nt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(x(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},ln.clone=function(){return new M(this)},ln.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Nt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=R(t)){case"year":r=Bt(this,s)/12;break;case"month":r=Bt(this,s);break;case"quarter":r=Bt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:D(r)},ln.endOf=function(e){return void 0===(e=R(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},ln.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},ln.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.fromNow=function(e){return this.from(Tt(),e)},ln.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.toNow=function(e){return this.to(Tt(),e)},ln.get=function(e){return x(this[e=R(e)])?this[e]():this},ln.invalidAt=function(){return g(this).overflow},ln.isAfter=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},ln.isBefore=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){var i=S(e)?e:Tt(e),r=S(t)?t:Tt(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n))},ln.isSame=function(e,t){var n,s=S(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=R(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},ln.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},ln.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},ln.isValid=function(){return p(this)},ln.lang=Xt,ln.locale=Qt,ln.localeData=Kt,ln.max=bt,ln.min=xt,ln.parsingFlags=function(){return _({},g(this))},ln.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:F[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=C(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},ln.startOf=function(e){switch(e=R(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},ln.subtract=Jt,ln.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},ln.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},ln.toDate=function(){return new Date(this.valueOf())},ln.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},ln.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},ln.toJSON=function(){return this.isValid()?this.toISOString():null},ln.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},ln.unix=function(){return Math.floor(this.valueOf()/1e3)},ln.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ln.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ln.year=Oe,ln.isLeapYear=function(){return ke(this.year())},ln.weekYear=function(e){return tn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ln.isoWeekYear=function(e){return tn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},ln.quarter=ln.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},ln.month=Fe,ln.daysInMonth=function(){return Pe(this.year(),this.month())},ln.week=ln.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},ln.isoWeek=ln.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},ln.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},ln.isoWeeksInYear=function(){return Ae(this.year(),1,4)},ln.date=nn,ln.day=ln.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},ln.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},ln.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,n,s=(t=e,n=this.localeData(),"string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?s:s-7)},ln.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},ln.hour=ln.hours=tt,ln.minute=ln.minutes=sn,ln.second=ln.seconds=an,ln.millisecond=ln.milliseconds=un,ln.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Gt(this);if("string"==typeof e){if(null===(e=Ut(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Gt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,At(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this},ln.utc=function(e){return this.utcOffset(0,e)},ln.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),"m")),this},ln.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Ut(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},ln.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},ln.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Fe),ln.years=n("years accessor is deprecated. Use year instead",Oe),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var hn=P.prototype;function cn(e,t,n,s){var i=lt(),r=y().set(s,t);return i[n](r,e)}function fn(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=cn(e,s,n,"month");return i}function mn(e,t,n,s){t=("boolean"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t||"");var i,r=lt(),a=e?r._week.dow:0;if(null!=n)return cn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}hn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return x(s)?s.call(t,n):s},hn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(e){return this._ordinal.replace("%d",e)},hn.preparse=dn,hn.postformat=dn,hn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},hn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return x(n)?n(t):n.replace(/%s/i,t)},hn.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},hn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},hn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},hn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},hn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},hn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},hn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},hn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ot("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ot),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",lt);var _n=Math.abs;function yn(e,t,n,s){var i=At(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function pn(e){return 4800*e/146097}function vn(e){return 146097*e/4800}function wn(e){return function(){return this.as(e)}}var Mn=wn("ms"),Sn=wn("s"),Dn=wn("m"),kn=wn("h"),Yn=wn("d"),On=wn("w"),Tn=wn("M"),xn=wn("y");function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Pn=bn("milliseconds"),Wn=bn("seconds"),Hn=bn("minutes"),Rn=bn("hours"),Cn=bn("days"),Fn=bn("months"),Ln=bn("years");var Un=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var Gn=Math.abs;function Vn(e){return(0<e)-(e<0)||+e}function En(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Gn(this._milliseconds)/1e3,s=Gn(this._days),i=Gn(this._months);t=D((e=D(n/60))/60),n%=60,e%=60;var r=D(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Vn(this._months)!==Vn(h)?"-":"",m=Vn(this._days)!==Vn(h)?"-":"",_=Vn(this._milliseconds)!==Vn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||d?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(d?_+d+"S":"")}var In=Ht.prototype;return In.isValid=function(){return this._isValid},In.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},In.add=function(e,t){return yn(this,e,t,1)},In.subtract=function(e,t){return yn(this,e,t,-1)},In.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=R(e))||"year"===e)return t=this._days+s/864e5,n=this._months+pn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(vn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},In.asMilliseconds=Mn,In.asSeconds=Sn,In.asMinutes=Dn,In.asHours=kn,In.asDays=Yn,In.asWeeks=On,In.asMonths=Tn,In.asYears=xn,In.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},In._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*gn(vn(o)+a),o=a=0),u.milliseconds=r%1e3,e=D(r/1e3),u.seconds=e%60,t=D(e/60),u.minutes=t%60,n=D(t/60),u.hours=n%24,o+=i=D(pn(a+=D(n/24))),a-=gn(vn(i)),s=D(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},In.clone=function(){return At(this)},In.get=function(e){return e=R(e),this.isValid()?this[e+"s"]():NaN},In.milliseconds=Pn,In.seconds=Wn,In.minutes=Hn,In.hours=Rn,In.days=Cn,In.weeks=function(){return D(this.days()/7)},In.months=Fn,In.years=Ln,In.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,d,h,c=this.localeData(),f=(n=!e,s=c,i=At(t=this).abs(),r=Un(i.as("s")),a=Un(i.as("m")),o=Un(i.as("h")),u=Un(i.as("d")),l=Un(i.as("M")),d=Un(i.as("y")),(h=r<=Nn.ss&&["s",r]||r<Nn.s&&["ss",r]||a<=1&&["m"]||a<Nn.m&&["mm",a]||o<=1&&["h"]||o<Nn.h&&["hh",o]||u<=1&&["d"]||u<Nn.d&&["dd",u]||l<=1&&["M"]||l<Nn.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=n,h[3]=0<+t,h[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,h));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},In.toISOString=En,In.toString=En,In.toJSON=En,In.locale=Qt,In.localeData=Kt,In.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",En),In.lang=Xt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(k(e))}),c.version="2.23.0",e=Tt,c.fn=ln,c.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return Tt(1e3*e)},c.months=function(e,t){return fn(e,t,"months")},c.isDate=h,c.locale=ot,c.invalid=v,c.duration=At,c.isMoment=S,c.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},c.parseZone=function(){return Tt.apply(null,arguments).parseZone()},c.localeData=lt,c.isDuration=Rt,c.monthsShort=function(e,t){return fn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},c.defineLocale=ut,c.updateLocale=function(e,t){if(null!=t){var n,s,i=nt;null!=(s=at(e))&&(i=s._config),(n=new P(t=b(i,t))).parentLocale=st[e],st[e]=n,ot(e)}else null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]);return st[e]},c.locales=function(){return s(st)},c.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},c.normalizeUnits=R,c.relativeTimeRounding=function(e){return void 0===e?Un:"function"==typeof e&&(Un=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==Nn[e]&&(void 0===t?Nn[e]:(Nn[e]=t,"s"===e&&(Nn.ss=t-1),!0))},c.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=ln,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},c});
 
lara-google-analytics.php CHANGED
@@ -4,14 +4,14 @@
4
  Plugin Name: Lara's Google Analytics
5
  Plugin URI: https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/
6
  Description: Full width Google Analytics dashboard widget for Wordpress admin interface, which also inserts latest Google Analytics tracking code to your pages.
7
- Version: 2.0.7
8
  Author: Amr M. Ibrahim
9
  Author URI: https://www.xtraorbit.com/
10
  License: GPL2
11
  */
12
 
13
- define ("lrgawidget_plugin_version", "2.0.7");
14
- define ("lrgawidget_plugin_scripts_version", "207");
15
  define ("lrgawidget_plugin_prefiex", "lrgalite-");
16
  define ("lrgawidget_plugin_dist_dir", plugin_dir_url( __FILE__ ).'dist/');
17
  define ("lrgawidget_plugin_plugins_dir", plugin_dir_url( __FILE__ ).'dist/plugins/');
@@ -35,31 +35,29 @@ add_action( 'wp_ajax_lrgawidget_getOS', 'lrgawidget_callback' );
35
  add_action( 'wp_ajax_lrgawidget_getDevices', 'lrgawidget_callback' );
36
  add_action( 'wp_ajax_lrgawidget_getScreenResolution', 'lrgawidget_callback' );
37
  add_action( 'wp_ajax_lrgawidget_getPages', 'lrgawidget_callback' );
38
-
39
  add_action( 'wp_head', 'lrgawidget_ga_code');
40
 
41
- function lrgawidget_is_analytics($str){
42
- return (bool) preg_match('/^ua-\d{4,20}(-\d{1,10})?$/i', $str);
43
- }
44
 
45
  function lrgawidget_enqueue($hook) {
46
- if ( 'index.php' != $hook || !current_user_can('manage_options')) {
47
- return;
48
- }
49
- $user_id = get_current_user_id();
50
- $wstate = get_user_option( 'lrgawidget_hideShowWidget', $user_id );
51
-
52
- if ($wstate !== "hide"){
53
- wp_enqueue_style( lrgawidget_plugin_prefiex.'lrgawidget', plugin_dir_url( __FILE__ ).'dist/css/'.lrgawidget_plugin_prefiex.'main.css' ,array(),lrgawidget_plugin_scripts_version);
54
- wp_enqueue_script( 'jquery' );
55
- wp_enqueue_script( lrgawidget_plugin_prefiex.'main', plugin_dir_url( __FILE__ ).'dist/js/'.lrgawidget_plugin_prefiex.'main.js' ,array('jquery'),lrgawidget_plugin_scripts_version,true);
56
- wp_localize_script( lrgawidget_plugin_prefiex.'main', 'lrgawidget_ajax_object', array( 'lrgawidget_ajax_url' => admin_url( 'admin-ajax.php' ) ));
57
- add_action( 'admin_notices', 'lrga_welcome_panel' );
58
- }else{
59
- wp_enqueue_script( 'jquery' );
60
- wp_enqueue_script( lrgawidget_plugin_prefiex.'main', plugin_dir_url( __FILE__ ).'dist/js/lrgawidget_control.js' ,array('jquery'),lrgawidget_plugin_scripts_version);
61
- wp_localize_script( lrgawidget_plugin_prefiex.'main', 'lrgawidget_ajax_object', array( 'lrgawidget_ajax_url' => admin_url( 'admin-ajax.php' ) ));
62
- }
63
  }
64
 
65
 
@@ -67,6 +65,7 @@ function lrgawidget_enqueue($hook) {
67
  function lrgawidget_internal_permissions(){
68
  $parray = array();
69
  $globalWidgetPermissions = array("lrgawidget_perm_admin",
 
70
  "lrgawidget_perm_sessions",
71
  "lrgawidget_perm_browsers",
72
  "lrgawidget_perm_languages",
@@ -79,42 +78,37 @@ function lrgawidget_internal_permissions(){
79
  return $parray;
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
82
  function lrgawidget_callback() {
83
- if (current_user_can('manage_options')){
84
- global $wpdb;
85
- $user_id = get_current_user_id();
86
- $lrperm = lrgawidget_internal_permissions();
87
  $lrdata = array_map ( 'htmlspecialchars' , $_POST );
88
  $modifiedAction = explode("_", $lrdata['action']);
89
  $lrdata['action'] = sanitize_text_field($modifiedAction[1]);
90
 
91
- if ($lrdata['action'] == "setProfileID"){
92
- $lrdata['property_id'] = sanitize_text_field($lrdata['property_id']);
93
- if ( (isset($lrdata['enable_universal_tracking'])) && !empty($lrdata['property_id']) && lrgawidget_is_analytics($lrdata['property_id']) ){
94
- update_option('lrgawidget_property_id', $lrdata['property_id']);
95
- }else{
96
- delete_option('lrgawidget_property_id');
97
- }
98
- }
99
- if ($lrdata['action'] == "settingsReset"){
100
- delete_option('lrgawidget_property_id');
101
- }
102
-
103
  if ($lrdata['action'] == "hideShowWidget"){
104
- $lrdata['wstate'] = sanitize_text_field($lrdata['wstate']);
105
- if ($lrdata['wstate'] == "show" || $lrdata['wstate'] == "hide"){
106
- update_user_option( $user_id, 'lrgawidget_hideShowWidget', $lrdata['wstate'] );
107
  lrgawidget_jsonOutput();
108
  }
109
- };
110
-
111
-
112
  require (dirname(__FILE__).'/core/lrgawidget.handler.php');
113
  }
114
  }
115
 
116
  function lrgawidget_jsonOutput(){
117
- header('Content-Type: application/json');
118
  $output['status'] = "done";
119
  echo json_encode($output);
120
  exit();
@@ -128,23 +122,8 @@ function lrga_welcome_panel() {
128
  }
129
 
130
  function lrgawidget_ga_code(){
131
- $lrgawidget_property_id = sanitize_text_field(get_option('lrgawidget_property_id',""));
132
- if (!current_user_can('edit_posts') && !empty($lrgawidget_property_id) && lrgawidget_is_analytics($lrgawidget_property_id)) {
133
- ?>
134
-
135
- <!-- Google Analytics by Lara - https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/ -->
136
- <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $lrgawidget_property_id ?>"></script>
137
- <script>
138
- window.dataLayer = window.dataLayer || [];
139
- function gtag(){dataLayer.push(arguments);}
140
- gtag('js', new Date());
141
- gtag('config', '<?php echo $lrgawidget_property_id ?>', { 'anonymize_ip': true });
142
- </script>
143
-
144
- <?php
145
- }
146
-
147
- }
148
 
149
  function lrgawidget_activate() {
150
  global $wpdb;
@@ -152,15 +131,14 @@ function lrgawidget_activate() {
152
  deactivate_plugins( basename( __FILE__ ) );
153
  wp_die('<p>'.sprintf('This plugin can not be activated because it requires a PHP version greater than <b>5.3.0</b>.<br>You are currently using PHP <b>%1$s</b>.<br><br>Your PHP version can be updated by your hosting company.',PHP_VERSION).'</p><a href="'. admin_url('plugins.php').'">Go back</a>');
154
  }else{
155
- $sql = "CREATE TABLE IF NOT EXISTS `".lrgawidget_plugin_table."` (`id` int(10) NOT NULL AUTO_INCREMENT, `name` TEXT NOT NULL, `value` TEXT NOT NULL, PRIMARY KEY (`id`))";
156
- $wpdb->query($sql);
157
  }
158
  }
159
 
160
  function lrgawidget_uninstall() {
161
  global $wpdb;
162
- $sql = "DROP TABLE `".lrgawidget_plugin_table."`";
163
- $wpdb->query($sql);
164
  delete_option('lrgawidget_property_id');
 
165
  }
166
  ?>
4
  Plugin Name: Lara's Google Analytics
5
  Plugin URI: https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/
6
  Description: Full width Google Analytics dashboard widget for Wordpress admin interface, which also inserts latest Google Analytics tracking code to your pages.
7
+ Version: 3.0.0
8
  Author: Amr M. Ibrahim
9
  Author URI: https://www.xtraorbit.com/
10
  License: GPL2
11
  */
12
 
13
+ define ("lrgawidget_plugin_version", "3.0.0");
14
+ define ("lrgawidget_plugin_scripts_version", "300");
15
  define ("lrgawidget_plugin_prefiex", "lrgalite-");
16
  define ("lrgawidget_plugin_dist_dir", plugin_dir_url( __FILE__ ).'dist/');
17
  define ("lrgawidget_plugin_plugins_dir", plugin_dir_url( __FILE__ ).'dist/plugins/');
35
  add_action( 'wp_ajax_lrgawidget_getDevices', 'lrgawidget_callback' );
36
  add_action( 'wp_ajax_lrgawidget_getScreenResolution', 'lrgawidget_callback' );
37
  add_action( 'wp_ajax_lrgawidget_getPages', 'lrgawidget_callback' );
38
+ add_action( 'wp_ajax_lrgawidget_getPermissions', 'lrgawidget_permissions_editor' );
39
  add_action( 'wp_head', 'lrgawidget_ga_code');
40
 
41
+
42
+ require_once(dirname(__FILE__).'/core/wp.helper.functions.php');
 
43
 
44
  function lrgawidget_enqueue($hook) {
45
+ if ( ('index.php' === $hook) && !is_network_admin() ){
46
+ if (current_user_can('manage_options')) {
47
+ $wstate = Lara\Utils\Common\WPHelperFunctions::get_current_user_option('lrgawidget_hideShowWidget');
48
+ if ($wstate !== "hide"){
49
+ wp_enqueue_style( lrgawidget_plugin_prefiex.'lrgawidget', plugin_dir_url( __FILE__ ).'dist/css/'.lrgawidget_plugin_prefiex.'main.css' ,array(),lrgawidget_plugin_scripts_version);
50
+ wp_enqueue_script( 'jquery' );
51
+ wp_enqueue_script( lrgawidget_plugin_prefiex.'main', plugin_dir_url( __FILE__ ).'dist/js/'.lrgawidget_plugin_prefiex.'main.js' ,array('jquery'),lrgawidget_plugin_scripts_version,true);
52
+ wp_localize_script( lrgawidget_plugin_prefiex.'main', 'lrgawidget_ajax_object', array( 'lrgawidget_ajax_url' => admin_url( 'admin-ajax.php' ) ));
53
+ add_action( 'admin_notices', 'lrga_welcome_panel' );
54
+ }else{
55
+ wp_enqueue_script( 'jquery' );
56
+ wp_enqueue_script( lrgawidget_plugin_prefiex.'main', plugin_dir_url( __FILE__ ).'dist/js/lrgawidget_control.js' ,array('jquery'),lrgawidget_plugin_scripts_version);
57
+ wp_localize_script( lrgawidget_plugin_prefiex.'main', 'lrgawidget_ajax_object', array( 'lrgawidget_ajax_url' => admin_url( 'admin-ajax.php' ) ));
58
+ }
59
+ }else{return;}
60
+ }else{return;}
 
61
  }
62
 
63
 
65
  function lrgawidget_internal_permissions(){
66
  $parray = array();
67
  $globalWidgetPermissions = array("lrgawidget_perm_admin",
68
+ "lrgawidget_perm_perm",
69
  "lrgawidget_perm_sessions",
70
  "lrgawidget_perm_browsers",
71
  "lrgawidget_perm_languages",
78
  return $parray;
79
  }
80
 
81
+
82
+ function lrgawidget_permissions_editor() {
83
+ require (dirname(__FILE__).'/core/lrgawidget.permissions.php');
84
+ $call = new Lara\Utils\Common\permissions();
85
+
86
+ if ($_POST['action'] == "lrgawidget_getPermissions"){
87
+ $call->getCurrentBlogRolesPermissions();
88
+ }
89
+
90
+ }
91
+
92
  function lrgawidget_callback() {
93
+ $lrperm = lrgawidget_internal_permissions();
94
+ if (current_user_can('manage_options')) {
 
 
95
  $lrdata = array_map ( 'htmlspecialchars' , $_POST );
96
  $modifiedAction = explode("_", $lrdata['action']);
97
  $lrdata['action'] = sanitize_text_field($modifiedAction[1]);
98
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  if ($lrdata['action'] == "hideShowWidget"){
100
+ if ($lrdata['wstate'] === "show" || $lrdata['wstate'] === "hide"){
101
+ Lara\Utils\Common\WPHelperFunctions::update_current_user_option('lrgawidget_hideShowWidget', $lrdata['wstate']);
 
102
  lrgawidget_jsonOutput();
103
  }
104
+ }
105
+
 
106
  require (dirname(__FILE__).'/core/lrgawidget.handler.php');
107
  }
108
  }
109
 
110
  function lrgawidget_jsonOutput(){
111
+ header('Content-Type: application/json; charset=utf-8');
112
  $output['status'] = "done";
113
  echo json_encode($output);
114
  exit();
122
  }
123
 
124
  function lrgawidget_ga_code(){
125
+ Lara\Utils\Common\WPHelperFunctions::get_ga_code();
126
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
  function lrgawidget_activate() {
129
  global $wpdb;
131
  deactivate_plugins( basename( __FILE__ ) );
132
  wp_die('<p>'.sprintf('This plugin can not be activated because it requires a PHP version greater than <b>5.3.0</b>.<br>You are currently using PHP <b>%1$s</b>.<br><br>Your PHP version can be updated by your hosting company.',PHP_VERSION).'</p><a href="'. admin_url('plugins.php').'">Go back</a>');
133
  }else{
134
+ $wpdb->query("CREATE TABLE IF NOT EXISTS `".lrgawidget_plugin_table."` (`id` int(10) NOT NULL AUTO_INCREMENT, `name` TEXT NOT NULL, `value` TEXT NOT NULL, PRIMARY KEY (`id`))");
 
135
  }
136
  }
137
 
138
  function lrgawidget_uninstall() {
139
  global $wpdb;
140
+ $wpdb->query("DROP TABLE `".lrgawidget_plugin_table."`");
 
141
  delete_option('lrgawidget_property_id');
142
+ delete_network_option( 1, lrgawidget_plugin_prefiex.'version' );
143
  }
144
  ?>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Tags: analytics,google analytics,google analytics dashboard,google analytics plu
3
  Contributors: amribrahim, laragoogleanalytics
4
  Requires PHP: 5.3.0
5
  Requires at least: 4.0
6
- Tested up to: 5.2.3
7
- Stable tag: 2.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -111,4 +111,11 @@ Adds a full width Google Analytics dashboard widget for WordPress admin interfac
111
 
112
  = 2.0.7 =
113
  * 14-Oct-2019
114
- * Fix : restrict settings to super admins.
 
 
 
 
 
 
 
3
  Contributors: amribrahim, laragoogleanalytics
4
  Requires PHP: 5.3.0
5
  Requires at least: 4.0
6
+ Tested up to: 5.3.2
7
+ Stable tag: 3.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
111
 
112
  = 2.0.7 =
113
  * 14-Oct-2019
114
+ * Fix : restrict settings to super admins.
115
+
116
+ = 3.0.0 =
117
+ * 02-Jan-2020
118
+ * New : Code refactoring.
119
+ * New : Various security checks and validation for POST variables.
120
+ * New : Implementing Multisite Multi-Network in the Pro Version.
121
+ * New : Implementing Permissions Control in the Pro Version.
widgets/lrgawidget.php CHANGED
@@ -19,7 +19,7 @@
19
  <div class="nav-tabs-custom" id="lrgawidget_main">
20
  <ul class="nav nav-tabs">
21
  <?php if (in_array("lrgawidget_perm_admin",$globalWidgetPermissions)){ ?>
22
- <li><a data-toggle="tab" data-target="#lrgawidget_settings_tab" href="#lrgawidget_settings_tab"><i class="fa fa-cog fa-fw"></i><span class="hidden-xs hidden-sm"> Settings</span></a></li>
23
 
24
  <?php } if (in_array("lrgawidget_perm_sessions",$globalWidgetPermissions)){ $actLrgaTabs[] = "lrgawidget_sessions_tab"; ?>
25
  <li><a data-toggle="tab" data-target="#lrgawidget_sessions_tab" href="#lrgawidget_sessions_tab"><i class="fa fa-users fa-fw"></i><span class="hidden-xs hidden-sm"> Sessions</span></a></li>
@@ -43,6 +43,14 @@
43
  <li><a data-toggle="tab" data-target="#lrgawidget_screenres_tab" href="#lrgawidget_screenres_tab"><i class="fa fa-arrows-alt fa-fw"></i><span class="hidden-xs hidden-sm"> Screen Resolution</span></a></li>
44
  <?php } ?>
45
  <li><a data-toggle="tab" data-target="#lrgawidget_gopro_tab" href="#lrgawidget_gopro_tab"><i class="fa fa-unlock fa-fw"></i><span class="hidden-xs hidden-sm"> Go Premium ! </span></a></li>
 
 
 
 
 
 
 
 
46
  </ul>
47
  <div class="tab-content">
48
  <div class="alert alert-danger hidden" id="lrgawidget_error"></div>
@@ -225,11 +233,18 @@
225
  <select class="form-control" style="width: 100%;" id="lrgawidget-profiles" name="profile_id">
226
  </select>
227
  </div>
 
 
 
 
 
 
 
228
  <div class="callout" style="padding: 5px;">
229
- <input name="enable_universal_tracking" checked="checked" type="checkbox" style="margin: 0px;"> Add "<b>Google Universal Analytics</b>" tracking code to all pages.
230
  </div>
231
  <div>
232
- <button class="btn btn-primary" type="submit">Save</button>
233
  </div>
234
  </form>
235
  </div>
@@ -264,7 +279,27 @@
264
  </div><!-- /.tab-pane -->
265
  <?php } ?>
266
 
267
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  <?php if (in_array("lrgawidget_perm_sessions",$globalWidgetPermissions)){ ?>
269
  <div class="tab-pane" id="lrgawidget_sessions_tab">
270
  <div id="lrgawidget_sessions_chartDiv" style="height: 350px; width: 100%;">
@@ -522,6 +557,13 @@
522
  background-repeat: no-repeat;
523
  }
524
 
 
 
 
 
 
 
 
525
  #lrgawidget_gopro_tab .lrga_gpro_who p{
526
  font-size: 14px;
527
  text-align: center;
@@ -573,6 +615,13 @@
573
  </div>
574
 
575
  <div class="row text-left lrga_gpro_features lrga_gpro_boxtopb">
 
 
 
 
 
 
 
576
 
577
  <div class="col-md-6">
578
  <ul class="fa-ul">
19
  <div class="nav-tabs-custom" id="lrgawidget_main">
20
  <ul class="nav nav-tabs">
21
  <?php if (in_array("lrgawidget_perm_admin",$globalWidgetPermissions)){ ?>
22
+
23
 
24
  <?php } if (in_array("lrgawidget_perm_sessions",$globalWidgetPermissions)){ $actLrgaTabs[] = "lrgawidget_sessions_tab"; ?>
25
  <li><a data-toggle="tab" data-target="#lrgawidget_sessions_tab" href="#lrgawidget_sessions_tab"><i class="fa fa-users fa-fw"></i><span class="hidden-xs hidden-sm"> Sessions</span></a></li>
43
  <li><a data-toggle="tab" data-target="#lrgawidget_screenres_tab" href="#lrgawidget_screenres_tab"><i class="fa fa-arrows-alt fa-fw"></i><span class="hidden-xs hidden-sm"> Screen Resolution</span></a></li>
44
  <?php } ?>
45
  <li><a data-toggle="tab" data-target="#lrgawidget_gopro_tab" href="#lrgawidget_gopro_tab"><i class="fa fa-unlock fa-fw"></i><span class="hidden-xs hidden-sm"> Go Premium ! </span></a></li>
46
+
47
+ <?php if (in_array("lrgawidget_perm_admin",$globalWidgetPermissions)){ ?>
48
+ <li class="pull-right"><a data-toggle="tab" data-target="#lrgawidget_settings_tab" href="#lrgawidget_settings_tab"><i class="fa fa-cog fa-fw"></i></a></li>
49
+ <?php } ?>
50
+
51
+ <?php if (in_array("lrgawidget_perm_perm",$globalWidgetPermissions)){ ?>
52
+ <li class="pull-right"><a data-toggle="tab" data-target="#lrgawidget_permissions_tab" href="#lrgawidget_permissions_tab"><i class="fa fa-key fa-fw"></i></a></li>
53
+ <?php } ?>
54
  </ul>
55
  <div class="tab-content">
56
  <div class="alert alert-danger hidden" id="lrgawidget_error"></div>
233
  <select class="form-control" style="width: 100%;" id="lrgawidget-profiles" name="profile_id">
234
  </select>
235
  </div>
236
+ <?php
237
+ $is_traching_enabled = "";
238
+ $enable_universal_tracking = Lara\Utils\Common\WPHelperFunctions::get_blog_option('enable_universal_tracking');
239
+ if ($enable_universal_tracking !== "off"){
240
+ $is_traching_enabled = "checked";
241
+ }
242
+ ?>
243
  <div class="callout" style="padding: 5px;">
244
+ <input name="enable_universal_tracking" <?php echo $is_traching_enabled ?> type="checkbox" style="margin: 0px;" value="on"> Add "<b>Google Universal Analytics</b>" tracking code to all pages.
245
  </div>
246
  <div>
247
+ <button class="btn btn-primary" type="submit" id="lrgawidget-save-settings">Save</button>
248
  </div>
249
  </form>
250
  </div>
279
  </div><!-- /.tab-pane -->
280
  <?php } ?>
281
 
282
+ <?php if (in_array("lrgawidget_perm_perm",$globalWidgetPermissions)){ ?>
283
+ <div class="tab-pane" id="lrgawidget_permissions_tab">
284
+ <div class="row lrgawidget_permissions">
285
+ <div class="col-md-3">
286
+ <ul class="nav nav-pills nav-stacked" id="lrgawidget_permissions_roles">
287
+ </ul>
288
+ </div>
289
+ <div class="col-md-9">
290
+ <form id="lrgawidget_permissions_form"" role="form">
291
+ <input name="action" type="hidden" value="setPermissions">
292
+ <div class="tab-content" id="lrgawidget_permissions_list">
293
+ </div>
294
+ <div>
295
+ <button class="btn btn-primary pull-right" type="submit"><i class="fa fa-save fa-fw"></i> Save</button>
296
+ </div>
297
+ </form>
298
+ </div>
299
+ </div>
300
+ </div>
301
+ <?php } ?>
302
+
303
  <?php if (in_array("lrgawidget_perm_sessions",$globalWidgetPermissions)){ ?>
304
  <div class="tab-pane" id="lrgawidget_sessions_tab">
305
  <div id="lrgawidget_sessions_chartDiv" style="height: 350px; width: 100%;">
557
  background-repeat: no-repeat;
558
  }
559
 
560
+ #lrgawidget_gopro_tab .lrga_gpro_featured {
561
+ background-color: #F8F8F8;
562
+ border: 2px solid #ededed;
563
+ padding: 10px;
564
+ margin-bottom:15px;
565
+ }
566
+
567
  #lrgawidget_gopro_tab .lrga_gpro_who p{
568
  font-size: 14px;
569
  text-align: center;
615
  </div>
616
 
617
  <div class="row text-left lrga_gpro_features lrga_gpro_boxtopb">
618
+
619
+ <div class="col-md-12 lrga_gpro_featured">
620
+ <ul class="fa-ul" style="margin-top: 5px;margin-bottom: 5px;">
621
+ <li><i class="fa-li fa fa-sitemap fa-lg fa-fw"></i><b>Multisite Multi-Network enabled : </b>Every blog/site in your network can have its own analytics tracking code and dashboard widget.</li>
622
+ <li><i class="fa-li fa fa-key fa-lg fa-fw"></i><b>Permissions : </b>Easily control which data is viwed by your blog admins and users (also compatible with Multisite Multi-Network).</li>
623
+ </ul>
624
+ </div>
625
 
626
  <div class="col-md-6">
627
  <ul class="fa-ul">