Advanced Access Manager - Version 5.6.1

Version Description

  • Fixed the bug with caching
  • Fixed the bug with the way post type and taxonomies are registered with extensions
  • Turned on by default the ability to edit and delete capabilities
Download this release

Release Info

Developer vasyl_m
Plugin Icon 128x128 Advanced Access Manager
Version 5.6.1
Comparing to
See all releases

Code changes from version 5.6 to 5.6.1

Application/Api/Manager.php CHANGED
@@ -66,11 +66,6 @@ class AAM_Api_Manager {
66
  // Manage access to the RESTful endpoints
67
  add_filter('rest_pre_dispatch', array($this, 'authorizeRest'), 1, 3);
68
 
69
- // Check if user has ability to perform certain task based on provided
70
- // capability and meta data
71
- $shared = AAM_Shared_Manager::getInstance();
72
- add_filter('user_has_cap', array($shared, 'userHasCap'), 999, 3);
73
-
74
  // Register any additional endpoints with ConfigPress
75
  $additional = AAM_Core_Config::get('rest.manage.endpoint');
76
 
66
  // Manage access to the RESTful endpoints
67
  add_filter('rest_pre_dispatch', array($this, 'authorizeRest'), 1, 3);
68
 
 
 
 
 
 
69
  // Register any additional endpoints with ConfigPress
70
  $additional = AAM_Core_Config::get('rest.manage.endpoint');
71
 
Application/Backend/Feature/Main/Capability.php CHANGED
@@ -54,7 +54,7 @@ class AAM_Backend_Feature_Main_Capability extends AAM_Backend_Feature_Abstract {
54
  'aam_manage_404_redirect', 'aam_manage_ip_check', 'aam_manage_admin_toolbar',
55
  'aam_manage_default', 'aam_manage_visitors', 'aam_manage_roles', 'aam_manage_users',
56
  'aam_edit_roles', 'aam_delete_roles', 'aam_toggle_users', 'aam_switch_users',
57
- 'aam_manage_configpress', 'aam_manage_api_routes', 'aam_manage_uri'
58
  )
59
  );
60
 
@@ -147,13 +147,30 @@ class AAM_Backend_Feature_Main_Capability extends AAM_Backend_Feature_Abstract {
147
  $subject = AAM_Backend_Subject::getInstance();
148
  $actions = array();
149
 
150
- $actions[] = ($subject->hasCapability($cap) ? 'checked' : 'unchecked');
 
 
 
 
 
 
151
 
152
  //allow to delete or update capability only for roles!
153
- if (AAM_Core_Config::get('core.settings.editCapabilities', false)
154
  && ($subject->getUID() === AAM_Core_Subject_Role::UID)) {
155
- $actions[] = 'edit';
156
- $actions[] = 'delete';
 
 
 
 
 
 
 
 
 
 
 
157
  } else {
158
  $actions[] = 'no-edit';
159
  $actions[] = 'no-delete';
54
  'aam_manage_404_redirect', 'aam_manage_ip_check', 'aam_manage_admin_toolbar',
55
  'aam_manage_default', 'aam_manage_visitors', 'aam_manage_roles', 'aam_manage_users',
56
  'aam_edit_roles', 'aam_delete_roles', 'aam_toggle_users', 'aam_switch_users',
57
+ 'aam_manage_configpress', 'aam_manage_api_routes', 'aam_manage_uri', 'aam_manage_policy'
58
  )
59
  );
60
 
147
  $subject = AAM_Backend_Subject::getInstance();
148
  $actions = array();
149
 
150
+ $toggle = ($subject->hasCapability($cap) ? 'checked' : 'unchecked');
151
+
152
+ if (AAM::api()->isAllowed("Capability:{$cap}", 'AAM:toggle') === false) {
153
+ $toggle = 'no-' . $toggle;
154
+ }
155
+
156
+ $actions[] = $toggle;
157
 
158
  //allow to delete or update capability only for roles!
159
+ if (AAM_Core_Config::get('core.settings.editCapabilities', true)
160
  && ($subject->getUID() === AAM_Core_Subject_Role::UID)) {
161
+ $edit = 'edit';
162
+ $delete = 'delete';
163
+
164
+ if (AAM::api()->isAllowed("Capability:{$cap}", 'AAM:update') === false) {
165
+ $edit = 'no-' . $edit;
166
+ }
167
+
168
+ if (AAM::api()->isAllowed("Capability:{$cap}", 'AAM:delete') === false) {
169
+ $edit = 'no-' . $delete;
170
+ }
171
+
172
+ $actions[] = $edit;
173
+ $actions[] = $delete;
174
  } else {
175
  $actions[] = 'no-edit';
176
  $actions[] = 'no-delete';
Application/Backend/Feature/Main/Policy.php ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ======================================================================
5
+ * LICENSE: This file is subject to the terms and conditions defined in *
6
+ * file 'license.txt', which is part of this source code package. *
7
+ * ======================================================================
8
+ */
9
+
10
+ /**
11
+ * WordPress API manager
12
+ *
13
+ * @package AAM
14
+ * @author Vasyl Martyniuk <vasyl@vasyltech.com>
15
+ */
16
+ class AAM_Backend_Feature_Main_Policy extends AAM_Backend_Feature_Abstract {
17
+
18
+ /**
19
+ *
20
+ * @return type
21
+ */
22
+ public function getTable() {
23
+ return wp_json_encode($this->retrievePolicies());
24
+ }
25
+
26
+ /**
27
+ *
28
+ * @return type
29
+ */
30
+ public function savePolicy() {
31
+ $id = filter_input(INPUT_POST, 'id');
32
+ $policy = filter_input(INPUT_POST, 'policy');
33
+
34
+ $policies = AAM_Core_API::getOption('aam-policy-list', array(), 'site');
35
+
36
+ if (empty($id)) {
37
+ $id = uniqid();
38
+ }
39
+
40
+ $policies[$id] = $policy;
41
+
42
+ AAM_Core_API::updateOption('aam-policy-list', $policies, 'site');
43
+
44
+ return wp_json_encode(array('status' => 'success'));
45
+ }
46
+
47
+ /**
48
+ *
49
+ * @return type
50
+ */
51
+ public function deletePolicy() {
52
+ $id = filter_input(INPUT_POST, 'id');
53
+
54
+ $policies = AAM_Core_API::getOption('aam-policy-list', array(), 'site');
55
+
56
+ if (isset($policies[$id])) {
57
+ unset($policies[$id]);
58
+ }
59
+
60
+ AAM_Core_API::updateOption('aam-policy-list', $policies, 'site');
61
+
62
+ return wp_json_encode(array('status' => 'success'));
63
+ }
64
+
65
+ /**
66
+ * Save post properties
67
+ *
68
+ * @return string
69
+ *
70
+ * @access public
71
+ */
72
+ public function save() {
73
+ $subject = AAM_Backend_Subject::getInstance();
74
+
75
+
76
+ $id = AAM_Core_Request::post('id');
77
+ $effect = AAM_Core_Request::post('effect');
78
+
79
+ //clear cache
80
+ AAM_Core_API::clearCache();
81
+
82
+ $result = $subject->save($id, $effect, 'policy');
83
+
84
+ return wp_json_encode(array(
85
+ 'status' => ($result ? 'success' : 'failure')
86
+ ));
87
+ }
88
+
89
+ /**
90
+ * @inheritdoc
91
+ */
92
+ public static function getTemplate() {
93
+ return 'main/policy.phtml';
94
+ }
95
+
96
+ /**
97
+ * Check inheritance status
98
+ *
99
+ * Check if menu settings are overwritten
100
+ *
101
+ * @return boolean
102
+ *
103
+ * @access protected
104
+ */
105
+ protected function isOverwritten() {
106
+ $object = AAM_Backend_Subject::getInstance()->getObject('policy');
107
+
108
+ return $object->isOverwritten();
109
+ }
110
+
111
+ /**
112
+ *
113
+ * @return type
114
+ */
115
+ protected function retrievePolicies() {
116
+ $list = AAM_Core_API::getOption('aam-policy-list', array(), 'site');
117
+
118
+ $response = array(
119
+ 'recordsTotal' => count($list),
120
+ 'recordsFiltered' => count($list),
121
+ 'draw' => AAM_Core_Request::request('draw'),
122
+ 'data' => array(),
123
+ );
124
+
125
+ foreach($list as $id => $json) {
126
+ $policy = json_decode($json);
127
+ $response['data'][] = array(
128
+ $id,
129
+ $this->buildTitle($policy),
130
+ $json,
131
+ $this->buildActionList($id)
132
+ );
133
+ }
134
+
135
+ return $response;
136
+ }
137
+
138
+ protected function buildTitle($policy) {
139
+ $title = (isset($policy->Title) ? esc_js($policy->Title) : __('No Title', AAM_KEY));
140
+ $title .= '<br/>';
141
+
142
+ if (isset($policy->Description)) {
143
+ $title .= '<small>' . esc_js($policy->Description) . '</small>';
144
+ }
145
+
146
+ return $title;
147
+ }
148
+
149
+ /**
150
+ *
151
+ * @param type $id
152
+ * @return type
153
+ */
154
+ protected function buildActionList($id) {
155
+ //'assign,edit,clone,delete'
156
+ $subject = AAM_Backend_Subject::getInstance();
157
+ $object = $subject->getObject('policy');
158
+ $actions = array();
159
+
160
+ $actions[] = $object->has($id) ? 'unassign' : 'assign';
161
+ $actions[] = 'edit';
162
+ $actions[] = 'delete';
163
+
164
+ return implode(',', $actions);
165
+ }
166
+
167
+ /**
168
+ * Register Menu feature
169
+ *
170
+ * @return void
171
+ *
172
+ * @access public
173
+ */
174
+ public static function register() {
175
+ AAM_Backend_Feature::registerFeature((object) array(
176
+ 'uid' => 'policy',
177
+ 'position' => 2,
178
+ 'title' => __('Access Policies', AAM_KEY) . '<span class="badge">NEW</span>',
179
+ 'capability' => 'aam_manage_policy',
180
+ 'type' => 'main',
181
+ 'subjects' => array(
182
+ AAM_Core_Subject_Role::UID,
183
+ AAM_Core_Subject_User::UID,
184
+ AAM_Core_Subject_Visitor::UID,
185
+ AAM_Core_Subject_Default::UID
186
+ ),
187
+ 'view' => __CLASS__
188
+ ));
189
+ }
190
+
191
+ }
Application/Backend/Feature/Settings/Core.php CHANGED
@@ -36,7 +36,7 @@ class AAM_Backend_Feature_Settings_Core extends AAM_Backend_Feature_Abstract {
36
  'core.settings.editCapabilities' => array(
37
  'title' => __('Edit/Delete Capabilities', AAM_KEY),
38
  'descr' => AAM_Backend_View_Helper::preparePhrase('Allow to edit or delete any existing capability on the Capabilities tab. [Warning!] For experienced users only. Changing or deleting capability may result in loosing access to some features or even the entire website.', 'b'),
39
- 'value' => AAM_Core_Config::get('core.settings.editCapabilities', false)
40
  ),
41
  'core.settings.backendAccessControl' => array(
42
  'title' => __('Backend Access Control', AAM_KEY),
36
  'core.settings.editCapabilities' => array(
37
  'title' => __('Edit/Delete Capabilities', AAM_KEY),
38
  'descr' => AAM_Backend_View_Helper::preparePhrase('Allow to edit or delete any existing capability on the Capabilities tab. [Warning!] For experienced users only. Changing or deleting capability may result in loosing access to some features or even the entire website.', 'b'),
39
+ 'value' => AAM_Core_Config::get('core.settings.editCapabilities', true)
40
  ),
41
  'core.settings.backendAccessControl' => array(
42
  'title' => __('Backend Access Control', AAM_KEY),
Application/Backend/Filter.php CHANGED
@@ -61,15 +61,6 @@ class AAM_Backend_Filter {
61
  add_filter('views_users', array($this, 'filterViews'));
62
  }
63
 
64
- // Check if user has ability to perform certain task based on provided
65
- // capability and meta data
66
- add_filter(
67
- 'user_has_cap',
68
- array(AAM_Shared_Manager::getInstance(), 'userHasCap'),
69
- 999,
70
- 3
71
- );
72
-
73
  AAM_Backend_Authorization::bootstrap(); //bootstrap backend authorization
74
 
75
  //check URI
61
  add_filter('views_users', array($this, 'filterViews'));
62
  }
63
 
 
 
 
 
 
 
 
 
 
64
  AAM_Backend_Authorization::bootstrap(); //bootstrap backend authorization
65
 
66
  //check URI
Application/Backend/View.php CHANGED
@@ -34,6 +34,7 @@ class AAM_Backend_View {
34
  protected function __construct() {
35
  //register default features
36
  AAM_Backend_Feature_Main_GetStarted::register();
 
37
  AAM_Backend_Feature_Main_Menu::register();
38
  AAM_Backend_Feature_Main_Toolbar::register();
39
  AAM_Backend_Feature_Main_Metabox::register();
@@ -269,7 +270,7 @@ class AAM_Backend_View {
269
  );
270
 
271
  // Making sure that user that we are switching too is not logged in
272
- // already. Kinding by https://github.com/KenAer
273
  $sessions = WP_Session_Tokens::get_instance($user->ID);
274
  if (count($sessions->get_all()) > 1) {
275
  $sessions->destroy_all();
34
  protected function __construct() {
35
  //register default features
36
  AAM_Backend_Feature_Main_GetStarted::register();
37
+ //AAM_Backend_Feature_Main_Policy::register();
38
  AAM_Backend_Feature_Main_Menu::register();
39
  AAM_Backend_Feature_Main_Toolbar::register();
40
  AAM_Backend_Feature_Main_Metabox::register();
270
  );
271
 
272
  // Making sure that user that we are switching too is not logged in
273
+ // already. Reported by https://github.com/KenAer
274
  $sessions = WP_Session_Tokens::get_instance($user->ID);
275
  if (count($sessions->get_all()) > 1) {
276
  $sessions->destroy_all();
Application/Backend/phtml/main/menu.phtml CHANGED
@@ -41,18 +41,31 @@
41
 
42
  <div id="menu-<?php echo $i; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="menu-<?php echo $i; ?>-heading">
43
  <div class="panel-body">
 
 
 
 
 
 
 
 
44
  <?php if (!empty($menu['submenu'])) { ?>
45
  <div class="row aam-inner-tab">
46
  <?php echo ($object->has($menu['id']) ? '<div class="aam-lock"></div>' : ''); ?>
47
  <?php foreach ($menu['submenu'] as $j => $submenu) { ?>
48
  <?php if ($submenu['id'] == 'index.php') { ?>
49
  <div class="col-xs-12 col-md-6 aam-submenu-item">
50
- <label for="menu-item-<?php echo $i . $j; ?>"><u><?php echo $submenu['name']; ?></u><small class="aam-menu-capability"><?php echo __('Cap:', AAM_KEY), ' <b>', $submenu['capability']; ?></b></small></label>
 
51
  <a href="#dashboard-lockout-modal" data-toggle="modal"><i class="icon-help-circled"></i></a>
52
  </div>
53
  <?php } else { ?>
54
  <div class="col-xs-12 col-md-6 aam-submenu-item">
55
- <label for="menu-item-<?php echo $i . $j; ?>"><u><?php echo $submenu['name']; ?></u><small class="aam-menu-capability"><?php echo __('Cap:', AAM_KEY), ' <b>', $submenu['capability']; ?></b></small></label>
 
 
 
 
56
  <input type="checkbox" class="aam-checkbox-danger" id="menu-item-<?php echo $i . $j; ?>" data-menu-id="<?php echo $submenu['id']; ?>"<?php echo ($object->has($submenu['id']) ? ' checked="checked"' : ''); ?> />
57
  <label for="menu-item-<?php echo $i . $j; ?>" data-toggle="tooltip" title="<?php echo ($object->has($submenu['id']) ? __('Uncheck to allow', AAM_KEY) : __('Check to restrict', AAM_KEY)); ?>"></label>
58
  </div>
41
 
42
  <div id="menu-<?php echo $i; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="menu-<?php echo $i; ?>-heading">
43
  <div class="panel-body">
44
+ <?php if ($menu['id'] != 'menu-index.php') { ?>
45
+ <div class="row aam-inner-tab">
46
+ <div class="col-xs-12 text-center">
47
+ <small class="aam-menu-capability"><?php echo __('Menu ID:', AAM_KEY); ?> <b><?php echo crc32($menu['id']); ?></b></small>
48
+ </div>
49
+ </div>
50
+ <hr class="aam-divider" />
51
+ <?php } ?>
52
  <?php if (!empty($menu['submenu'])) { ?>
53
  <div class="row aam-inner-tab">
54
  <?php echo ($object->has($menu['id']) ? '<div class="aam-lock"></div>' : ''); ?>
55
  <?php foreach ($menu['submenu'] as $j => $submenu) { ?>
56
  <?php if ($submenu['id'] == 'index.php') { ?>
57
  <div class="col-xs-12 col-md-6 aam-submenu-item">
58
+ <label for="menu-item-<?php echo $i . $j; ?>">
59
+ <u><?php echo $submenu['name']; ?></u><small class="aam-menu-capability"><?php echo __('Cap:', AAM_KEY), ' <b>', $submenu['capability']; ?></b></small></label>
60
  <a href="#dashboard-lockout-modal" data-toggle="modal"><i class="icon-help-circled"></i></a>
61
  </div>
62
  <?php } else { ?>
63
  <div class="col-xs-12 col-md-6 aam-submenu-item">
64
+ <label for="menu-item-<?php echo $i . $j; ?>">
65
+ <u><?php echo $submenu['name']; ?></u>
66
+ <small class="aam-menu-capability"><?php echo __('Cap:', AAM_KEY), ' <b>', $submenu['capability']; ?></b></small>
67
+ <small class="aam-menu-capability"><?php echo __('ID:', AAM_KEY), ' <b>', crc32($submenu['id']); ?></b></small>
68
+ </label>
69
  <input type="checkbox" class="aam-checkbox-danger" id="menu-item-<?php echo $i . $j; ?>" data-menu-id="<?php echo $submenu['id']; ?>"<?php echo ($object->has($submenu['id']) ? ' checked="checked"' : ''); ?> />
70
  <label for="menu-item-<?php echo $i . $j; ?>" data-toggle="tooltip" title="<?php echo ($object->has($submenu['id']) ? __('Uncheck to allow', AAM_KEY) : __('Check to restrict', AAM_KEY)); ?>"></label>
71
  </div>
Application/Backend/phtml/main/policy.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (defined('AAM_KEY')) { ?>
2
+ <div class="aam-feature" id="policy-content">
3
+ <?php $subject = AAM_Backend_Subject::getInstance(); ?>
4
+
5
+ <div class="row">
6
+ <div class="col-xs-12">
7
+ <p class="aam-info">
8
+ <?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('Manage access and security policies for [%s]. For more information check %sthis page%s.', 'b'), AAM_Backend_Subject::getInstance()->getName(), '<a href="#" target="_blank">', '</a>'); ?>
9
+ </p>
10
+ </div>
11
+ </div>
12
+
13
+ <div class="row">
14
+ <div class="col-xs-12">
15
+ <div class="aam-overwrite" id="aam-policy-overwrite" style="display: <?php echo ($this->isOverwritten() ? 'block' : 'none'); ?>">
16
+ <span><i class="icon-check"></i> <?php echo __('Policies are customized', AAM_KEY); ?></span>
17
+ <span><a href="#" id="policy-reset" class="btn btn-xs btn-primary"><?php echo __('Reset To Default', AAM_KEY); ?></a>
18
+ </div>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="row">
23
+ <div class="col-xs-12">
24
+ <table id="policy-list" class="table table-striped table-bordered">
25
+ <thead>
26
+ <tr>
27
+ <th>ID</th>
28
+ <th width="80%"><?php echo __('Policy', AAM_KEY); ?></th>
29
+ <th>JSON</th>
30
+ <th><?php echo __('Actions', AAM_KEY); ?></th>
31
+ </tr>
32
+ </thead>
33
+ <tbody></tbody>
34
+ </table>
35
+ </div>
36
+ </div>
37
+
38
+ <div class="modal fade" id="policy-model" tabindex="-1" role="dialog">
39
+ <div class="modal-dialog modal-lg" role="document">
40
+ <div class="modal-content">
41
+ <div class="modal-header">
42
+ <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">&times;</span></button>
43
+ <h4 class="modal-title"><?php echo __('Manage Policy', AAM_KEY); ?></h4>
44
+ </div>
45
+ <div class="modal-body">
46
+ <div class="form-group">
47
+ <label><?php echo AAM_Backend_View_Helper::preparePhrase('Policy Document', 'small'); ?></label>
48
+ <div class="alert alert-danger hidden" id="policy-parsing-error"></div>
49
+ <div class="aam-outer-top-xxs">
50
+ <textarea id="policy-editor" class="policy-editor" rows="10"></textarea>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ <div class="modal-footer">
55
+ <button type="button" class="btn btn-success" id="policy-save-btn"><?php echo __('Save', AAM_KEY); ?></button>
56
+ <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="modal fade" id="policy-delete-model" tabindex="-1" role="dialog">
63
+ <div class="modal-dialog modal-sm" role="document">
64
+ <div class="modal-content">
65
+ <div class="modal-header">
66
+ <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">&times;</span></button>
67
+ <h4 class="modal-title"><?php echo __('Delete Policy', AAM_KEY); ?></h4>
68
+ </div>
69
+ <div class="modal-body">
70
+ <div class="form-group">
71
+ <p class="aam-notification">
72
+ You are about to delete the access policy. Please confirm!
73
+ </p>
74
+ </div>
75
+ </div>
76
+ <div class="modal-footer">
77
+ <button type="button" class="btn btn-danger" id="policy-delete-btn"><?php echo __('Delete', AAM_KEY); ?></button>
78
+ <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ <?php }
Application/Backend/phtml/main/route.phtml CHANGED
@@ -5,8 +5,7 @@
5
  <div class="row">
6
  <div class="col-xs-12">
7
  <p class="aam-info">
8
- <?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('Manage access to the website API routes for [%s]. For full RESTful API experience, you might want to use %sJWT authentication%s that is already available in AAM.', 'b'), AAM_Backend_Subject::getInstance()->getName(), '<a href="https://aamplugin.com/help/how-to-authenticate-wordpress-user-with-jwt-token" target="_blank">', '</a>'); ?><br/><br/>
9
- <?php echo AAM_Backend_View_Helper::preparePhrase('[Please note!] It is the initial version of this feature. It can be significantly enhanced with a lot of useful functionality. Your feedback and suggestions are highly appreciated!', 'b'); ?>
10
  </p>
11
  </div>
12
  </div>
5
  <div class="row">
6
  <div class="col-xs-12">
7
  <p class="aam-info">
8
+ <?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('Manage access to the website API routes for [%s]. For full RESTful API experience, you might want to use %sJWT authentication%s that is already available in AAM.', 'b'), AAM_Backend_Subject::getInstance()->getName(), '<a href="https://aamplugin.com/help/how-to-authenticate-wordpress-user-with-jwt-token" target="_blank">', '</a>'); ?>
 
9
  </p>
10
  </div>
11
  </div>
Application/Backend/phtml/main/toolbar.phtml CHANGED
@@ -39,12 +39,22 @@
39
 
40
  <div id="toolbar-<?php echo $branch->id; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="toolbar-<?php echo $branch->id; ?>-heading">
41
  <div class="panel-body">
 
 
 
 
 
 
42
  <?php if (!empty($branch->children)) { ?>
43
  <div class="row aam-inner-tab">
44
  <?php echo ($object->has('toolbar-' . $branch->id) ? '<div class="aam-lock"></div>' : ''); ?>
45
  <?php foreach($this->getAllChildren($branch) as $child) { ?>
46
  <div class="col-xs-12 aam-submenu-item">
47
- <label for="toolbar-<?php echo $child->id; ?>"><u><?php echo $this->normalizeTitle($child); ?></u><small class="aam-menu-capability"><?php echo str_replace(site_url(), '', $child->href); ?></b></small></label>
 
 
 
 
48
  <input type="checkbox" class="aam-checkbox-danger" id="toolbar-<?php echo $child->id; ?>" data-toolbar="<?php echo $child->id; ?>"<?php echo ($object->has($child->id) ? ' checked="checked"' : ''); ?> />
49
  <label for="toolbar-<?php echo $child->id; ?>" data-toggle="tooltip" title="<?php echo ($object->has($child->id) ? __('Uncheck to allow', AAM_KEY) : __('Check to restrict', AAM_KEY)); ?>"></label>
50
  </div>
39
 
40
  <div id="toolbar-<?php echo $branch->id; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="toolbar-<?php echo $branch->id; ?>-heading">
41
  <div class="panel-body">
42
+ <div class="row aam-inner-tab">
43
+ <div class="col-xs-12 text-center">
44
+ <small class="aam-menu-capability"><?php echo __('Menu ID:', AAM_KEY); ?> <b><?php echo $branch->id; ?></b></small>
45
+ </div>
46
+ </div>
47
+ <hr class="aam-divider" />
48
  <?php if (!empty($branch->children)) { ?>
49
  <div class="row aam-inner-tab">
50
  <?php echo ($object->has('toolbar-' . $branch->id) ? '<div class="aam-lock"></div>' : ''); ?>
51
  <?php foreach($this->getAllChildren($branch) as $child) { ?>
52
  <div class="col-xs-12 aam-submenu-item">
53
+ <label for="toolbar-<?php echo $child->id; ?>">
54
+ <u><?php echo $this->normalizeTitle($child); ?></u>
55
+ <small class="aam-menu-capability"><?php echo __('URI:', AAM_KEY); ?> <b><?php echo str_replace(site_url(), '', $child->href); ?></b></small>
56
+ <small class="aam-menu-capability"><?php echo __('ID:', AAM_KEY); ?> <b><?php echo esc_js($child->id); ?></b></small>
57
+ </label>
58
  <input type="checkbox" class="aam-checkbox-danger" id="toolbar-<?php echo $child->id; ?>" data-toolbar="<?php echo $child->id; ?>"<?php echo ($object->has($child->id) ? ' checked="checked"' : ''); ?> />
59
  <label for="toolbar-<?php echo $child->id; ?>" data-toggle="tooltip" title="<?php echo ($object->has($child->id) ? __('Uncheck to allow', AAM_KEY) : __('Check to restrict', AAM_KEY)); ?>"></label>
60
  </div>
Application/Core/API.php CHANGED
@@ -357,6 +357,7 @@ final class AAM_Core_API {
357
  */
358
  public static function redirect($rule, $args = null) {
359
  $path = wp_parse_url($rule);
 
360
  if ($path && !empty($path['host'])) {
361
  wp_redirect($rule, 307); exit;
362
  } elseif (preg_match('/^[\d]+$/', $rule)) {
357
  */
358
  public static function redirect($rule, $args = null) {
359
  $path = wp_parse_url($rule);
360
+
361
  if ($path && !empty($path['host'])) {
362
  wp_redirect($rule, 307); exit;
363
  } elseif (preg_match('/^[\d]+$/', $rule)) {
Application/Core/Gateway.php CHANGED
@@ -91,6 +91,22 @@ final class AAM_Core_Gateway {
91
  AAM_Core_API::reject(AAM_Core_Api_Area::get(), $params);
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  /**
95
  * Redirect request
96
  *
91
  AAM_Core_API::reject(AAM_Core_Api_Area::get(), $params);
92
  }
93
 
94
+ /**
95
+ * Check if current user has access to specified resource
96
+ *
97
+ * Apply all access/security policies and identify if user has access to specified
98
+ * resource.
99
+ *
100
+ * @param string $resource
101
+ * @param string $action
102
+ *
103
+ * @return mixed Boolean true|false if explicit access is defined or null if no
104
+ * exact match found
105
+ */
106
+ public function isAllowed($resource, $action = null) {
107
+ return AAM::api()->getUser()->getObject('policy')->isAllowed($resource, $action);
108
+ }
109
+
110
  /**
111
  * Redirect request
112
  *
Application/Core/Object/Cache.php CHANGED
@@ -57,13 +57,20 @@ class AAM_Core_Object_Cache extends AAM_Core_Object {
57
  if ($this->enabled) {
58
  // Register shutdown hook
59
  register_shutdown_function(array($this, 'save'));
60
-
61
- // Just get the cache from current subject level. Do not trigger
62
- // inheritance chain!
63
- $this->setOption($this->getSubject()->readOption('cache'));
64
  }
65
  }
66
 
 
 
 
 
 
 
 
 
 
67
  /**
68
  *
69
  * @param type $type
57
  if ($this->enabled) {
58
  // Register shutdown hook
59
  register_shutdown_function(array($this, 'save'));
60
+
61
+ $this->reload();
 
 
62
  }
63
  }
64
 
65
+ /**
66
+ *
67
+ */
68
+ public function reload() {
69
+ // Just get the cache from current subject level. Do not trigger
70
+ // inheritance chain!
71
+ $this->setOption($this->getSubject()->readOption('cache'));
72
+ }
73
+
74
  /**
75
  *
76
  * @param type $type
Application/Core/Object/Menu.php CHANGED
@@ -186,17 +186,24 @@ class AAM_Core_Object_Menu extends AAM_Core_Object {
186
  public function has($menu, $both = false) {
187
  //decode URL in case of any special characters like &amp;
188
  $decoded = htmlspecialchars_decode($menu);
 
189
  $options = $this->getOption();
190
  $parent = $this->getParentMenu($decoded);
191
 
 
 
 
 
 
 
192
  // Step #1. Check if menu is directly restricted
193
- $direct = !empty($options[$decoded]);
194
 
195
  // Step #2. Check if whole branch is restricted
196
- $branch = ($both && !empty($options['menu-' . $decoded]));
197
 
198
  // Step #3. Check if dynamic submenu is restricted because of whole branch
199
- $indirect = ($parent && !empty($options['menu-' . $parent]));
200
 
201
  return $direct || $branch || $indirect;
202
  }
186
  public function has($menu, $both = false) {
187
  //decode URL in case of any special characters like &amp;
188
  $decoded = htmlspecialchars_decode($menu);
189
+
190
  $options = $this->getOption();
191
  $parent = $this->getParentMenu($decoded);
192
 
193
+ // Policy API
194
+ $api = AAM::api();
195
+ $crc = crc32($decoded);
196
+ $bcrc = crc32('menu-' . $decoded);
197
+ $pcrc = crc32('menu-' . $parent);
198
+
199
  // Step #1. Check if menu is directly restricted
200
+ $direct = !empty($options[$decoded]) || ($api->isAllowed("BackendMenu:{$crc}") === false);
201
 
202
  // Step #2. Check if whole branch is restricted
203
+ $branch = ($both && (!empty($options['menu-' . $decoded]) || ($api->isAllowed("BackendMenu:{$bcrc}") === false)));
204
 
205
  // Step #3. Check if dynamic submenu is restricted because of whole branch
206
+ $indirect = ($parent && (!empty($options['menu-' . $parent]) || ($api->isAllowed("BackendMenu:{$pcrc}") === false)));
207
 
208
  return $direct || $branch || $indirect;
209
  }
Application/Core/Object/Metabox.php CHANGED
@@ -166,8 +166,11 @@ class AAM_Core_Object_Metabox extends AAM_Core_Object {
166
  */
167
  public function has($screen, $metabox) {
168
  $options = $this->getOption();
 
 
 
169
 
170
- return !empty($options[$screen][$metabox]);
171
  }
172
 
173
  /**
166
  */
167
  public function has($screen, $metabox) {
168
  $options = $this->getOption();
169
+
170
+ $area = ($screen === 'widgets' ? 'Widget' : 'Metabox');
171
+ $isAllowed = AAM::api()->isAllowed("{$area}:{$metabox}");
172
 
173
+ return !empty($options[$screen][$metabox]) || ($isAllowed === false);
174
  }
175
 
176
  /**
Application/Core/Object/Policy.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ======================================================================
5
+ * LICENSE: This file is subject to the terms and conditions defined in *
6
+ * file 'license.txt', which is part of this source code package. *
7
+ * ======================================================================
8
+ */
9
+
10
+ /**
11
+ * Policy object
12
+ *
13
+ * @package AAM
14
+ * @author Vasyl Martyniuk <vasyl@vasyltech.com>
15
+ */
16
+ class AAM_Core_Object_Policy extends AAM_Core_Object {
17
+
18
+ /**
19
+ *
20
+ * @var type
21
+ */
22
+ protected $resources = array();
23
+
24
+ /**
25
+ * Constructor
26
+ *
27
+ * @param AAM_Core_Subject $subject
28
+ *
29
+ * @return void
30
+ *
31
+ * @access public
32
+ */
33
+ public function __construct(AAM_Core_Subject $subject) {
34
+ parent::__construct($subject);
35
+
36
+ $parent = $this->getSubject()->inheritFromParent('policy');
37
+ if(empty($parent)) {
38
+ $parent = array();
39
+ }
40
+
41
+ $option = $this->getSubject()->readOption('policy');
42
+ if (empty($option)) {
43
+ $option = array();
44
+ } else {
45
+ $this->setOverwritten(true);
46
+ }
47
+
48
+ $this->setOption(array_merge($parent, $option));
49
+ }
50
+
51
+ /**
52
+ *
53
+ */
54
+ public function load() {
55
+ $resources = AAM::api()->getUser()->getObject('cache')->get('policy', 0, null);
56
+
57
+ if (is_null($resources)) {
58
+ $policies = AAM_Core_API::getOption('aam-policy-list', array(), 'site');
59
+ $statements = array();
60
+
61
+ // Step #1. Extract all statements
62
+ foreach($this->getOption() as $id => $effect) {
63
+ if (isset($policies[$id]) && $effect) {
64
+ $policy = json_decode($policies[$id], true);
65
+ $statements = array_merge(
66
+ $statements, $this->extractStatements($policy)
67
+ );
68
+ }
69
+ }
70
+
71
+ // Step #2. Merge all statements
72
+ $resources = array();
73
+
74
+ foreach($statements as $statement) {
75
+ if (isset($statement['Resource'])) {
76
+ $actions = (array)(isset($statement['Action']) ? $statement['Action'] : '');
77
+
78
+ foreach((array) $statement['Resource'] as $resource) {
79
+ foreach($actions as $action) {
80
+ $id = strtolower(
81
+ $resource . (!empty($action) ? ":{$action}" : '')
82
+ );
83
+
84
+ if (!isset($resources[$id])) {
85
+ $resources[$id] = $statement;
86
+ } elseif (empty($resources[$id]['Enforce'])) {
87
+ $resources[$id] = $this->mergeStatements(
88
+ $resources[$id], $statement
89
+ );
90
+ }
91
+
92
+ // cleanup
93
+ if (isset($resources[$id]['Resource'])) { unset($resources[$id]['Resource']); }
94
+ if (isset($resources[$id]['Action'])) { unset($resources[$id]['Action']); }
95
+ }
96
+ }
97
+ }
98
+ }
99
+
100
+ AAM::api()->getUser()->getObject('cache')->add('policy', 0, $resources);
101
+ }
102
+
103
+ $this->resources = $resources;
104
+ }
105
+
106
+ /**
107
+ *
108
+ * @param type $policy
109
+ * @return type
110
+ */
111
+ protected function extractStatements($policy) {
112
+ $statements = array();
113
+
114
+ if (isset($policy['Statement'])) {
115
+ if (is_array($policy['Statement'])) {
116
+ $statements = $policy['Statement'];
117
+ } else {
118
+ $statements = array($policy['Statement']);
119
+ }
120
+ }
121
+
122
+ // normalize each statement
123
+ foreach(array('Action', 'Condition') as $prop) {
124
+ foreach($statements as $i => $statement) {
125
+ if (isset($statement[$prop])) {
126
+ $statements[$i][$prop] = (array) $statement[$prop];
127
+ }
128
+ }
129
+ }
130
+
131
+ return $statements;
132
+ }
133
+
134
+ /**
135
+ *
136
+ * @param type $left
137
+ * @param type $right
138
+ * @return type
139
+ */
140
+ protected function mergeStatements($left, $right) {
141
+ if (isset($right['Resource'])) {
142
+ unset($right['Resource']);
143
+ }
144
+
145
+ $merged = array_merge_recursive($left, $right);
146
+
147
+ if (!isset($merged['Effect'])) {
148
+ $merged['Effect'] = 'deny';
149
+ }
150
+
151
+ return $merged;
152
+ }
153
+
154
+ /**
155
+ * Save menu option
156
+ *
157
+ * @return bool
158
+ *
159
+ * @access public
160
+ */
161
+ public function save($title, $policy) {
162
+ $option = $this->getOption();
163
+ $option[$title] = $policy;
164
+
165
+ $this->setOption($option);
166
+
167
+ return $this->getSubject()->updateOption($this->getOption(), 'policy');
168
+ }
169
+
170
+ /**
171
+ *
172
+ * @param type $id
173
+ */
174
+ public function has($id) {
175
+ $option = $this->getOption();
176
+
177
+ return !empty($option[$id]);
178
+ }
179
+
180
+ /**
181
+ *
182
+ * @param type $resource
183
+ * @return type
184
+ */
185
+ public function isAllowed($resource, $action = null) {
186
+ $allowed = null;
187
+
188
+ $id = strtolower($resource . (!empty($action) ? ":{$action}" : ''));
189
+
190
+ if (isset($this->resources[$id])) {
191
+ $allowed = ($this->resources[$id]['Effect'] === 'allow');
192
+ }
193
+
194
+ return $allowed;
195
+ }
196
+
197
+ /**
198
+ *
199
+ * @param type $id
200
+ *
201
+ * @return type
202
+ */
203
+ public function delete($id) {
204
+ $option = $this->getOption();
205
+ if (isset($option[$id])) {
206
+ unset($option[$id]);
207
+ }
208
+ $this->setOption($option);
209
+
210
+ return $this->getSubject()->updateOption($this->getOption(), 'policy');
211
+ }
212
+
213
+ /**
214
+ * Reset default settings
215
+ *
216
+ * @return bool
217
+ *
218
+ * @access public
219
+ */
220
+ public function reset() {
221
+ //clear cache
222
+ AAM_Core_API::clearCache();
223
+
224
+ return $this->getSubject()->deleteOption('policy');
225
+ }
226
+
227
+ }
Application/Core/Object/Toolbar.php CHANGED
@@ -52,11 +52,14 @@ class AAM_Core_Object_Toolbar extends AAM_Core_Object {
52
  public function has($item, $both = false) {
53
  $options = $this->getOption();
54
 
 
 
 
55
  // Step #1. Check if toolbar item is directly restricted
56
- $direct = !empty($options[$item]);
57
 
58
  // Step #2. Check if whole branch is restricted
59
- $branch = ($both && !empty($options['toolbar-' . $item]));
60
 
61
  return $direct || $branch;
62
  }
52
  public function has($item, $both = false) {
53
  $options = $this->getOption();
54
 
55
+ // Policy API
56
+ $api = AAM::api();
57
+
58
  // Step #1. Check if toolbar item is directly restricted
59
+ $direct = !empty($options[$item]) || ($api->isAllowed("Toolbar:{$item}") === false);
60
 
61
  // Step #2. Check if whole branch is restricted
62
+ $branch = ($both && (!empty($options['toolbar-' . $item]) || ($api->isAllowed("Toolbar:toolbar-{$item}") === false)));
63
 
64
  return $direct || $branch;
65
  }
Application/Core/Subject.php CHANGED
@@ -74,7 +74,7 @@ abstract class AAM_Core_Subject {
74
  //retrieve and set subject itself
75
  $this->setSubject($this->retrieveSubject());
76
  }
77
-
78
  /**
79
  * Trigger Subject native methods
80
  *
@@ -238,7 +238,7 @@ abstract class AAM_Core_Subject {
238
  $id = (is_scalar($id) ? $id : 'none'); //prevent from any surprises
239
 
240
  //check if there is an object with specified ID
241
- if (!isset($this->_objects[$type][$id]) || ($type === 'cache')) {
242
  $classname = 'AAM_Core_Object_' . ucfirst($type);
243
 
244
  if (class_exists($classname)) {
74
  //retrieve and set subject itself
75
  $this->setSubject($this->retrieveSubject());
76
  }
77
+
78
  /**
79
  * Trigger Subject native methods
80
  *
238
  $id = (is_scalar($id) ? $id : 'none'); //prevent from any surprises
239
 
240
  //check if there is an object with specified ID
241
+ if (!isset($this->_objects[$type][$id])) {
242
  $classname = 'AAM_Core_Object_' . ucfirst($type);
243
 
244
  if (class_exists($classname)) {
Application/Extension/List.php CHANGED
@@ -22,7 +22,8 @@ class AAM_Extension_List {
22
  'description' => 'Get the complete list of all premium AAM extensions in one package and all future premium extensions already included for now additional cost.',
23
  'url' => 'https://aamplugin.com/complete-package',
24
  'version' => (defined('AAM_COMPLETE_PACKAGE') ? constant('AAM_COMPLETE_PACKAGE') : null),
25
- 'latest' => '3.8.9'
 
26
  ),
27
  'AAM_PLUS_PACKAGE' => array(
28
  'title' => 'Plus Package',
@@ -31,7 +32,8 @@ class AAM_Extension_List {
31
  'description' => 'Manage access to your WordPress website posts, pages, media, custom post types, categories and hierarchical taxonomies for any role, individual user, visitors or even define default access for everybody; and do this separately for frontend, backend or API levels. As the bonus, define more granular access to how comments can be managed on the backend by other users.',
32
  'url' => 'https://aamplugin.com/extension/plus-package',
33
  'version' => (defined('AAM_PLUS_PACKAGE') ? constant('AAM_PLUS_PACKAGE') : null),
34
- 'latest' => '3.8.3'
 
35
  ),
36
  'AAM_IP_CHECK' => array(
37
  'title' => 'IP Check',
@@ -40,7 +42,8 @@ class AAM_Extension_List {
40
  'description' => 'Manage access to your WordPress website by visitor\'s IP address and referred hosts or completely lockdown the entire website and allow only certain IP ranges.',
41
  'url' => 'https://aamplugin.com/extension/ip-check',
42
  'version' => (defined('AAM_IP_CHECK') ? constant('AAM_IP_CHECK') : null),
43
- 'latest' => '2.0'
 
44
  ),
45
  'AAM_ROLE_HIERARCHY' => array(
46
  'title' => 'Role Hierarchy',
@@ -49,7 +52,8 @@ class AAM_Extension_List {
49
  'description' => 'Define and manage complex WordPress role hierarchy where child role inherits all access settings from its parent with ability to override setting for any specific role.',
50
  'url' => 'https://aamplugin.com/extension/role-hierarchy',
51
  'version' => (defined('AAM_ROLE_HIERARCHY') ? constant('AAM_ROLE_HIERARCHY') : null),
52
- 'latest' => '1.4'
 
53
  ),
54
  'AAM_ECOMMERCE' => array(
55
  'title' => 'E-Commerce',
@@ -59,7 +63,8 @@ class AAM_Extension_List {
59
  'description' => 'Start monetizing access to your premium content. Restrict access to read any WordPress post, page or custom post type until user purchase access to it.',
60
  'url' => 'https://aamplugin.com/extension/ecommerce',
61
  'version' => (defined('AAM_ECOMMERCE') ? constant('AAM_ECOMMERCE') : null),
62
- 'latest' => '1.2.1'
 
63
  ),
64
  'AAM_MULTISITE' => array(
65
  'title' => 'Multisite',
@@ -68,7 +73,8 @@ class AAM_Extension_List {
68
  'license' => 'AAMMULTISITE',
69
  'description' => 'Convenient way to navigate between different sites in the Network Admin Panel. This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/multisite-extension" target="_blank">Github here</a>.',
70
  'version' => (defined('AAM_MULTISITE') ? constant('AAM_MULTISITE') : null),
71
- 'latest' => '2.5.4'
 
72
  ),
73
  'AAM_USER_ACTIVITY' => array(
74
  'title' => 'User Activities',
@@ -77,7 +83,8 @@ class AAM_Extension_List {
77
  'license' => 'AAMUSERACTIVITY',
78
  'description' => 'Track any kind of user or visitor activity on your website. <a href="https://aamplugin.com/help/how-to-track-any-wordpress-user-activity" target="_blank">Read more.</a> This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/user-activity-extension" target="_blank">Github here</a>.',
79
  'version' => (defined('AAM_USER_ACTIVITY') ? constant('AAM_USER_ACTIVITY') : null),
80
- 'latest' => '1.4.1'
 
81
  ),
82
  'AAM_SOCIAL_LOGIN' => array(
83
  'title' => 'Social Login',
@@ -87,7 +94,8 @@ class AAM_Extension_List {
87
  'license' => 'AAMSOCIALLOGIN',
88
  'description' => 'Login to your website with social networks like Facebook, Twitter, Instagram etc. <a href="https://aamplugin.com/help/how-does-aam-social-login-works" target="_blank">Read more.</a> This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/social-login-extension" target="_blank">Github here</a>.',
89
  'version' => (defined('AAM_SOCIAL_LOGIN') ? constant('AAM_SOCIAL_LOGIN') : null),
90
- 'latest' => '0.2.1'
 
91
  ),
92
  );
93
  }
22
  'description' => 'Get the complete list of all premium AAM extensions in one package and all future premium extensions already included for now additional cost.',
23
  'url' => 'https://aamplugin.com/complete-package',
24
  'version' => (defined('AAM_COMPLETE_PACKAGE') ? constant('AAM_COMPLETE_PACKAGE') : null),
25
+ 'latest' => '3.8.10',
26
+ 'requires' => '5.6.1'
27
  ),
28
  'AAM_PLUS_PACKAGE' => array(
29
  'title' => 'Plus Package',
32
  'description' => 'Manage access to your WordPress website posts, pages, media, custom post types, categories and hierarchical taxonomies for any role, individual user, visitors or even define default access for everybody; and do this separately for frontend, backend or API levels. As the bonus, define more granular access to how comments can be managed on the backend by other users.',
33
  'url' => 'https://aamplugin.com/extension/plus-package',
34
  'version' => (defined('AAM_PLUS_PACKAGE') ? constant('AAM_PLUS_PACKAGE') : null),
35
+ 'latest' => '3.8.4',
36
+ 'requires' => '5.6.1'
37
  ),
38
  'AAM_IP_CHECK' => array(
39
  'title' => 'IP Check',
42
  'description' => 'Manage access to your WordPress website by visitor\'s IP address and referred hosts or completely lockdown the entire website and allow only certain IP ranges.',
43
  'url' => 'https://aamplugin.com/extension/ip-check',
44
  'version' => (defined('AAM_IP_CHECK') ? constant('AAM_IP_CHECK') : null),
45
+ 'latest' => '2.0',
46
+ 'requires' => '4.5'
47
  ),
48
  'AAM_ROLE_HIERARCHY' => array(
49
  'title' => 'Role Hierarchy',
52
  'description' => 'Define and manage complex WordPress role hierarchy where child role inherits all access settings from its parent with ability to override setting for any specific role.',
53
  'url' => 'https://aamplugin.com/extension/role-hierarchy',
54
  'version' => (defined('AAM_ROLE_HIERARCHY') ? constant('AAM_ROLE_HIERARCHY') : null),
55
+ 'latest' => '1.4',
56
+ 'requires' => '4.0'
57
  ),
58
  'AAM_ECOMMERCE' => array(
59
  'title' => 'E-Commerce',
63
  'description' => 'Start monetizing access to your premium content. Restrict access to read any WordPress post, page or custom post type until user purchase access to it.',
64
  'url' => 'https://aamplugin.com/extension/ecommerce',
65
  'version' => (defined('AAM_ECOMMERCE') ? constant('AAM_ECOMMERCE') : null),
66
+ 'latest' => '1.2.2',
67
+ 'requires' => '5.6.1'
68
  ),
69
  'AAM_MULTISITE' => array(
70
  'title' => 'Multisite',
73
  'license' => 'AAMMULTISITE',
74
  'description' => 'Convenient way to navigate between different sites in the Network Admin Panel. This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/multisite-extension" target="_blank">Github here</a>.',
75
  'version' => (defined('AAM_MULTISITE') ? constant('AAM_MULTISITE') : null),
76
+ 'latest' => '2.5.4',
77
+ 'requires' => '4.0'
78
  ),
79
  'AAM_USER_ACTIVITY' => array(
80
  'title' => 'User Activities',
83
  'license' => 'AAMUSERACTIVITY',
84
  'description' => 'Track any kind of user or visitor activity on your website. <a href="https://aamplugin.com/help/how-to-track-any-wordpress-user-activity" target="_blank">Read more.</a> This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/user-activity-extension" target="_blank">Github here</a>.',
85
  'version' => (defined('AAM_USER_ACTIVITY') ? constant('AAM_USER_ACTIVITY') : null),
86
+ 'latest' => '1.4.1',
87
+ 'requires' => '4.5'
88
  ),
89
  'AAM_SOCIAL_LOGIN' => array(
90
  'title' => 'Social Login',
94
  'license' => 'AAMSOCIALLOGIN',
95
  'description' => 'Login to your website with social networks like Facebook, Twitter, Instagram etc. <a href="https://aamplugin.com/help/how-does-aam-social-login-works" target="_blank">Read more.</a> This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/social-login-extension" target="_blank">Github here</a>.',
96
  'version' => (defined('AAM_SOCIAL_LOGIN') ? constant('AAM_SOCIAL_LOGIN') : null),
97
+ 'latest' => '0.2.1',
98
+ 'requires' => '4.5'
99
  ),
100
  );
101
  }
Application/Extension/Repository.php CHANGED
@@ -116,13 +116,32 @@ class AAM_Extension_Repository {
116
  $cache = AAM_Core_Compatibility::getLicenseList();
117
  }
118
 
119
- $load = true;
120
  $config = "{$path}/config.php";
121
  $bootstrap = "{$path}/bootstrap.php";
122
 
123
  if (file_exists($config)) {
124
  $conf = require $config;
125
- $load = empty($cache[$conf['id']]['status']) || ($cache[$conf['id']]['status'] !== self::STATUS_INACTIVE);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  } else { // TODO - Remove May 2019
127
  AAM_Core_Console::add(AAM_Backend_View_Helper::preparePhrase(
128
  sprintf(
116
  $cache = AAM_Core_Compatibility::getLicenseList();
117
  }
118
 
119
+ $load = false;
120
  $config = "{$path}/config.php";
121
  $bootstrap = "{$path}/bootstrap.php";
122
 
123
  if (file_exists($config)) {
124
  $conf = require $config;
125
+
126
+ // determin if extension needs to be loaded based on the status
127
+ $status = empty($cache[$conf['id']]['status']) || ($cache[$conf['id']]['status'] !== self::STATUS_INACTIVE);
128
+
129
+ // determin if extension meets minimum required AAM version
130
+ $list = AAM_Extension_List::get();
131
+ $version = (version_compare(AAM_Core_API::version(), $list[$conf['id']]['requires']) >= 0);
132
+ $load = $status && $version;
133
+
134
+ if (!$version) {
135
+ AAM_Core_Console::add(AAM_Backend_View_Helper::preparePhrase(
136
+ sprintf(
137
+ __('[%s] was not loaded. It requires AAM version [%s] or higher.', AAM_KEY),
138
+ $list[$conf['id']]['title'],
139
+ $list[$conf['id']]['requires']
140
+ ),
141
+ 'b',
142
+ 'b'
143
+ ));
144
+ }
145
  } else { // TODO - Remove May 2019
146
  AAM_Core_Console::add(AAM_Backend_View_Helper::preparePhrase(
147
  sprintf(
Application/Shared/Manager.php CHANGED
@@ -87,6 +87,10 @@ class AAM_Shared_Manager {
87
  }
88
  }
89
 
 
 
 
 
90
  // Security. Make sure that we escaping all translation strings
91
  add_filter(
92
  'gettext', array(self::$_instance, 'escapeTranslation'), 999, 3
@@ -375,6 +379,11 @@ class AAM_Shared_Manager {
375
  $capability = (isset($args[0]) && is_string($args[0]) ? $args[0] : '');
376
  $uid = (isset($args[2]) && is_numeric($args[2]) ? $args[2] : 0);
377
 
 
 
 
 
 
378
  switch($capability) {
379
  case 'edit_user':
380
  case 'delete_user':
87
  }
88
  }
89
 
90
+ // Check if user has ability to perform certain task based on provided
91
+ // capability and meta data
92
+ add_filter('user_has_cap', array(self::$_instance, 'userHasCap'), 999, 3);
93
+
94
  // Security. Make sure that we escaping all translation strings
95
  add_filter(
96
  'gettext', array(self::$_instance, 'escapeTranslation'), 999, 3
379
  $capability = (isset($args[0]) && is_string($args[0]) ? $args[0] : '');
380
  $uid = (isset($args[2]) && is_numeric($args[2]) ? $args[2] : 0);
381
 
382
+ // Apply policy first
383
+ if (AAM::api()->isAllowed("Capability:{$capability}") === true) {
384
+ $caps[$capability] = true;
385
+ }
386
+
387
  switch($capability) {
388
  case 'edit_user':
389
  case 'delete_user':
aam.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: All you need to manage access to your WordPress website
6
- Version: 5.6
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
@@ -115,6 +115,17 @@ class AAM {
115
  //load AAM core config
116
  AAM_Core_Config::bootstrap();
117
 
 
 
 
 
 
 
 
 
 
 
 
118
  //load WP Core hooks
119
  AAM_Shared_Manager::bootstrap();
120
 
@@ -138,14 +149,6 @@ class AAM {
138
  * @static
139
  */
140
  public static function onInit() {
141
- // Load AAM
142
- AAM::getInstance();
143
-
144
- //load all installed extension
145
- if (AAM_Core_Config::get('core.settings.extensionSupport', true)) {
146
- AAM_Extension_Repository::getInstance()->load();
147
- }
148
-
149
  //load media control
150
  AAM_Core_Media::bootstrap();
151
 
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: All you need to manage access to your WordPress website
6
+ Version: 5.6.1
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
115
  //load AAM core config
116
  AAM_Core_Config::bootstrap();
117
 
118
+ // Load AAM
119
+ AAM::getInstance();
120
+
121
+ //load all installed extension
122
+ if (AAM_Core_Config::get('core.settings.extensionSupport', true)) {
123
+ AAM_Extension_Repository::getInstance()->load();
124
+ }
125
+
126
+ // Load Access/Security Policies
127
+ self::getUser()->getObject('policy')->load();
128
+
129
  //load WP Core hooks
130
  AAM_Shared_Manager::bootstrap();
131
 
149
  * @static
150
  */
151
  public static function onInit() {
 
 
 
 
 
 
 
 
152
  //load media control
153
  AAM_Core_Media::bootstrap();
154
 
media/css/aam.css CHANGED
@@ -945,6 +945,10 @@ input[type=radio]:checked + label:before {
945
  margin-bottom: 20px !important;
946
  }
947
 
 
 
 
 
948
  .aam-info-modal, .aam-info-modal p, .aam-info-modal ul {
949
  font-size: 1.1em;
950
  -moz-hyphens: auto;
@@ -1057,6 +1061,15 @@ input[type=radio]:checked + label:before {
1057
  color: rgba(220, 220, 220, 0.8);
1058
  }
1059
 
 
 
 
 
 
 
 
 
 
1060
  .aam-current-subject {
1061
  background-color: #337ab7;
1062
  padding: 5px 15px 4px 10px;
@@ -1164,14 +1177,12 @@ input[type=radio]:checked + label:before {
1164
  /* GUTTER */
1165
 
1166
  .CodeMirror-gutters {
1167
- border-right: 1px solid #ddd;
1168
- background-color: #f7f7f7;
1169
  white-space: nowrap;
1170
  }
1171
  .CodeMirror-linenumbers {}
1172
  .CodeMirror-linenumber {
1173
- padding: 0 3px 0 5px;
1174
- min-width: 20px;
1175
  text-align: right;
1176
  color: #999;
1177
  white-space: nowrap;
@@ -1395,6 +1406,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
1395
  -webkit-font-variant-ligatures: contextual;
1396
  font-variant-ligatures: contextual;
1397
  }
 
 
 
1398
  .CodeMirror-wrap pre {
1399
  word-wrap: break-word;
1400
  white-space: pre-wrap;
945
  margin-bottom: 20px !important;
946
  }
947
 
948
+ .aam-outer-top-xxs {
949
+ margin-top: 10px;
950
+ }
951
+
952
  .aam-info-modal, .aam-info-modal p, .aam-info-modal ul {
953
  font-size: 1.1em;
954
  -moz-hyphens: auto;
1061
  color: rgba(220, 220, 220, 0.8);
1062
  }
1063
 
1064
+ .json-editor-blackbord {
1065
+ background: #333333 !important;
1066
+ border-radius: 0;
1067
+ padding: 10px 25px;
1068
+ border: 0;
1069
+ max-height: 60vh;
1070
+ overflow-y: scroll;
1071
+ }
1072
+
1073
  .aam-current-subject {
1074
  background-color: #337ab7;
1075
  padding: 5px 15px 4px 10px;
1177
  /* GUTTER */
1178
 
1179
  .CodeMirror-gutters {
 
 
1180
  white-space: nowrap;
1181
  }
1182
  .CodeMirror-linenumbers {}
1183
  .CodeMirror-linenumber {
1184
+ padding: 0 3px 0 0px;
1185
+ min-width: 15px;
1186
  text-align: right;
1187
  color: #999;
1188
  white-space: nowrap;
1406
  -webkit-font-variant-ligatures: contextual;
1407
  font-variant-ligatures: contextual;
1408
  }
1409
+ #policy-model .CodeMirror pre {
1410
+ padding-left: 20px;
1411
+ }
1412
  .CodeMirror-wrap pre {
1413
  word-wrap: break-word;
1414
  white-space: pre-wrap;
media/js/aam.js CHANGED
@@ -1111,6 +1111,295 @@
1111
  });
1112
 
1113
  })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1114
 
1115
 
1116
  /**
@@ -1565,6 +1854,7 @@
1565
  }
1566
  });
1567
  }
 
1568
  /**
1569
  *
1570
  * @returns {undefined}
@@ -1620,6 +1910,18 @@
1620
  save(data[0], this);
1621
  }));
1622
  break;
 
 
 
 
 
 
 
 
 
 
 
 
1623
 
1624
  case 'edit':
1625
  $(container).append($('<i/>', {
1111
  });
1112
 
1113
  })(jQuery);
1114
+
1115
+ /**
1116
+ * Policy Interface
1117
+ *
1118
+ * @param {jQuery} $
1119
+ *
1120
+ * @returns {void}
1121
+ */
1122
+ (function ($) {
1123
+ var editor = null;
1124
+
1125
+ /**
1126
+ *
1127
+ * @param {type} id
1128
+ * @param {type} effect
1129
+ * @returns {undefined}
1130
+ */
1131
+ function assign(id, btn) {
1132
+ var effect = $(btn).hasClass('icon-check-empty') ? 1 : 0;
1133
+
1134
+ //show indicator
1135
+ $(btn).attr('class', 'aam-row-action icon-spin4 animate-spin');
1136
+
1137
+ getAAM().queueRequest(function() {
1138
+ $.ajax(getLocal().ajaxurl, {
1139
+ type: 'POST',
1140
+ dataType: 'json',
1141
+ data: {
1142
+ action: 'aam',
1143
+ sub_action: 'Main_Policy.save',
1144
+ subject: getAAM().getSubject().type,
1145
+ subjectId: getAAM().getSubject().id,
1146
+ _ajax_nonce: getLocal().nonce,
1147
+ id: id,
1148
+ effect: effect
1149
+ },
1150
+ success: function(response) {
1151
+ if (response.status === 'success') {
1152
+ if (effect) {
1153
+ $(btn).attr('class', 'aam-row-action text-success icon-check');
1154
+ } else {
1155
+ $(btn).attr('class', 'aam-row-action text-muted icon-check-empty');
1156
+ }
1157
+ } else {
1158
+ if (effect) {
1159
+ getAAM().notification(
1160
+ 'danger',
1161
+ getAAM().__('Failed to apply policy changes')
1162
+ );
1163
+ $(btn).attr('class', 'aam-row-action text-muted icon-check-empty');
1164
+ } else {
1165
+ $(btn).attr('class', 'aam-row-action text-success icon-check');
1166
+ }
1167
+ }
1168
+ },
1169
+ error: function () {
1170
+ getAAM().notification(
1171
+ 'danger', getAAM().__('Application Error')
1172
+ );
1173
+ }
1174
+ });
1175
+ });
1176
+ }
1177
+
1178
+ function initialize() {
1179
+ var container = '#policy-content';
1180
+
1181
+ if ($(container).length) {
1182
+ //reset button
1183
+ $('#policy-reset').bind('click', function () {
1184
+ getAAM().reset('policy', $(this));
1185
+ });
1186
+
1187
+ editor = CodeMirror.fromTextArea(
1188
+ document.getElementById("policy-editor"),
1189
+ {
1190
+ mode: "application/json",
1191
+ lineNumbers: true
1192
+ }
1193
+ );
1194
+
1195
+ $('#policy-save-btn').bind('click', function() {
1196
+ var json = editor.getValue();
1197
+
1198
+ $('#policy-parsing-error').addClass('hidden');
1199
+ try {
1200
+ JSON.parse(json);
1201
+
1202
+ getAAM().queueRequest(function() {
1203
+ $.ajax(getLocal().ajaxurl, {
1204
+ type: 'POST',
1205
+ dataType: 'json',
1206
+ data: {
1207
+ action: 'aam',
1208
+ sub_action: 'Main_Policy.savePolicy',
1209
+ subject: getAAM().getSubject().type,
1210
+ subjectId: getAAM().getSubject().id,
1211
+ _ajax_nonce: getLocal().nonce,
1212
+ policy: json,
1213
+ id: $('#policy-save-btn').attr('data-id')
1214
+ },
1215
+ beforeSend: function () {
1216
+ $('#policy-save-btn').text(getAAM().__('Saving...')).attr('disabled', true);
1217
+ },
1218
+ success: function(response) {
1219
+ if (response.status === 'success') {
1220
+ $('#policy-list').DataTable().ajax.reload();
1221
+ $('#policy-model').modal('hide');
1222
+ } else {
1223
+ aam.notification(
1224
+ 'danger', aam.__('Failed to save policy')
1225
+ );
1226
+ }
1227
+ },
1228
+ error: function () {
1229
+ getAAM().notification(
1230
+ 'danger', getAAM().__('Application Error')
1231
+ );
1232
+ },
1233
+ complete: function () {
1234
+ $('#policy-save-btn').text(getAAM().__('Save')).attr('disabled', false);
1235
+ }
1236
+ });
1237
+ });
1238
+ } catch (e) {
1239
+ $('#policy-parsing-error').removeClass('hidden').html(
1240
+ '<b>' + getAAM().__('Syntax Error') + '</b>: ' + e.message.replace('JSON.parse:', '')
1241
+ );
1242
+ }
1243
+ });
1244
+
1245
+ $('#policy-delete-btn').bind('click', function (event) {
1246
+ event.preventDefault();
1247
+
1248
+ $.ajax(aamLocal.ajaxurl, {
1249
+ type: 'POST',
1250
+ dataType: 'json',
1251
+ data: {
1252
+ action: 'aam',
1253
+ sub_action: 'Main_Policy.deletePolicy',
1254
+ _ajax_nonce: aamLocal.nonce,
1255
+ subject: getAAM().getSubject().type,
1256
+ subjectId: getAAM().getSubject().id,
1257
+ id: $('#policy-delete-btn').data('id')
1258
+ },
1259
+ beforeSend: function () {
1260
+ $('#policy-delete-btn').text(aam.__('Deleting...')).attr('disabled', true);
1261
+ },
1262
+ success: function (response) {
1263
+ if (response.status === 'success') {
1264
+ $('#policy-list').DataTable().ajax.reload();
1265
+ } else {
1266
+ getAAM().notification(
1267
+ 'danger',
1268
+ getAAM().__('Failed to delete policy')
1269
+ );
1270
+ }
1271
+ },
1272
+ error: function () {
1273
+ getAAM().notification(
1274
+ 'danger',
1275
+ getAAM().__('Application error')
1276
+ );
1277
+ },
1278
+ complete: function () {
1279
+ $('#policy-delete-model').modal('hide');
1280
+ $('#policy-delete-btn').text(getAAM().__('Delete')).attr('disabled', false);
1281
+ }
1282
+ });
1283
+ });
1284
+
1285
+ $('#policy-list').DataTable({
1286
+ autoWidth: false,
1287
+ ordering: false,
1288
+ dom: 'ftrip',
1289
+ pagingType: 'simple',
1290
+ processing: true,
1291
+ stateSave: true,
1292
+ serverSide: false,
1293
+ ajax: {
1294
+ url: aamLocal.ajaxurl,
1295
+ type: 'POST',
1296
+ dataType: 'json',
1297
+ data: {
1298
+ action: 'aam',
1299
+ sub_action: 'Main_Policy.getTable',
1300
+ _ajax_nonce: aamLocal.nonce,
1301
+ subject: getAAM().getSubject().type,
1302
+ subjectId: getAAM().getSubject().id
1303
+ }
1304
+ },
1305
+ language: {
1306
+ search: '_INPUT_',
1307
+ searchPlaceholder: getAAM().__('Search Policy'),
1308
+ info: getAAM().__('_TOTAL_ Policies'),
1309
+ infoFiltered: ''
1310
+ },
1311
+ columnDefs: [
1312
+ {visible: false, targets: [0,2]}
1313
+ ],
1314
+ initComplete: function () {
1315
+ var create = $('<a/>', {
1316
+ 'href': '#',
1317
+ 'class': 'btn btn-success'
1318
+ }).html('<i class="icon-plus"></i> ' + getAAM().__('Create'))
1319
+ .bind('click', function () {
1320
+ $('#policy-parsing-error').addClass('hidden');
1321
+ $('#policy-save-btn').removeAttr('data-id');
1322
+
1323
+ $('#policy-model').modal('show');
1324
+ setTimeout(function() {
1325
+ editor.setValue('');
1326
+ editor.focus();
1327
+ }, 500);
1328
+ });
1329
+
1330
+ $('.dataTables_filter', '#policy-list_wrapper').append(create);
1331
+ },
1332
+ createdRow: function (row, data) {
1333
+ var actions = data[3].split(',');
1334
+
1335
+ var container = $('<div/>', {'class': 'aam-row-actions'});
1336
+ $.each(actions, function (i, action) {
1337
+ switch (action) {
1338
+ case 'assign':
1339
+ $(container).append($('<i/>', {
1340
+ 'class': 'aam-row-action text-muted icon-check-empty'
1341
+ }).bind('click', function () {
1342
+ assign(data[0], this);
1343
+ }).attr({
1344
+ 'data-toggle': "tooltip",
1345
+ 'title': getAAM().__('Apply Policy')
1346
+ }));
1347
+ break;
1348
+
1349
+ case 'unassign':
1350
+ $(container).append($('<i/>', {
1351
+ 'class': 'aam-row-action text-success icon-check'
1352
+ }).bind('click', function () {
1353
+ assign(data[0], this);
1354
+ }).attr({
1355
+ 'data-toggle': "tooltip",
1356
+ 'title': getAAM().__('Revoke Policy')
1357
+ }));
1358
+ break;
1359
+
1360
+ case 'edit':
1361
+ $(container).append($('<i/>', {
1362
+ 'class': 'aam-row-action icon-pencil text-warning'
1363
+ }).bind('click', function () {
1364
+ $('#policy-save-btn').attr('data-id', data[0]);
1365
+ $('#policy-model').modal('show');
1366
+ setTimeout(function() {
1367
+ editor.setValue(data[2]);
1368
+ editor.focus();
1369
+ }, 500);
1370
+ }).attr({
1371
+ 'data-toggle': "tooltip",
1372
+ 'title': getAAM().__('Edit Policy')
1373
+ }));
1374
+ break;
1375
+
1376
+ case 'delete':
1377
+ $(container).append($('<i/>', {
1378
+ 'class': 'aam-row-action icon-trash-empty text-danger'
1379
+ }).bind('click', function () {
1380
+ $('#policy-delete-btn').attr('data-id', data[0]);
1381
+ $('#policy-delete-model').modal('show');
1382
+ }).attr({
1383
+ 'data-toggle': "tooltip",
1384
+ 'title': getAAM().__('Delete Policy')
1385
+ }));
1386
+ break;
1387
+
1388
+ default:
1389
+ break;
1390
+ }
1391
+ });
1392
+ $('td:eq(1)', row).html(container);
1393
+
1394
+ $('td:eq(0)', row).html(data[1]);
1395
+ }
1396
+ });
1397
+ }
1398
+ }
1399
+
1400
+ getAAM().addHook('init', initialize);
1401
+
1402
+ })(jQuery);
1403
 
1404
 
1405
  /**
1854
  }
1855
  });
1856
  }
1857
+
1858
  /**
1859
  *
1860
  * @returns {undefined}
1910
  save(data[0], this);
1911
  }));
1912
  break;
1913
+
1914
+ case 'no-unchecked':
1915
+ $(container).append($('<i/>', {
1916
+ 'class': 'aam-row-action text-muted icon-check-empty'
1917
+ }));
1918
+ break;
1919
+
1920
+ case 'no-checked':
1921
+ $(container).append($('<i/>', {
1922
+ 'class': 'aam-row-action text-muted icon-check'
1923
+ }));
1924
+ break;
1925
 
1926
  case 'edit':
1927
  $(container).append($('<i/>', {
media/js/vendor.js CHANGED
@@ -560,6 +560,42 @@ za;a.rmClass=Ua;a.keyNames=Ga})(F);F.version="5.34.0";return F});
560
  (function(X){"object"==typeof exports&&"object"==typeof module?X(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],X):X(CodeMirror)})(function(X){X.defineMode("properties",function(){return{token:function(I,D){var u=I.sol()||D.afterSection,U=I.eol();D.afterSection=!1;u&&(D.nextMultiline?(D.inMultiline=!0,D.nextMultiline=!1):D.position="def");U&&!D.nextMultiline&&(D.inMultiline=!1,D.position="def");if(u)for(;I.eatSpace(););U=I.next();if(!u||"#"!==
561
  U&&"!"!==U&&";"!==U){if(u&&"["===U)return D.afterSection=!0,I.skipTo("]"),I.eat("]"),"header";if("="===U||":"===U)return D.position="quote",null;"\\"===U&&"quote"===D.position&&I.eol()&&(D.nextMultiline=!0)}else return D.position="comment",I.skipToEnd(),"comment";return D.position},startState:function(){return{position:"def",nextMultiline:!1,inMultiline:!1,afterSection:!1}}}});X.defineMIME("text/x-properties","properties");X.defineMIME("text/x-ini","properties")});
562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
  // Moment.js
564
  !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 o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=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){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]}return delete st[e],null}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||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:(a[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(l(t)?"millisecond":t))?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(l(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,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){var t=(n=e,s=this.localeData(),"string"==typeof n?s.weekdaysParse(n)%7||7:isNaN(n)?null:n);return this.day(this.day()%7?t:t-7)}return this.day()||7;var n,s},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){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}return this._isUTC?i:Gt(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){"boolean"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t=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.22.2",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:"YYYY-[W]WW",MONTH:"YYYY-MM"},c});
565
 
560
  (function(X){"object"==typeof exports&&"object"==typeof module?X(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],X):X(CodeMirror)})(function(X){X.defineMode("properties",function(){return{token:function(I,D){var u=I.sol()||D.afterSection,U=I.eol();D.afterSection=!1;u&&(D.nextMultiline?(D.inMultiline=!0,D.nextMultiline=!1):D.position="def");U&&!D.nextMultiline&&(D.inMultiline=!1,D.position="def");if(u)for(;I.eatSpace(););U=I.next();if(!u||"#"!==
561
  U&&"!"!==U&&";"!==U){if(u&&"["===U)return D.afterSection=!0,I.skipTo("]"),I.eat("]"),"header";if("="===U||":"===U)return D.position="quote",null;"\\"===U&&"quote"===D.position&&I.eol()&&(D.nextMultiline=!0)}else return D.position="comment",I.skipToEnd(),"comment";return D.position},startState:function(){return{position:"def",nextMultiline:!1,inMultiline:!1,afterSection:!1}}}});X.defineMIME("text/x-properties","properties");X.defineMIME("text/x-ini","properties")});
562
 
563
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
564
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
565
+ (function(q){"object"==typeof exports&&"object"==typeof module?q(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],q):q(CodeMirror)})(function(q){q.defineMode("javascript",function(Ga,w){function p(a,c,b){L=a;S=b;return c}function A(a,c){var b=a.next();if('"'==b||"'"==b)return c.tokenize=Ha(b),c.tokenize(a,c);if("."==b&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return p("number","number");if("."==b&&a.match(".."))return p("spread","meta");if(/[\[\]{}\(\),;:\.]/.test(b))return p(b);
566
+ if("="==b&&a.eat(">"))return p("=>","operator");if("0"==b&&a.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return p("number","number");if(/\d/.test(b))return a.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),p("number","number");if("/"==b){if(a.eat("*"))return c.tokenize=T,T(a,c);if(a.eat("/"))return a.skipToEnd(),p("comment","comment");if(na(a,c,1)){a:{b=!1;for(var e,d=!1;null!=(e=a.next());){if(!b){if("/"==e&&!d)break a;"["==e?d=!0:d&&"]"==e&&(d=!1)}b=!b&&"\\"==e}}a.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);
567
+ return p("regexp","string-2")}a.eat("=");return p("operator","operator",a.current())}if("`"==b)return c.tokenize=da,da(a,c);if("#"==b)return a.skipToEnd(),p("error","error");if(oa.test(b))return">"==b&&c.lexical&&">"==c.lexical.type||(a.eat("=")?"!"!=b&&"="!=b||a.eat("="):/[<>*+\-]/.test(b)&&(a.eat(b),">"==b&&a.eat(b))),p("operator","operator",a.current());if(ea.test(b)){a.eatWhile(ea);b=a.current();if("."!=c.lastType){if(pa.propertyIsEnumerable(b))return e=pa[b],p(e.type,e.style,b);if("async"==b&&
568
+ a.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return p("async","keyword",b)}return p("variable","variable",b)}}function Ha(a){return function(c,b){var e=!1,d;if(U&&"@"==c.peek()&&c.match(Ia))return b.tokenize=A,p("jsonld-keyword","meta");for(;null!=(d=c.next())&&(d!=a||e);)e=!e&&"\\"==d;e||(b.tokenize=A);return p("string","string")}}function T(a,c){for(var b=!1,e;e=a.next();){if("/"==e&&b){c.tokenize=A;break}b="*"==e}return p("comment","comment")}function da(a,c){for(var b=!1,e;null!=(e=a.next());){if(!b&&
569
+ ("`"==e||"$"==e&&a.eat("{"))){c.tokenize=A;break}b=!b&&"\\"==e}return p("quasi","string-2",a.current())}function fa(a,c){c.fatArrowAt&&(c.fatArrowAt=null);var b=a.string.indexOf("=>",a.start);if(!(0>b)){if(m){var e=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(a.string.slice(a.start,b));e&&(b=e.index)}e=0;var d=!1;for(--b;0<=b;--b){var g=a.string.charAt(b),f="([{}])".indexOf(g);if(0<=f&&3>f){if(!e){++b;break}if(0==--e){"("==g&&(d=!0);break}}else if(3<=f&&6>f)++e;else if(ea.test(g))d=!0;else{if(/["'\/]/.test(g))return;
570
+ if(d&&!e){++b;break}}}d&&!e&&(c.fatArrowAt=b)}}function qa(a,c,b,e,d,g){this.indented=a;this.column=c;this.type=b;this.prev=d;this.info=g;null!=e&&(this.align=e)}function h(){for(var a=arguments.length-1;0<=a;a--)d.cc.push(arguments[a])}function b(){h.apply(null,arguments);return!0}function ha(a,c){for(var b=c;b;b=b.next)if(b.name==a)return!0;return!1}function M(a){var c=d.state;d.marked="def";if(c.context)if("var"==c.lexical.info&&c.context&&c.context.block){var b=ra(a,c.context);if(null!=b){c.context=
571
+ b;return}}else if(!ha(a,c.localVars)){c.localVars=new N(a,c.localVars);return}w.globalVars&&!ha(a,c.globalVars)&&(c.globalVars=new N(a,c.globalVars))}function ra(a,c){if(c){if(c.block){var b=ra(a,c.prev);return b?b==c.prev?c:new O(b,c.vars,!0):null}return ha(a,c.vars)?c:new O(c.prev,new N(a,c.vars),!1)}return null}function V(a){return"public"==a||"private"==a||"protected"==a||"abstract"==a||"readonly"==a}function O(a,c,b){this.prev=a;this.vars=c;this.block=b}function N(a,c){this.name=a;this.next=
572
+ c}function P(){d.state.context=new O(d.state.context,d.state.localVars,!1);d.state.localVars=Ja}function sa(){d.state.context=new O(d.state.context,d.state.localVars,!0);d.state.localVars=null}function z(){d.state.localVars=d.state.context.vars;d.state.context=d.state.context.prev}function f(a,c){var b=function(){var b=d.state,g=b.indented;if("stat"==b.lexical.type)g=b.lexical.indented;else for(var f=b.lexical;f&&")"==f.type&&f.align;f=f.prev)g=f.indented;b.lexical=new qa(g,d.stream.column(),a,null,
573
+ b.lexical,c)};b.lex=!0;return b}function g(){var a=d.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function l(a){function c(d){return d==a?b():";"==a||"}"==d||")"==d||"]"==d?h():b(c)}return c}function r(a,c){return"var"==a?b(f("vardef",c),ia,l(";"),g):"keyword a"==a?b(f("form"),ja,r,g):"keyword b"==a?b(f("form"),r,g):"keyword d"==a?d.stream.match(/^\s*$/,!1)?b():b(f("stat"),ka,l(";"),g):"debugger"==a?b(l(";")):"{"==a?b(f("}"),sa,Q,g,z):";"==
574
+ a?b():"if"==a?("else"==d.state.lexical.info&&d.state.cc[d.state.cc.length-1]==g&&d.state.cc.pop()(),b(f("form"),ja,r,g,ta)):"function"==a?b(y):"for"==a?b(f("form"),ua,r,g):"class"==a||m&&"interface"==c?(d.marked="keyword",b(f("form"),va,g)):"variable"==a?m&&"declare"==c?(d.marked="keyword",b(r)):m&&("module"==c||"enum"==c||"type"==c)&&d.stream.match(/^\s*\w/,!1)?(d.marked="keyword","enum"==c?b(wa):"type"==c?b(n,l("operator"),n,l(";")):b(f("form"),x,l("{"),f("}"),Q,g,g)):m&&"namespace"==c?(d.marked=
575
+ "keyword",b(f("form"),k,Q,g)):m&&"abstract"==c?(d.marked="keyword",b(r)):b(f("stat"),Ka):"switch"==a?b(f("form"),ja,l("{"),f("}","switch"),sa,Q,g,g,z):"case"==a?b(k,l(":")):"default"==a?b(l(":")):"catch"==a?b(f("form"),P,La,r,g,z):"export"==a?b(f("stat"),Ma,g):"import"==a?b(f("stat"),Na,g):"async"==a?b(r):"@"==c?b(k,r):h(f("stat"),k,l(";"),g)}function La(a){if("("==a)return b(H,l(")"))}function k(a,b){return xa(a,b,!1)}function u(a,b){return xa(a,b,!0)}function ja(a){return"("!=a?h():b(f(")"),k,l(")"),
576
+ g)}function xa(a,c,v){if(d.state.fatArrowAt==d.stream.start){var e=v?ya:za;if("("==a)return b(P,f(")"),t(H,")"),g,l("=>"),e,z);if("variable"==a)return h(P,x,l("=>"),e,z)}e=v?I:B;return Oa.hasOwnProperty(a)?b(e):"function"==a?b(y,e):"class"==a||m&&"interface"==c?(d.marked="keyword",b(f("form"),Pa,g)):"keyword c"==a||"async"==a?b(v?u:k):"("==a?b(f(")"),ka,l(")"),g,e):"operator"==a||"spread"==a?b(v?u:k):"["==a?b(f("]"),Qa,g,e):"{"==a?R(W,"}",null,e):"quasi"==a?h(X,e):"new"==a?b(Ra(v)):"import"==a?b(k):
577
+ b()}function ka(a){return a.match(/[;\}\)\],]/)?h():h(k)}function B(a,c){return","==a?b(k):I(a,c,!1)}function I(a,c,v){var e=0==v?B:I,ca=0==v?k:u;if("=>"==a)return b(P,v?ya:za,z);if("operator"==a)return/\+\+|--/.test(c)||m&&"!"==c?b(e):m&&"<"==c&&d.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?b(f(">"),t(n,">"),g,e):"?"==c?b(k,l(":"),ca):b(ca);if("quasi"==a)return h(X,e);if(";"!=a){if("("==a)return R(u,")","call",e);if("."==a)return b(Sa,e);if("["==a)return b(f("]"),ka,l("]"),g,e);if(m&&"as"==c)return d.marked=
578
+ "keyword",b(n,e);if("regexp"==a)return d.state.lastType=d.marked="operator",d.stream.backUp(d.stream.pos-d.stream.start-1),b(ca)}}function X(a,c){return"quasi"!=a?h():"${"!=c.slice(c.length-2)?b(X):b(k,Ta)}function Ta(a){if("}"==a)return d.marked="string-2",d.state.tokenize=da,b(X)}function za(a){fa(d.stream,d.state);return h("{"==a?r:k)}function ya(a){fa(d.stream,d.state);return h("{"==a?r:u)}function Ra(a){return function(c){return"."==c?b(a?Ua:Va):"variable"==c&&m?b(Wa,a?I:B):h(a?u:k)}}function Va(a,
579
+ c){if("target"==c)return d.marked="keyword",b(B)}function Ua(a,c){if("target"==c)return d.marked="keyword",b(I)}function Ka(a){return":"==a?b(g,r):h(B,l(";"),g)}function Sa(a){if("variable"==a)return d.marked="property",b()}function W(a,c){if("async"==a)return d.marked="property",b(W);if("variable"==a||"keyword"==d.style){d.marked="property";if("get"==c||"set"==c)return b(Xa);var g;m&&d.state.fatArrowAt==d.stream.start&&(g=d.stream.match(/^\s*:\s*/,!1))&&(d.state.fatArrowAt=d.stream.pos+g[0].length);
580
+ return b(C)}if("number"==a||"string"==a)return d.marked=U?"property":d.style+" property",b(C);if("jsonld-keyword"==a)return b(C);if(m&&V(c))return d.marked="keyword",b(W);if("["==a)return b(k,J,l("]"),C);if("spread"==a)return b(u,C);if("*"==c)return d.marked="keyword",b(W);if(":"==a)return h(C)}function Xa(a){if("variable"!=a)return h(C);d.marked="property";return b(y)}function C(a){if(":"==a)return b(u);if("("==a)return h(y)}function t(a,c,g){function e(f,k){if(g?-1<g.indexOf(f):","==f){var v=d.state.lexical;
581
+ "call"==v.info&&(v.pos=(v.pos||0)+1);return b(function(b,d){return b==c||d==c?h():h(a)},e)}return f==c||k==c?b():b(l(c))}return function(d,g){return d==c||g==c?b():h(a,e)}}function R(a,c,h){for(var e=3;e<arguments.length;e++)d.cc.push(arguments[e]);return b(f(c,h),t(a,c),g)}function Q(a){return"}"==a?b():h(r,Q)}function J(a,c){if(m){if(":"==a)return b(n);if("?"==c)return b(J)}}function Ya(a){if(m&&":"==a)return d.stream.match(/^\s*\w+\s+is\b/,!1)?b(k,Za,n):b(n)}function Za(a,c){if("is"==c)return d.marked=
582
+ "keyword",b()}function n(a,c){if("keyof"==c||"typeof"==c)return d.marked="keyword",b("keyof"==c?n:u);if("variable"==a||"void"==c)return d.marked="type",b(D);if("string"==a||"number"==a||"atom"==a)return b(D);if("["==a)return b(f("]"),t(n,"]",","),g,D);if("{"==a)return b(f("}"),t(Y,"}",",;"),g,D);if("("==a)return b(t(Aa,")"),$a);if("<"==a)return b(t(n,">"),n)}function $a(a){if("=>"==a)return b(n)}function Y(a,c){if("variable"==a||"keyword"==d.style)return d.marked="property",b(Y);if("?"==c)return b(Y);
583
+ if(":"==a)return b(n);if("["==a)return b(k,J,l("]"),Y)}function Aa(a,c){return"variable"==a&&d.stream.match(/^\s*[?:]/,!1)||"?"==c?b(Aa):":"==a?b(n):h(n)}function D(a,c){if("<"==c)return b(f(">"),t(n,">"),g,D);if("|"==c||"."==a||"&"==c)return b(n);if("["==a)return b(l("]"),D);if("extends"==c||"implements"==c)return d.marked="keyword",b(n)}function Wa(a,c){if("<"==c)return b(f(">"),t(n,">"),g,D)}function Ba(){return h(n,ab)}function ab(a,c){if("="==c)return b(n)}function ia(a,c){return"enum"==c?(d.marked=
584
+ "keyword",b(wa)):h(x,J,E,bb)}function x(a,c){if(m&&V(c))return d.marked="keyword",b(x);if("variable"==a)return M(c),b();if("spread"==a)return b(x);if("["==a)return R(cb,"]");if("{"==a)return R(db,"}")}function db(a,c){if("variable"==a&&!d.stream.match(/^\s*:/,!1))return M(c),b(E);"variable"==a&&(d.marked="property");return"spread"==a?b(x):"}"==a?h():b(l(":"),x,E)}function cb(){return h(x,E)}function E(a,c){if("="==c)return b(u)}function bb(a){if(","==a)return b(ia)}function ta(a,c){if("keyword b"==
585
+ a&&"else"==c)return b(f("form","else"),r,g)}function ua(a,c){if("await"==c)return b(ua);if("("==a)return b(f(")"),eb,l(")"),g)}function eb(a){return"var"==a?b(ia,l(";"),Z):";"==a?b(Z):"variable"==a?b(fb):h(k,l(";"),Z)}function fb(a,c){return"in"==c||"of"==c?(d.marked="keyword",b(k)):b(B,Z)}function Z(a,c){return";"==a?b(Ca):"in"==c||"of"==c?(d.marked="keyword",b(k)):h(k,l(";"),Ca)}function Ca(a){")"!=a&&b(k)}function y(a,c){if("*"==c)return d.marked="keyword",b(y);if("variable"==a)return M(c),b(y);
586
+ if("("==a)return b(P,f(")"),t(H,")"),g,Ya,r,z);if(m&&"<"==c)return b(f(">"),t(Ba,">"),g,y)}function H(a,c){"@"==c&&b(k,H);return"spread"==a?b(H):m&&V(c)?(d.marked="keyword",b(H)):h(x,J,E)}function Pa(a,b){return"variable"==a?va(a,b):aa(a,b)}function va(a,c){if("variable"==a)return M(c),b(aa)}function aa(a,c){if("<"==c)return b(f(">"),t(Ba,">"),g,aa);if("extends"==c||"implements"==c||m&&","==a)return"implements"==c&&(d.marked="keyword"),b(m?n:k,aa);if("{"==a)return b(f("}"),F,g)}function F(a,c){if("async"==
587
+ a||"variable"==a&&("static"==c||"get"==c||"set"==c||m&&V(c))&&d.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return d.marked="keyword",b(F);if("variable"==a||"keyword"==d.style)return d.marked="property",b(m?la:y,F);if("["==a)return b(k,J,l("]"),m?la:y,F);if("*"==c)return d.marked="keyword",b(F);if(";"==a)return b(F);if("}"==a)return b();if("@"==c)return b(k,F)}function la(a,c){return"?"==c?b(la):":"==a?b(n,E):"="==c?b(u):h(y)}function Ma(a,c){return"*"==c?(d.marked="keyword",b(ma,l(";"))):"default"==
588
+ c?(d.marked="keyword",b(k,l(";"))):"{"==a?b(t(Da,"}"),ma,l(";")):h(r)}function Da(a,c){if("as"==c)return d.marked="keyword",b(l("variable"));if("variable"==a)return h(u,Da)}function Na(a){return"string"==a?b():"("==a?h(k):h(ba,Ea,ma)}function ba(a,c){if("{"==a)return R(ba,"}");"variable"==a&&M(c);"*"==c&&(d.marked="keyword");return b(gb)}function Ea(a){if(","==a)return b(ba,Ea)}function gb(a,c){if("as"==c)return d.marked="keyword",b(ba)}function ma(a,c){if("from"==c)return d.marked="keyword",b(k)}
589
+ function Qa(a){return"]"==a?b():h(t(u,"]"))}function wa(){return h(f("form"),x,l("{"),f("}"),t(hb,"}"),g,g)}function hb(){return h(x,E)}function na(a,b,d){return b.tokenize==A&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(b.lastType)||"quasi"==b.lastType&&/\{\s*$/.test(a.string.slice(0,a.pos-(d||0)))}var K=Ga.indentUnit,Fa=w.statementIndent,U=w.jsonld,G=w.json||U,m=w.typescript,ea=w.wordCharacters||/[\w$\xa1-\uffff]/,pa=function(){function a(a){return{type:a,
590
+ style:"keyword"}}var b=a("keyword a"),d=a("keyword b"),e=a("keyword c"),g=a("keyword d"),f=a("operator"),h={type:"atom",style:"atom"};return{"if":a("if"),"while":b,"with":b,"else":d,"do":d,"try":d,"finally":d,"return":g,"break":g,"continue":g,"new":a("new"),"delete":e,"void":e,"throw":e,"debugger":a("debugger"),"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":f,"typeof":f,"instanceof":f,
591
+ "true":h,"false":h,"null":h,undefined:h,NaN:h,Infinity:h,"this":a("this"),"class":a("class"),"super":a("atom"),yield:e,"export":a("export"),"import":a("import"),"extends":e,await:e}}(),oa=/[+\-*&%=<>!?|~^@]/,Ia=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,L,S,Oa={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},d={state:null,column:null,marked:null,cc:null},Ja=new N("this",new N("arguments",null));z.lex=!0;g.lex=!0;return{startState:function(a){a=
592
+ {tokenize:A,lastType:"sof",cc:[],lexical:new qa((a||0)-K,0,"block",!1),localVars:w.localVars,context:w.localVars&&new O(null,null,!1),indented:a||0};w.globalVars&&"object"==typeof w.globalVars&&(a.globalVars=w.globalVars);return a},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),fa(a,b));if(b.tokenize!=T&&a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"==L)return c;b.lastType="operator"!=L||"++"!=S&&"--"!=S?L:"incdec";a:{var e=
593
+ L,g=S,f=b.cc;d.state=b;d.stream=a;d.marked=null;d.cc=f;d.style=c;b.lexical.hasOwnProperty("align")||(b.lexical.align=!0);for(;;)if((f.length?f.pop():G?k:r)(e,g)){for(;f.length&&f[f.length-1].lex;)f.pop()();if(d.marked){c=d.marked;break a}if(e="variable"==e)b:{for(e=b.localVars;e;e=e.next)if(e.name==g){e=!0;break b}for(f=b.context;f;f=f.prev)for(e=f.vars;e;e=e.next)if(e.name==g){e=!0;break b}e=void 0}if(e){c="variable-2";break a}break a}}return c},indent:function(a,b){if(a.tokenize==T)return q.Pass;
594
+ if(a.tokenize!=A)return 0;var c=b&&b.charAt(0),d=a.lexical,f;if(!/^\s*else\b/.test(b))for(var h=a.cc.length-1;0<=h;--h){var k=a.cc[h];if(k==g)d=d.prev;else if(k!=ta)break}for(;!("stat"!=d.type&&"form"!=d.type||"}"!=c&&(!(f=a.cc[a.cc.length-1])||f!=B&&f!=I||/^[,\.=+\-*:?[\(]/.test(b)));)d=d.prev;Fa&&")"==d.type&&"stat"==d.prev.type&&(d=d.prev);f=d.type;h=c==f;return"vardef"==f?d.indented+("operator"==a.lastType||","==a.lastType?d.info.length+1:0):"form"==f&&"{"==c?d.indented:"form"==f?d.indented+K:
595
+ "stat"==f?(c=d.indented,d="operator"==a.lastType||","==a.lastType||oa.test(b.charAt(0))||/[,.]/.test(b.charAt(0)),c+(d?Fa||K:0)):"switch"!=d.info||h||0==w.doubleIndentSwitch?d.align?d.column+(h?0:1):d.indented+(h?0:K):d.indented+(/^(?:case|default)\b/.test(b)?K:2*K)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:G?null:"/*",blockCommentEnd:G?null:"*/",blockCommentContinue:G?null:" * ",lineComment:G?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:G?"json":"javascript",
596
+ jsonldMode:U,jsonMode:G,expressionAllowed:na,skipExpression:function(a){var b=a.cc[a.cc.length-1];b!=k&&b!=u||a.cc.pop()}}});q.registerHelper("wordChars","javascript",/[\w$]/);q.defineMIME("text/javascript","javascript");q.defineMIME("text/ecmascript","javascript");q.defineMIME("application/javascript","javascript");q.defineMIME("application/x-javascript","javascript");q.defineMIME("application/ecmascript","javascript");q.defineMIME("application/json",{name:"javascript",json:!0});q.defineMIME("application/x-json",
597
+ {name:"javascript",json:!0});q.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});q.defineMIME("text/typescript",{name:"javascript",typescript:!0});q.defineMIME("application/typescript",{name:"javascript",typescript:!0})});
598
+
599
  // Moment.js
600
  !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 o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=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){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]}return delete st[e],null}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||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:(a[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(l(t)?"millisecond":t))?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(l(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,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){var t=(n=e,s=this.localeData(),"string"==typeof n?s.weekdaysParse(n)%7||7:isNaN(n)?null:n);return this.day(this.day()%7?t:t-7)}return this.day()||7;var n,s},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){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}return this._isUTC?i:Gt(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){"boolean"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t=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.22.2",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:"YYYY-[W]WW",MONTH:"YYYY-MM"},c});
601
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vasyltech,noelalvarez
3
  Tags: access control, membership, backend menu, user role, restricted content
4
  Requires at least: 4.0
5
  Tested up to: 4.9.7
6
- Stable tag: 5.6
7
 
8
  All you need to manage access to you WordPress websites on frontend, backend and API levels for any role, user or visitors.
9
 
@@ -22,7 +22,6 @@ https://www.youtube.com/watch?v=mj5Xa_Wc16Y
22
  * No ads or other promotional crap. The UI is clean and well crafted so you can focus only on what matters;
23
  * No need to be a "paid" customer to get help. Request support via email or start chat with Google Hangout;
24
  * Some features are limited or available only with [premium extensions](https://aamplugin.com/store). AAM functionality is transparent and you will absolute know when you need to get a premium extension;
25
- * There are some bad reviews however most of them where posted years ago and are unrelated to current AAM version; or were posted by users that did not bother reading the bullet-point above.
26
 
27
  = Main Areas Of Focus =
28
 
@@ -77,6 +76,11 @@ https://www.youtube.com/watch?v=mj5Xa_Wc16Y
77
 
78
  == Changelog ==
79
 
 
 
 
 
 
80
  = 5.6 =
81
  * Fixed the bug with encoding on Safari when gzip is enabled
82
  * Fixed the bug with double caching
3
  Tags: access control, membership, backend menu, user role, restricted content
4
  Requires at least: 4.0
5
  Tested up to: 4.9.7
6
+ Stable tag: 5.6.1
7
 
8
  All you need to manage access to you WordPress websites on frontend, backend and API levels for any role, user or visitors.
9
 
22
  * No ads or other promotional crap. The UI is clean and well crafted so you can focus only on what matters;
23
  * No need to be a "paid" customer to get help. Request support via email or start chat with Google Hangout;
24
  * Some features are limited or available only with [premium extensions](https://aamplugin.com/store). AAM functionality is transparent and you will absolute know when you need to get a premium extension;
 
25
 
26
  = Main Areas Of Focus =
27
 
76
 
77
  == Changelog ==
78
 
79
+ = 5.6.1 =
80
+ * Fixed the bug with caching
81
+ * Fixed the bug with the way post type and taxonomies are registered with extensions
82
+ * Turned on by default the ability to edit and delete capabilities
83
+
84
  = 5.6 =
85
  * Fixed the bug with encoding on Safari when gzip is enabled
86
  * Fixed the bug with double caching