diff --git a/wp-admin/about.php b/wp-admin/about.php index 68fa12422f..13269ad58f 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -19,15 +19,27 @@
-
- +
+ + ' ); ?>" /> + <?php _e( 'Code is Poetry' ); ?>' ); ?>" /> +
-
-

- - -

+
+
+

+ + +

+
+ +
+ +
+
+ <?php _e( 'New' ); ?>' ); ?>" /> +
-
-

+
+

-
- -
-
-

-

- Version %1$s addressed %2$s bug.', - 'Version %1$s addressed %2$s bugs.', - 1 - ), - '5.5.3', - number_format_i18n( 1 ) - ); - ?> - the release notes.' ), - sprintf( - /* translators: %s: WordPress version. */ - esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ), - sanitize_title( '5.5.3' ) - ) - ); - ?> -

-

- Version %1$s addressed some security issues and fixed %2$s bug.', - 'Version %1$s addressed some security issues and fixed %2$s bugs.', - 14 - ), - '5.5.2', - number_format_i18n( 14 ) - ); - ?> - the release notes.' ), - sprintf( - /* translators: %s: WordPress version */ - esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ), - sanitize_title( '5.5.2' ) - ) - ); - ?> -

-

- Version %1$s addressed %2$s bug.', - 'Version %1$s addressed %2$s bugs.', - 44 - ), - '5.5.1', - number_format_i18n( 44 ) - ); - ?> - the release notes.' ), - sprintf( - /* translators: %s: WordPress version. */ - esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ), - sanitize_title( '5.5.1' ) - ) - ); - ?> -

+
' ); ?>');"> +
+
+

+

+
+
+
+
+
+

+

+
+
+
+
+

+

+
-
+
-
-

-

-

-

-

-
+

+

+ +

-
-
-

-

-

-

-

+
+ +
+
+

-
-
-

-

-

-

-

-

+
+
+

+ WordPress accessibility-ready guidelines and addresses several more specialized standards from the Web Content Accessibility Guidelines (WCAG) 2.1 at level AAA. It will help you meet the highest level of international accessibility standards when you create accessible content and choose plugins which are accessible too!' ), + 'https://make.wordpress.org/themes/handbook/review/accessibility/', + 'https://www.w3.org/WAI/WCAG2AAA-Conformance' + ); + ?> +

-
-
- -
-
+
+ ' ); ?>" style="max-width:25em" alt="" />

-
+
+
+

+
-

-

+

+

-
-
-
- -
-
-
-
- -
-
-
-
-

-

-

-

-

- -

-

-

-

+
+
+

+
-
-
-

-

-

-

+
+
+

+
+
+ +
+
+

+

+
+
+

+

+ feature plugin includes template copy for you to update and publish, and it’s written to support different contexts and jurisdictions.' ), + 'https://github.com/10degrees/accessibility-statement-plugin' + ); + ?> +

+
+
+

+


-
-
-

-

-
+
+

-

-

+

+

-

-

+

+

+ read the PHP 8 developer note.' ), + 'https://make.wordpress.org/core/2020/11/23/wordpress-and-php-8-0/' + ); + ?> +

- -
+
-

+

wp_get_environment_type()' + /* translators: %s: jQuery update test plugin link. */ + __( 'Updates to jQuery in WordPress take place across three releases: 5.5, 5.6, and 5.7. As we reach the mid-point of this process, run the update test plugin to check your sites for errors ahead of time.' ), + current_user_can( 'install_plugins' ) ? + esc_url( network_admin_url( 'plugin-install.php?tab=search&type=term&s=slug:wp-jquery-update-test' ) ) : + esc_url( __( 'https://wordpress.org/plugins/wp-jquery-update-test/' ) ) ); ?>

-
-
-

get_header()', - 'get_template_part()', - '$args' + /* translators: %s: jQuery Migrate plugin link. */ + __( 'If you find issues with the way your site looks (e.g. a slider doesn’t work, a button is stuck — that sort of thing), install the jQuery Migrate plugin.' ), + current_user_can( 'install_plugins' ) ? + esc_url( network_admin_url( 'plugin-install.php?tab=search&type=term&s=slug:enable-jquery-migrate-helper' ) ) : + esc_url( __( 'https://wordpress.org/plugins/enable-jquery-migrate-helper/' ) ) ); ?>

-
-
-

-
    -
  • -
  • - redirect_guess_404_permalink()' - ); - ?> -
  • -
  • - wp_opcache_invalidate()' - ); - ?> -
  • -
  • -
  • - register_taxonomy()' - ); - ?> -
  • -
  • - register_meta()' - ); - ?> -
  • -
  • -
-
-
-
@@ -339,9 +239,9 @@

WordPress 5.5 Field Guide.' ), - 'https://make.wordpress.org/core/wordpress-5-5-field-guide/' + /* translators: %s: WordPress 5.6 Field Guide link. */ + __( 'Check out the latest version of the WordPress Field Guide. It highlights developer notes for each change you may want to be aware of. WordPress 5.6 Field Guide.' ), + 'https://make.wordpress.org/core/2020/11/20/wordpress-5-6-field-guide/' ); ?>

@@ -353,7 +253,7 @@
- + | diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 28caf3d227..144facf7fe 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -143,7 +143,15 @@ ); // Deprecated. -$core_actions_post_deprecated = array( 'wp-fullscreen-save-post', 'press-this-save-post', 'press-this-add-category' ); +$core_actions_post_deprecated = array( + 'wp-fullscreen-save-post', + 'press-this-save-post', + 'press-this-add-category', + 'health-check-dotorg-communication', + 'health-check-is-in-debug-mode', + 'health-check-background-updates', + 'health-check-loopback-requests', +); $core_actions_post = array_merge( $core_actions_post, $core_actions_post_deprecated ); // Register core Ajax calls. diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 4b5b67efb3..cd068f1f9b 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -170,7 +170,7 @@ $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; } -$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( get_bloginfo( 'version' ) ) ); +$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', (float) get_bloginfo( 'version' ) ); $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) ); $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php index 39f28a6237..d1c9b6e1b2 100644 --- a/wp-admin/async-upload.php +++ b/wp-admin/async-upload.php @@ -39,8 +39,8 @@ } // Just fetch the detail form for that attachment. -if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) && $_REQUEST['fetch'] ) { - $id = intval( $_REQUEST['attachment_id'] ); +if ( isset( $_REQUEST['attachment_id'] ) && (int) $_REQUEST['attachment_id'] && $_REQUEST['fetch'] ) { + $id = (int) $_REQUEST['attachment_id']; $post = get_post( $id ); if ( 'attachment' !== $post->post_type ) { wp_die( __( 'Invalid post type.' ) ); diff --git a/wp-admin/authorize-application.php b/wp-admin/authorize-application.php new file mode 100644 index 0000000000..fa8d919747 --- /dev/null +++ b/wp-admin/authorize-application.php @@ -0,0 +1,308 @@ + $app_name, + 'app_id' => $app_id, + ) + ); + + if ( is_wp_error( $created ) ) { + $error = $created; + } else { + list( $new_password ) = $created; + + if ( $success_url ) { + $redirect = add_query_arg( + array( + 'site_url' => urlencode( site_url() ), + 'user_login' => urlencode( wp_get_current_user()->user_login ), + 'password' => urlencode( $new_password ), + ), + $success_url + ); + } + } + } + + if ( $redirect ) { + // Explicitly not using wp_safe_redirect b/c sends to arbitrary domain. + wp_redirect( $redirect ); + exit; + } +} + +$title = __( 'Authorize Application' ); + +$app_name = ! empty( $_REQUEST['app_name'] ) ? $_REQUEST['app_name'] : ''; +$app_id = ! empty( $_REQUEST['app_id'] ) ? $_REQUEST['app_id'] : ''; +$success_url = ! empty( $_REQUEST['success_url'] ) ? $_REQUEST['success_url'] : null; + +if ( ! empty( $_REQUEST['reject_url'] ) ) { + $reject_url = $_REQUEST['reject_url']; +} elseif ( $success_url ) { + $reject_url = add_query_arg( 'success', 'false', $success_url ); +} else { + $reject_url = null; +} + +$user = wp_get_current_user(); + +$request = compact( 'app_name', 'app_id', 'success_url', 'reject_url' ); +$is_valid = wp_is_authorize_application_password_request_valid( $request, $user ); + +if ( is_wp_error( $is_valid ) ) { + wp_die( + __( 'The Authorize Application request is not allowed.' ) . ' ' . implode( ' ', $is_valid->get_error_messages() ), + __( 'Cannot Authorize Application' ) + ); +} + +if ( ! empty( $_SERVER['PHP_AUTH_USER'] ) || ! empty( $_SERVER['PHP_AUTH_PW'] ) ) { + wp_die( + __( 'Your website appears to use Basic Authentication, which is not currently compatible with Application Passwords.' ), + __( 'Cannot Authorize Application' ), + array( + 'response' => 501, + 'link_text' => __( 'Go Back' ), + 'link_url' => $reject_url ? add_query_arg( 'error', 'disabled', $reject_url ) : admin_url(), + ) + ); +} + +if ( ! wp_is_application_passwords_available_for_user( $user ) ) { + if ( wp_is_application_passwords_available() ) { + $message = __( 'Application passwords are not available for your account. Please contact the site administrator for assistance.' ); + } else { + $message = __( 'Application passwords are not available.' ); + } + + wp_die( + $message, + __( 'Cannot Authorize Application' ), + array( + 'response' => 501, + 'link_text' => __( 'Go Back' ), + 'link_url' => $reject_url ? add_query_arg( 'error', 'disabled', $reject_url ) : admin_url(), + ) + ); +} + +wp_enqueue_script( 'auth-app' ); +wp_localize_script( + 'auth-app', + 'authApp', + array( + 'site_url' => site_url(), + 'user_login' => $user->user_login, + 'success' => $success_url, + 'reject' => $reject_url ? $reject_url : admin_url(), + ) +); + +require_once ABSPATH . 'wp-admin/admin-header.php'; + +?> +
+

+ + +

get_error_message(); ?>

+ + +
+

+ +

+ ' . esc_html( $app_name ) . '' + ); + ?> +

+ +

+ + + ID, true ); + $blogs_count = count( $blogs ); + if ( $blogs_count > 1 ) { + ?> +

+ the %2$s blog in this installation that you have permissions on.', + 'This will grant access to all %2$s blogs in this installation that you have permissions on.', + $blogs_count + ), + admin_url( 'my-sites.php' ), + number_format_i18n( $blogs_count ) + ); + ?> +

+ + + +
+

+ + +

+

+
+ + + +
+ + + + + + +
+ + +
+ + + + 'description-approve', + ) + ); + ?> +

+ ' . esc_html( + add_query_arg( + array( + 'site_url' => site_url(), + 'user_login' => $user->user_login, + 'password' => '[------]', + ), + $success_url + ) + ) . '' + ); + } else { + _e( 'You will be given a password to manually enter into the application in question.' ); + } + ?> +

+ + 'description-reject', + ) + ); + ?> +

+ ' . esc_html( $reject_url ) . '' + ); + } else { + _e( 'You will be returned to the WordPress Dashboard, and no changes will be made.' ); + } + ?> +

+
+ +
+
+comment_post_ID ) ) { diff --git a/wp-admin/credits.php b/wp-admin/credits.php index 4605538d70..24985c16fb 100644 --- a/wp-admin/credits.php +++ b/wp-admin/credits.php @@ -21,15 +21,27 @@
-
- +
+ + ' ); ?>" /> + <?php _e( 'Code is Poetry' ); ?>' ); ?>" /> +
-
-

- - -

+
+
+

+ + +

+
+ +
+ +
+
+ <?php _e( 'New' ); ?>' ); ?>" /> +
-
- +
+ + ' ); ?>" /> + <?php _e( 'Code is Poetry' ); ?>' ); ?>" /> +
-
-

- - -

+
+
+

+ + +

+
+ +
+ +
+
+ <?php _e( 'New' ); ?>' ); ?>" /> +
-
- -
+

post_date ) { $time = ''; } else { - /* translators: Date format in table columns, see https://www.php.net/date */ + /* translators: Date format in table columns, see https://www.php.net/manual/datetime.format.php */ $time = mysql2date( __( 'Y/m/d' ), $post->post_date ); } @@ -2370,7 +2370,7 @@ function wp_ajax_save_widget() { } /** - * Ajax handler for saving a widget. + * Ajax handler for updating a widget. * * @since 3.9.0 * @@ -2594,7 +2594,7 @@ function wp_ajax_upload_attachment() { * @since 3.1.0 */ function wp_ajax_image_editor() { - $attachment_id = intval( $_POST['postid'] ); + $attachment_id = (int) $_POST['postid']; if ( empty( $attachment_id ) || ! current_user_can( 'edit_post', $attachment_id ) ) { wp_die( -1 ); @@ -2651,12 +2651,12 @@ function wp_ajax_image_editor() { function wp_ajax_set_post_thumbnail() { $json = ! empty( $_REQUEST['json'] ); // New-style request. - $post_ID = intval( $_POST['post_id'] ); + $post_ID = (int) $_POST['post_id']; if ( ! current_user_can( 'edit_post', $post_ID ) ) { wp_die( -1 ); } - $thumbnail_id = intval( $_POST['thumbnail_id'] ); + $thumbnail_id = (int) $_POST['thumbnail_id']; if ( $json ) { check_ajax_referer( "update-post_$post_ID" ); @@ -2687,7 +2687,7 @@ function wp_ajax_set_post_thumbnail() { * @since 4.6.0 */ function wp_ajax_get_post_thumbnail_html() { - $post_ID = intval( $_POST['post_id'] ); + $post_ID = (int) $_POST['post_id']; check_ajax_referer( "update-post_$post_ID" ); @@ -2695,7 +2695,7 @@ function wp_ajax_get_post_thumbnail_html() { wp_die( -1 ); } - $thumbnail_id = intval( $_POST['thumbnail_id'] ); + $thumbnail_id = (int) $_POST['thumbnail_id']; // For backward compatibility, -1 refers to no featured image. if ( -1 === $thumbnail_id ) { @@ -3208,7 +3208,7 @@ function wp_ajax_send_attachment_to_editor() { $attachment = wp_unslash( $_POST['attachment'] ); - $id = intval( $attachment['id'] ); + $id = (int) $attachment['id']; $post = get_post( $id ); if ( ! $post ) { @@ -3221,7 +3221,7 @@ function wp_ajax_send_attachment_to_editor() { if ( current_user_can( 'edit_post', $id ) ) { // If this attachment is unattached, attach it. Primarily a back compat thing. - $insert_into_post_id = intval( $_POST['post_id'] ); + $insert_into_post_id = (int) $_POST['post_id']; if ( 0 == $post->post_parent && $insert_into_post_id ) { wp_update_post( @@ -3622,7 +3622,7 @@ function wp_ajax_parse_embed() { wp_send_json_error(); } - $post_id = isset( $_POST['post_ID'] ) ? intval( $_POST['post_ID'] ) : 0; + $post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0; if ( $post_id > 0 ) { $post = get_post( $post_id ); @@ -3674,9 +3674,9 @@ function wp_ajax_parse_embed() { // Set $content_width so any embeds fit in the destination iframe. if ( isset( $_POST['maxwidth'] ) && is_numeric( $_POST['maxwidth'] ) && $_POST['maxwidth'] > 0 ) { if ( ! isset( $content_width ) ) { - $content_width = intval( $_POST['maxwidth'] ); + $content_width = (int) $_POST['maxwidth']; } else { - $content_width = min( $content_width, intval( $_POST['maxwidth'] ) ); + $content_width = min( $content_width, (int) $_POST['maxwidth'] ); } } @@ -5142,8 +5142,21 @@ function wp_ajax_wp_privacy_erase_personal_data() { * Ajax handler for site health checks on server communication. * * @since 5.2.0 + * @deprecated 5.6.0 Use WP_REST_Site_Health_Controller::test_dotorg_communication() + * @see WP_REST_Site_Health_Controller::test_dotorg_communication() */ function wp_ajax_health_check_dotorg_communication() { + _doing_it_wrong( + 'wp_ajax_health_check_dotorg_communication', + sprintf( + // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. + __( 'The Site Health check for %1$s has been replaced with %2$s.' ), + 'wp_ajax_health_check_dotorg_communication', + 'WP_REST_Site_Health_Controller::test_dotorg_communication' + ), + '5.6.0' + ); + check_ajax_referer( 'health-check-site-status' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { @@ -5158,32 +5171,25 @@ function wp_ajax_health_check_dotorg_communication() { wp_send_json_success( $site_health->get_test_dotorg_communication() ); } -/** - * Ajax handler for site health checks on debug mode. - * - * @since 5.2.0 - */ -function wp_ajax_health_check_is_in_debug_mode() { - wp_verify_nonce( 'health-check-site-status' ); - - if ( ! current_user_can( 'view_site_health_checks' ) ) { - wp_send_json_error(); - } - - if ( ! class_exists( 'WP_Site_Health' ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; - } - - $site_health = WP_Site_Health::get_instance(); - wp_send_json_success( $site_health->get_test_is_in_debug_mode() ); -} - /** * Ajax handler for site health checks on background updates. * * @since 5.2.0 + * @deprecated 5.6.0 Use WP_REST_Site_Health_Controller::test_background_updates() + * @see WP_REST_Site_Health_Controller::test_background_updates() */ function wp_ajax_health_check_background_updates() { + _doing_it_wrong( + 'wp_ajax_health_check_background_updates', + sprintf( + // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. + __( 'The Site Health check for %1$s has been replaced with %2$s.' ), + 'wp_ajax_health_check_background_updates', + 'WP_REST_Site_Health_Controller::test_background_updates' + ), + '5.6.0' + ); + check_ajax_referer( 'health-check-site-status' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { @@ -5202,8 +5208,21 @@ function wp_ajax_health_check_background_updates() { * Ajax handler for site health checks on loopback requests. * * @since 5.2.0 + * @deprecated 5.6.0 Use WP_REST_Site_Health_Controller::test_loopback_requests() + * @see WP_REST_Site_Health_Controller::test_loopback_requests() */ function wp_ajax_health_check_loopback_requests() { + _doing_it_wrong( + 'wp_ajax_health_check_loopback_requests', + sprintf( + // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. + __( 'The Site Health check for %1$s has been replaced with %2$s.' ), + 'wp_ajax_health_check_loopback_requests', + 'WP_REST_Site_Health_Controller::test_loopback_requests' + ), + '5.6.0' + ); + check_ajax_referer( 'health-check-site-status' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { @@ -5239,8 +5258,21 @@ function wp_ajax_health_check_site_status_result() { * Ajax handler for site health check to get directories and database sizes. * * @since 5.2.0 + * @deprecated 5.6.0 Use WP_REST_Site_Health_Controller::get_directory_sizes() + * @see WP_REST_Site_Health_Controller::get_directory_sizes() */ function wp_ajax_health_check_get_sizes() { + _doing_it_wrong( + 'wp_ajax_health_check_get_sizes', + sprintf( + // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. + __( 'The Site Health check for %1$s has been replaced with %2$s.' ), + 'wp_ajax_health_check_get_sizes', + 'WP_REST_Site_Health_Controller::get_directory_sizes' + ), + '5.6.0' + ); + check_ajax_referer( 'health-check-site-status-result' ); if ( ! current_user_can( 'view_site_health_checks' ) || is_multisite() ) { diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 622ea06955..6cc6683f02 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -142,13 +142,34 @@ function get_link_to_edit( $link ) { } /** - * Inserts/updates links into/in the database. + * Inserts a link into the database, or updates an existing link. + * + * Runs all the necessary sanitizing, provides default values if arguments are missing, + * and finally saves the link. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param array $linkdata Elements that make up the link to insert. + * @param array $linkdata { + * Elements that make up the link to insert. + * + * @type int $link_id Optional. The ID of the existing link if updating. + * @type string $link_url The URL the link points to. + * @type string $link_name The title of the link. + * @type string $link_image Optional. A URL of an image. + * @type string $link_target Optional. The target element for the anchor tag. + * @type string $link_description Optional. A short description of the link. + * @type string $link_visible Optional. 'Y' means visible, anything else means not. + * @type int $link_owner Optional. A user ID. + * @type int $link_rating Optional. A rating for the link. + * @type string $link_updated Optional. When the link was last updated. + * @type string $link_rel Optional. A relationship of the link to you. + * @type string $link_notes Optional. An extended description of or notes on the link. + * @type string $link_rss Optional. A URL of an associated RSS feed. + * @type int $link_category Optional. The term ID of the link category. + * If empty, uses default link category. + * } * @param bool $wp_error Optional. Whether to return a WP_Error object on failure. Default false. * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success. */ @@ -274,7 +295,7 @@ function wp_set_link_cats( $link_id = 0, $link_categories = array() ) { * * @since 2.0.0 * - * @param array $linkdata Link data to update. + * @param array $linkdata Link data to update. See wp_insert_link() for accepted arguments. * @return int|WP_Error Value 0 or WP_Error on failure. The updated link ID on success. */ function wp_update_link( $linkdata ) { diff --git a/wp-admin/includes/class-automatic-upgrader-skin.php b/wp-admin/includes/class-automatic-upgrader-skin.php index 9875c6dee5..1835b3952c 100644 --- a/wp-admin/includes/class-automatic-upgrader-skin.php +++ b/wp-admin/includes/class-automatic-upgrader-skin.php @@ -8,7 +8,7 @@ */ /** - * Upgrader Skin for Automatic WordPress Upgrades + * Upgrader Skin for Automatic WordPress Upgrades. * * This skin is designed to be used when no output is intended, all output * is captured and stored for the caller to process and log/email/discard. @@ -52,14 +52,22 @@ public function request_filesystem_credentials( $error = false, $context = '', $ } /** - * @return array + * Retrieves the upgrade messages. + * + * @since 3.7.0 + * + * @return array Messages during an upgrade. */ public function get_upgrade_messages() { return $this->messages; } /** - * @param string|array|WP_Error $data + * Stores a message about the upgrade. + * + * @since 3.7.0 + * + * @param string|array|WP_Error $data Message data. * @param mixed ...$args Optional text replacements. */ public function feedback( $data, ...$args ) { @@ -103,12 +111,18 @@ public function feedback( $data, ...$args ) { } /** + * Creates a new output buffer. + * + * @since 3.7.0 */ public function header() { ob_start(); } /** + * Retrieves the buffered content, deletes the buffer, and processes the output. + * + * @since 3.7.0 */ public function footer() { $output = ob_get_clean(); diff --git a/wp-admin/includes/class-bulk-plugin-upgrader-skin.php b/wp-admin/includes/class-bulk-plugin-upgrader-skin.php index 308cacf553..9844e19460 100644 --- a/wp-admin/includes/class-bulk-plugin-upgrader-skin.php +++ b/wp-admin/includes/class-bulk-plugin-upgrader-skin.php @@ -48,12 +48,12 @@ public function bulk_footer() { 'plugins_page' => sprintf( '%s', self_admin_url( 'plugins.php' ), - __( 'Return to Plugins page' ) + __( 'Go to Plugins page' ) ), 'updates_page' => sprintf( '%s', self_admin_url( 'update-core.php' ), - __( 'Return to WordPress Updates page' ) + __( 'Go to WordPress Updates page' ) ), ); diff --git a/wp-admin/includes/class-bulk-theme-upgrader-skin.php b/wp-admin/includes/class-bulk-theme-upgrader-skin.php index d3f0c914ea..94daa27131 100644 --- a/wp-admin/includes/class-bulk-theme-upgrader-skin.php +++ b/wp-admin/includes/class-bulk-theme-upgrader-skin.php @@ -48,12 +48,12 @@ public function bulk_footer() { 'themes_page' => sprintf( '%s', self_admin_url( 'themes.php' ), - __( 'Return to Themes page' ) + __( 'Go to Themes page' ) ), 'updates_page' => sprintf( '%s', self_admin_url( 'update-core.php' ), - __( 'Return to WordPress Updates page' ) + __( 'Go to WordPress Updates page' ) ), ); diff --git a/wp-admin/includes/class-core-upgrader.php b/wp-admin/includes/class-core-upgrader.php index d7305589bf..b57a13fd7b 100644 --- a/wp-admin/includes/class-core-upgrader.php +++ b/wp-admin/includes/class-core-upgrader.php @@ -279,18 +279,21 @@ public static function should_update_to_version( $offered_ver ) { $current_is_development_version = (bool) strpos( $wp_version, '-' ); // Defaults: - $upgrade_dev = true; - $upgrade_minor = true; - $upgrade_major = false; + $upgrade_dev = get_site_option( 'auto_update_core_dev', 'enabled' ) === 'enabled'; + $upgrade_minor = get_site_option( 'auto_update_core_minor', 'enabled' ) === 'enabled'; + $upgrade_major = get_site_option( 'auto_update_core_major', 'unset' ) === 'enabled'; - // WP_AUTO_UPDATE_CORE = true (all), 'minor', false. + // WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'minor', false. if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) { if ( false === WP_AUTO_UPDATE_CORE ) { // Defaults to turned off, unless a filter allows it. $upgrade_dev = false; $upgrade_minor = false; $upgrade_major = false; - } elseif ( true === WP_AUTO_UPDATE_CORE ) { + } elseif ( true === WP_AUTO_UPDATE_CORE + || 'beta' === WP_AUTO_UPDATE_CORE + || 'rc' === WP_AUTO_UPDATE_CORE + ) { // ALL updates for core. $upgrade_dev = true; $upgrade_minor = true; diff --git a/wp-admin/includes/class-language-pack-upgrader-skin.php b/wp-admin/includes/class-language-pack-upgrader-skin.php index cbbc834808..05676269f0 100644 --- a/wp-admin/includes/class-language-pack-upgrader-skin.php +++ b/wp-admin/includes/class-language-pack-upgrader-skin.php @@ -75,7 +75,7 @@ public function bulk_footer() { 'updates_page' => sprintf( '%s', self_admin_url( 'update-core.php' ), - __( 'Return to WordPress Updates page' ) + __( 'Go to WordPress Updates page' ) ), ); diff --git a/wp-admin/includes/class-language-pack-upgrader.php b/wp-admin/includes/class-language-pack-upgrader.php index e88db55848..2ac6e76329 100644 --- a/wp-admin/includes/class-language-pack-upgrader.php +++ b/wp-admin/includes/class-language-pack-upgrader.php @@ -309,17 +309,18 @@ public function bulk_upgrade( $language_updates = array(), $args = array() ) { } /** - * Check the package source to make sure there are .mo and .po files. + * Checks that the package source contains .mo and .po files. * * Hooked to the {@see 'upgrader_source_selection'} filter by * Language_Pack_Upgrader::bulk_upgrade(). * * @since 3.7.0 * - * @global WP_Filesystem_Base $wp_filesystem Subclass + * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * - * @param string|WP_Error $source - * @param string $remote_source + * @param string|WP_Error $source The path to the downloaded package source. + * @param string $remote_source Remote file source location. + * @return string|WP_Error The source as passed, or a WP_Error object on failure. */ public function check_package( $source, $remote_source ) { global $wp_filesystem; diff --git a/wp-admin/includes/class-pclzip.php b/wp-admin/includes/class-pclzip.php index 47f2a344a2..8a085f8bd0 100644 --- a/wp-admin/includes/class-pclzip.php +++ b/wp-admin/includes/class-pclzip.php @@ -1171,7 +1171,7 @@ function duplicate($p_archive) $this->privErrorReset(); // ----- Look if the $p_archive is a PclZip object - if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) + if (is_object($p_archive) && $p_archive instanceof pclzip) { // ----- Duplicate the archive @@ -1235,7 +1235,7 @@ function merge($p_archive_to_add) } // ----- Look if the $p_archive_to_add is a PclZip object - if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) + if (is_object($p_archive_to_add) && $p_archive_to_add instanceof pclzip) { // ----- Merge the archive diff --git a/wp-admin/includes/class-plugin-installer-skin.php b/wp-admin/includes/class-plugin-installer-skin.php index 5bb19ebfbc..dad5983d7a 100644 --- a/wp-admin/includes/class-plugin-installer-skin.php +++ b/wp-admin/includes/class-plugin-installer-skin.php @@ -107,7 +107,7 @@ public function after() { $install_actions['activate_plugin'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=activate&from=press-this&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ), - __( 'Activate Plugin & Return to Press This' ) + __( 'Activate Plugin & Go to Press This' ) ); } else { $install_actions['activate_plugin'] = sprintf( @@ -130,25 +130,25 @@ public function after() { $install_actions['importers_page'] = sprintf( '%s', admin_url( 'import.php' ), - __( 'Return to Importers' ) + __( 'Go to Importers' ) ); } elseif ( 'web' === $this->type ) { $install_actions['plugins_page'] = sprintf( '%s', self_admin_url( 'plugin-install.php' ), - __( 'Return to Plugin Installer' ) + __( 'Go to Plugin Installer' ) ); } elseif ( 'upload' === $this->type && 'plugins' === $from ) { $install_actions['plugins_page'] = sprintf( '%s', self_admin_url( 'plugin-install.php' ), - __( 'Return to Plugin Installer' ) + __( 'Go to Plugin Installer' ) ); } else { $install_actions['plugins_page'] = sprintf( '%s', self_admin_url( 'plugins.php' ), - __( 'Return to Plugins page' ) + __( 'Go to Plugins page' ) ); } diff --git a/wp-admin/includes/class-plugin-upgrader-skin.php b/wp-admin/includes/class-plugin-upgrader-skin.php index 6b911bfea2..1d56b29d21 100644 --- a/wp-admin/includes/class-plugin-upgrader-skin.php +++ b/wp-admin/includes/class-plugin-upgrader-skin.php @@ -22,7 +22,7 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin { * * @since 2.8.0 * - * @var object + * @var string */ public $plugin = ''; @@ -98,7 +98,7 @@ public function after() { 'plugins_page' => sprintf( '%s', self_admin_url( 'plugins.php' ), - __( 'Return to Plugins page' ) + __( 'Go to Plugins page' ) ), ); diff --git a/wp-admin/includes/class-plugin-upgrader.php b/wp-admin/includes/class-plugin-upgrader.php index 27dc757f19..b171f9228b 100644 --- a/wp-admin/includes/class-plugin-upgrader.php +++ b/wp-admin/includes/class-plugin-upgrader.php @@ -398,21 +398,20 @@ public function bulk_upgrade( $plugins, $args = array() ) { } /** - * Check a source package to be sure it contains a plugin. + * Checks that the source package contains a valid plugin. * - * This function is added to the {@see 'upgrader_source_selection'} filter by - * Plugin_Upgrader::install(). + * Hooked to the {@see 'upgrader_source_selection'} filter by Plugin_Upgrader::install(). * * @since 3.3.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. + * @global string $wp_version The WordPress version string. * * @param string $source The path to the downloaded package source. - * @return string|WP_Error The source as passed, or a WP_Error object - * if no plugins were found. + * @return string|WP_Error The source as passed, or a WP_Error object on failure. */ public function check_package( $source ) { - global $wp_filesystem; + global $wp_filesystem, $wp_version; $this->new_plugin_data = array(); @@ -459,7 +458,7 @@ public function check_package( $source ) { $error = sprintf( /* translators: 1: Current WordPress version, 2: Version required by the uploaded plugin. */ __( 'Your WordPress version is %1$s, however the uploaded plugin requires %2$s.' ), - $GLOBALS['wp_version'], + $wp_version, $requires_wp ); diff --git a/wp-admin/includes/class-theme-installer-skin.php b/wp-admin/includes/class-theme-installer-skin.php index c6d0900abe..c22ad86e7a 100644 --- a/wp-admin/includes/class-theme-installer-skin.php +++ b/wp-admin/includes/class-theme-installer-skin.php @@ -155,13 +155,13 @@ public function after() { $install_actions['themes_page'] = sprintf( '%s', self_admin_url( 'theme-install.php' ), - __( 'Return to Theme Installer' ) + __( 'Go to Theme Installer' ) ); } elseif ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) { $install_actions['themes_page'] = sprintf( '%s', self_admin_url( 'themes.php' ), - __( 'Return to Themes page' ) + __( 'Go to Themes page' ) ); } diff --git a/wp-admin/includes/class-theme-upgrader-skin.php b/wp-admin/includes/class-theme-upgrader-skin.php index 7ca0b70db9..e1420b032f 100644 --- a/wp-admin/includes/class-theme-upgrader-skin.php +++ b/wp-admin/includes/class-theme-upgrader-skin.php @@ -22,7 +22,7 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin { * * @since 2.8.0 * - * @var object + * @var string */ public $theme = ''; @@ -124,7 +124,7 @@ public function after() { $update_actions['themes_page'] = sprintf( '%s', self_admin_url( 'themes.php' ), - __( 'Return to Themes page' ) + __( 'Go to Themes page' ) ); /** diff --git a/wp-admin/includes/class-theme-upgrader.php b/wp-admin/includes/class-theme-upgrader.php index c08d3c2d5c..229a8115bd 100644 --- a/wp-admin/includes/class-theme-upgrader.php +++ b/wp-admin/includes/class-theme-upgrader.php @@ -510,21 +510,20 @@ public function bulk_upgrade( $themes, $args = array() ) { } /** - * Check that the package source contains a valid theme. + * Checks that the package source contains a valid theme. * * Hooked to the {@see 'upgrader_source_selection'} filter by Theme_Upgrader::install(). - * It will return an error if the theme doesn't have style.css or index.php - * files. * * @since 3.3.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. + * @global string $wp_version The WordPress version string. * - * @param string $source The full path to the package source. - * @return string|WP_Error The source or a WP_Error. + * @param string $source The path to the downloaded package source. + * @return string|WP_Error The source as passed, or a WP_Error object on failure. */ public function check_package( $source ) { - global $wp_filesystem; + global $wp_filesystem, $wp_version; $this->new_theme_data = array(); @@ -606,7 +605,7 @@ public function check_package( $source ) { $error = sprintf( /* translators: 1: Current WordPress version, 2: Version required by the uploaded theme. */ __( 'Your WordPress version is %1$s, however the uploaded theme requires %2$s.' ), - $GLOBALS['wp_version'], + $wp_version, $requires_wp ); diff --git a/wp-admin/includes/class-walker-category-checklist.php b/wp-admin/includes/class-walker-category-checklist.php index 4c6cc9ef31..171e731987 100644 --- a/wp-admin/includes/class-walker-category-checklist.php +++ b/wp-admin/includes/class-walker-category-checklist.php @@ -62,11 +62,11 @@ public function end_lvl( &$output, $depth = 0, $args = array() ) { * * @since 2.5.1 * - * @param string $output Used to append additional content (passed by reference). - * @param object $category The current term object. - * @param int $depth Depth of the term in reference to parents. Default 0. - * @param array $args An array of arguments. @see wp_terms_checklist() - * @param int $id ID of the current term. + * @param string $output Used to append additional content (passed by reference). + * @param WP_Term $category The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. @see wp_terms_checklist() + * @param int $id ID of the current term. */ public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { if ( empty( $args['taxonomy'] ) ) { @@ -121,10 +121,10 @@ public function start_el( &$output, $category, $depth = 0, $args = array(), $id * * @since 2.5.1 * - * @param string $output Used to append additional content (passed by reference). - * @param object $category The current term object. - * @param int $depth Depth of the term in reference to parents. Default 0. - * @param array $args An array of arguments. @see wp_terms_checklist() + * @param string $output Used to append additional content (passed by reference). + * @param WP_Term $category The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. @see wp_terms_checklist() */ public function end_el( &$output, $category, $depth = 0, $args = array() ) { $output .= "\n"; diff --git a/wp-admin/includes/class-walker-nav-menu-checklist.php b/wp-admin/includes/class-walker-nav-menu-checklist.php index 11e78dd529..3f4d6c1574 100644 --- a/wp-admin/includes/class-walker-nav-menu-checklist.php +++ b/wp-admin/includes/class-walker-nav-menu-checklist.php @@ -74,7 +74,7 @@ public function end_lvl( &$output, $depth = 0, $args = null ) { public function start_el( &$output, $item, $depth = 0, $args = null, $id = 0 ) { global $_nav_menu_placeholder, $nav_menu_selected_id; - $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1; + $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? (int) $_nav_menu_placeholder - 1 : -1; $possible_object_id = isset( $item->post_type ) && 'nav_menu_item' === $item->post_type ? $item->object_id : $_nav_menu_placeholder; $possible_db_id = ( ! empty( $item->ID ) ) && ( 0 < $possible_object_id ) ? (int) $item->ID : 0; diff --git a/wp-admin/includes/class-wp-ajax-upgrader-skin.php b/wp-admin/includes/class-wp-ajax-upgrader-skin.php index cd4175cd47..27d8beb740 100644 --- a/wp-admin/includes/class-wp-ajax-upgrader-skin.php +++ b/wp-admin/includes/class-wp-ajax-upgrader-skin.php @@ -81,7 +81,7 @@ public function get_error_messages() { } /** - * Stores a log entry for an error. + * Stores an error message about the upgrade. * * @since 4.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it @@ -116,13 +116,13 @@ public function error( $errors, ...$args ) { } /** - * Stores a log entry. + * Stores a message about the upgrade. * * @since 4.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * - * @param string|array|WP_Error $data Log entry data. + * @param string|array|WP_Error $data Message data. * @param mixed ...$args Optional text replacements. */ public function feedback( $data, ...$args ) { diff --git a/wp-admin/includes/class-wp-application-passwords-list-table.php b/wp-admin/includes/class-wp-application-passwords-list-table.php new file mode 100644 index 0000000000..d1c128b50a --- /dev/null +++ b/wp-admin/includes/class-wp-application-passwords-list-table.php @@ -0,0 +1,267 @@ + __( 'Name' ), + 'created' => __( 'Created' ), + 'last_used' => __( 'Last Used' ), + 'last_ip' => __( 'Last IP' ), + 'revoke' => __( 'Revoke' ), + ); + } + + /** + * Prepares the list of items for displaying. + * + * @since 5.6.0 + * + * @global int $user_id User ID. + */ + public function prepare_items() { + global $user_id; + $this->items = array_reverse( WP_Application_Passwords::get_user_application_passwords( $user_id ) ); + } + + /** + * Handles the name column output. + * + * @since 5.6.0 + * + * @param array $item The current application password item. + */ + public function column_name( $item ) { + echo esc_html( $item['name'] ); + } + + /** + * Handles the created column output. + * + * @since 5.6.0 + * + * @param array $item The current application password item. + */ + public function column_created( $item ) { + if ( empty( $item['created'] ) ) { + echo '—'; + } else { + echo date_i18n( __( 'F j, Y' ), $item['created'] ); + } + } + + /** + * Handles the last used column output. + * + * @since 5.6.0 + * + * @param array $item The current application password item. + */ + public function column_last_used( $item ) { + if ( empty( $item['last_used'] ) ) { + echo '—'; + } else { + echo date_i18n( __( 'F j, Y' ), $item['last_used'] ); + } + } + + /** + * Handles the last ip column output. + * + * @since 5.6.0 + * + * @param array $item The current application password item. + */ + public function column_last_ip( $item ) { + if ( empty( $item['last_ip'] ) ) { + echo '—'; + } else { + echo $item['last_ip']; + } + } + + /** + * Handles the revoke column output. + * + * @since 5.6.0 + * + * @param array $item The current application password item. + */ + public function column_revoke( $item ) { + submit_button( + __( 'Revoke' ), + 'delete', + 'revoke-application-password-' . $item['uuid'], + false, + array( + /* translators: %s: the application password's given name. */ + 'aria-label' => sprintf( __( 'Revoke "%s"' ), $item['name'] ), + ) + ); + } + + /** + * Generates content for a single row of the table + * + * @since 5.6.0 + * + * @param array $item The current item. + * @param string $column_name The current column name. + */ + protected function column_default( $item, $column_name ) { + /** + * Fires for each custom column in the Application Passwords list table. + * + * Custom columns are registered using the {@see 'manage_application-passwords-user_columns'} filter. + * + * @since 5.6.0 + * + * @param string $column_name Name of the custom column. + * @param array $item The application password item. + */ + do_action( "manage_{$this->screen->id}_custom_column", $column_name, $item ); + } + + /** + * Generates custom table navigation to prevent conflicting nonces. + * + * @since 5.6.0 + * + * @param string $which The location of the bulk actions: 'top' or 'bottom'. + */ + protected function display_tablenav( $which ) { + ?> +

+ +
+ +
+ +
+ bulk_actions( $which ); ?> +
+ extra_tablenav( $which ); + $this->pagination( $which ); + ?> +
+
+ '; + $this->single_row_columns( $item ); + echo ''; + } + + /** + * Gets the name of the default primary column. + * + * @since 5.6.0 + * + * @return string Name of the default primary column, in this case, 'name'. + */ + protected function get_default_primary_column_name() { + return 'name'; + } + + /** + * Prints the JavaScript template for the new row item. + * + * @since 5.6.0 + */ + public function print_js_template_row() { + list( $columns, $hidden, , $primary ) = $this->get_column_info(); + + echo ''; + + foreach ( $columns as $column_name => $display_name ) { + $is_primary = $primary === $column_name; + $classes = "{$column_name} column-{$column_name}"; + + if ( $is_primary ) { + $classes .= ' has-row-actions column-primary'; + } + + if ( in_array( $column_name, $hidden, true ) ) { + $classes .= ' hidden'; + } + + printf( '', esc_attr( $classes ), esc_attr( wp_strip_all_tags( $display_name ) ) ); + + switch ( $column_name ) { + case 'name': + echo '{{ data.name }}'; + break; + case 'created': + // JSON encoding automatically doubles backslashes to ensure they don't get lost when printing the inline JS. + echo '<# print( wp.date.dateI18n( ' . wp_json_encode( __( 'F j, Y' ) ) . ', data.created ) ) #>'; + break; + case 'last_used': + echo '<# print( data.last_used !== null ? wp.date.dateI18n( ' . wp_json_encode( __( 'F j, Y' ) ) . ", data.last_used ) : '—' ) #>"; + break; + case 'last_ip': + echo "{{ data.last_ip || '—' }}"; + break; + case 'revoke': + printf( + '', + esc_attr( __( 'Revoke' ) ), + /* translators: %s: the application password's given name. */ + esc_attr( sprintf( __( 'Revoke "%s"' ), '{{ data.name }}' ) ) + ); + break; + default: + /** + * Fires in the JavaScript row template for each custom column in the Application Passwords list table. + * + * Custom columns are registered using the {@see 'manage_application-passwords-user_columns'} filter. + * + * @since 5.6.0 + * + * @param string $column_name Name of the custom column. + */ + do_action( "manage_{$this->screen->id}_custom_column_js_template", $column_name ); + break; + } + + if ( $is_primary ) { + echo ''; + } + + echo ''; + } + + echo ''; + } +} diff --git a/wp-admin/includes/class-wp-automatic-updater.php b/wp-admin/includes/class-wp-automatic-updater.php index 02f1f8d4cf..7f482daa1e 100644 --- a/wp-admin/includes/class-wp-automatic-updater.php +++ b/wp-admin/includes/class-wp-automatic-updater.php @@ -62,7 +62,7 @@ public function is_disabled() { * filesystem to the top of the drive, erring on the side of detecting a VCS * checkout somewhere. * - * ABSPATH is always checked in addition to whatever $context is (which may be the + * ABSPATH is always checked in addition to whatever `$context` is (which may be the * wp-content directory, for example). The underlying assumption is that if you are * using version control *anywhere*, then you should be making decisions for * how things get updated. @@ -70,6 +70,8 @@ public function is_disabled() { * @since 3.7.0 * * @param string $context The filesystem path to check, in addition to ABSPATH. + * @return bool True if a VCS checkout was discovered at `$context` or ABSPATH, + * or anywhere higher. False otherwise. */ public function is_vcs_checkout( $context ) { $context_dirs = array( untrailingslashit( $context ) ); @@ -112,7 +114,7 @@ public function is_vcs_checkout( $context ) { * * @since 3.7.0 * - * @param bool $checkout Whether a VCS checkout was discovered at $context + * @param bool $checkout Whether a VCS checkout was discovered at `$context` * or ABSPATH, or anywhere higher. * @param string $context The filesystem context (a path) against which * filesystem status should be checked. @@ -132,6 +134,7 @@ public function is_vcs_checkout( $context ) { * @param object $item The update offer. * @param string $context The filesystem context (a path) against which filesystem * access and status should be checked. + * @return bool True if the item should be updated, false otherwise. */ public function should_update( $type, $item, $context ) { // Used to see if WP_Filesystem is set up to allow unattended updates. @@ -242,6 +245,8 @@ public function should_update( $type, $item, $context ) { * @since 3.7.0 * * @param object $item The update offer. + * @return bool True if the site administrator is notified of a core update, + * false otherwise. */ protected function send_core_update_notification_email( $item ) { $notified = get_site_option( 'auto_core_update_notified' ); @@ -343,6 +348,11 @@ public function update( $type, $item ) { $upgrader_item = $item->theme; $theme = wp_get_theme( $upgrader_item ); $item_name = $theme->Get( 'Name' ); + // Add the current version so that it can be reported in the notification email. + $item->current_version = $theme->get( 'Version' ); + if ( empty( $item->current_version ) ) { + $item->current_version = false; + } /* translators: %s: Theme name. */ $skin->feedback( __( 'Updating theme: %s' ), $item_name ); break; @@ -350,6 +360,11 @@ public function update( $type, $item ) { $upgrader_item = $item->plugin; $plugin_data = get_plugin_data( $context . '/' . $upgrader_item ); $item_name = $plugin_data['Name']; + // Add the current version so that it can be reported in the notification email. + $item->current_version = $plugin_data['Version']; + if ( empty( $item->current_version ) ) { + $item->current_version = false; + } /* translators: %s: Plugin name. */ $skin->feedback( __( 'Updating plugin: %s' ), $item_name ); break; @@ -1065,12 +1080,22 @@ protected function send_plugin_theme_email( $type, $successful_updates, $failed_ $body[] = __( 'These plugins failed to update:' ); foreach ( $failed_updates['plugin'] as $item ) { - $body[] = sprintf( - /* translators: 1: Plugin name, 2: Version number. */ - __( '- %1$s version %2$s' ), - $item->name, - $item->item->new_version - ); + if ( $item->item->current_version ) { + $body[] = sprintf( + /* translators: 1: Plugin name, 2: Current version number, 3: New version number. */ + __( '- %1$s (from version %2$s to %3$s)' ), + $item->name, + $item->item->current_version, + $item->item->new_version + ); + } else { + $body[] = sprintf( + /* translators: 1: Plugin name, 2: Version number. */ + __( '- %1$s version %2$s' ), + $item->name, + $item->item->new_version + ); + } $past_failure_emails[ $item->item->plugin ] = $item->item->new_version; } @@ -1083,12 +1108,22 @@ protected function send_plugin_theme_email( $type, $successful_updates, $failed_ $body[] = __( 'These themes failed to update:' ); foreach ( $failed_updates['theme'] as $item ) { - $body[] = sprintf( - /* translators: 1: Theme name, 2: Version number. */ - __( '- %1$s version %2$s' ), - $item->name, - $item->item->new_version - ); + if ( $item->item->current_version ) { + $body[] = sprintf( + /* translators: 1: Theme name, 2: Current version number, 3: New version number. */ + __( '- %1$s (from version %2$s to %3$s)' ), + $item->name, + $item->item->current_version, + $item->item->new_version + ); + } else { + $body[] = sprintf( + /* translators: 1: Theme name, 2: Version number. */ + __( '- %1$s version %2$s' ), + $item->name, + $item->item->new_version + ); + } $past_failure_emails[ $item->item->theme ] = $item->item->new_version; } @@ -1106,12 +1141,22 @@ protected function send_plugin_theme_email( $type, $successful_updates, $failed_ $body[] = __( 'These plugins are now up to date:' ); foreach ( $successful_updates['plugin'] as $item ) { - $body[] = sprintf( - /* translators: 1: Plugin name, 2: Version number. */ - __( '- %1$s version %2$s' ), - $item->name, - $item->item->new_version - ); + if ( $item->item->current_version ) { + $body[] = sprintf( + /* translators: 1: Plugin name, 2: Current version number, 3: New version number. */ + __( '- %1$s (from version %2$s to %3$s)' ), + $item->name, + $item->item->current_version, + $item->item->new_version + ); + } else { + $body[] = sprintf( + /* translators: 1: Plugin name, 2: Version number. */ + __( '- %1$s version %2$s' ), + $item->name, + $item->item->new_version + ); + } unset( $past_failure_emails[ $item->item->plugin ] ); } @@ -1124,12 +1169,22 @@ protected function send_plugin_theme_email( $type, $successful_updates, $failed_ $body[] = __( 'These themes are now up to date:' ); foreach ( $successful_updates['theme'] as $item ) { - $body[] = sprintf( - /* translators: 1: Theme name, 2: Version number. */ - __( '- %1$s version %2$s' ), - $item->name, - $item->item->new_version - ); + if ( $item->item->current_version ) { + $body[] = sprintf( + /* translators: 1: Theme name, 2: Current version number, 3: New version number. */ + __( '- %1$s (from version %2$s to %3$s)' ), + $item->name, + $item->item->current_version, + $item->item->new_version + ); + } else { + $body[] = sprintf( + /* translators: 1: Theme name, 2: Version number. */ + __( '- %1$s version %2$s' ), + $item->name, + $item->item->new_version + ); + } unset( $past_failure_emails[ $item->item->theme ] ); } diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index 91b29c5c1f..563187ffe4 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -390,11 +390,14 @@ protected function extra_tablenav( $which ) { if ( ! isset( $has_items ) ) { $has_items = $this->has_items(); } + echo '
'; + if ( 'top' === $which ) { ob_start(); - $this->comment_status_dropdown( $comment_type ); + $this->comment_type_dropdown( $comment_type ); + /** * Fires just before the Filter submit button for comment types. * @@ -406,7 +409,7 @@ protected function extra_tablenav( $which ) { if ( ! empty( $output ) && $this->has_items() ) { echo $output; - submit_button( esc_html__( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); + submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); } } @@ -415,14 +418,18 @@ protected function extra_tablenav( $which ) { $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' ); submit_button( $title, 'apply', 'delete_all', false ); } + /** * Fires after the Filter submit button for comment types. * * @since 2.5.0 + * @since 5.6.0 The `$which` parameter was added. * * @param string $comment_status The comment status name. Default 'All'. + * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. */ - do_action( 'manage_comments_nav', $comment_status ); + do_action( 'manage_comments_nav', $comment_status, $which ); + echo '
'; } @@ -465,34 +472,35 @@ public function get_columns() { } /** - * Displays a comment status drop-down for filtering on the Comments list table. + * Displays a comment type drop-down for filtering on the Comments list table. * * @since 5.5.0 + * @since 5.6.0 Renamed from `comment_status_dropdown()` to `comment_type_dropdown()`. * * @param string $comment_type The current comment type slug. */ - protected function comment_status_dropdown( $comment_type ) { + protected function comment_type_dropdown( $comment_type ) { /** - * Filters the comment types dropdown menu. + * Filters the comment types shown in the drop-down menu on the Comments list table. * * @since 2.7.0 * - * @param array $comment_types An array of comment types. Accepts 'Comments', 'Pings'. + * @param string[] $comment_types Array of comment type labels keyed by their name. */ $comment_types = apply_filters( 'admin_comment_types_dropdown', array( - 'comment' => esc_html__( 'Comments' ), - 'pings' => esc_html__( 'Pings' ), + 'comment' => __( 'Comments' ), + 'pings' => __( 'Pings' ), ) ); if ( $comment_types && is_array( $comment_types ) ) { - printf( '', esc_html__( 'Filter by comment type' ) ); + printf( '', __( 'Filter by comment type' ) ); echo '\n"; echo '\n"; - foreach ( $this->_actions as $name => $title ) { - $class = 'edit' === $name ? ' class="hide-if-no-js"' : ''; + foreach ( $this->_actions as $key => $value ) { + if ( is_array( $value ) ) { + echo "\t" . '' . "\n"; + + foreach ( $value as $name => $title ) { + $class = ( 'edit' === $name ) ? ' class="hide-if-no-js"' : ''; - echo "\t" . '\n"; + echo "\t\t" . '\n"; + } + echo "\t" . "\n"; + } else { + $class = ( 'edit' === $key ) ? ' class="hide-if-no-js"' : ''; + + echo "\t" . '\n"; + } } echo "\n"; @@ -947,7 +976,7 @@ protected function pagination( $which ) { if ( ! empty( $infinite_scroll ) ) { $pagination_links_class .= ' hide-if-js'; } - $output .= "\n" . join( "\n", $page_links ) . ''; + $output .= "\n" . implode( "\n", $page_links ) . ''; if ( $total_pages ) { $page_class = $total_pages < 2 ? ' one-page' : ''; @@ -1044,7 +1073,7 @@ protected function get_primary_column_name() { // If the primary column doesn't exist, // fall back to the first non-checkbox column. if ( ! isset( $columns[ $default ] ) ) { - $default = WP_List_Table::get_default_primary_column_name(); + $default = self::get_default_primary_column_name(); } /** @@ -1065,7 +1094,7 @@ protected function get_primary_column_name() { } /** - * Gets a list of all, hidden and sortable columns, with filter applied. + * Gets a list of all, hidden, and sortable columns, with filter applied. * * @since 3.1.0 * @@ -1092,7 +1121,7 @@ protected function get_column_info() { * Filters the list table sortable columns for a specific screen. * * The dynamic portion of the hook name, `$this->screen->id`, refers - * to the ID of the current screen, usually a string. + * to the ID of the current screen. * * @since 3.1.0 * @@ -1213,7 +1242,7 @@ public function print_column_headers( $with_id = true ) { $id = $with_id ? "id='$column_key'" : ''; if ( ! empty( $class ) ) { - $class = "class='" . join( ' ', $class ) . "'"; + $class = "class='" . implode( ' ', $class ) . "'"; } echo "<$tag $scope $id $class>$column_display_name"; @@ -1343,7 +1372,7 @@ public function display_rows() { * * @since 3.1.0 * - * @param object $item The current item + * @param object|array $item The current item */ public function single_row( $item ) { echo ''; @@ -1352,13 +1381,13 @@ public function single_row( $item ) { } /** - * @param object $item + * @param object|array $item * @param string $column_name */ protected function column_default( $item, $column_name ) {} /** - * @param object $item + * @param object|array $item */ protected function column_cb( $item ) {} @@ -1367,7 +1396,7 @@ protected function column_cb( $item ) {} * * @since 3.1.0 * - * @param object $item The current item. + * @param object|array $item The current item. */ protected function single_row_columns( $item ) { list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); @@ -1419,9 +1448,9 @@ protected function single_row_columns( $item ) { * * @since 4.3.0 * - * @param object $item The item being acted upon. - * @param string $column_name Current column name. - * @param string $primary Primary column name. + * @param object|array $item The item being acted upon. + * @param string $column_name Current column name. + * @param string $primary Primary column name. * @return string The row actions HTML, or an empty string * if the current column is not the primary column. */ diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php index fdc26de6ea..031f306987 100644 --- a/wp-admin/includes/class-wp-media-list-table.php +++ b/wp-admin/includes/class-wp-media-list-table.php @@ -614,7 +614,7 @@ public function column_default( $post, $column_name ) { ); } /* translators: Used between list items, there is a space after the comma. */ - echo join( __( ', ' ), $out ); + echo implode( __( ', ' ), $out ); } else { echo '' . get_taxonomy( $taxonomy )->labels->no_terms . ''; } @@ -802,9 +802,9 @@ private function _get_row_actions( $post, $att_title ) { * * @since 4.3.0 * - * @param object $post Attachment being acted upon. - * @param string $column_name Current column name. - * @param string $primary Primary column name. + * @param WP_Post $post Attachment being acted upon. + * @param string $column_name Current column name. + * @param string $primary Primary column name. * @return string Row actions output for media attachments, or an empty string * if the current column is not the primary column. */ diff --git a/wp-admin/includes/class-wp-ms-sites-list-table.php b/wp-admin/includes/class-wp-ms-sites-list-table.php index 3b3c7a88a6..b928ee92c6 100644 --- a/wp-admin/includes/class-wp-ms-sites-list-table.php +++ b/wp-admin/includes/class-wp-ms-sites-list-table.php @@ -103,8 +103,8 @@ public function prepare_items() { } $args = array( - 'number' => intval( $per_page ), - 'offset' => intval( ( $pagenum - 1 ) * $per_page ), + 'number' => (int) $per_page, + 'offset' => (int) ( ( $pagenum - 1 ) * $per_page ), 'network_id' => get_current_network_id(), ); @@ -332,7 +332,9 @@ protected function extra_tablenav( $which ) { * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. */ do_action( 'restrict_manage_sites', $which ); + $output = ob_get_clean(); + if ( ! empty( $output ) ) { echo $output; submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'site-query-submit' ) ); @@ -618,13 +620,13 @@ protected function site_states( $site ) { $site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : ''; foreach ( $this->status_list as $status => $col ) { - if ( ( 1 === intval( $_site->{$status} ) ) && ( $site_status !== $status ) ) { + if ( ( 1 === (int) $_site->{$status} ) && ( $site_status !== $status ) ) { $site_states[ $col[0] ] = $col[1]; } } /** - * Filter the default site display states for items in the Sites list table. + * Filters the default site display states for items in the Sites list table. * * @since 5.3.0 * @@ -662,7 +664,7 @@ protected function get_default_primary_column_name() { * * @since 4.3.0 * - * @param object $blog Site being acted upon. + * @param array $blog Site being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for sites in Multisite, or an empty string diff --git a/wp-admin/includes/class-wp-ms-themes-list-table.php b/wp-admin/includes/class-wp-ms-themes-list-table.php index 7f751a3b2f..2091603cf0 100644 --- a/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -63,7 +63,7 @@ public function __construct( $args = array() ) { $this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false; if ( $this->is_site_themes ) { - $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; + $this->site_id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0; } $this->show_autoupdates = wp_is_auto_update_enabled_for_type( 'theme' ) && @@ -179,11 +179,9 @@ public function prepare_items() { 'requires_php' => '', ); - $filter_payload = array_merge( $filter_payload, array_intersect_key( $theme_data, $filter_payload ) ); + $filter_payload = (object) array_merge( $filter_payload, array_intersect_key( $theme_data, $filter_payload ) ); - $type = 'theme'; - /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $filter_payload ); + $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, $filter_payload ); if ( ! is_null( $auto_update_forced ) ) { $theme->auto_update_forced = $auto_update_forced; @@ -208,9 +206,11 @@ public function prepare_items() { $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( $this, '_search_callback' ) ); } - $totals = array(); + $totals = array(); + $js_themes = array(); foreach ( $themes as $type => $list ) { - $totals[ $type ] = count( $list ); + $totals[ $type ] = count( $list ); + $js_themes[ $type ] = array_keys( $list ); } if ( empty( $themes[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) { @@ -227,7 +227,7 @@ public function prepare_items() { 'updates', '_wpUpdatesItemCounts', array( - 'themes' => $totals, + 'themes' => $js_themes, 'totals' => wp_get_update_data(), ) ); @@ -301,7 +301,7 @@ public function _order_callback( $theme_a, $theme_b ) { $a = $theme_a[ $orderby ]; $b = $theme_b[ $orderby ]; - if ( $a == $b ) { + if ( $a === $b ) { return 0; } diff --git a/wp-admin/includes/class-wp-ms-users-list-table.php b/wp-admin/includes/class-wp-ms-users-list-table.php index 3b9670750d..8e1656ed6c 100644 --- a/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/wp-admin/includes/class-wp-ms-users-list-table.php @@ -490,9 +490,9 @@ protected function get_default_primary_column_name() { * * @since 4.3.0 * - * @param object $user User being acted upon. - * @param string $column_name Current column name. - * @param string $primary Primary column name. + * @param WP_User $user User being acted upon. + * @param string $column_name Current column name. + * @param string $primary Primary column name. * @return string Row actions output for users in Multisite, or an empty string * if the current column is not the primary column. */ diff --git a/wp-admin/includes/class-wp-plugin-install-list-table.php b/wp-admin/includes/class-wp-plugin-install-list-table.php index fe160cbd8b..ee6ba137e3 100644 --- a/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -101,13 +101,16 @@ public function prepare_items() { if ( 'search' === $tab ) { $tabs['search'] = __( 'Search Results' ); } + if ( 'beta' === $tab || false !== strpos( get_bloginfo( 'version' ), '-' ) ) { $tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' ); } + $tabs['featured'] = _x( 'Featured', 'Plugin Installer' ); $tabs['popular'] = _x( 'Popular', 'Plugin Installer' ); $tabs['recommended'] = _x( 'Recommended', 'Plugin Installer' ); $tabs['favorites'] = _x( 'Favorites', 'Plugin Installer' ); + if ( current_user_can( 'upload_plugins' ) ) { // No longer a real tab. Here for filter compatibility. // Gets skipped in get_views(). @@ -427,7 +430,7 @@ private function order_callback( $plugin_a, $plugin_b ) { $a = $plugin_a->$orderby; $b = $plugin_b->$orderby; - if ( $a == $b ) { + if ( $a === $b ) { return 0; } @@ -472,7 +475,7 @@ public function display_rows() { } // Display the group heading if there is one. - if ( isset( $plugin['group'] ) && $plugin['group'] != $group ) { + if ( isset( $plugin['group'] ) && $plugin['group'] !== $group ) { if ( isset( $this->groups[ $plugin['group'] ] ) ) { $group_name = $this->groups[ $plugin['group'] ]; if ( isset( $plugins_group_titles[ $group_name ] ) ) { @@ -493,6 +496,7 @@ public function display_rows() { $group = $plugin['group']; } + $title = wp_kses( $plugin['name'], $plugins_allowedtags ); // Remove any HTML from the description. @@ -743,7 +747,7 @@ public function display_rows() { _nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ), number_format_i18n( $active_installs_millions ) ); - } elseif ( 0 == $plugin['active_installs'] ) { + } elseif ( 0 === $plugin['active_installs'] ) { $active_installs_text = _x( 'Less Than 10', 'Active plugin installations' ); } else { $active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+'; diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php index e487e32cfb..b8af207da0 100644 --- a/wp-admin/includes/class-wp-plugins-list-table.php +++ b/wp-admin/includes/class-wp-plugins-list-table.php @@ -229,11 +229,10 @@ public function prepare_items() { 'requires_php' => '', 'compatibility' => new stdClass(), ); - $filter_payload = (object) array_merge( $filter_payload, array_intersect_key( $plugin_data, $filter_payload ) ); - $type = 'plugin'; - /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $auto_update_forced = apply_filters( "auto_update_{$type}", null, $filter_payload ); + $filter_payload = (object) wp_parse_args( $plugin_data, $filter_payload ); + + $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload ); if ( ! is_null( $auto_update_forced ) ) { $plugin_data['auto-update-forced'] = $auto_update_forced; @@ -318,7 +317,7 @@ public function prepare_items() { $js_plugins = array(); foreach ( $plugins as $key => $list ) { - $js_plugins[ $key ] = array_keys( (array) $list ); + $js_plugins[ $key ] = array_keys( $list ); } wp_localize_script( @@ -387,7 +386,7 @@ public function _order_callback( $plugin_a, $plugin_b ) { $a = $plugin_a[ $orderby ]; $b = $plugin_b[ $orderby ]; - if ( $a == $b ) { + if ( $a === $b ) { return 0; } @@ -408,7 +407,7 @@ public function no_items() { $s = esc_html( wp_unslash( $_REQUEST['s'] ) ); /* translators: %s: Plugin search term. */ - printf( __( 'No plugins found for “%s”.' ), $s ); + printf( __( 'No plugins found for: %s.' ), '' . $s . '' ); // We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link. if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) { @@ -745,9 +744,11 @@ public function single_row( $item ) { } elseif ( 'dropins' === $context ) { $dropins = _get_dropins(); $plugin_name = $plugin_file; - if ( $plugin_file != $plugin_data['Name'] ) { + + if ( $plugin_file !== $plugin_data['Name'] ) { $plugin_name .= '
' . $plugin_data['Name']; } + if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant. $is_active = true; $description = '

' . $dropins[ $plugin_file ][0] . '

'; @@ -764,6 +765,7 @@ public function single_row( $item ) { 'wp-config.php' ) . '

'; } + if ( $plugin_data['Description'] ) { $description .= '

' . $plugin_data['Description'] . '

'; } @@ -946,7 +948,8 @@ public function single_row( $item ) { $requires_php = isset( $plugin_data['requires_php'] ) ? $plugin_data['requires_php'] : null; $compatible_php = is_php_version_compatible( $requires_php ); $class = $is_active ? 'active' : 'inactive'; - $checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] ); + $checkbox_id = 'checkbox_' . md5( $plugin_file ); + if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ), true ) || ! $compatible_php ) { $checkbox = ''; } else { @@ -959,6 +962,7 @@ public function single_row( $item ) { esc_attr( $plugin_file ) ); } + if ( 'dropins' !== $context ) { $description = '

' . ( $plugin_data['Description'] ? $plugin_data['Description'] : ' ' ) . '

'; $plugin_name = $plugin_data['Name']; @@ -1124,7 +1128,7 @@ public function single_row( $item ) { $url = add_query_arg( $query_args, 'plugins.php' ); - if ( 'unavailable' == $action ) { + if ( 'unavailable' === $action ) { $html[] = '' . $text . ''; } else { $html[] = sprintf( diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index a7d4748840..22a46d27c9 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -89,19 +89,17 @@ public function __construct( $args = array() ) { 'show_in_admin_all_list' => false, ) ); - $this->user_posts_count = intval( - $wpdb->get_var( - $wpdb->prepare( - " + $this->user_posts_count = (int) $wpdb->get_var( + $wpdb->prepare( + " SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' ) AND post_author = %d ", - $post_type, - get_current_user_id() - ) + $post_type, + get_current_user_id() ) ); @@ -1081,9 +1079,9 @@ public function column_date( $post ) { $t_time = sprintf( /* translators: 1: Post date, 2: Post time. */ __( '%1$s at %2$s' ), - /* translators: Post date format. See https://www.php.net/date */ + /* translators: Post date format. See https://www.php.net/manual/datetime.format.php */ get_the_time( __( 'Y/m/d' ), $post ), - /* translators: Post time format. See https://www.php.net/date */ + /* translators: Post time format. See https://www.php.net/manual/datetime.format.php */ get_the_time( __( 'g:i a' ), $post ) ); @@ -1221,7 +1219,7 @@ public function column_default( $post, $column_name ) { $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms ); /* translators: Used between list items, there is a space after the comma. */ - echo join( __( ', ' ), $term_links ); + echo implode( __( ', ' ), $term_links ); } else { echo '' . $taxonomy_object->labels->no_terms . ''; } @@ -1323,9 +1321,9 @@ protected function get_default_primary_column_name() { * * @since 4.3.0 * - * @param object $post Post being acted upon. - * @param string $column_name Current column name. - * @param string $primary Primary column name. + * @param WP_Post $post Post being acted upon. + * @param string $column_name Current column name. + * @param string $primary Primary column name. * @return string Row actions output for posts, or an empty string * if the current column is not the primary column. */ @@ -1589,6 +1587,18 @@ public function inline_edit() { $users_opt['show_option_none'] = __( '— No Change —' ); } + /** + * Filters the arguments used to generate the Quick Edit authors drop-down. + * + * @since 5.6.0 + * + * @see wp_dropdown_users() + * + * @param array $users_opt An array of arguments passed to wp_dropdown_users(). + * @param bool $bulk A flag to denote if it's a bulk action. + */ + $users_opt = apply_filters( 'quick_edit_dropdown_authors_args', $users_opt, $bulk ); + $authors = wp_dropdown_users( $users_opt ); if ( $authors ) : $authors_dropdown = '
'; } - $content .= ' ' . __( 'Return to top' ) . ''; + $content .= ' ' . __( 'Go to top' ) . ''; $content .= '
'; // End of .privacy-text-section. } @@ -584,6 +584,9 @@ public static function get_default_content( $description = false, $blocks = true $strings[] = '

' . __( 'By default WordPress does not share any personal data with anyone.' ) . '

'; } + /* translators: Default privacy policy text. */ + $strings[] = '

' . $suggested_text . __( 'If you request a password reset, your IP address will be included in the reset email.' ) . '

'; + /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'How long we retain your data' ) . '

'; diff --git a/wp-admin/includes/class-wp-privacy-requests-table.php b/wp-admin/includes/class-wp-privacy-requests-table.php index 714e087ab4..bb1d445da7 100644 --- a/wp-admin/includes/class-wp-privacy-requests-table.php +++ b/wp-admin/includes/class-wp-privacy-requests-table.php @@ -43,7 +43,7 @@ public function get_columns() { 'email' => __( 'Requester' ), 'status' => __( 'Status' ), 'created_timestamp' => __( 'Requested' ), - 'next_steps' => __( 'Next Steps' ), + 'next_steps' => __( 'Next steps' ), ); return $columns; } @@ -206,12 +206,13 @@ protected function get_views() { * * @since 4.9.6 * - * @return string[] Array of bulk action labels keyed by their action. + * @return array Array of bulk action labels keyed by their action. */ protected function get_bulk_actions() { return array( - 'delete' => __( 'Delete Requests' ), - 'resend' => __( 'Resend Confirmation Requests' ), + 'resend' => __( 'Resend confirmation requests' ), + 'complete' => __( 'Mark requests as completed' ), + 'delete' => __( 'Delete requests' ), ); } @@ -219,38 +220,74 @@ protected function get_bulk_actions() { * Process bulk actions. * * @since 4.9.6 + * @since 5.6.0 Added support for the `complete` action. */ public function process_bulk_action() { $action = $this->current_action(); $request_ids = isset( $_REQUEST['request_id'] ) ? wp_parse_id_list( wp_unslash( $_REQUEST['request_id'] ) ) : array(); - $count = 0; - - if ( $request_ids ) { - check_admin_referer( 'bulk-privacy_requests' ); + if ( empty( $request_ids ) ) { + return; } + $count = 0; + $failures = 0; + + check_admin_referer( 'bulk-privacy_requests' ); + switch ( $action ) { - case 'delete': + case 'resend': foreach ( $request_ids as $request_id ) { - if ( wp_delete_post( $request_id, true ) ) { - $count ++; + $resend = _wp_privacy_resend_request( $request_id ); + + if ( $resend && ! is_wp_error( $resend ) ) { + $count++; + } else { + $failures++; } } - add_settings_error( - 'bulk_action', - 'bulk_action', - /* translators: %d: Number of requests. */ - sprintf( _n( 'Deleted %d request', 'Deleted %d requests', $count ), $count ), - 'success' - ); + if ( $failures ) { + add_settings_error( + 'bulk_action', + 'bulk_action', + sprintf( + /* translators: %d: Number of requests. */ + _n( + '%d confirmation request failed to resend.', + '%d confirmation requests failed to resend.', + $failures + ), + $failures + ), + 'error' + ); + } + + if ( $count ) { + add_settings_error( + 'bulk_action', + 'bulk_action', + sprintf( + /* translators: %d: Number of requests. */ + _n( + '%d confirmation request re-sent successfully.', + '%d confirmation requests re-sent successfully.', + $count + ), + $count + ), + 'success' + ); + } + break; - case 'resend': + + case 'complete': foreach ( $request_ids as $request_id ) { - $resend = _wp_privacy_resend_request( $request_id ); + $result = _wp_privacy_completed_request( $request_id ); - if ( $resend && ! is_wp_error( $resend ) ) { + if ( $result && ! is_wp_error( $result ) ) { $count++; } } @@ -258,11 +295,63 @@ public function process_bulk_action() { add_settings_error( 'bulk_action', 'bulk_action', - /* translators: %d: Number of requests. */ - sprintf( _n( 'Re-sent %d request', 'Re-sent %d requests', $count ), $count ), + sprintf( + /* translators: %d: Number of requests. */ + _n( + '%d request marked as complete.', + '%d requests marked as complete.', + $count + ), + $count + ), 'success' ); break; + + case 'delete': + foreach ( $request_ids as $request_id ) { + if ( wp_delete_post( $request_id, true ) ) { + $count++; + } else { + $failures++; + } + } + + if ( $failures ) { + add_settings_error( + 'bulk_action', + 'bulk_action', + sprintf( + /* translators: %d: Number of requests. */ + _n( + '%d request failed to delete.', + '%d requests failed to delete.', + $failures + ), + $failures + ), + 'error' + ); + } + + if ( $count ) { + add_settings_error( + 'bulk_action', + 'bulk_action', + sprintf( + /* translators: %d: Number of requests. */ + _n( + '%d request deleted successfully.', + '%d requests deleted successfully.', + $count + ), + $count + ), + 'success' + ); + } + + break; } } diff --git a/wp-admin/includes/class-wp-screen.php b/wp-admin/includes/class-wp-screen.php index 440527f249..9464fabe05 100644 --- a/wp-admin/includes/class-wp-screen.php +++ b/wp-admin/includes/class-wp-screen.php @@ -377,7 +377,7 @@ public static function get( $hook_name = '' ) { return $screen; } } else { - $screen = new WP_Screen(); + $screen = new self(); $screen->id = $id; } @@ -1113,9 +1113,14 @@ public function render_meta_boxes_preferences() { } ?>
- + +

+ + +

id && has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) { if ( isset( $_GET['welcome'] ) ) { diff --git a/wp-admin/includes/class-wp-site-health-auto-updates.php b/wp-admin/includes/class-wp-site-health-auto-updates.php index 4e3383eb1a..3483bfae91 100644 --- a/wp-admin/includes/class-wp-site-health-auto-updates.php +++ b/wp-admin/includes/class-wp-site-health-auto-updates.php @@ -27,7 +27,7 @@ public function __construct() { */ public function run_tests() { $tests = array( - $this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'minor' ) ), + $this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'beta', 'rc', 'minor' ) ), $this->test_wp_version_check_attached(), $this->test_filters_automatic_updater_disabled(), $this->test_wp_automatic_updates_disabled(), @@ -90,46 +90,7 @@ public function test_constants( $constant, $value ) { * @return array The test results. */ public function test_wp_version_check_attached() { - if ( ! is_main_site() ) { - return; - } - - $cookies = wp_unslash( $_COOKIE ); - $timeout = 10; - $headers = array( - 'Cache-Control' => 'no-cache', - ); - /** This filter is documented in wp-includes/class-wp-http-streams.php */ - $sslverify = apply_filters( 'https_local_ssl_verify', false ); - - // Include Basic auth in loopback requests. - if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { - $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); - } - - $url = add_query_arg( - array( - 'health-check-test-wp_version_check' => true, - ), - admin_url( 'site-health.php' ) - ); - - $test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) ); - - if ( is_wp_error( $test ) ) { - return array( - 'description' => sprintf( - /* translators: %s: Name of the filter used. */ - __( 'Could not confirm that the %s filter is available.' ), - 'wp_version_check()' - ), - 'severity' => 'warning', - ); - } - - $response = wp_remote_retrieve_body( $test ); - - if ( 'yes' !== $response ) { + if ( ! has_filter( 'wp_version_check', 'wp_version_check' ) ) { return array( 'description' => sprintf( /* translators: %s: Name of the filter used. */ @@ -310,6 +271,11 @@ public function test_vcs_abspath() { * @return array The test results. */ function test_check_wp_filesystem_method() { + // Make sure the `request_filesystem_credentials` function is available during our REST call. + if ( ! function_exists( 'request_filesystem_credentials' ) ) { + require_once ABSPATH . '/wp-admin/includes/file.php'; + } + $skin = new Automatic_Upgrader_Skin; $success = $skin->request_filesystem_credentials( false, ABSPATH ); @@ -356,6 +322,11 @@ function test_all_files_writable() { return false; } + // Make sure the `get_core_checksums` function is available during our REST call. + if ( ! function_exists( 'get_core_checksums' ) ) { + require_once ABSPATH . '/wp-admin/includes/update.php'; + } + $checksums = get_core_checksums( $wp_version, 'en_US' ); $dev = ( false !== strpos( $wp_version, '-' ) ); // Get the last stable version's files and test against that. diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 42d9bd4947..fcc1ed7247 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -106,8 +106,8 @@ public function enqueue_scripts() { if ( 'site-health' === $screen->id && ! isset( $_GET['tab'] ) ) { $tests = WP_Site_Health::get_tests(); - // Don't run https test on localhost. - if ( 'localhost' === preg_replace( '|https?://|', '', get_site_url() ) ) { + // Don't run https test on development environments. + if ( $this->is_development_environment() ) { unset( $tests['direct']['https_status'] ); } @@ -133,7 +133,9 @@ public function enqueue_scripts() { if ( is_string( $test['test'] ) ) { $health_check_js_variables['site_status']['async'][] = array( 'test' => $test['test'], + 'has_rest' => ( isset( $test['has_rest'] ) ? $test['has_rest'] : false ), 'completed' => false, + 'headers' => isset( $test['headers'] ) ? $test['headers'] : array(), ); } } @@ -152,7 +154,7 @@ public function enqueue_scripts() { */ private function perform_test( $callback ) { /** - * Filter the output of a finished Site Health test. + * Filters the output of a finished Site Health test. * * @since 5.3.0 * @@ -729,7 +731,7 @@ public function get_test_php_version() { ) ), 'actions' => sprintf( - '

%s %s

', + '

%s %s

', esc_url( wp_get_update_php_url() ), __( 'Learn more about updating PHP' ), /* translators: Accessibility text. */ @@ -841,7 +843,7 @@ public function get_test_php_extensions() { __( 'The WordPress Hosting Team maintains a list of those modules, both recommended and required, in the team handbook%3$s.' ), /* translators: Localized team handbook, if one exists. */ esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ), - 'target="_blank" rel="noopener noreferrer"', + 'target="_blank" rel="noopener"', sprintf( ' %s', /* translators: Accessibility text. */ @@ -1158,7 +1160,7 @@ public function get_test_sql_server() { __( 'The SQL server is a required piece of software for the database WordPress uses to store all your site’s content and settings.' ) ), 'actions' => sprintf( - '

%s %s

', + '

%s %s

', /* translators: Localized version of WordPress requirements if one exists. */ esc_url( __( 'https://wordpress.org/about/requirements/' ) ), __( 'Learn more about what WordPress requires to run.' ), @@ -1395,7 +1397,7 @@ public function get_test_dotorg_communication() { ); $result['actions'] = sprintf( - '

%s %s

', + '

%s %s

', /* translators: Localized Support reference. */ esc_url( __( 'https://wordpress.org/support' ) ), __( 'Get help resolving this issue.' ), @@ -1433,7 +1435,7 @@ public function get_test_is_in_debug_mode() { __( 'Debug mode is often enabled to gather more details about an error or site failure, but may contain sensitive information which should not be available on a publicly available website.' ) ), 'actions' => sprintf( - '

%s %s

', + '

%s %s

', /* translators: Documentation explaining debugging in WordPress. */ esc_url( __( 'https://wordpress.org/support/article/debugging-in-wordpress/' ) ), __( 'Learn more about debugging in WordPress.' ), @@ -1464,6 +1466,11 @@ public function get_test_is_in_debug_mode() { $result['status'] = 'critical'; + // On development environments, set the status to recommended. + if ( $this->is_development_environment() ) { + $result['status'] = 'recommended'; + } + $result['description'] .= sprintf( '

%s

', sprintf( @@ -1502,7 +1509,7 @@ public function get_test_https_status() { __( 'An HTTPS connection is a more secure way of browsing the web. Many services now have HTTPS as a requirement. HTTPS allows you to take advantage of new features that can increase site speed, improve search rankings, and gain the trust of your visitors by helping to protect their online privacy.' ) ), 'actions' => sprintf( - '

%s %s

', + '

%s %s

', /* translators: Documentation explaining HTTPS and why it should be used. */ esc_url( __( 'https://wordpress.org/support/article/why-should-i-use-https/' ) ), __( 'Learn more about why you should use HTTPS' ), @@ -1854,7 +1861,7 @@ public function get_test_http_requests() { $hosts = explode( ',', WP_ACCESSIBLE_HOSTS ); } - if ( $blocked && 0 === sizeof( $hosts ) ) { + if ( $blocked && 0 === count( $hosts ) ) { $result['status'] = 'critical'; $result['label'] = __( 'HTTP requests are blocked' ); @@ -1869,7 +1876,7 @@ public function get_test_http_requests() { ); } - if ( $blocked && 0 < sizeof( $hosts ) ) { + if ( $blocked && 0 < count( $hosts ) ) { $result['status'] = 'recommended'; $result['label'] = __( 'HTTP requests are partially blocked' ); @@ -2072,6 +2079,62 @@ public function get_test_file_uploads() { return $result; } + /** + * Tests if the Authorization header has the expected values. + * + * @since 5.6.0 + * + * @return array + */ + public function get_test_authorization_header() { + $result = array( + 'label' => __( 'The Authorization header is working as expected.' ), + 'status' => 'good', + 'badge' => array( + 'label' => __( 'Security' ), + 'color' => 'blue', + ), + 'description' => sprintf( + '

%s

', + __( 'The Authorization header comes from the third-party applications you approve. Without it, those apps cannot connect to your site.' ) + ), + 'actions' => '', + 'test' => 'authorization_header', + ); + + if ( ! isset( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) ) { + $result['label'] = __( 'The authorization header is missing.' ); + } elseif ( 'user' !== $_SERVER['PHP_AUTH_USER'] || 'pwd' !== $_SERVER['PHP_AUTH_PW'] ) { + $result['label'] = __( 'The authorization header is invalid.' ); + } else { + return $result; + } + + $result['status'] = 'recommended'; + + if ( ! function_exists( 'got_mod_rewrite' ) ) { + require_once ABSPATH . 'wp-admin/includes/misc.php'; + } + + if ( got_mod_rewrite() ) { + $result['actions'] .= sprintf( + '

%s

', + esc_url( admin_url( 'options-permalink.php' ) ), + __( 'Flush permalinks' ) + ); + } else { + $result['actions'] .= sprintf( + '

%s %s

', + __( 'https://developer.wordpress.org/rest-api/frequently-asked-questions/#why-is-authentication-not-working' ), + __( 'Learn how to configure the Authorization header.' ), + /* translators: Accessibility text. */ + __( '(opens in a new tab)' ) + ); + } + + return $result; + } + /** * Return a set of tests that belong to the site status page. * @@ -2080,6 +2143,7 @@ public function get_test_file_uploads() { * experiences. * * @since 5.2.0 + * @since 5.6.0 Added support for `has_rest` and `permissions`. * * @return array The list of tests to run. */ @@ -2153,16 +2217,29 @@ public static function get_tests() { ), 'async' => array( 'dotorg_communication' => array( - 'label' => __( 'Communication with WordPress.org' ), - 'test' => 'dotorg_communication', + 'label' => __( 'Communication with WordPress.org' ), + 'test' => rest_url( 'wp-site-health/v1/tests/dotorg-communication' ), + 'has_rest' => true, + 'async_direct_test' => array( WP_Site_Health::get_instance(), 'get_test_dotorg_communication' ), ), 'background_updates' => array( - 'label' => __( 'Background updates' ), - 'test' => 'background_updates', + 'label' => __( 'Background updates' ), + 'test' => rest_url( 'wp-site-health/v1/tests/background-updates' ), + 'has_rest' => true, + 'async_direct_test' => array( WP_Site_Health::get_instance(), 'get_test_background_updates' ), ), 'loopback_requests' => array( - 'label' => __( 'Loopback request' ), - 'test' => 'loopback_requests', + 'label' => __( 'Loopback request' ), + 'test' => rest_url( 'wp-site-health/v1/tests/loopback-requests' ), + 'has_rest' => true, + 'async_direct_test' => array( WP_Site_Health::get_instance(), 'get_test_loopback_requests' ), + ), + 'authorization_header' => array( + 'label' => __( 'Authorization header' ), + 'test' => rest_url( 'wp-site-health/v1/tests/authorization-header' ), + 'has_rest' => true, + 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:pwd' ) ), + 'skip_cron' => true, ), ), ); @@ -2189,6 +2266,8 @@ public static function get_tests() { * to complete should run asynchronously, to avoid extended loading periods within wp-admin. * * @since 5.2.0 + * @since 5.6.0 Added the `async_direct_test` array key. + * Added the `skip_cron` array key. * * @param array $test_type { * An associative array, where the `$test_type` is either `direct` or @@ -2199,9 +2278,14 @@ public static function get_tests() { * Plugins and themes are encouraged to prefix test identifiers with their slug * to avoid any collisions between tests. * - * @type string $label A friendly label for your test to identify it by. - * @type mixed $test A callable to perform a direct test, or a string Ajax action to be called - * to perform an async test. + * @type string $label A friendly label for your test to identify it by. + * @type mixed $test A callable to perform a direct test, or a string AJAX action + * to be called to perform an async test. + * @type boolean $has_rest Optional. Denote if `$test` has a REST API endpoint. + * @type boolean $skip_cron Whether to skip this test when running as cron. + * @type callable $async_direct_test A manner of directly calling the test marked as asynchronous, + * as the scheduled event can not authenticate, and endpoints + * may require authentication. * } * } */ @@ -2381,13 +2465,8 @@ function detect_plugin_theme_auto_update_issues() { 'requires_php' => '5.6.20', ); - $type = 'plugin'; - /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $test_plugins_enabled = apply_filters( "auto_update_{$type}", true, $mock_plugin ); - - $type = 'theme'; - /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $test_themes_enabled = apply_filters( "auto_update_{$type}", true, $mock_theme ); + $test_plugins_enabled = wp_is_auto_update_forced_for_item( 'plugin', true, $mock_plugin ); + $test_themes_enabled = wp_is_auto_update_forced_for_item( 'theme', true, $mock_theme ); $ui_enabled_for_plugins = wp_is_auto_update_enabled_for_type( 'plugin' ); $ui_enabled_for_themes = wp_is_auto_update_enabled_for_type( 'theme' ); @@ -2519,8 +2598,8 @@ public function wp_cron_scheduled_check() { 'critical' => 0, ); - // Don't run https test on localhost. - if ( 'localhost' === preg_replace( '|https?://|', '', get_site_url() ) ) { + // Don't run https test on development environments. + if ( $this->is_development_environment() ) { unset( $tests['direct']['https_status'] ); } @@ -2544,10 +2623,22 @@ public function wp_cron_scheduled_check() { } foreach ( $tests['async'] as $test ) { + if ( ! empty( $test['skip_cron'] ) ) { + continue; + } + + // Local endpoints may require authentication, so asynchronous tests can pass a direct test runner as well. + if ( ! empty( $test['async_direct_test'] ) && is_callable( $test['async_direct_test'] ) ) { + // This test is callable, do so and continue to the next asynchronous check. + $results[] = $this->perform_test( $test['async_direct_test'] ); + continue; + } + if ( is_string( $test['test'] ) ) { + // Check if this test has a REST API endpoint. if ( isset( $test['has_rest'] ) && $test['has_rest'] ) { - $result_fetch = wp_remote_post( - rest_url( $test['test'] ), + $result_fetch = wp_remote_get( + $test['test'], array( 'body' => array( '_wpnonce' => wp_create_nonce( 'wp_rest' ), @@ -2566,7 +2657,7 @@ public function wp_cron_scheduled_check() { ); } - if ( ! is_wp_error( $result_fetch ) ) { + if ( ! is_wp_error( $result_fetch ) && 200 === wp_remote_retrieve_response_code( $result_fetch ) ) { $result = json_decode( wp_remote_retrieve_body( $result_fetch ), true ); } else { $result = false; @@ -2595,4 +2686,16 @@ public function wp_cron_scheduled_check() { set_transient( 'health-check-site-status-result', wp_json_encode( $site_status ) ); } + + /** + * Checks if the current environment type is set to 'development' or 'local'. + * + * @since 5.6.0 + * + * @return bool True if it is a development environment, false if not. + */ + public function is_development_environment() { + return in_array( wp_get_environment_type(), array( 'development', 'local' ), true ); + } + } diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php index cb48cbc875..24df0daf6b 100644 --- a/wp-admin/includes/class-wp-terms-list-table.php +++ b/wp-admin/includes/class-wp-terms-list-table.php @@ -129,7 +129,12 @@ public function prepare_items() { $this->set_pagination_args( array( - 'total_items' => wp_count_terms( $this->screen->taxonomy, compact( 'search' ) ), + 'total_items' => wp_count_terms( + array( + 'taxonomy' => $this->screen->taxonomy, + 'search' => $search, + ) + ), 'per_page' => $tags_per_page, ) ); diff --git a/wp-admin/includes/class-wp-theme-install-list-table.php b/wp-admin/includes/class-wp-theme-install-list-table.php index 37ee8d459d..f721f9473d 100644 --- a/wp-admin/includes/class-wp-theme-install-list-table.php +++ b/wp-admin/includes/class-wp-theme-install-list-table.php @@ -246,15 +246,15 @@ public function display_rows() { * @param object $theme { * An object that contains theme data returned by the WordPress.org API. * - * @type string $name Theme name, e.g. 'Twenty Twenty'. - * @type string $slug Theme slug, e.g. 'twentytwenty'. + * @type string $name Theme name, e.g. 'Twenty Twenty-One'. + * @type string $slug Theme slug, e.g. 'twentytwentyone'. * @type string $version Theme version, e.g. '1.1'. * @type string $author Theme author username, e.g. 'melchoyce'. - * @type string $preview_url Preview URL, e.g. 'https://2020.wordpress.net/'. - * @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentytwenty/'. + * @type string $preview_url Preview URL, e.g. 'https://2021.wordpress.net/'. + * @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentytwentyone/'. * @type float $rating Rating score. * @type int $num_ratings The number of ratings. - * @type string $homepage Theme homepage, e.g. 'https://wordpress.org/themes/twentytwenty/'. + * @type string $homepage Theme homepage, e.g. 'https://wordpress.org/themes/twentytwentyone/'. * @type string $description Theme description. * @type string $download_link Theme ZIP download URL. * } diff --git a/wp-admin/includes/class-wp-upgrader-skin.php b/wp-admin/includes/class-wp-upgrader-skin.php index 6151004eab..06f10cdca3 100644 --- a/wp-admin/includes/class-wp-upgrader-skin.php +++ b/wp-admin/includes/class-wp-upgrader-skin.php @@ -20,7 +20,7 @@ class WP_Upgrader_Skin { * * @since 2.8.0 * - * @var object + * @var WP_Upgrader */ public $upgrader; diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 2da3b7cb21..5faac56213 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -344,12 +344,12 @@ public function unpack_package( $package, $delete_package = true ) { } /** - * Flatten the results of WP_Filesystem::dirlist() for iterating over. + * Flatten the results of WP_Filesystem_Base::dirlist() for iterating over. * * @since 4.9.0 * @access protected * - * @param array $nested_files Array of files as returned by WP_Filesystem::dirlist(). + * @param array $nested_files Array of files as returned by WP_Filesystem_Base::dirlist(). * @param string $path Relative path to prepend to child nodes. Optional. * @return array A flattened array of the $nested_files specified. */ diff --git a/wp-admin/includes/class-wp-users-list-table.php b/wp-admin/includes/class-wp-users-list-table.php index 018654bdd2..42cf19f5f8 100644 --- a/wp-admin/includes/class-wp-users-list-table.php +++ b/wp-admin/includes/class-wp-users-list-table.php @@ -54,7 +54,7 @@ public function __construct( $args = array() ) { $this->is_site_users = 'site-users-network' === $this->screen->id; if ( $this->is_site_users ) { - $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; + $this->site_id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0; } } @@ -259,7 +259,7 @@ protected function get_views() { * * @since 3.1.0 * - * @return string[] Array of bulk action labels keyed by their action. + * @return array Array of bulk action labels keyed by their action. */ protected function get_bulk_actions() { $actions = array(); diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php index 89022949b1..90d79dd211 100644 --- a/wp-admin/includes/comment.php +++ b/wp-admin/includes/comment.php @@ -141,8 +141,8 @@ function get_comment_to_edit( $id ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param int|array $post_id Either a single Post ID or an array of Post IDs - * @return int|array Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs + * @param int|int[] $post_id Either a single Post ID or an array of Post IDs + * @return int|int[] Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs */ function get_pending_comments_num( $post_id ) { global $wpdb; diff --git a/wp-admin/includes/credits.php b/wp-admin/includes/credits.php index ed6071b1d5..23fd532fc6 100644 --- a/wp-admin/includes/credits.php +++ b/wp-admin/includes/credits.php @@ -11,23 +11,32 @@ * Retrieve the contributor credits. * * @since 3.2.0 + * @since 5.6.0 Added the `$version` and `$locale` parameters. * + * @param string $version WordPress version. Defaults to the current version. + * @param string $locale WordPress locale. Defaults to the current user's locale. * @return array|false A list of all of the contributors, or false on error. */ -function wp_credits() { - // Include an unmodified $wp_version. - require ABSPATH . WPINC . '/version.php'; +function wp_credits( $version = '', $locale = '' ) { + if ( ! $version ) { + // Include an unmodified $wp_version. + require ABSPATH . WPINC . '/version.php'; - $locale = get_user_locale(); + $version = $wp_version; + } + + if ( ! $locale ) { + $locale = get_user_locale(); + } $results = get_site_transient( 'wordpress_credits_' . $locale ); if ( ! is_array( $results ) - || false !== strpos( $wp_version, '-' ) - || ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 ) + || false !== strpos( $version, '-' ) + || ( isset( $results['data']['version'] ) && strpos( $version, $results['data']['version'] ) !== 0 ) ) { - $url = "http://api.wordpress.org/core/credits/1.1/?version={$wp_version}&locale={$locale}"; - $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) ); + $url = "http://api.wordpress.org/core/credits/1.1/?version={$version}&locale={$locale}"; + $options = array( 'user-agent' => 'WordPress/' . $version . '; ' . home_url( '/' ) ); if ( wp_http_supports( array( 'ssl' ) ) ) { $url = set_url_scheme( $url, 'https' ); diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index f758c2c662..6855aa6c96 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -15,7 +15,7 @@ * * @global array $wp_registered_widgets * @global array $wp_registered_widget_controls - * @global array $wp_dashboard_control_callbacks + * @global callable[] $wp_dashboard_control_callbacks */ function wp_dashboard_setup() { global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks; @@ -157,8 +157,9 @@ function wp_dashboard_setup() { * Adds a new dashboard widget. * * @since 2.7.0 + * @since 5.6.0 The `$context` and `$priority` parameters were added. * - * @global array $wp_dashboard_control_callbacks + * @global callable[] $wp_dashboard_control_callbacks * * @param string $widget_id Widget ID (used in the 'id' attribute for the widget). * @param string $widget_name Title of the widget. @@ -167,8 +168,12 @@ function wp_dashboard_setup() { * @param callable $control_callback Optional. Function that outputs controls for the widget. Default null. * @param array $callback_args Optional. Data that should be set as the $args property of the widget array * (which is the second parameter passed to your callback). Default null. + * @param string $context Optional. The context within the screen where the box should display. + * Accepts 'normal', 'side', 'column3', or 'column4'. Default 'normal'. + * @param string $priority Optional. The priority within the context where the box should show. + * Accepts 'high', 'core', 'default', or 'low'. Default 'core'. */ -function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null ) { +function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null, $context = 'normal', $priority = 'core' ) { $screen = get_current_screen(); global $wp_dashboard_control_callbacks; @@ -194,19 +199,24 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_ $side_widgets = array( 'dashboard_quick_press', 'dashboard_primary' ); - $location = 'normal'; if ( in_array( $widget_id, $side_widgets, true ) ) { - $location = 'side'; + $context = 'side'; } $high_priority_widgets = array( 'dashboard_browser_nag', 'dashboard_php_nag' ); - $priority = 'core'; if ( in_array( $widget_id, $high_priority_widgets, true ) ) { $priority = 'high'; } - add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority, $callback_args ); + if ( empty( $context ) ) { + $context = 'normal'; + } + if ( empty( $priority ) ) { + $priority = 'core'; + } + + add_meta_box( $widget_id, $widget_name, $callback, $screen, $context, $priority, $callback_args ); } /** @@ -606,7 +616,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) { echo '

' . __( 'Your Recent Drafts' ) . "

\n
    "; /* translators: Maximum number of words used in a preview of a draft on the dashboard. */ - $draft_length = intval( _x( '10', 'draft_length' ) ); + $draft_length = (int) _x( '10', 'draft_length' ); $drafts = array_slice( $drafts, 0, 3 ); foreach ( $drafts as $draft ) { @@ -928,7 +938,7 @@ function wp_dashboard_recent_posts( $args ) { 'post_status' => $args['status'], 'orderby' => 'date', 'order' => $args['order'], - 'posts_per_page' => intval( $args['max'] ), + 'posts_per_page' => (int) $args['max'], 'no_found_rows' => true, 'cache_results' => false, 'perm' => ( 'future' === $args['status'] ) ? 'editable' : 'readable', @@ -965,10 +975,10 @@ function wp_dashboard_recent_posts( $args ) { } elseif ( gmdate( 'Y-m-d', $time ) == $tomorrow ) { $relative = __( 'Tomorrow' ); } elseif ( gmdate( 'Y', $time ) !== $year ) { - /* translators: Date and time format for recent posts on the dashboard, from a different calendar year, see https://www.php.net/date */ + /* translators: Date and time format for recent posts on the dashboard, from a different calendar year, see https://www.php.net/manual/datetime.format.php */ $relative = date_i18n( __( 'M jS Y' ), $time ); } else { - /* translators: Date and time format for recent posts on the dashboard, see https://www.php.net/date */ + /* translators: Date and time format for recent posts on the dashboard, see https://www.php.net/manual/datetime.format.php */ $relative = date_i18n( __( 'M jS' ), $time ); } @@ -1037,7 +1047,7 @@ function wp_dashboard_recent_comments( $total_items = 5 ) { } if ( $comments ) { - echo '
    '; + echo '
    '; echo '

    ' . __( 'Recent Comments' ) . '

    '; echo '
      '; @@ -1139,7 +1149,7 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar * * @since 2.5.0 * - * @global array $wp_dashboard_control_callbacks + * @global callable[] $wp_dashboard_control_callbacks * * @param int $widget_control_id Registered Widget ID. */ @@ -1452,7 +1462,7 @@ function wp_dashboard_primary() { * @param string $title Title attribute for the widget's primary link. */ 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ), - 'items' => 1, + 'items' => 2, 'show_summary' => 0, 'show_author' => 0, 'show_date' => 0, @@ -1751,7 +1761,7 @@ function wp_dashboard_php_nag() {

      %2$s %3$s', + '%2$s %3$s', esc_url( wp_get_update_php_url() ), __( 'Learn more about updating PHP' ), /* translators: Accessibility text. */ diff --git a/wp-admin/includes/deprecated.php b/wp-admin/includes/deprecated.php index ede053de6f..7caec42e54 100644 --- a/wp-admin/includes/deprecated.php +++ b/wp-admin/includes/deprecated.php @@ -981,7 +981,8 @@ function type_url_form_file() { * @deprecated 3.3.0 Use WP_Screen::add_help_tab() * @see WP_Screen::add_help_tab() * - * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. + * @param string $screen The handle for the screen to add help to. This is usually + * the hook name returned by the `add_*_page()` functions. * @param string $help The content of an 'Overview' help tab. */ function add_contextual_help( $screen, $help ) { @@ -1085,7 +1086,7 @@ function _media_button($title, $icon, $type, $id) { * @see get_post() * * @param int $id - * @return object + * @return WP_Post */ function get_post_to_edit( $id ) { _deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' ); diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 7b1b797eb4..74d7c5f823 100644 --- a/wp-admin/includes/export.php +++ b/wp-admin/includes/export.php @@ -227,7 +227,7 @@ function wxr_site_url() { * * @since 2.1.0 * - * @param object $category Category Object + * @param WP_Term $category Category Object */ function wxr_cat_name( $category ) { if ( empty( $category->name ) ) { @@ -242,7 +242,7 @@ function wxr_cat_name( $category ) { * * @since 2.1.0 * - * @param object $category Category Object + * @param WP_Term $category Category Object */ function wxr_category_description( $category ) { if ( empty( $category->description ) ) { @@ -257,7 +257,7 @@ function wxr_category_description( $category ) { * * @since 2.3.0 * - * @param object $tag Tag Object + * @param WP_Term $tag Tag Object */ function wxr_tag_name( $tag ) { if ( empty( $tag->name ) ) { @@ -272,7 +272,7 @@ function wxr_tag_name( $tag ) { * * @since 2.3.0 * - * @param object $tag Tag Object + * @param WP_Term $tag Tag Object */ function wxr_tag_description( $tag ) { if ( empty( $tag->description ) ) { @@ -287,7 +287,7 @@ function wxr_tag_description( $tag ) { * * @since 2.9.0 * - * @param object $term Term Object + * @param WP_Term $term Term Object */ function wxr_term_name( $term ) { if ( empty( $term->name ) ) { @@ -302,7 +302,7 @@ function wxr_term_name( $term ) { * * @since 2.9.0 * - * @param object $term Term Object + * @param WP_Term $term Term Object */ function wxr_term_description( $term ) { if ( empty( $term->description ) ) { @@ -372,7 +372,7 @@ function wxr_authors_list( array $post_ids = null ) { foreach ( $authors as $author ) { echo "\t"; - echo '' . intval( $author->ID ) . ''; + echo '' . (int) $author->ID . ''; echo '' . wxr_cdata( $author->user_login ) . ''; echo '' . wxr_cdata( $author->user_email ) . ''; echo '' . wxr_cdata( $author->display_name ) . ''; @@ -395,7 +395,7 @@ function wxr_nav_menu_terms() { foreach ( $nav_menus as $menu ) { echo "\t"; - echo '' . intval( $menu->term_id ) . ''; + echo '' . (int) $menu->term_id . ''; echo 'nav_menu'; echo '' . wxr_cdata( $menu->slug ) . ''; wxr_term_name( $menu ); @@ -478,7 +478,7 @@ function wxr_filter_postmeta( $return_me, $meta_key ) { - term_id ); ?> + term_id; ?> slug ); ?> parent ? $cats[ $c->parent ]->slug : '' ); ?> - term_id ); ?> + term_id; ?> slug ); ?> - term_id ); ?> + term_id; ?> taxonomy ); ?> slug ); ?> parent ? $terms[ $t->parent ]->slug : '' ); ?> @@ -534,7 +534,7 @@ function wxr_filter_postmeta( $return_me, $meta_key ) { // Fetch 20 posts at a time rather than loading the entire table into memory. while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) { - $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')'; + $where = 'WHERE ID IN (' . implode( ',', $next_posts ) . ')'; $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" ); // Begin Loop. @@ -573,18 +573,18 @@ function wxr_filter_postmeta( $return_me, $meta_key ) { - ID ); ?> + ID; ?> post_date ); ?> post_date_gmt ); ?> comment_status ); ?> ping_status ); ?> post_name ); ?> post_status ); ?> - post_parent ); ?> - menu_order ); ?> + post_parent; ?> + menu_order; ?> post_type ); ?> post_password ); ?> - + post_type ) : ?> ID ) ); ?> @@ -620,7 +620,7 @@ function wxr_filter_postmeta( $return_me, $meta_key ) { foreach ( $comments as $c ) : ?> - comment_ID ); ?> + comment_ID; ?> comment_author ); ?> comment_author_email ); ?> comment_author_url ); ?> @@ -630,8 +630,8 @@ function wxr_filter_postmeta( $return_me, $meta_key ) { comment_content ); ?> comment_approved ); ?> comment_type ); ?> - comment_parent ); ?> - user_id ); ?> + comment_parent; ?> + user_id; ?> get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) ); foreach ( $c_meta as $meta ) : diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index e22292c4f8..993635e460 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -489,7 +489,7 @@ function wp_edit_theme_plugin_file( $args ) { $previous_content = file_get_contents( $real_file ); - if ( ! is_writeable( $real_file ) ) { + if ( ! is_writable( $real_file ) ) { return new WP_Error( 'file_not_writable' ); } @@ -510,7 +510,7 @@ function wp_edit_theme_plugin_file( $args ) { $scrape_key = md5( rand() ); $transient = 'scrape_key_' . $scrape_key; - $scrape_nonce = strval( rand() ); + $scrape_nonce = (string) rand(); // It shouldn't take more than 60 seconds to make the two loopback requests. set_transient( $transient, $scrape_nonce, 60 ); @@ -928,7 +928,7 @@ function wp_handle_upload_error( &$file, $message ) { $url = $uploads['url'] . "/$filename"; if ( is_multisite() ) { - delete_transient( 'dirsize_cache' ); + clean_dirsize_cache( $new_file ); } /** @@ -1125,7 +1125,7 @@ function download_url( $url, $timeout = 300, $signature_verification = false ) { } /** - * Filter the URL where the signature for a file is located. + * Filters the URL where the signature for a file is located. * * @since 5.2.0 * @@ -1394,7 +1394,7 @@ function wp_trusted_keys() { // TODO: Add key #2 with longer expiration. /** - * Filter the valid signing keys used to verify the contents of files. + * Filters the valid signing keys used to verify the contents of files. * * @since 5.2.0 * diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index 1363f00ae7..0d23c18318 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -291,8 +291,8 @@ function wp_stream_image( $image, $mime_type, $attachment_id ) { * @since 2.9.0 * @deprecated 3.5.0 Use {@see 'image_editor_save_pre'} instead. * - * @param resource $image Image resource to be streamed. - * @param int $attachment_id The attachment post ID. + * @param resource|GdImage $image Image resource to be streamed. + * @param int $attachment_id The attachment post ID. */ $image = apply_filters_deprecated( 'image_save_pre', array( $image, $attachment_id ), '3.5.0', 'image_editor_save_pre' ); @@ -420,19 +420,22 @@ function _image_get_preview_ratio( $w, $h ) { * @see WP_Image_Editor::rotate() * * @ignore - * @param resource $img Image resource. - * @param float|int $angle Image rotation angle, in degrees. - * @return resource|false GD image resource, false otherwise. + * @param resource|GdImage $img Image resource. + * @param float|int $angle Image rotation angle, in degrees. + * @return resource|GdImage|false GD image resource or GdImage instance, false otherwise. */ function _rotate_image_resource( $img, $angle ) { _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::rotate()' ); + if ( function_exists( 'imagerotate' ) ) { $rotated = imagerotate( $img, $angle, 0 ); - if ( is_resource( $rotated ) ) { + + if ( is_gd_image( $rotated ) ) { imagedestroy( $img ); $img = $rotated; } } + return $img; } @@ -444,17 +447,19 @@ function _rotate_image_resource( $img, $angle ) { * @see WP_Image_Editor::flip() * * @ignore - * @param resource $img Image resource. - * @param bool $horz Whether to flip horizontally. - * @param bool $vert Whether to flip vertically. - * @return resource (maybe) flipped image resource. + * @param resource|GdImage $img Image resource or GdImage instance. + * @param bool $horz Whether to flip horizontally. + * @param bool $vert Whether to flip vertically. + * @return resource|GdImage (maybe) flipped image resource or GdImage instance. */ function _flip_image_resource( $img, $horz, $vert ) { _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::flip()' ); + $w = imagesx( $img ); $h = imagesy( $img ); $dst = wp_imagecreatetruecolor( $w, $h ); - if ( is_resource( $dst ) ) { + + if ( is_gd_image( $dst ) ) { $sx = $vert ? ( $w - 1 ) : 0; $sy = $horz ? ( $h - 1 ) : 0; $sw = $vert ? -$w : $w; @@ -465,6 +470,7 @@ function _flip_image_resource( $img, $horz, $vert ) { $img = $dst; } } + return $img; } @@ -474,21 +480,23 @@ function _flip_image_resource( $img, $horz, $vert ) { * @since 2.9.0 * * @ignore - * @param resource $img Image resource. - * @param float $x Source point x-coordinate. - * @param float $y Source point y-coordinate. - * @param float $w Source width. - * @param float $h Source height. - * @return resource (maybe) cropped image resource. + * @param resource|GdImage $img Image resource or GdImage instance. + * @param float $x Source point x-coordinate. + * @param float $y Source point y-coordinate. + * @param float $w Source width. + * @param float $h Source height. + * @return resource|GdImage (maybe) cropped image resource or GdImage instance. */ function _crop_image_resource( $img, $x, $y, $w, $h ) { $dst = wp_imagecreatetruecolor( $w, $h ); - if ( is_resource( $dst ) ) { + + if ( is_gd_image( $dst ) ) { if ( imagecopy( $dst, $img, 0, 0, $x, $y, $w, $h ) ) { imagedestroy( $img ); $img = $dst; } } + return $img; } @@ -502,7 +510,7 @@ function _crop_image_resource( $img, $x, $y, $w, $h ) { * @return WP_Image_Editor WP_Image_Editor instance with changes applied. */ function image_edit_apply_changes( $image, $changes ) { - if ( is_resource( $image ) ) { + if ( is_gd_image( $image ) ) { /* translators: 1: $image, 2: WP_Image_Editor */ _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) ); } @@ -566,7 +574,7 @@ function image_edit_apply_changes( $image, $changes ) { * @param array $changes Array of change operations. */ $image = apply_filters( 'wp_image_editor_before_change', $image, $changes ); - } elseif ( is_resource( $image ) ) { + } elseif ( is_gd_image( $image ) ) { /** * Filters the GD image resource before applying changes to the image. @@ -574,8 +582,8 @@ function image_edit_apply_changes( $image, $changes ) { * @since 2.9.0 * @deprecated 3.5.0 Use {@see 'wp_image_editor_before_change'} instead. * - * @param resource $image GD image resource. - * @param array $changes Array of change operations. + * @param resource|GdImage $image GD image resource or GdImage instance. + * @param array $changes Array of change operations. */ $image = apply_filters_deprecated( 'image_edit_before_change', array( $image, $changes ), '3.5.0', 'wp_image_editor_before_change' ); } @@ -778,8 +786,8 @@ function wp_save_image( $post_id ) { return $return; } - $fwidth = ! empty( $_REQUEST['fwidth'] ) ? intval( $_REQUEST['fwidth'] ) : 0; - $fheight = ! empty( $_REQUEST['fheight'] ) ? intval( $_REQUEST['fheight'] ) : 0; + $fwidth = ! empty( $_REQUEST['fwidth'] ) ? (int) $_REQUEST['fwidth'] : 0; + $fheight = ! empty( $_REQUEST['fheight'] ) ? (int) $_REQUEST['fheight'] : 0; $target = ! empty( $_REQUEST['target'] ) ? preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['target'] ) : ''; $scale = ! empty( $_REQUEST['do'] ) && 'scale' === $_REQUEST['do']; @@ -936,8 +944,8 @@ function wp_save_image( $post_id ) { } if ( isset( $_wp_additional_image_sizes[ $size ] ) ) { - $width = intval( $_wp_additional_image_sizes[ $size ]['width'] ); - $height = intval( $_wp_additional_image_sizes[ $size ]['height'] ); + $width = (int) $_wp_additional_image_sizes[ $size ]['width']; + $height = (int) $_wp_additional_image_sizes[ $size ]['height']; $crop = ( $nocrop ) ? false : $_wp_additional_image_sizes[ $size ]['crop']; } else { $height = get_option( "{$size}_size_h" ); diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index f0a3d38bb4..522e310c51 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -917,10 +917,12 @@ function file_is_displayable_image( $path ) { * * @since 2.9.0 * - * @param string $attachment_id Attachment ID. - * @param string $mime_type Image mime type. - * @param string $size Optional. Image size, defaults to 'full'. - * @return resource|false The resulting image resource on success, false on failure. + * @param int $attachment_id Attachment ID. + * @param string $mime_type Image mime type. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array + * of width and height values in pixels (in that order). Default 'full'. + * @return resource|GdImage|false The resulting image resource or GdImage instance on success, + * false on failure. */ function load_image_to_edit( $attachment_id, $mime_type, $size = 'full' ) { $filepath = _load_image_to_edit_path( $attachment_id, $size ); @@ -942,37 +944,42 @@ function load_image_to_edit( $attachment_id, $mime_type, $size = 'full' ) { $image = false; break; } - if ( is_resource( $image ) ) { + + if ( is_gd_image( $image ) ) { /** * Filters the current image being loaded for editing. * * @since 2.9.0 * - * @param resource $image Current image. - * @param string $attachment_id Attachment ID. - * @param string $size Image size. + * @param resource|GdImage $image Current image. + * @param int $attachment_id Attachment ID. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ $image = apply_filters( 'load_image_to_edit', $image, $attachment_id, $size ); + if ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) { imagealphablending( $image, false ); imagesavealpha( $image, true ); } } + return $image; } /** - * Retrieve the path or url of an attachment's attached file. + * Retrieve the path or URL of an attachment's attached file. * * If the attached file is not present on the local filesystem (usually due to replication plugins), - * then the url of the file is returned if url fopen is supported. + * then the URL of the file is returned if `allow_url_fopen` is supported. * * @since 3.4.0 * @access private * - * @param string $attachment_id Attachment ID. - * @param string $size Optional. Image size, defaults to 'full'. - * @return string|false File path or url on success, false on failure. + * @param int $attachment_id Attachment ID. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array + * of width and height values in pixels (in that order). Default 'full'. + * @return string|false File path or URL on success, false on failure. */ function _load_image_to_edit_path( $attachment_id, $size = 'full' ) { $filepath = get_attached_file( $attachment_id ); @@ -985,30 +992,32 @@ function _load_image_to_edit_path( $attachment_id, $size = 'full' ) { $filepath = path_join( dirname( $filepath ), $data['file'] ); /** - * Filters the path to the current image. + * Filters the path to an attachment's file when editing the image. * * The filter is evaluated for all image sizes except 'full'. * * @since 3.1.0 * - * @param string $path Path to the current image. - * @param string $attachment_id Attachment ID. - * @param string $size Size of the image. + * @param string $path Path to the current image. + * @param int $attachment_id Attachment ID. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ $filepath = apply_filters( 'load_image_to_edit_filesystempath', $filepath, $attachment_id, $size ); } } } elseif ( function_exists( 'fopen' ) && ini_get( 'allow_url_fopen' ) ) { /** - * Filters the image URL if not in the local filesystem. + * Filters the path to an attachment's URL when editing the image. * - * The filter is only evaluated if fopen is enabled on the server. + * The filter is only evaluated if the file isn't stored locally and `allow_url_fopen` is enabled on the server. * * @since 3.1.0 * - * @param string $image_url Current image URL. - * @param string $attachment_id Attachment ID. - * @param string $size Size of the image. + * @param string $image_url Current image URL. + * @param int $attachment_id Attachment ID. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ $filepath = apply_filters( 'load_image_to_edit_attachmenturl', wp_get_attachment_url( $attachment_id ), $attachment_id, $size ); } @@ -1018,9 +1027,10 @@ function _load_image_to_edit_path( $attachment_id, $size = 'full' ) { * * @since 2.9.0 * - * @param string|bool $filepath File path or URL to current image, or false. - * @param string $attachment_id Attachment ID. - * @param string $size Size of the image. + * @param string|bool $filepath File path or URL to current image, or false. + * @param int $attachment_id Attachment ID. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ return apply_filters( 'load_image_to_edit_path', $filepath, $attachment_id, $size ); } @@ -1031,7 +1041,7 @@ function _load_image_to_edit_path( $attachment_id, $size = 'full' ) { * @since 3.4.0 * @access private * - * @param string $attachment_id Attachment ID. + * @param int $attachment_id Attachment ID. * @return string|false New file path on success, false on failure. */ function _copy_image_file( $attachment_id ) { diff --git a/wp-admin/includes/list-table.php b/wp-admin/includes/list-table.php index 342f48dc9f..bc3b6a719c 100644 --- a/wp-admin/includes/list-table.php +++ b/wp-admin/includes/list-table.php @@ -33,6 +33,7 @@ function _get_list_table( $class, $args = array() ) { 'WP_Themes_List_Table' => 'themes', 'WP_Theme_Install_List_Table' => array( 'themes', 'theme-install' ), 'WP_Plugins_List_Table' => 'plugins', + 'WP_Application_Passwords_List_Table' => 'application-passwords', // Network Admin. 'WP_MS_Sites_List_Table' => 'ms-sites', @@ -70,9 +71,10 @@ function _get_list_table( $class, $args = array() ) { * * @since 2.7.0 * - * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the - * add_*_page() functions. - * @param string[] $columns An array of columns with column IDs as the keys and translated column names as the values. + * @param string $screen The handle for the screen to register column headers for. This is + * usually the hook name returned by the `add_*_page()` functions. + * @param string[] $columns An array of columns with column IDs as the keys and translated + * column names as the values. */ function register_column_headers( $screen, $columns ) { new _WP_List_Table_Compat( $screen, $columns ); diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index cc92f6a583..11629ae6e9 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -49,10 +49,10 @@ function update_gallery_tab( $tabs ) { return $tabs; } - $post_id = intval( $_REQUEST['post_id'] ); + $post_id = (int) $_REQUEST['post_id']; if ( $post_id ) { - $attachments = intval( $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id ) ) ); + $attachments = (int) $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id ) ); } if ( empty( $attachments ) ) { @@ -125,8 +125,8 @@ function the_media_upload_tabs() { * @param string $align Image CSS alignment property. * @param string $url Optional. Image src URL. Default empty. * @param bool|string $rel Optional. Value for rel attribute or whether to add a default value. Default false. - * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width - * and height values in pixels (in that order). Default 'medium'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of + * width and height values in pixels (in that order). Default 'medium'. * @param string $alt Optional. Image alt attribute. Default empty. * @return string The HTML output to insert into the editor. */ @@ -138,7 +138,7 @@ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re if ( is_string( $rel ) ) { $rel = ' rel="' . esc_attr( $rel ) . '"'; } else { - $rel = ' rel="attachment wp-att-' . intval( $id ) . '"'; + $rel = ' rel="attachment wp-att-' . (int) $id . '"'; } } else { $rel = ''; @@ -152,6 +152,7 @@ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re * Filters the image HTML markup to send to the editor when inserting an image. * * @since 2.5.0 + * @since 5.6.0 The `$rel` parameter was added. * * @param string $html The image HTML markup to send. * @param int $id The attachment ID. @@ -159,11 +160,12 @@ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re * @param string $title The image title. * @param string $align The image alignment. * @param string $url The image source URL. - * @param string|array $size Size of image. Image size or array of width and height values - * (in that order). Default 'medium'. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). * @param string $alt The image alternative, or alt, text. + * @param string $rel The image rel attribute. */ - $html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt ); + $html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt, $rel ); return $html; } @@ -174,12 +176,12 @@ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re * @since 2.6.0 * * @param string $html The image HTML markup to send. - * @param integer $id Image attachment ID. + * @param int $id Image attachment ID. * @param string $caption Image caption. * @param string $title Image title attribute (not used). * @param string $align Image CSS alignment property. * @param string $url Image source URL (not used). - * @param string $size Image size (`thumbnail`, `medium`, `large`, `full`, or added with `add_image_size()`) (not used). + * @param string $size Image size (not used). * @param string $alt Image `alt` attribute (not used). * @return string The image HTML markup with caption shortcode. */ @@ -958,11 +960,11 @@ function wp_media_upload_handler() { } /** - * Downloads an image from the specified URL and attaches it to a post. + * Downloads an image from the specified URL, saves it as an attachment, and optionally attaches it to a post. * * @since 2.6.0 * @since 4.2.0 Introduced the `$return` parameter. - * @since 4.8.0 Introduced the 'id' option within the `$return` parameter. + * @since 4.8.0 Introduced the 'id' option for the `$return` parameter. * @since 5.3.0 The `$post_id` parameter was made optional. * @since 5.4.0 The original URL of the attachment is stored in the `_source_url` * post meta value. @@ -972,13 +974,35 @@ function wp_media_upload_handler() { * @param string $desc Optional. Description of the image. * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL), * or 'id' (attachment ID). Default 'html'. - * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise. + * @return string|int|WP_Error Populated HTML img tag, attachment ID, or attachment source + * on success, WP_Error object otherwise. */ function media_sideload_image( $file, $post_id = 0, $desc = null, $return = 'html' ) { if ( ! empty( $file ) ) { + $allowed_extensions = array( 'jpg', 'jpeg', 'jpe', 'png', 'gif' ); + + /** + * Filters the list of allowed file extensions when sideloading an image from a URL. + * + * The default allowed extensions are: + * + * - `jpg` + * - `jpeg` + * - `jpe` + * - `png` + * - `gif` + * + * @since 5.6.0 + * + * @param string[] $allowed_extensions Array of allowed file extensions. + * @param string $file The URL of the image to download. + */ + $allowed_extensions = apply_filters( 'image_sideload_extensions', $allowed_extensions, $file ); + $allowed_extensions = array_map( 'preg_quote', $allowed_extensions ); + // Set variables for storage, fix file filename for query strings. - preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches ); + preg_match( '/[^\?]+\.(' . implode( '|', $allowed_extensions ) . ')\b/i', $file, $matches ); if ( ! $matches ) { return new WP_Error( 'image_sideload_failed', __( 'Invalid image URL.' ) ); @@ -1115,7 +1139,7 @@ function image_align_input_fields( $post, $checked = '' ) { " />"; } - return join( "\n", $out ); + return implode( "\n", $out ); } /** @@ -1192,7 +1216,7 @@ function image_size_input_fields( $post, $check = '' ) { return array( 'label' => __( 'Size' ), 'input' => 'html', - 'html' => join( "\n", $out ), + 'html' => implode( "\n", $out ), ); } @@ -1317,7 +1341,7 @@ function image_attachment_fields_to_save( $post, $attachment ) { * @since 2.5.0 * * @param string $html - * @param integer $attachment_id + * @param int $attachment_id * @param array $attachment * @return string */ @@ -1421,7 +1445,7 @@ function get_attachment_fields_to_edit( $post, $errors = null ) { $values[] = $term->slug; } - $t['value'] = join( ', ', $values ); + $t['value'] = implode( ', ', $values ); $form_fields[ $taxonomy ] = $t; } @@ -1547,7 +1571,7 @@ function get_media_item( $attachment_id, $args = null ) { global $redir_tab; $thumb_url = false; - $attachment_id = intval( $attachment_id ); + $attachment_id = (int) $attachment_id; if ( $attachment_id ) { $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ); @@ -1781,7 +1805,7 @@ function get_media_item( $attachment_id, $args = null ) { } if ( ! empty( $field['helps'] ) ) { - $item .= "

      " . join( "

      \n

      ", array_unique( (array) $field['helps'] ) ) . '

      '; + $item .= "

      " . implode( "

      \n

      ", array_unique( (array) $field['helps'] ) ) . '

      '; } $item .= "\n\t\t\n"; @@ -1880,7 +1904,7 @@ function get_compat_media_markup( $attachment_id, $args = null ) { $values[] = $term->slug; } - $t['value'] = join( ', ', $values ); + $t['value'] = implode( ', ', $values ); $t['taxonomy'] = true; $form_fields[ $taxonomy ] = $t; @@ -1973,7 +1997,7 @@ function get_compat_media_markup( $attachment_id, $args = null ) { } if ( ! empty( $field['helps'] ) ) { - $item .= "

      " . join( "

      \n

      ", array_unique( (array) $field['helps'] ) ) . '

      '; + $item .= "

      " . implode( "

      \n

      ", array_unique( (array) $field['helps'] ) ) . '

      '; } $item .= "\n\t\t\n"; @@ -2033,7 +2057,7 @@ function get_compat_media_markup( $attachment_id, $args = null ) { * @since 2.5.0 */ function media_upload_header() { - $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; + $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; echo ''; @@ -2069,7 +2093,7 @@ function media_upload_form( $errors = null ) { } $upload_action_url = admin_url( 'async-upload.php' ); - $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; + $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; $_type = isset( $type ) ? $type : ''; $_tab = isset( $tab ) ? $tab : ''; @@ -2271,15 +2295,15 @@ function media_upload_form( $errors = null ) { * * @since 2.5.0 * - * @param string $type - * @param object $errors - * @param integer $id + * @param string $type + * @param array $errors + * @param int|WP_Error $id */ function media_upload_type_form( $type = 'file', $errors = null, $id = null ) { media_upload_header(); - $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; + $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; $form_action_url = admin_url( "media-upload.php?type=$type&tab=type&post_id=$post_id" ); @@ -2347,7 +2371,7 @@ function media_upload_type_form( $type = 'file', $errors = null, $id = null ) { * * @param string $type * @param object $errors - * @param integer $id + * @param int $id */ function media_upload_type_url_form( $type = null, $errors = null, $id = null ) { if ( null === $type ) { @@ -2356,7 +2380,7 @@ function media_upload_type_url_form( $type = null, $errors = null, $id = null ) media_upload_header(); - $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; + $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; $form_action_url = admin_url( "media-upload.php?type=$type&tab=type&post_id=$post_id" ); /** This filter is documented in wp-admin/includes/media.php */ @@ -2504,7 +2528,7 @@ function media_upload_gallery_form( $errors ) { $redir_tab = 'gallery'; media_upload_header(); - $post_id = intval( $_REQUEST['post_id'] ); + $post_id = (int) $_REQUEST['post_id']; $form_action_url = admin_url( "media-upload.php?type=$type&tab=gallery&post_id=$post_id" ); /** This filter is documented in wp-admin/includes/media.php */ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); @@ -2667,7 +2691,7 @@ function media_upload_library_form( $errors ) { media_upload_header(); - $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; + $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id" ); /** This filter is documented in wp-admin/includes/media.php */ @@ -2680,7 +2704,7 @@ function media_upload_library_form( $errors ) { $q = $_GET; $q['posts_per_page'] = 10; - $q['paged'] = isset( $q['paged'] ) ? intval( $q['paged'] ) : 0; + $q['paged'] = isset( $q['paged'] ) ? (int) $q['paged'] : 0; if ( $q['paged'] < 1 ) { $q['paged'] = 1; } @@ -2982,9 +3006,9 @@ function media_upload_flash_bypass() { $post = get_post(); if ( $post ) { - $browser_uploader .= '&post_id=' . intval( $post->ID ); + $browser_uploader .= '&post_id=' . (int) $post->ID; } elseif ( ! empty( $GLOBALS['post_ID'] ) ) { - $browser_uploader .= '&post_id=' . intval( $GLOBALS['post_ID'] ); + $browser_uploader .= '&post_id=' . (int) $GLOBALS['post_ID']; } ?> @@ -3076,7 +3100,7 @@ function edit_form_image_editor( $post ) { } $thumb_url = false; - $attachment_id = intval( $post->ID ); + $attachment_id = (int) $post->ID; if ( $attachment_id ) { $thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 450 ), true ); @@ -3192,7 +3216,7 @@ function edit_form_image_editor( $post ) { /* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */ __( 'Describe the purpose of the image%3$s. Leave empty if the image is purely decorative.' ), esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ), - 'target="_blank" rel="noopener noreferrer"', + 'target="_blank" rel="noopener"', sprintf( ' %s', /* translators: Accessibility text. */ @@ -3264,12 +3288,47 @@ function attachment_submitbox_metadata() { $att_url = wp_get_attachment_url( $attachment_id ); + $author = get_userdata( $post->post_author ); + + $uploaded_by_name = __( '(no author)' ); + $uploaded_by_link = ''; + if ( $author->exists() ) { + $uploaded_by_name = $author->display_name ? $author->display_name : $author->nickname; + $uploaded_by_link = get_edit_user_link( $author->ID ); + } ?> +
      + + + + + +
      + + post_parent ) { + $post_parent = get_post( $post->post_parent ); + if ( $post_parent ) { + $uploaded_to_title = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' ); + $uploaded_to_link = get_edit_post_link( $post->post_parent, 'raw' ); + ?> +
      + + + + + +
      + +
      - +
      diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index f1cec18c5e..5d003d3210 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -212,11 +212,11 @@ function post_submit_meta_box( $post, $args = array() ) {
    @@ -404,11 +404,11 @@ function attachment_submit_meta_box( $post ) { post_date ) ), - /* translators: Publish box time format, see https://www.php.net/date */ + /* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */ date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) ) ); /* translators: Attachment information. %s: Date the attachment was uploaded. */ @@ -695,7 +695,7 @@ function post_categories_meta_box( $post, $box ) { * * @since 2.6.0 * - * @param object $post + * @param WP_Post $post */ function post_excerpt_meta_box( $post ) { ?> @@ -717,7 +717,7 @@ function post_excerpt_meta_box( $post ) { * * @since 2.6.0 * - * @param object $post + * @param WP_Post $post */ function post_trackback_meta_box( $post ) { $form_trackback = ' '; - echo '' . __( 'Return to Dashboard' ) . ''; + echo '' . __( 'Go to Dashboard' ) . ''; echo '
    '; require_once ABSPATH . 'wp-admin/admin-footer.php'; die(); @@ -640,6 +640,7 @@ function network_step2( $errors = false ) { $htaccess_file = <<delete( $this_plugin_dir, true ); } else { $deleted = $wp_filesystem->delete( $plugins_dir . $plugin_file ); @@ -1150,8 +1152,8 @@ function validate_plugin_requirements( $plugin ) { $compatible_wp = is_wp_version_compatible( $requirements['requires'] ); $compatible_php = is_php_version_compatible( $requirements['requires_php'] ); - /* translators: %s: URL to Update PHP page. */ $php_update_message = '

    ' . sprintf( + /* translators: %s: URL to Update PHP page. */ __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); @@ -1414,9 +1416,9 @@ function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, * parent file someone is trying to link back to the parent manually. In * this case, don't automatically add a link back to avoid duplication. */ - if ( ! isset( $submenu[ $parent_slug ] ) && $menu_slug != $parent_slug ) { + if ( ! isset( $submenu[ $parent_slug ] ) && $menu_slug !== $parent_slug ) { foreach ( (array) $menu as $parent_menu ) { - if ( $parent_menu[2] == $parent_slug && current_user_can( $parent_menu[1] ) ) { + if ( $parent_menu[2] === $parent_slug && current_user_can( $parent_menu[1] ) ) { $submenu[ $parent_slug ][] = array_slice( $parent_menu, 0, 4 ); } } @@ -1767,7 +1769,7 @@ function remove_menu_page( $menu_slug ) { global $menu; foreach ( $menu as $i => $item ) { - if ( $menu_slug == $item[2] ) { + if ( $menu_slug === $item[2] ) { unset( $menu[ $i ] ); return $item; } @@ -1795,7 +1797,7 @@ function remove_submenu_page( $menu_slug, $submenu_slug ) { } foreach ( $submenu[ $menu_slug ] as $i => $item ) { - if ( $submenu_slug == $item[2] ) { + if ( $submenu_slug === $item[2] ) { unset( $submenu[ $menu_slug ][ $i ] ); return $item; } @@ -1822,6 +1824,7 @@ function menu_page_url( $menu_slug, $echo = true ) { if ( isset( $_parent_pages[ $menu_slug ] ) ) { $parent_slug = $_parent_pages[ $menu_slug ]; + if ( $parent_slug && ! isset( $_parent_pages[ $parent_slug ] ) ) { $url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) ); } else { @@ -1870,33 +1873,40 @@ function get_admin_page_parent( $parent = '' ) { if ( isset( $_wp_real_parent_file[ $parent ] ) ) { $parent = $_wp_real_parent_file[ $parent ]; } + return $parent; } if ( 'admin.php' === $pagenow && isset( $plugin_page ) ) { foreach ( (array) $menu as $parent_menu ) { - if ( $parent_menu[2] == $plugin_page ) { + if ( $parent_menu[2] === $plugin_page ) { $parent_file = $plugin_page; + if ( isset( $_wp_real_parent_file[ $parent_file ] ) ) { $parent_file = $_wp_real_parent_file[ $parent_file ]; } + return $parent_file; } } if ( isset( $_wp_menu_nopriv[ $plugin_page ] ) ) { $parent_file = $plugin_page; + if ( isset( $_wp_real_parent_file[ $parent_file ] ) ) { $parent_file = $_wp_real_parent_file[ $parent_file ]; } + return $parent_file; } } if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $pagenow ][ $plugin_page ] ) ) { $parent_file = $pagenow; + if ( isset( $_wp_real_parent_file[ $parent_file ] ) ) { $parent_file = $_wp_real_parent_file[ $parent_file ]; } + return $parent_file; } @@ -1905,13 +1915,16 @@ function get_admin_page_parent( $parent = '' ) { if ( isset( $_wp_real_parent_file[ $parent ] ) ) { $parent = $_wp_real_parent_file[ $parent ]; } - if ( ! empty( $typenow ) && ( "$pagenow?post_type=$typenow" === $submenu_array[2] ) ) { + + if ( ! empty( $typenow ) && "$pagenow?post_type=$typenow" === $submenu_array[2] ) { $parent_file = $parent; return $parent; - } elseif ( $submenu_array[2] == $pagenow && empty( $typenow ) && ( empty( $parent_file ) || false === strpos( $parent_file, '?' ) ) ) { + } elseif ( empty( $typenow ) && $pagenow === $submenu_array[2] + && ( empty( $parent_file ) || false === strpos( $parent_file, '?' ) ) + ) { $parent_file = $parent; return $parent; - } elseif ( isset( $plugin_page ) && ( $plugin_page == $submenu_array[2] ) ) { + } elseif ( isset( $plugin_page ) && $plugin_page === $submenu_array[2] ) { $parent_file = $parent; return $parent; } @@ -1953,10 +1966,10 @@ function get_admin_page_title() { if ( empty( $parent ) ) { foreach ( (array) $menu as $menu_array ) { if ( isset( $menu_array[3] ) ) { - if ( $menu_array[2] == $pagenow ) { + if ( $menu_array[2] === $pagenow ) { $title = $menu_array[3]; return $menu_array[3]; - } elseif ( isset( $plugin_page ) && ( $plugin_page == $menu_array[2] ) && ( $hook == $menu_array[5] ) ) { + } elseif ( isset( $plugin_page ) && $plugin_page === $menu_array[2] && $hook === $menu_array[5] ) { $title = $menu_array[3]; return $menu_array[3]; } @@ -1968,21 +1981,19 @@ function get_admin_page_title() { } else { foreach ( array_keys( $submenu ) as $parent ) { foreach ( $submenu[ $parent ] as $submenu_array ) { - if ( isset( $plugin_page ) && - ( $plugin_page == $submenu_array[2] ) && - ( - ( $parent == $pagenow ) || - ( $parent == $plugin_page ) || - ( $plugin_page == $hook ) || - ( 'admin.php' === $pagenow && $parent1 != $submenu_array[2] ) || - ( ! empty( $typenow ) && $parent == $pagenow . '?post_type=' . $typenow ) - ) + if ( isset( $plugin_page ) + && $plugin_page === $submenu_array[2] + && ( $pagenow === $parent + || $plugin_page === $parent + || $plugin_page === $hook + || 'admin.php' === $pagenow && $parent1 !== $submenu_array[2] + || ! empty( $typenow ) && "$pagenow?post_type=$typenow" === $parent ) ) { $title = $submenu_array[3]; return $submenu_array[3]; } - if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) { // Not the current page. + if ( $submenu_array[2] !== $pagenow || isset( $_GET['page'] ) ) { // Not the current page. continue; } @@ -1997,10 +2008,11 @@ function get_admin_page_title() { } if ( empty( $title ) ) { foreach ( $menu as $menu_array ) { - if ( isset( $plugin_page ) && - ( $plugin_page == $menu_array[2] ) && - ( 'admin.php' === $pagenow ) && - ( $parent1 == $menu_array[2] ) ) { + if ( isset( $plugin_page ) + && $plugin_page === $menu_array[2] + && 'admin.php' === $pagenow + && $parent1 === $menu_array[2] + ) { $title = $menu_array[3]; return $menu_array[3]; } @@ -2113,6 +2125,7 @@ function user_can_access_admin_page() { if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[ $plugin_page ] ) ) { return false; } + foreach ( array_keys( $_wp_submenu_nopriv ) as $key ) { if ( isset( $_wp_submenu_nopriv[ $key ][ $pagenow ] ) ) { return false; @@ -2121,38 +2134,27 @@ function user_can_access_admin_page() { return false; } } + return true; } - if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[ $plugin_page ] ) ) { + if ( isset( $plugin_page ) && $plugin_page === $parent && isset( $_wp_menu_nopriv[ $plugin_page ] ) ) { return false; } if ( isset( $submenu[ $parent ] ) ) { foreach ( $submenu[ $parent ] as $submenu_array ) { - if ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) { - if ( current_user_can( $submenu_array[1] ) ) { - return true; - } else { - return false; - } - } elseif ( $submenu_array[2] == $pagenow ) { - if ( current_user_can( $submenu_array[1] ) ) { - return true; - } else { - return false; - } + if ( isset( $plugin_page ) && $submenu_array[2] === $plugin_page ) { + return current_user_can( $submenu_array[1] ); + } elseif ( $submenu_array[2] === $pagenow ) { + return current_user_can( $submenu_array[1] ); } } } foreach ( $menu as $menu_array ) { - if ( $menu_array[2] == $parent ) { - if ( current_user_can( $menu_array[1] ) ) { - return true; - } else { - return false; - } + if ( $menu_array[2] === $parent ) { + return current_user_can( $menu_array[1] ); } } @@ -2188,7 +2190,7 @@ function option_update_filter( $options ) { /** * Adds an array of options to the list of allowed options. * - * @since 2.7.0 + * @since 5.5.0 * * @global array $allowed_options * diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 486f6dc1db..fbf11b3ded 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -685,12 +685,15 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft', - ) + ), + false, + false ); $post = get_post( $post_id ); if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) { set_post_format( $post, get_option( 'default_post_format' ) ); } + wp_after_insert_post( $post, false, null ); // Schedule auto-draft cleanup. if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) { @@ -1332,9 +1335,9 @@ function postbox_classes( $box_id, $screen_id ) { * * @since 2.5.0 * - * @param int $id Post ID or post object. - * @param string $title Optional. Title to override the post's current title when generating the post name. Default null. - * @param string $name Optional. Name to override the post name. Default null. + * @param int|WP_Post $id Post ID or post object. + * @param string $title Optional. Title to override the post's current title when generating the post name. Default null. + * @param string $name Optional. Name to override the post name. Default null. * @return array { * Array containing the sample permalink with placeholder for the post name, and the post name. * @@ -1536,15 +1539,12 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { * * Note: When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' * image size is registered, which differs from the 'thumbnail' image size - * managed via the Settings > Media screen. See the `$size` parameter description - * for more information on default values. + * managed via the Settings > Media screen. * * @since 4.4.0 * - * @param string|array $size Post thumbnail image size to display in the meta box. Accepts any valid - * image size, or an array of width and height values in pixels (in that order). - * If the 'post-thumbnail' size is set, default is 'post-thumbnail'. Otherwise, - * default is an array with 266 as both the height and width values. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). * @param int $thumbnail_id Post thumbnail attachment ID. * @param WP_Post $post The post object associated with the thumbnail. */ @@ -1585,7 +1585,7 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { * * @since 2.5.0 * - * @param int $post_id ID of the post to check for editing. + * @param int|WP_Post $post_id ID or object of the post to check for editing. * @return int|false ID of the user with lock. False if the post does not exist, post is not locked, * the user with lock does not exist, or the post is locked by current user. */ @@ -1623,7 +1623,7 @@ function wp_check_post_lock( $post_id ) { * * @since 2.5.0 * - * @param int $post_id ID of the post being edited. + * @param int|WP_Post $post_id ID or object of the post being edited. * @return array|false Array of the lock time and user ID. False if the post does not exist, or * there is no current user. */ @@ -1741,10 +1741,10 @@ function _admin_notice_post_locked() { display_name ) ); + printf( __( '%s is currently editing this post. Do you want to take over?' ), esc_html( $user->display_name ) ); } else { /* translators: %s: User's display name. */ - printf( __( '%s is already editing this post.' ), esc_html( $user->display_name ) ); + printf( __( '%s is currently editing this post.' ), esc_html( $user->display_name ) ); } ?>

    @@ -1926,7 +1926,7 @@ function post_preview() { } if ( isset( $_POST['_thumbnail_id'] ) ) { - $query_args['_thumbnail_id'] = ( intval( $_POST['_thumbnail_id'] ) <= 0 ) ? '-1' : intval( $_POST['_thumbnail_id'] ); + $query_args['_thumbnail_id'] = ( (int) $_POST['_thumbnail_id'] <= 0 ) ? '-1' : (int) $_POST['_thumbnail_id']; } } @@ -2088,7 +2088,7 @@ function taxonomy_meta_box_sanitize_cb_input( $taxonomy, $terms ) { ); if ( ! empty( $_term ) ) { - $clean_terms[] = intval( $_term[0] ); + $clean_terms[] = (int) $_term[0]; } else { // No existing term was found, so pass the string. A new term will be created. $clean_terms[] = $term; @@ -2127,7 +2127,7 @@ function use_block_editor_for_post( $post ) { $use_block_editor = use_block_editor_for_post_type( $post->post_type ); /** - * Filter whether a post is able to be edited in the block editor. + * Filters whether a post is able to be edited in the block editor. * * @since 5.0.0 * @@ -2163,7 +2163,7 @@ function use_block_editor_for_post_type( $post_type ) { } /** - * Filter whether a post is able to be edited in the block editor. + * Filters whether a post is able to be edited in the block editor. * * @since 5.0.0 * @@ -2216,7 +2216,7 @@ function get_block_categories( $post ) { ); /** - * Filter the default array of block categories. + * Filters the default array of block categories. * * @since 5.0.0 * diff --git a/wp-admin/includes/privacy-tools.php b/wp-admin/includes/privacy-tools.php index ada0f11410..14914dcb9c 100644 --- a/wp-admin/includes/privacy-tools.php +++ b/wp-admin/includes/privacy-tools.php @@ -13,14 +13,14 @@ * @access private * * @param int $request_id Request ID. - * @return bool|WP_Error Returns true/false based on the success of sending the email, or a WP_Error object. + * @return bool|WP_Error Returns true if sending the email was successful, or a WP_Error object. */ function _wp_privacy_resend_request( $request_id ) { $request_id = absint( $request_id ); $request = get_post( $request_id ); if ( ! $request || 'user_request' !== $request->post_type ) { - return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) ); + return new WP_Error( 'privacy_request_error', __( 'Invalid user privacy request.' ) ); } $result = wp_send_user_request( $request_id ); @@ -28,7 +28,7 @@ function _wp_privacy_resend_request( $request_id ) { if ( is_wp_error( $result ) ) { return $result; } elseif ( ! $result ) { - return new WP_Error( 'privacy_request_error', __( 'Unable to initiate confirmation request.' ) ); + return new WP_Error( 'privacy_request_error', __( 'Unable to initiate user privacy confirmation request.' ) ); } return true; @@ -49,7 +49,7 @@ function _wp_privacy_completed_request( $request_id ) { $request = wp_get_user_request( $request_id ); if ( ! $request ) { - return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) ); + return new WP_Error( 'privacy_request_error', __( 'Invalid user privacy request.' ) ); } update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() ); @@ -104,7 +104,7 @@ function _wp_personal_data_handle_actions() { add_settings_error( 'action_type', 'action_type', - __( 'Invalid action.' ), + __( 'Invalid user privacy action.' ), 'error' ); } @@ -116,7 +116,7 @@ function _wp_personal_data_handle_actions() { add_settings_error( 'action_type', 'action_type', - __( 'Invalid action.' ), + __( 'Invalid user privacy action.' ), 'error' ); } @@ -279,7 +279,7 @@ function wp_privacy_generate_personal_data_export_group_html( $group_data, $grou if ( $groups_count > 1 ) { $group_html .= '
    '; - $group_html .= ' ' . esc_html__( 'Return to top' ) . ''; + $group_html .= ' ' . esc_html__( 'Go to top' ) . ''; $group_html .= '
    '; } @@ -297,20 +297,20 @@ function wp_privacy_generate_personal_data_export_group_html( $group_data, $grou */ function wp_privacy_generate_personal_data_export_file( $request_id ) { if ( ! class_exists( 'ZipArchive' ) ) { - wp_send_json_error( __( 'Unable to generate export file. ZipArchive not available.' ) ); + wp_send_json_error( __( 'Unable to generate user privacy export file. ZipArchive not available.' ) ); } // Get the request. $request = wp_get_user_request( $request_id ); if ( ! $request || 'export_personal_data' !== $request->action_name ) { - wp_send_json_error( __( 'Invalid request ID when generating export file.' ) ); + wp_send_json_error( __( 'Invalid request ID when generating user privacy export file.' ) ); } $email_address = $request->email; if ( ! is_email( $email_address ) ) { - wp_send_json_error( __( 'Invalid email address when generating export file.' ) ); + wp_send_json_error( __( 'Invalid email address when generating user privacy export file.' ) ); } // Create the exports folder if needed. @@ -318,7 +318,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $exports_url = wp_privacy_exports_url(); if ( ! wp_mkdir_p( $exports_dir ) ) { - wp_send_json_error( __( 'Unable to create export folder.' ) ); + wp_send_json_error( __( 'Unable to create user privacy export folder.' ) ); } // Protect export folder from browsing. @@ -326,7 +326,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { if ( ! file_exists( $index_pathname ) ) { $file = fopen( $index_pathname, 'w' ); if ( false === $file ) { - wp_send_json_error( __( 'Unable to protect export folder from browsing.' ) ); + wp_send_json_error( __( 'Unable to protect user privacy export folder from browsing.' ) ); } fwrite( $file, '' ); fclose( $file ); @@ -395,7 +395,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $file = fopen( $json_report_pathname, 'w' ); if ( false === $file ) { - wp_send_json_error( __( 'Unable to open export file (JSON report) for writing.' ) ); + wp_send_json_error( __( 'Unable to open user privacy export file (JSON report) for writing.' ) ); } fwrite( $file, '{' ); @@ -410,7 +410,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $file = fopen( $html_report_pathname, 'w' ); if ( false === $file ) { - wp_send_json_error( __( 'Unable to open export file (HTML report) for writing.' ) ); + wp_send_json_error( __( 'Unable to open user privacy export file (HTML report) for writing.' ) ); } fwrite( $file, "\n" ); @@ -504,11 +504,11 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $zip = new ZipArchive; if ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) { if ( ! $zip->addFile( $json_report_pathname, 'export.json' ) ) { - $error = __( 'Unable to add data to JSON file.' ); + $error = __( 'Unable to add data to user privacy export file (JSON format).' ); } if ( ! $zip->addFile( $html_report_pathname, 'index.html' ) ) { - $error = __( 'Unable to add data to HTML file.' ); + $error = __( 'Unable to add data to user privacy export file (HTML format).' ); } $zip->close(); @@ -529,7 +529,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id, $json_report_pathname ); } } else { - $error = __( 'Unable to open export file (archive) for writing.' ); + $error = __( 'Unable to open user privacy export file (archive) for writing.' ); } // Remove the JSON file. @@ -758,7 +758,7 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde $request = wp_get_user_request( $request_id ); if ( ! $request || 'export_personal_data' !== $request->action_name ) { - wp_send_json_error( __( 'Invalid request ID when merging exporter data.' ) ); + wp_send_json_error( __( 'Invalid request ID when merging user privacy exporter data.' ) ); } $export_data = array(); @@ -767,7 +767,11 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde if ( 1 === $exporter_index && 1 === $page ) { update_post_meta( $request_id, '_export_data_raw', $export_data ); } else { - $export_data = get_post_meta( $request_id, '_export_data_raw', true ); + $accumulated_data = get_post_meta( $request_id, '_export_data_raw', true ); + + if ( $accumulated_data ) { + $export_data = $accumulated_data; + } } // Now, merge the data from the exporter response into the data we have accumulated already. @@ -905,7 +909,7 @@ function wp_privacy_process_personal_data_erasure_page( $response, $eraser_index $request = wp_get_user_request( $request_id ); if ( ! $request || 'remove_personal_data' !== $request->action_name ) { - wp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) ); + wp_send_json_error( __( 'Invalid request ID when processing user privacy eraser data.' ) ); } /** This filter is documented in wp-admin/includes/ajax-actions.php */ diff --git a/wp-admin/includes/revision.php b/wp-admin/includes/revision.php index 52600dce06..7718a831e4 100644 --- a/wp-admin/includes/revision.php +++ b/wp-admin/includes/revision.php @@ -275,7 +275,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null * If we only have one revision, the initial revision is missing; This happens * when we have an autsosave and the user has clicked 'View the Autosave' */ - if ( 1 === sizeof( $revisions ) ) { + if ( 1 === count( $revisions ) ) { $revisions[ $post->ID ] = array( 'id' => $post->ID, 'title' => get_the_title( $post->ID ), diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 54e9171f4b..a59c7c36ce 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -422,11 +422,11 @@ function populate_options( array $options = array() ) { 'default_ping_status' => 'open', 'default_pingback_flag' => 1, 'posts_per_page' => 10, - /* translators: Default date format, see https://www.php.net/date */ + /* translators: Default date format, see https://www.php.net/manual/datetime.format.php */ 'date_format' => __( 'F j, Y' ), - /* translators: Default time format, see https://www.php.net/date */ + /* translators: Default time format, see https://www.php.net/manual/datetime.format.php */ 'time_format' => __( 'g:i a' ), - /* translators: Links last updated date format, see https://www.php.net/date */ + /* translators: Links last updated date format, see https://www.php.net/manual/datetime.format.php */ 'links_updated_date_format' => __( 'F j, Y g:i a' ), 'comment_moderation' => 0, 'moderation_notify' => 1, @@ -535,6 +535,13 @@ function populate_options( array $options = array() ) { 'disallowed_keys' => '', 'comment_previously_approved' => 1, 'auto_plugin_theme_update_emails' => array(), + + // 5.6.0 + 'auto_update_core_dev' => 'enabled', + 'auto_update_core_minor' => 'enabled', + // Default to enabled for new installs. + // See https://core.trac.wordpress.org/ticket/51742. + 'auto_update_core_major' => 'enabled', ); // 3.3.0 diff --git a/wp-admin/includes/taxonomy.php b/wp-admin/includes/taxonomy.php index 7f7e60952c..de76917cd0 100644 --- a/wp-admin/includes/taxonomy.php +++ b/wp-admin/includes/taxonomy.php @@ -278,7 +278,7 @@ function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) { $term_names[] = $term->name; } - $terms_to_edit = esc_attr( join( ',', $term_names ) ); + $terms_to_edit = esc_attr( implode( ',', $term_names ) ); /** * Filters the comma-separated list of terms available to edit. diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 49725a9ce5..4acbb25afa 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -813,7 +813,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { $cur_hh = current_time( 'H' ); $cur_mn = current_time( 'i' ); - $month = ''; - $day = ''; - $year = ''; - $hour = ''; - $minute = ''; + $day = ''; + $year = ''; + $hour = ''; + $minute = ''; echo '
    '; /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */ @@ -1014,14 +1014,14 @@ function wp_import_upload_form( $action ) { * add_submenu_page() to create a new screen (and hence screen_id), * make sure your menu slug conforms to the limits of sanitize_key() * otherwise the 'screen' menu may not correctly render on your page. - * @param string $context Optional. The context within the screen where the boxes + * @param string $context Optional. The context within the screen where the box * should display. Available contexts vary from screen to * screen. Post edit screen contexts include 'normal', 'side', * and 'advanced'. Comments screen contexts include 'normal' * and 'side'. Menus meta boxes (accordion sections) all use * the 'side' context. Global default is 'advanced'. - * @param string $priority Optional. The priority within the context where the boxes - * should show ('high', 'low'). Default 'default'. + * @param string $priority Optional. The priority within the context where the box should show. + * Accepts 'high', 'core', 'default', or 'low'. Default 'default'. * @param array $callback_args Optional. Data that should be set as the $args property * of the box array (which is the second parameter passed * to your callback). Default null. @@ -1321,7 +1321,7 @@ function do_meta_boxes( $screen, $context, $object ) { echo ''; echo '' . __( 'Warning:' ) . ' '; } - echo "{$box['title']}"; + echo $box['title']; echo "

\n"; if ( 'dashboard_browser_nag' !== $box['id'] ) { @@ -1797,7 +1797,16 @@ function add_settings_error( $setting, $code, $message, $type = 'error' ) { * * @param string $setting Optional. Slug title of a specific setting whose errors you want. * @param bool $sanitize Optional. Whether to re-sanitize the setting value before returning errors. - * @return array Array of settings errors. + * @return array { + * Array of settings errors. + * + * @type string $setting Slug title of the setting to which this error applies. + * @type string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output. + * @type string $message The formatted message text to display to the user (will be shown inside styled + * `
` and `

` tags). + * @type string $type Optional. Message type, controls HTML class. Possible values include 'error', + * 'success', 'warning', 'info'. Default 'error'. + * } */ function get_settings_errors( $setting = '', $sanitize = false ) { global $wp_settings_errors; @@ -2196,16 +2205,16 @@ function get_post_states( $post ) { } if ( 'page' === get_option( 'show_on_front' ) ) { - if ( intval( get_option( 'page_on_front' ) ) === $post->ID ) { + if ( (int) get_option( 'page_on_front' ) === $post->ID ) { $post_states['page_on_front'] = _x( 'Front Page', 'page label' ); } - if ( intval( get_option( 'page_for_posts' ) ) === $post->ID ) { + if ( (int) get_option( 'page_for_posts' ) === $post->ID ) { $post_states['page_for_posts'] = _x( 'Posts Page', 'page label' ); } } - if ( intval( get_option( 'wp_page_for_privacy_policy' ) ) === $post->ID ) { + if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) { $post_states['page_for_privacy_policy'] = _x( 'Privacy Policy Page', 'page label' ); } @@ -2228,10 +2237,45 @@ function get_post_states( $post ) { * Outputs the attachment media states as HTML. * * @since 3.2.0 + * @since 5.6.0 Added the `$echo` parameter and a return value. * * @param WP_Post $post The attachment post to retrieve states for. + * @param bool $echo Optional. Whether to echo the post states as an HTML string. Default true. + * @return string Media states string. */ -function _media_states( $post ) { +function _media_states( $post, $echo = true ) { + $media_states = get_media_states( $post ); + $media_states_string = ''; + + if ( ! empty( $media_states ) ) { + $state_count = count( $media_states ); + $i = 0; + + $media_states_string .= ' — '; + + foreach ( $media_states as $state ) { + $sep = ( ++$i === $state_count ) ? '' : ', '; + + $media_states_string .= "$state$sep"; + } + } + + if ( $echo ) { + echo $media_states_string; + } + + return $media_states_string; +} + +/** + * Retrieves an array of media states from an attachment. + * + * @since 5.6.0 + * + * @param WP_Post $post The attachment to retrieve states for. + * @return string[] Array of media state labels keyed by their state. + */ +function get_media_states( $post ) { static $header_images; $media_states = array(); @@ -2261,6 +2305,13 @@ function _media_states( $post ) { $media_states[] = __( 'Current Header Image' ); } } + + if ( get_theme_support( 'custom-header', 'video' ) && has_header_video() ) { + $mods = get_theme_mods(); + if ( isset( $mods['header_video'] ) && $post->ID === $mods['header_video'] ) { + $media_states[] = __( 'Current Header Video' ); + } + } } if ( current_theme_supports( 'custom-background' ) ) { @@ -2294,20 +2345,7 @@ function _media_states( $post ) { * 'Background Image', 'Site Icon', 'Logo'. * @param WP_Post $post The current attachment object. */ - $media_states = apply_filters( 'display_media_states', $media_states, $post ); - - if ( ! empty( $media_states ) ) { - $state_count = count( $media_states ); - $i = 0; - - echo ' — '; - - foreach ( $media_states as $state ) { - $sep = ( ++$i === $state_count ) ? '' : ', '; - - echo "$state$sep"; - } - } + return apply_filters( 'display_media_states', $media_states, $post ); } /** diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 21730339cd..f11a6fc234 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -649,7 +649,7 @@ function wp_prepare_themes_for_js( $themes = null ) { $updates = array(); $no_updates = array(); - if ( current_user_can( 'update_themes' ) ) { + if ( ! is_multisite() && current_user_can( 'update_themes' ) ) { $updates_transient = get_site_transient( 'update_themes' ); if ( isset( $updates_transient->response ) ) { $updates = $updates_transient->response; @@ -716,9 +716,7 @@ function wp_prepare_themes_for_js( $themes = null ) { ); } - $type = 'theme'; - /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $auto_update_forced = apply_filters( "auto_update_{$type}", null, $auto_update_filter_payload ); + $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, $auto_update_filter_payload ); $prepared_themes[ $slug ] = array( 'id' => $slug, @@ -748,7 +746,7 @@ function wp_prepare_themes_for_js( $themes = null ) { 'actions' => array( 'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null, 'customize' => $customize_action, - 'delete' => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null, + 'delete' => ( ! is_multisite() && current_user_can( 'delete_themes' ) ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null, 'autoupdate' => wp_is_auto_update_enabled_for_type( 'theme' ) && ! is_multisite() && current_user_can( 'update_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=' . $auto_update_action . '&stylesheet=' . $encoded_slug ), 'updates' ) : null, diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 27599cc192..fea68cbad2 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -798,6 +798,9 @@ 'wp-admin/css/ie.min.css', 'wp-admin/css/ie-rtl.css', 'wp-admin/css/ie-rtl.min.css', + // 5.6 + 'wp-includes/js/jquery/ui/position.min.js', + 'wp-includes/js/jquery/ui/widget.min.js', ); /** @@ -835,6 +838,7 @@ 'themes/twentyseventeen/' => '4.7', 'themes/twentynineteen/' => '5.0', 'themes/twentytwenty/' => '5.3', + 'themes/twentytwentyone/' => '5.6', ); /** diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index e7ebabb8f7..e01fd28eb3 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -240,14 +240,19 @@ function core_update_footer( $msg = '' ) { $cur->current = ''; } - if ( ! isset( $cur->url ) ) { - $cur->url = ''; - } - if ( ! isset( $cur->response ) ) { $cur->response = ''; } + // Include an unmodified $wp_version. + require ABSPATH . WPINC . '/version.php'; + + $is_development_version = preg_match( '/alpha|beta|RC/', $wp_version ); + + if ( $is_development_version && 'latest' === $cur->response ) { + $cur->response = 'development'; + } + switch ( $cur->response ) { case 'development': return sprintf( @@ -1045,6 +1050,22 @@ function wp_is_auto_update_enabled_for_type( $type ) { return false; } +/** + * Checks whether auto-updates are forced for an item. + * + * @since 5.6.0 + * + * @param string $type The type of update being checked: 'theme' or 'plugin'. + * @param bool|null $update Whether to update. The value of null is internally used + * to detect whether nothing has hooked into this filter. + * @param object $item The update offer. + * @return bool True if auto-updates are forced for `$item`, false otherwise. + */ +function wp_is_auto_update_forced_for_item( $type, $update, $item ) { + /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */ + return apply_filters( "auto_update_{$type}", $update, $item ); +} + /** * Determines the appropriate auto-update message to be displayed. * @@ -1059,7 +1080,7 @@ function wp_get_auto_update_message() { if ( false === $next_update_time ) { $message = __( 'Automatic update not scheduled. There may be a problem with WP-Cron.' ); } else { - $time_to_next_update = human_time_diff( intval( $next_update_time ) ); + $time_to_next_update = human_time_diff( (int) $next_update_time ); // See if cron is overdue. $overdue = ( time() - $next_update_time ) > 0; diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index e0170f2705..5b8822552e 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -586,17 +586,18 @@ function wp_install_maybe_enable_pretty_permalinks() { if ( ! function_exists( 'wp_new_blog_notification' ) ) : /** - * Notifies the site admin that the setup is complete. + * Notifies the site admin that the installation of WordPress is complete. * - * Sends an email with wp_mail to the new administrator that the site setup is complete, + * Sends an email to the new administrator that the installation is complete * and provides them with a record of their login credentials. * * @since 2.1.0 * * @param string $blog_title Site title. - * @param string $blog_url Site url. - * @param int $user_id User ID. - * @param string $password User's Password. + * @param string $blog_url Site URL. + * @param int $user_id Administrator's user ID. + * @param string $password Administrator's password. Note that a placeholder message is + * usually passed instead of the actual password. */ function wp_new_blog_notification( $blog_title, $blog_url, $user_id, $password ) { $user = new WP_User( $user_id ); @@ -629,7 +630,40 @@ function wp_new_blog_notification( $blog_title, $blog_url, $user_id, $password ) $login_url ); - wp_mail( $email, __( 'New WordPress Site' ), $message ); + $installed_email = array( + 'to' => $email, + 'subject' => __( 'New WordPress Site' ), + 'message' => $message, + 'headers' => '', + ); + + /** + * Filters the contents of the email sent to the site administrator when WordPress is installed. + * + * @since 5.6.0 + * + * @param array $installed_email { + * Used to build wp_mail(). + * + * @type string $to The email address of the recipient. + * @type string $subject The subject of the email. + * @type string $message The content of the email. + * @type string $headers Headers. + * } + * @param WP_User $user The site administrator user object. + * @param string $blog_title The site title. + * @param string $blog_url The site URL. + * @param string $password The site administrator's password. Note that a placeholder message + * is usually passed instead of the user's actual password. + */ + $installed_email = apply_filters( 'wp_installed_email', $installed_email, $user, $blog_title, $blog_url, $password ); + + wp_mail( + $installed_email['to'], + $installed_email['subject'], + $installed_email['message'], + $installed_email['headers'] + ); } endif; @@ -840,6 +874,10 @@ function upgrade_all() { upgrade_550(); } + if ( $wp_current_db_version < 49752 ) { + upgrade_560(); + } + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -988,8 +1026,8 @@ function upgrade_110() { if ( ! $got_gmt_fields ) { // Add or subtract time to all dates, to get GMT dates. - $add_hours = intval( $diff_gmt_weblogger ); - $add_minutes = intval( 60 * ( $diff_gmt_weblogger - $add_hours ) ); + $add_hours = (int) $diff_gmt_weblogger; + $add_minutes = (int) ( 60 * ( $diff_gmt_weblogger - $add_hours ) ); $wpdb->query( "UPDATE $wpdb->posts SET post_date_gmt = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)" ); $wpdb->query( "UPDATE $wpdb->posts SET post_modified = post_date" ); $wpdb->query( "UPDATE $wpdb->posts SET post_modified_gmt = DATE_ADD(post_modified, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE) WHERE post_modified != '0000-00-00 00:00:00'" ); @@ -1078,7 +1116,7 @@ function upgrade_130() { $limit = $option->dupes - 1; $dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) ); if ( $dupe_ids ) { - $dupe_ids = join( ',', $dupe_ids ); + $dupe_ids = implode( ',', $dupe_ids ); $wpdb->query( "DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)" ); } } @@ -2014,7 +2052,7 @@ function upgrade_430_fix_comments() { return; } - $allowed_length = intval( $content_length['length'] ) - 10; + $allowed_length = (int) $content_length['length'] - 10; $comments = $wpdb->get_results( "SELECT `comment_ID` FROM `{$wpdb->comments}` @@ -2202,6 +2240,60 @@ function upgrade_550() { } } +/** + * Executes changes made in WordPress 5.6.0. + * + * @ignore + * @since 5.6.0 + */ +function upgrade_560() { + global $wp_current_db_version, $wpdb; + + if ( $wp_current_db_version < 49572 ) { + /* + * Clean up the `post_category` column removed from schema in version 2.8.0. + * Its presence may conflict with `WP_Post::__get()`. + */ + $post_category_exists = $wpdb->get_var( "SHOW COLUMNS FROM $wpdb->posts LIKE 'post_category'" ); + if ( ! is_null( $post_category_exists ) ) { + $wpdb->query( "ALTER TABLE $wpdb->posts DROP COLUMN `post_category`" ); + } + + /* + * When upgrading from WP < 5.6.0 set the core major auto-updates option to `unset` by default. + * This overrides the same option from populate_options() that is intended for new installs. + * See https://core.trac.wordpress.org/ticket/51742. + */ + update_option( 'auto_update_core_major', 'unset' ); + } + + if ( $wp_current_db_version < 49632 ) { + /* + * Regenerate the .htaccess file to add the `HTTP_AUTHORIZATION` rewrite rule. + * See https://core.trac.wordpress.org/ticket/51723. + */ + save_mod_rewrite_rules(); + } + + if ( $wp_current_db_version < 49735 ) { + delete_transient( 'dirsize_cache' ); + } + + if ( $wp_current_db_version < 49752 ) { + $results = $wpdb->get_results( + $wpdb->prepare( + "SELECT 1 FROM {$wpdb->usermeta} WHERE meta_key = %s LIMIT 1", + WP_Application_Passwords::USERMETA_KEY_APPLICATION_PASSWORDS + ) + ); + + if ( ! empty( $results ) ) { + $network_id = get_main_network_id(); + update_network_option( $network_id, WP_Application_Passwords::OPTION_KEY_IN_USE, 1 ); + } + } +} + /** * Executes network-level upgrade routines. * diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index 78deb2552e..a08fe3f4b2 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -47,10 +47,10 @@ function edit_user( $user_id = 0 ) { $pass1 = ''; $pass2 = ''; if ( isset( $_POST['pass1'] ) ) { - $pass1 = $_POST['pass1']; + $pass1 = trim( $_POST['pass1'] ); } if ( isset( $_POST['pass2'] ) ) { - $pass2 = $_POST['pass2']; + $pass2 = trim( $_POST['pass2'] ); } if ( isset( $_POST['role'] ) && current_user_can( 'promote_users' ) && ( ! $user_id || current_user_can( 'promote_user', $user_id ) ) ) { @@ -489,8 +489,8 @@ function default_password_nag_handler( $errors = false ) { /** * @since 2.8.0 * - * @param int $user_ID - * @param object $old_data + * @param int $user_ID + * @param WP_User $old_data */ function default_password_nag_edit_user( $user_ID, $old_data ) { // Short-circuit it. @@ -594,3 +594,69 @@ function admin_created_user_email( $text ) { wp_specialchars_decode( translate_user_role( $role['name'] ) ) ); } + +/** + * Checks if the Authorize Application Password request is valid. + * + * @since 5.6.0 + * + * @param array $request { + * The array of request data. All arguments are optional and may be empty. + * + * @type string $app_name The suggested name of the application. + * @type string $app_id A uuid provided by the application to uniquely identify it. + * @type string $success_url The url the user will be redirected to after approving the application. + * @type string $reject_url The url the user will be redirected to after rejecting the application. + * } + * @param WP_User $user The user authorizing the application. + * @return true|WP_Error True if the request is valid, a WP_Error object contains errors if not. + */ +function wp_is_authorize_application_password_request_valid( $request, $user ) { + $error = new WP_Error(); + + if ( ! empty( $request['success_url'] ) ) { + $scheme = wp_parse_url( $request['success_url'], PHP_URL_SCHEME ); + + if ( 'http' === $scheme ) { + $error->add( + 'invalid_redirect_scheme', + __( 'The success url must be served over a secure connection.' ) + ); + } + } + + if ( ! empty( $request['reject_url'] ) ) { + $scheme = wp_parse_url( $request['reject_url'], PHP_URL_SCHEME ); + + if ( 'http' === $scheme ) { + $error->add( + 'invalid_redirect_scheme', + __( 'The rejection url must be served over a secure connection.' ) + ); + } + } + + if ( ! empty( $request['app_id'] ) && ! wp_is_uuid( $request['app_id'] ) ) { + $error->add( + 'invalid_app_id', + __( 'The app id must be a uuid.' ) + ); + } + + /** + * Fires before application password errors are returned. + * + * @since 5.6.0 + * + * @param WP_Error $error The error object. + * @param array $request The array of request data. + * @param WP_User $user The user authorizing the application. + */ + do_action( 'wp_authorize_application_password_request_errors', $error, $request, $user ); + + if ( $error->has_errors() ) { + return $error; + } + + return true; +} diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index a74896cc54..ac98cdb527 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -294,8 +294,7 @@ function wp_widget_control( $sidebar_args ) {

- | - + |
diff --git a/wp-admin/index.php b/wp-admin/index.php index 8cb469f1a2..6c704cc2fe 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -72,8 +72,16 @@ $help = '

' . __( 'The boxes on your Dashboard screen are:' ) . '

'; +if ( current_user_can( 'edit_theme_options' ) ) { + $help .= '

' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '

'; +} + +if ( current_user_can( 'view_site_health_checks' ) ) { + $help .= '

' . __( 'Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '

'; +} + if ( current_user_can( 'edit_posts' ) ) { - $help .= '

' . __( 'At A Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '

'; + $help .= '

' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '

'; } $help .= '

' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '

'; @@ -88,10 +96,6 @@ __( 'https://planet.wordpress.org/' ) ) . '

'; -if ( current_user_can( 'edit_theme_options' ) ) { - $help .= '

' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '

'; -} - $screen->add_help_tab( array( 'id' => 'help-content', diff --git a/wp-admin/js/application-passwords.js b/wp-admin/js/application-passwords.js new file mode 100644 index 0000000000..b1a20ceb8e --- /dev/null +++ b/wp-admin/js/application-passwords.js @@ -0,0 +1,212 @@ +/** + * @output wp-admin/js/application-passwords.js + */ + +( function( $ ) { + var $appPassSection = $( '#application-passwords-section' ), + $newAppPassForm = $appPassSection.find( '.create-application-password' ), + $newAppPassField = $newAppPassForm.find( '.input' ), + $newAppPassButton = $newAppPassForm.find( '.button' ), + $appPassTwrapper = $appPassSection.find( '.application-passwords-list-table-wrapper' ), + $appPassTbody = $appPassSection.find( 'tbody' ), + $appPassTrNoItems = $appPassTbody.find( '.no-items' ), + $removeAllBtn = $( '#revoke-all-application-passwords' ), + tmplNewAppPass = wp.template( 'new-application-password' ), + tmplAppPassRow = wp.template( 'application-password-row' ), + userId = $( '#user_id' ).val(); + + $newAppPassButton.click( function( e ) { + e.preventDefault(); + + if ( $newAppPassButton.prop( 'aria-disabled' ) ) { + return; + } + + var name = $newAppPassField.val(); + + if ( 0 === name.length ) { + $newAppPassField.focus(); + return; + } + + clearNotices(); + $newAppPassButton.prop( 'aria-disabled', true ).addClass( 'disabled' ); + + var request = { + name: name + }; + + /** + * Filters the request data used to create a new Application Password. + * + * @since 5.6.0 + * + * @param {Object} request The request data. + * @param {number} userId The id of the user the password is added for. + */ + request = wp.hooks.applyFilters( 'wp_application_passwords_new_password_request', request, userId ); + + wp.apiRequest( { + path: '/wp/v2/users/' + userId + '/application-passwords?_locale=user', + method: 'POST', + data: request + } ).always( function() { + $newAppPassButton.removeProp( 'aria-disabled' ).removeClass( 'disabled' ); + } ).done( function( response ) { + $newAppPassField.val( '' ); + $newAppPassButton.prop( 'disabled', false ); + + $newAppPassForm.after( tmplNewAppPass( { + name: name, + password: response.password + } ) ); + $( '.new-application-password-notice' ).focus(); + + $appPassTbody.prepend( tmplAppPassRow( response ) ); + + $appPassTwrapper.show(); + $appPassTrNoItems.remove(); + + /** + * Fires after an application password has been successfully created. + * + * @since 5.6.0 + * + * @param {Object} response The response data from the REST API. + * @param {Object} request The request data used to create the password. + */ + wp.hooks.doAction( 'wp_application_passwords_created_password', response, request ); + } ).fail( handleErrorResponse ); + } ); + + $appPassTbody.on( 'click', '.delete', function( e ) { + e.preventDefault(); + + if ( ! window.confirm( wp.i18n.__( 'Are you sure you want to revoke this password? This action cannot be undone.' ) ) ) { + return; + } + + var $submitButton = $( this ), + $tr = $submitButton.closest( 'tr' ), + uuid = $tr.data( 'uuid' ); + + clearNotices(); + $submitButton.prop( 'disabled', true ); + + wp.apiRequest( { + path: '/wp/v2/users/' + userId + '/application-passwords/' + uuid + '?_locale=user', + method: 'DELETE' + } ).always( function() { + $submitButton.prop( 'disabled', false ); + } ).done( function( response ) { + if ( response.deleted ) { + if ( 0 === $tr.siblings().length ) { + $appPassTwrapper.hide(); + } + $tr.remove(); + + addNotice( wp.i18n.__( 'Application password revoked.' ), 'success' ).focus(); + } + } ).fail( handleErrorResponse ); + } ); + + $removeAllBtn.on( 'click', function( e ) { + e.preventDefault(); + + if ( ! window.confirm( wp.i18n.__( 'Are you sure you want to revoke all passwords? This action cannot be undone.' ) ) ) { + return; + } + + var $submitButton = $( this ); + + clearNotices(); + $submitButton.prop( 'disabled', true ); + + wp.apiRequest( { + path: '/wp/v2/users/' + userId + '/application-passwords?_locale=user', + method: 'DELETE' + } ).always( function() { + $submitButton.prop( 'disabled', false ); + } ).done( function( response ) { + if ( response.deleted ) { + $appPassTbody.children().remove(); + $appPassSection.children( '.new-application-password' ).remove(); + $appPassTwrapper.hide(); + + addNotice( wp.i18n.__( 'All application passwords revoked.' ), 'success' ).focus(); + } + } ).fail( handleErrorResponse ); + } ); + + $appPassSection.on( 'click', '.notice-dismiss', function( e ) { + e.preventDefault(); + var $el = $( this ).parent(); + $el.removeAttr( 'role' ); + $el.fadeTo( 100, 0, function () { + $el.slideUp( 100, function () { + $el.remove(); + $newAppPassField.focus(); + } ); + } ); + } ); + + // If there are no items, don't display the table yet. If there are, show it. + if ( 0 === $appPassTbody.children( 'tr' ).not( $appPassTrNoItems ).length ) { + $appPassTwrapper.hide(); + } + + /** + * Handles an error response from the REST API. + * + * @since 5.6.0 + * + * @param {jqXHR} xhr The XHR object from the ajax call. + * @param {string} textStatus The string categorizing the ajax request's status. + * @param {string} errorThrown The HTTP status error text. + */ + function handleErrorResponse( xhr, textStatus, errorThrown ) { + var errorMessage = errorThrown; + + if ( xhr.responseJSON && xhr.responseJSON.message ) { + errorMessage = xhr.responseJSON.message; + } + + addNotice( errorMessage, 'error' ); + } + + /** + * Displays a message in the Application Passwords section. + * + * @since 5.6.0 + * + * @param {string} message The message to display. + * @param {string} type The notice type. Either 'success' or 'error'. + * @returns {jQuery} The notice element. + */ + function addNotice( message, type ) { + var $notice = $( '
' ) + .attr( 'role', 'alert' ) + .attr( 'tabindex', '-1' ) + .addClass( 'is-dismissible notice notice-' + type ) + .append( $( '

' ).text( message ) ) + .append( + $( '' ) + .attr( 'type', 'button' ) + .addClass( 'notice-dismiss' ) + .append( $( '' ).addClass( 'screen-reader-text' ).text( wp.i18n.__( 'Dismiss this notice.' ) ) ) + ); + + $newAppPassForm.after( $notice ); + + return $notice; + } + + /** + * Clears notice messages from the Application Passwords section. + * + * @since 5.6.0 + */ + function clearNotices() { + $( '.notice', $appPassSection ).remove(); + } +}( jQuery ) ); diff --git a/wp-admin/js/application-passwords.min.js b/wp-admin/js/application-passwords.min.js new file mode 100644 index 0000000000..95389326ae --- /dev/null +++ b/wp-admin/js/application-passwords.min.js @@ -0,0 +1,2 @@ +/*! This file is auto-generated */ +!function(i){var a=i("#application-passwords-section"),o=a.find(".create-application-password"),n=o.find(".input"),t=o.find(".button"),p=a.find(".application-passwords-list-table-wrapper"),r=a.find("tbody"),d=r.find(".no-items"),e=i("#revoke-all-application-passwords"),l=wp.template("new-application-password"),c=wp.template("application-password-row"),u=i("#user_id").val();function w(e,s,a){var o=a;e.responseJSON&&e.responseJSON.message&&(o=e.responseJSON.message),f(o,"error")}function f(e,s){var a=i("
").attr("role","alert").attr("tabindex","-1").addClass("is-dismissible notice notice-"+s).append(i("

").text(e)).append(i("").attr("type","button").addClass("notice-dismiss").append(i("").addClass("screen-reader-text").text(wp.i18n.__("Dismiss this notice."))));return o.after(a),a}function v(){i(".notice",a).remove()}t.click(function(e){if(e.preventDefault(),!t.prop("aria-disabled")){var s=n.val();if(0!==s.length){v(),t.prop("aria-disabled",!0).addClass("disabled");var a={name:s};a=wp.hooks.applyFilters("wp_application_passwords_new_password_request",a,u),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"POST",data:a}).always(function(){t.removeProp("aria-disabled").removeClass("disabled")}).done(function(e){n.val(""),t.prop("disabled",!1),o.after(l({name:s,password:e.password})),i(".new-application-password-notice").focus(),r.prepend(c(e)),p.show(),d.remove(),wp.hooks.doAction("wp_application_passwords_created_password",e,a)}).fail(w)}else n.focus()}}),r.on("click",".delete",function(e){if(e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke this password? This action cannot be undone."))){var s=i(this),a=s.closest("tr"),o=a.data("uuid");v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords/"+o+"?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(0===a.siblings().length&&p.hide(),a.remove(),f(wp.i18n.__("Application password revoked."),"success").focus())}).fail(w)}}),e.on("click",function(e){if(e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke all passwords? This action cannot be undone."))){var s=i(this);v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(r.children().remove(),a.children(".new-application-password").remove(),p.hide(),f(wp.i18n.__("All application passwords revoked."),"success").focus())}).fail(w)}}),a.on("click",".notice-dismiss",function(e){e.preventDefault();var s=i(this).parent();s.removeAttr("role"),s.fadeTo(100,0,function(){s.slideUp(100,function(){s.remove(),n.focus()})})}),0===r.children("tr").not(d).length&&p.hide()}(jQuery); \ No newline at end of file diff --git a/wp-admin/js/auth-app.js b/wp-admin/js/auth-app.js new file mode 100644 index 0000000000..ad4403032d --- /dev/null +++ b/wp-admin/js/auth-app.js @@ -0,0 +1,161 @@ +/** + * @output wp-admin/js/auth-app.js + */ + +/* global authApp */ + +( function( $, authApp ) { + var $appNameField = $( '#app_name' ), + $approveBtn = $( '#approve' ), + $rejectBtn = $( '#reject' ), + $form = $appNameField.closest( 'form' ), + context = { + userLogin: authApp.user_login, + successUrl: authApp.success, + rejectUrl: authApp.reject + }; + + $approveBtn.click( function( e ) { + var name = $appNameField.val(), + appId = $( 'input[name="app_id"]', $form ).val(); + + e.preventDefault(); + + if ( $approveBtn.prop( 'aria-disabled' ) ) { + return; + } + + if ( 0 === name.length ) { + $appNameField.focus(); + return; + } + + $approveBtn.prop( 'aria-disabled', true ).addClass( 'disabled' ); + + var request = { + name: name + }; + + if ( appId.length > 0 ) { + request.app_id = appId; + } + + /** + * Filters the request data used to Authorize an Application Password request. + * + * @since 5.6.0 + * + * @param {Object} request The request data. + * @param {Object} context Context about the Application Password request. + * @param {string} context.userLogin The user's login username. + * @param {string} context.successUrl The URL the user will be redirected to after approving the request. + * @param {string} context.rejectUrl The URL the user will be redirected to after rejecting the request. + */ + request = wp.hooks.applyFilters( 'wp_application_passwords_approve_app_request', request, context ); + + wp.apiRequest( { + path: '/wp/v2/users/me/application-passwords?_locale=user', + method: 'POST', + data: request + } ).done( function( response, textStatus, jqXHR ) { + + /** + * Fires when an Authorize Application Password request has been successfully approved. + * + * @since 5.6.0 + * + * @param {Object} response The response from the REST API. + * @param {string} response.password The newly created password. + * @param {string} textStatus The status of the request. + * @param {jqXHR} jqXHR The underlying jqXHR object that made the request. + */ + wp.hooks.doAction( 'wp_application_passwords_approve_app_request_success', response, textStatus, jqXHR ); + + var raw = authApp.success, + url, message, $notice; + + if ( raw ) { + url = raw + ( -1 === raw.indexOf( '?' ) ? '?' : '&' ) + + 'site_url=' + encodeURIComponent( authApp.site_url ) + + '&user_login=' + encodeURIComponent( authApp.user_login ) + + '&password=' + encodeURIComponent( response.password ); + + window.location = url; + } else { + message = wp.i18n.sprintf( + /* translators: %s: Application name. */ + '', + '' + ) + ' '; + $notice = $( '
' ) + .attr( 'role', 'alert' ) + .attr( 'tabindex', -1 ) + .addClass( 'notice notice-success notice-alt' ) + .append( $( '

' ).addClass( 'application-password-display' ).html( message ) ) + .append( '

' + wp.i18n.__( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ) + '

' ); + + // We're using .text() to write the variables to avoid any chance of XSS. + $( 'strong', $notice ).text( name ); + $( 'input', $notice ).val( response.password ); + + $form.replaceWith( $notice ); + $notice.focus(); + } + } ).fail( function( jqXHR, textStatus, errorThrown ) { + var errorMessage = errorThrown, + error = null; + + if ( jqXHR.responseJSON ) { + error = jqXHR.responseJSON; + + if ( error.message ) { + errorMessage = error.message; + } + } + + var $notice = $( '
' ) + .attr( 'role', 'alert' ) + .addClass( 'notice notice-error' ) + .append( $( '

' ).text( errorMessage ) ); + + $( 'h1' ).after( $notice ); + + $approveBtn.removeProp( 'aria-disabled', false ).removeClass( 'disabled' ); + + /** + * Fires when an Authorize Application Password request encountered an error when trying to approve the request. + * + * @since 5.6.0 + * + * @param {Object|null} error The error from the REST API. May be null if the server did not send proper JSON. + * @param {string} textStatus The status of the request. + * @param {string} errorThrown The error message associated with the response status code. + * @param {jqXHR} jqXHR The underlying jqXHR object that made the request. + */ + wp.hooks.doAction( 'wp_application_passwords_approve_app_request_success', error, textStatus, jqXHR ); + } ); + } ); + + $rejectBtn.click( function( e ) { + e.preventDefault(); + + /** + * Fires when an Authorize Application Password request has been rejected by the user. + * + * @since 5.6.0 + * + * @param {Object} context Context about the Application Password request. + * @param {string} context.userLogin The user's login username. + * @param {string} context.successUrl The URL the user will be redirected to after approving the request. + * @param {string} context.rejectUrl The URL the user will be redirected to after rejecting the request. + */ + wp.hooks.doAction( 'wp_application_passwords_reject_app', context ); + + // @todo: Make a better way to do this so it feels like less of a semi-open redirect. + window.location = authApp.reject; + } ); + + $form.on( 'submit', function( e ) { + e.preventDefault(); + } ); +}( jQuery, authApp ) ); diff --git a/wp-admin/js/auth-app.min.js b/wp-admin/js/auth-app.min.js new file mode 100644 index 0000000000..6695f4dc1a --- /dev/null +++ b/wp-admin/js/auth-app.min.js @@ -0,0 +1,2 @@ +/*! This file is auto-generated */ +!function(r,l){var o=r("#app_name"),i=r("#approve"),e=r("#reject"),d=o.closest("form"),p={userLogin:l.user_login,successUrl:l.success,rejectUrl:l.reject};i.click(function(e){var n=o.val(),a=r('input[name="app_id"]',d).val();if(e.preventDefault(),!i.prop("aria-disabled"))if(0!==n.length){i.prop("aria-disabled",!0).addClass("disabled");var s={name:n};0'+wp.i18n.__("Your new password for %s is:")+"","")+' ',t=r("
").attr("role","alert").attr("tabindex",-1).addClass("notice notice-success notice-alt").append(r("

").addClass("application-password-display").html(p)).append("

"+wp.i18n.__("Be sure to save this in a safe location. You will not be able to retrieve it.")+"

"),r("strong",t).text(n),r("input",t).val(e.password),d.replaceWith(t),t.focus())}).fail(function(e,a,s){var o=s,p=null;e.responseJSON&&(p=e.responseJSON).message&&(o=p.message);var t=r("
").attr("role","alert").addClass("notice notice-error").append(r("

").text(o));r("h1").after(t),i.removeProp("aria-disabled",!1).removeClass("disabled"),wp.hooks.doAction("wp_application_passwords_approve_app_request_success",p,a,e)})}else o.focus()}),e.click(function(e){e.preventDefault(),wp.hooks.doAction("wp_application_passwords_reject_app",p),window.location=l.reject}),d.on("submit",function(e){e.preventDefault()})}(jQuery,authApp); \ No newline at end of file diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index 772ec1f1f7..eea96d3778 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -55,13 +55,15 @@ function deprecatedProperty( propName, version, replacement ) { * Deprecate all properties on an object. * * @since 5.5.1 + * @since 5.6.0 Added the `version` parameter. * * @param {string} name The name of the object, i.e. commonL10n. * @param {object} l10nObject The object to deprecate the properties on. + * @param {string} version The version of WordPress that deprecated the property. * * @return {object} The object with all its properties deprecated. */ -function deprecateL10nObject( name, l10nObject ) { +function deprecateL10nObject( name, l10nObject, version ) { var deprecatedObject = {}; Object.keys( l10nObject ).forEach( function( key ) { @@ -70,12 +72,12 @@ function deprecateL10nObject( name, l10nObject ) { if ( 'object' === typeof prop ) { Object.defineProperty( deprecatedObject, key, { get: function() { - deprecatedProperty( propName, '5.5.0', prop.alternative ); + deprecatedProperty( propName, version, prop.alternative ); return prop.func(); } } ); } else { Object.defineProperty( deprecatedObject, key, { get: function() { - deprecatedProperty( propName, '5.5.0', 'wp.i18n' ); + deprecatedProperty( propName, version, 'wp.i18n' ); return prop; } } ); } @@ -99,7 +101,7 @@ window.commonL10n = window.commonL10n || { expandMenu: '' }; -window.commonL10n = deprecateL10nObject( 'commonL10n', window.commonL10n ); +window.commonL10n = deprecateL10nObject( 'commonL10n', window.commonL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -111,7 +113,7 @@ window.wpPointerL10n = window.wpPointerL10n || { dismiss: '' }; -window.wpPointerL10n = deprecateL10nObject( 'wpPointerL10n', window.wpPointerL10n ); +window.wpPointerL10n = deprecateL10nObject( 'wpPointerL10n', window.wpPointerL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -129,7 +131,7 @@ window.userProfileL10n = window.userProfileL10n || { ariaHide: '' }; -window.userProfileL10n = deprecateL10nObject( 'userProfileL10n', window.userProfileL10n ); +window.userProfileL10n = deprecateL10nObject( 'userProfileL10n', window.userProfileL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -148,7 +150,7 @@ window.privacyToolsL10n = window.privacyToolsL10n || { exportError: '' }; -window.privacyToolsL10n = deprecateL10nObject( 'privacyToolsL10n', window.privacyToolsL10n ); +window.privacyToolsL10n = deprecateL10nObject( 'privacyToolsL10n', window.privacyToolsL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -160,7 +162,7 @@ window.authcheckL10n = { beforeunload: '' }; -window.authcheckL10n = window.authcheckL10n || deprecateL10nObject( 'authcheckL10n', window.authcheckL10n ); +window.authcheckL10n = window.authcheckL10n || deprecateL10nObject( 'authcheckL10n', window.authcheckL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -173,7 +175,7 @@ window.tagsl10n = { broken: '' }; -window.tagsl10n = window.tagsl10n || deprecateL10nObject( 'tagsl10n', window.tagsl10n ); +window.tagsl10n = window.tagsl10n || deprecateL10nObject( 'tagsl10n', window.tagsl10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -198,7 +200,7 @@ window.adminCommentsL10n = window.adminCommentsL10n || { docTitleCommentsCount: '' }; -window.adminCommentsL10n = deprecateL10nObject( 'adminCommentsL10n', window.adminCommentsL10n ); +window.adminCommentsL10n = deprecateL10nObject( 'adminCommentsL10n', window.adminCommentsL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -214,7 +216,7 @@ window.tagsSuggestL10n = window.tagsSuggestL10n || { termRemoved: '' }; -window.tagsSuggestL10n = deprecateL10nObject( 'tagsSuggestL10n', window.tagsSuggestL10n ); +window.tagsSuggestL10n = deprecateL10nObject( 'tagsSuggestL10n', window.tagsSuggestL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -231,7 +233,7 @@ window.wpColorPickerL10n = window.wpColorPickerL10n || { defaultLabel: '' }; -window.wpColorPickerL10n = deprecateL10nObject( 'wpColorPickerL10n', window.wpColorPickerL10n ); +window.wpColorPickerL10n = deprecateL10nObject( 'wpColorPickerL10n', window.wpColorPickerL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -243,7 +245,7 @@ window.attachMediaBoxL10n = window.attachMediaBoxL10n || { error: '' }; -window.attachMediaBoxL10n = deprecateL10nObject( 'attachMediaBoxL10n', window.attachMediaBoxL10n ); +window.attachMediaBoxL10n = deprecateL10nObject( 'attachMediaBoxL10n', window.attachMediaBoxL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -276,7 +278,7 @@ window.postL10n = window.postL10n || { permalinkSaved: '' }; -window.postL10n = deprecateL10nObject( 'postL10n', window.postL10n ); +window.postL10n = deprecateL10nObject( 'postL10n', window.postL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -292,7 +294,7 @@ window.inlineEditL10n = window.inlineEditL10n || { saved: '' }; -window.inlineEditL10n = deprecateL10nObject( 'inlineEditL10n', window.inlineEditL10n ); +window.inlineEditL10n = deprecateL10nObject( 'inlineEditL10n', window.inlineEditL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -306,7 +308,7 @@ window.plugininstallL10n = window.plugininstallL10n || { ays: '' }; -window.plugininstallL10n = deprecateL10nObject( 'plugininstallL10n', window.plugininstallL10n ); +window.plugininstallL10n = deprecateL10nObject( 'plugininstallL10n', window.plugininstallL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -321,7 +323,7 @@ window.navMenuL10n = window.navMenuL10n || { untitled: '' }; -window.navMenuL10n = deprecateL10nObject( 'navMenuL10n', window.navMenuL10n ); +window.navMenuL10n = deprecateL10nObject( 'navMenuL10n', window.navMenuL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -334,7 +336,7 @@ window.commentL10n = window.commentL10n || { dateFormat: '' }; -window.commentL10n = deprecateL10nObject( 'commentL10n', window.commentL10n ); +window.commentL10n = deprecateL10nObject( 'commentL10n', window.commentL10n, '5.5.0' ); /** * Removed in 5.5.0, needed for back-compatibility. @@ -349,7 +351,7 @@ window.setPostThumbnailL10n = window.setPostThumbnailL10n || { done: '' }; -window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n ); +window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n, '5.5.0' ); /** * Removed in 3.3.0, needed for back-compatibility. @@ -1092,6 +1094,10 @@ $document.ready( function() { var $el = $( this ), $button = $( '' ); + if ( $el.find( '.notice-dismiss' ).length ) { + return; + } + // Ensure plain text. $button.find( '.screen-reader-text' ).text( __( 'Dismiss this notice.' ) ); $button.on( 'click.wp-dismiss-notice', function( event ) { @@ -1233,7 +1239,7 @@ $document.ready( function() { focusedRowActions.removeClass( 'visible' ); }, 30 ); } - }, '.has-row-actions' ); + }, '.table-view-list .has-row-actions' ); // Toggle list table rows on small screens. $( 'tbody' ).on( 'click', '.toggle-row', function() { diff --git a/wp-admin/js/common.min.js b/wp-admin/js/common.min.js index f61e647207..be463b7cc2 100644 --- a/wp-admin/js/common.min.js +++ b/wp-admin/js/common.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(W,$){var Q=W(document),H=W($),V=W(document.body),q=wp.i18n.__,o=wp.i18n.sprintf;function a(e,t,n){var i;i=void 0!==n?o(q("%1$s is deprecated since version %2$s! Use %3$s instead."),e,t,n):o(q("%1$s is deprecated since version %2$s with no alternative available."),e,t),$.console.warn(i)}function e(i,o){var s={};return Object.keys(o).forEach(function(e){var t=o[e],n=i+"."+e;"object"==typeof t?Object.defineProperty(s,e,{get:function(){return a(n,"5.5.0",t.alternative),t.func()}}):Object.defineProperty(s,e,{get:function(){return a(n,"5.5.0","wp.i18n"),t}})}),s}$.wp.deprecateL10nObject=e,$.commonL10n=$.commonL10n||{warnDelete:"",dismiss:"",collapseMenu:"",expandMenu:""},$.commonL10n=e("commonL10n",$.commonL10n),$.wpPointerL10n=$.wpPointerL10n||{dismiss:""},$.wpPointerL10n=e("wpPointerL10n",$.wpPointerL10n),$.userProfileL10n=$.userProfileL10n||{warn:"",warnWeak:"",show:"",hide:"",cancel:"",ariaShow:"",ariaHide:""},$.userProfileL10n=e("userProfileL10n",$.userProfileL10n),$.privacyToolsL10n=$.privacyToolsL10n||{noDataFound:"",foundAndRemoved:"",noneRemoved:"",someNotRemoved:"",removalError:"",emailSent:"",noExportFile:"",exportError:""},$.privacyToolsL10n=e("privacyToolsL10n",$.privacyToolsL10n),$.authcheckL10n={beforeunload:""},$.authcheckL10n=$.authcheckL10n||e("authcheckL10n",$.authcheckL10n),$.tagsl10n={noPerm:"",broken:""},$.tagsl10n=$.tagsl10n||e("tagsl10n",$.tagsl10n),$.adminCommentsL10n=$.adminCommentsL10n||{hotkeys_highlight_first:{alternative:"window.adminCommentsSettings.hotkeys_highlight_first",func:function(){return $.adminCommentsSettings.hotkeys_highlight_first}},hotkeys_highlight_last:{alternative:"window.adminCommentsSettings.hotkeys_highlight_last",func:function(){return $.adminCommentsSettings.hotkeys_highlight_last}},replyApprove:"",reply:"",warnQuickEdit:"",warnCommentChanges:"",docTitleComments:"",docTitleCommentsCount:""},$.adminCommentsL10n=e("adminCommentsL10n",$.adminCommentsL10n),$.tagsSuggestL10n=$.tagsSuggestL10n||{tagDelimiter:"",removeTerm:"",termSelected:"",termAdded:"",termRemoved:""},$.tagsSuggestL10n=e("tagsSuggestL10n",$.tagsSuggestL10n),$.wpColorPickerL10n=$.wpColorPickerL10n||{clear:"",clearAriaLabel:"",defaultString:"",defaultAriaLabel:"",pick:"",defaultLabel:""},$.wpColorPickerL10n=e("wpColorPickerL10n",$.wpColorPickerL10n),$.attachMediaBoxL10n=$.attachMediaBoxL10n||{error:""},$.attachMediaBoxL10n=e("attachMediaBoxL10n",$.attachMediaBoxL10n),$.postL10n=$.postL10n||{ok:"",cancel:"",publishOn:"",publishOnFuture:"",publishOnPast:"",dateFormat:"",showcomm:"",endcomm:"",publish:"",schedule:"",update:"",savePending:"",saveDraft:"",private:"",public:"",publicSticky:"",password:"",privatelyPublished:"",published:"",saveAlert:"",savingText:"",permalinkSaved:""},$.postL10n=e("postL10n",$.postL10n),$.inlineEditL10n=$.inlineEditL10n||{error:"",ntdeltitle:"",notitle:"",comma:"",saved:""},$.inlineEditL10n=e("inlineEditL10n",$.inlineEditL10n),$.plugininstallL10n=$.plugininstallL10n||{plugin_information:"",plugin_modal_label:"",ays:""},$.plugininstallL10n=e("plugininstallL10n",$.plugininstallL10n),$.navMenuL10n=$.navMenuL10n||{noResultsFound:"",warnDeleteMenu:"",saveAlert:"",untitled:""},$.navMenuL10n=e("navMenuL10n",$.navMenuL10n),$.commentL10n=$.commentL10n||{submittedOn:"",dateFormat:""},$.commentL10n=e("commentL10n",$.commentL10n),$.setPostThumbnailL10n=$.setPostThumbnailL10n||{setThumbnail:"",saving:"",error:"",done:""},$.setPostThumbnailL10n=e("setPostThumbnailL10n",$.setPostThumbnailL10n),$.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},$.columns={init:function(){var n=this;W(".hide-column-tog","#adv-settings").click(function(){var e=W(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();W.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:W("#screenoptionnonce").val(),page:pagenow})},checked:function(e){W(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){W(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return W(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return W(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=W("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},Q.ready(function(){columns.init()}),$.validateForm=function(e){return!W(e).find(".form-required").filter(function(){return""===W(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){W(this).closest(".form-invalid").removeClass("form-invalid")}).length},$.showNotice={warn:function(){return!!confirm(q("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},$.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=W("#screen-meta"),this.toggles=W("#screen-meta-links").find(".show-settings"),this.page=W("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=W("#"+W(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,W(this)):screenMeta.open(e,W(this)))},open:function(e,t){W("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),Q.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),W(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),Q.trigger("screen:options:close")}},W(".contextual-help-tabs").delegate("a","click",function(e){var t,n=W(this);if(e.preventDefault(),n.is(".active a"))return!1;W(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=W(n.attr("href")),W(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var t,r=!1,l=W("#permalink_structure"),n=W(".permalink-structure input:radio"),c=W("#custom_selection"),i=W(".form-table.permalink-structure .available-structure-tags button");function d(e){-1!==l.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function s(){Q.trigger("wp-window-resized")}n.on("change",function(){"custom"!==this.value&&(l.val(this.value),i.each(function(){d(W(this))}))}),l.on("click input",function(){c.prop("checked",!0)}),l.on("focus",function(e){r=!0,W(this).off(e)}),i.each(function(){d(W(this))}),l.on("change",function(){i.each(function(){d(W(this))})}),i.on("click",function(){var e,t=l.val(),n=l[0].selectionStart,i=l[0].selectionEnd,o=W(this).text().trim(),s=W(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),l.val("/"===t?"":t),W("#custom_selection_updated").text(s),void d(W(this));r||0!==n||0!==i||(n=i=t.length),c.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),l.val(t.substr(0,n)+o+t.substr(i)),W("#custom_selection_updated").text(s),d(W(this)),r&&l[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,l[0].setSelectionRange(e,e),l.focus())}),Q.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=W("input.current-page"),m=p.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),f=-1!==navigator.userAgent.indexOf("Android"),v=W("#adminmenuwrap"),b=W("#wpwrap"),g=W("#adminmenu"),w=W("#wp-responsive-overlay"),k=W("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),L=W(".meta-box-sortables"),y=!1,x=W("#wpadminbar"),S=0,P=!1,T=!1,M=0,_=!1,D={window:H.height(),wpwrap:b.height(),adminbar:x.height(),menu:v.height()},E=W(".wp-header-end");function A(){var e=W("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function O(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=H.scrollTop())-30,n=60+(t=o+r.height()+1)-b.height(),(i=H.height()+s-50)');e.find(".screen-reader-text").text(q("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e)})}function R(){l.prop("disabled",""===c.map(function(){return W(this).val()}).get().join(""))}function U(e){var t=H.scrollTop(),n=!e||"scroll"!==e.type;if(!h&&!g.data("wp-responsive"))if(D.menu+D.adminbarD.wpwrap)I();else{if(_=!0,D.menu+D.adminbar>D.window){if(t<0)return void(P||(T=!(P=!0),v.css({position:"fixed",top:"",bottom:""})));if(t+D.window>Q.height()-1)return void(T||(P=!(T=!0),v.css({position:"fixed",top:"",bottom:0})));St+D.window&&(M=t),v.css({position:"absolute",top:M,bottom:""})):!P&&v.offset().top>=t+D.adminbar&&(P=!0,v.css({position:"fixed",top:"",bottom:""})):n&&(P=T=!1,0<(M=t+D.window-D.menu-D.adminbar-1)?v.css({position:"absolute",top:M,bottom:""}):I())}S=t}}function F(){D={window:H.height(),wpwrap:b.height(),adminbar:x.height(),menu:v.height()}}function I(){!h&&_&&(P=T=_=!1,v.css({position:"",top:"",bottom:""}))}function K(){F(),g.data("wp-responsive")?(V.removeClass("sticky-menu"),I()):D.menu+D.adminbar>D.window?(U(),V.removeClass("sticky-menu")):(V.addClass("sticky-menu"),I())}function z(){W(".aria-button-if-js").attr("role","button")}function B(){var e=!1;return $.innerWidth&&(e=Math.max($.innerWidth,document.documentElement.clientWidth)),e}function N(){var e=B()||961;r=e<=782?"responsive":V.hasClass("folded")||V.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=W(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=W(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(W(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),Q.on("wp-window-resized.wp-responsive",W.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),Q.on("postbox-toggled",this.maybeDisableSortables),W("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1
').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),W(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(L.length)try{L.sortable("disable"),L.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(L.length)try{L.sortable("enable"),L.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},W(document).ajaxComplete(function(){z()}),Q.on("wp-window-resized.set-menu-state",N),Q.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i,o=W("#collapse-button");i="folded"===t.state?(n="false",q("Expand Main menu")):(n="true",q("Collapse Main menu")),o.attr({"aria-expanded":n,"aria-label":i})}),$.wpResponsive.init(),K(),N(),A(),j(),z(),Q.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",K),W(".wp-initial-focus").focus(),V.on("click",".js-update-details-toggle",function(){var e=W(this).closest(".js-update-details"),t=W("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),W(this).attr("aria-expanded",t.is(":visible"))})}),Q.ready(function(e){var t,n;V.hasClass("update-php")&&(t=e("a.update-from-upload-overwrite"),n=e(".update-from-upload-expired"),t.length&&n.length&&$.setTimeout(function(){t.hide(),n.removeClass("hidden"),$.wp&&$.wp.a11y&&$.wp.a11y.speak(n.text())},714e4))}),H.on("resize.wp-fire-once",function(){$.clearTimeout(t),t=$.setTimeout(s,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window); \ No newline at end of file +!function(W,$){var Q=W(document),H=W($),V=W(document.body),q=wp.i18n.__,o=wp.i18n.sprintf;function r(e,t,n){var i;i=void 0!==n?o(q("%1$s is deprecated since version %2$s! Use %3$s instead."),e,t,n):o(q("%1$s is deprecated since version %2$s with no alternative available."),e,t),$.console.warn(i)}function e(i,o,s){var a={};return Object.keys(o).forEach(function(e){var t=o[e],n=i+"."+e;"object"==typeof t?Object.defineProperty(a,e,{get:function(){return r(n,s,t.alternative),t.func()}}):Object.defineProperty(a,e,{get:function(){return r(n,s,"wp.i18n"),t}})}),a}$.wp.deprecateL10nObject=e,$.commonL10n=$.commonL10n||{warnDelete:"",dismiss:"",collapseMenu:"",expandMenu:""},$.commonL10n=e("commonL10n",$.commonL10n,"5.5.0"),$.wpPointerL10n=$.wpPointerL10n||{dismiss:""},$.wpPointerL10n=e("wpPointerL10n",$.wpPointerL10n,"5.5.0"),$.userProfileL10n=$.userProfileL10n||{warn:"",warnWeak:"",show:"",hide:"",cancel:"",ariaShow:"",ariaHide:""},$.userProfileL10n=e("userProfileL10n",$.userProfileL10n,"5.5.0"),$.privacyToolsL10n=$.privacyToolsL10n||{noDataFound:"",foundAndRemoved:"",noneRemoved:"",someNotRemoved:"",removalError:"",emailSent:"",noExportFile:"",exportError:""},$.privacyToolsL10n=e("privacyToolsL10n",$.privacyToolsL10n,"5.5.0"),$.authcheckL10n={beforeunload:""},$.authcheckL10n=$.authcheckL10n||e("authcheckL10n",$.authcheckL10n,"5.5.0"),$.tagsl10n={noPerm:"",broken:""},$.tagsl10n=$.tagsl10n||e("tagsl10n",$.tagsl10n,"5.5.0"),$.adminCommentsL10n=$.adminCommentsL10n||{hotkeys_highlight_first:{alternative:"window.adminCommentsSettings.hotkeys_highlight_first",func:function(){return $.adminCommentsSettings.hotkeys_highlight_first}},hotkeys_highlight_last:{alternative:"window.adminCommentsSettings.hotkeys_highlight_last",func:function(){return $.adminCommentsSettings.hotkeys_highlight_last}},replyApprove:"",reply:"",warnQuickEdit:"",warnCommentChanges:"",docTitleComments:"",docTitleCommentsCount:""},$.adminCommentsL10n=e("adminCommentsL10n",$.adminCommentsL10n,"5.5.0"),$.tagsSuggestL10n=$.tagsSuggestL10n||{tagDelimiter:"",removeTerm:"",termSelected:"",termAdded:"",termRemoved:""},$.tagsSuggestL10n=e("tagsSuggestL10n",$.tagsSuggestL10n,"5.5.0"),$.wpColorPickerL10n=$.wpColorPickerL10n||{clear:"",clearAriaLabel:"",defaultString:"",defaultAriaLabel:"",pick:"",defaultLabel:""},$.wpColorPickerL10n=e("wpColorPickerL10n",$.wpColorPickerL10n,"5.5.0"),$.attachMediaBoxL10n=$.attachMediaBoxL10n||{error:""},$.attachMediaBoxL10n=e("attachMediaBoxL10n",$.attachMediaBoxL10n,"5.5.0"),$.postL10n=$.postL10n||{ok:"",cancel:"",publishOn:"",publishOnFuture:"",publishOnPast:"",dateFormat:"",showcomm:"",endcomm:"",publish:"",schedule:"",update:"",savePending:"",saveDraft:"",private:"",public:"",publicSticky:"",password:"",privatelyPublished:"",published:"",saveAlert:"",savingText:"",permalinkSaved:""},$.postL10n=e("postL10n",$.postL10n,"5.5.0"),$.inlineEditL10n=$.inlineEditL10n||{error:"",ntdeltitle:"",notitle:"",comma:"",saved:""},$.inlineEditL10n=e("inlineEditL10n",$.inlineEditL10n,"5.5.0"),$.plugininstallL10n=$.plugininstallL10n||{plugin_information:"",plugin_modal_label:"",ays:""},$.plugininstallL10n=e("plugininstallL10n",$.plugininstallL10n,"5.5.0"),$.navMenuL10n=$.navMenuL10n||{noResultsFound:"",warnDeleteMenu:"",saveAlert:"",untitled:""},$.navMenuL10n=e("navMenuL10n",$.navMenuL10n,"5.5.0"),$.commentL10n=$.commentL10n||{submittedOn:"",dateFormat:""},$.commentL10n=e("commentL10n",$.commentL10n,"5.5.0"),$.setPostThumbnailL10n=$.setPostThumbnailL10n||{setThumbnail:"",saving:"",error:"",done:""},$.setPostThumbnailL10n=e("setPostThumbnailL10n",$.setPostThumbnailL10n,"5.5.0"),$.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},$.columns={init:function(){var n=this;W(".hide-column-tog","#adv-settings").click(function(){var e=W(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();W.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:W("#screenoptionnonce").val(),page:pagenow})},checked:function(e){W(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){W(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return W(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return W(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=W("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},Q.ready(function(){columns.init()}),$.validateForm=function(e){return!W(e).find(".form-required").filter(function(){return""===W(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){W(this).closest(".form-invalid").removeClass("form-invalid")}).length},$.showNotice={warn:function(){return!!confirm(q("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},$.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=W("#screen-meta"),this.toggles=W("#screen-meta-links").find(".show-settings"),this.page=W("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=W("#"+W(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,W(this)):screenMeta.open(e,W(this)))},open:function(e,t){W("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),Q.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),W(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),Q.trigger("screen:options:close")}},W(".contextual-help-tabs").delegate("a","click",function(e){var t,n=W(this);if(e.preventDefault(),n.is(".active a"))return!1;W(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=W(n.attr("href")),W(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var t,a=!1,l=W("#permalink_structure"),n=W(".permalink-structure input:radio"),c=W("#custom_selection"),i=W(".form-table.permalink-structure .available-structure-tags button");function d(e){-1!==l.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function s(){Q.trigger("wp-window-resized")}n.on("change",function(){"custom"!==this.value&&(l.val(this.value),i.each(function(){d(W(this))}))}),l.on("click input",function(){c.prop("checked",!0)}),l.on("focus",function(e){a=!0,W(this).off(e)}),i.each(function(){d(W(this))}),l.on("change",function(){i.each(function(){d(W(this))})}),i.on("click",function(){var e,t=l.val(),n=l[0].selectionStart,i=l[0].selectionEnd,o=W(this).text().trim(),s=W(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),l.val("/"===t?"":t),W("#custom_selection_updated").text(s),void d(W(this));a||0!==n||0!==i||(n=i=t.length),c.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),l.val(t.substr(0,n)+o+t.substr(i)),W("#custom_selection_updated").text(s),d(W(this)),a&&l[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,l[0].setSelectionRange(e,e),l.focus())}),Q.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=W("input.current-page"),m=p.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),f=-1!==navigator.userAgent.indexOf("Android"),v=W("#adminmenuwrap"),b=W("#wpwrap"),g=W("#adminmenu"),w=W("#wp-responsive-overlay"),k=W("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),L=W(".meta-box-sortables"),y=!1,x=W("#wpadminbar"),S=0,P=!1,T=!1,M=0,_=!1,D={window:H.height(),wpwrap:b.height(),adminbar:x.height(),menu:v.height()},E=W(".wp-header-end");function A(){var e=W("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function O(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=H.scrollTop())-30,n=60+(t=o+r.height()+1)-b.height(),(i=H.height()+s-50)');t.find(".notice-dismiss").length||(e.find(".screen-reader-text").text(q("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e))})}function R(){l.prop("disabled",""===c.map(function(){return W(this).val()}).get().join(""))}function U(e){var t=H.scrollTop(),n=!e||"scroll"!==e.type;if(!h&&!g.data("wp-responsive"))if(D.menu+D.adminbarD.wpwrap)I();else{if(_=!0,D.menu+D.adminbar>D.window){if(t<0)return void(P||(T=!(P=!0),v.css({position:"fixed",top:"",bottom:""})));if(t+D.window>Q.height()-1)return void(T||(P=!(T=!0),v.css({position:"fixed",top:"",bottom:0})));St+D.window&&(M=t),v.css({position:"absolute",top:M,bottom:""})):!P&&v.offset().top>=t+D.adminbar&&(P=!0,v.css({position:"fixed",top:"",bottom:""})):n&&(P=T=!1,0<(M=t+D.window-D.menu-D.adminbar-1)?v.css({position:"absolute",top:M,bottom:""}):I())}S=t}}function F(){D={window:H.height(),wpwrap:b.height(),adminbar:x.height(),menu:v.height()}}function I(){!h&&_&&(P=T=_=!1,v.css({position:"",top:"",bottom:""}))}function K(){F(),g.data("wp-responsive")?(V.removeClass("sticky-menu"),I()):D.menu+D.adminbar>D.window?(U(),V.removeClass("sticky-menu")):(V.addClass("sticky-menu"),I())}function z(){W(".aria-button-if-js").attr("role","button")}function B(){var e=!1;return $.innerWidth&&(e=Math.max($.innerWidth,document.documentElement.clientWidth)),e}function N(){var e=B()||961;r=e<=782?"responsive":V.hasClass("folded")||V.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=W(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=W(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(W(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),Q.on("wp-window-resized.wp-responsive",W.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),Q.on("postbox-toggled",this.maybeDisableSortables),W("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1
').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),W(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(L.length)try{L.sortable("disable"),L.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(L.length)try{L.sortable("enable"),L.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},W(document).ajaxComplete(function(){z()}),Q.on("wp-window-resized.set-menu-state",N),Q.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i,o=W("#collapse-button");i="folded"===t.state?(n="false",q("Expand Main menu")):(n="true",q("Collapse Main menu")),o.attr({"aria-expanded":n,"aria-label":i})}),$.wpResponsive.init(),K(),N(),A(),j(),z(),Q.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",K),W(".wp-initial-focus").focus(),V.on("click",".js-update-details-toggle",function(){var e=W(this).closest(".js-update-details"),t=W("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),W(this).attr("aria-expanded",t.is(":visible"))})}),Q.ready(function(e){var t,n;V.hasClass("update-php")&&(t=e("a.update-from-upload-overwrite"),n=e(".update-from-upload-expired"),t.length&&n.length&&$.setTimeout(function(){t.hide(),n.removeClass("hidden"),$.wp&&$.wp.a11y&&$.wp.a11y.speak(n.text())},714e4))}),H.on("resize.wp-fire-once",function(){$.clearTimeout(t),t=$.setTimeout(s,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window); \ No newline at end of file diff --git a/wp-admin/js/customize-controls.js b/wp-admin/js/customize-controls.js index 484ac5a49b..0c359c79c6 100644 --- a/wp-admin/js/customize-controls.js +++ b/wp-admin/js/customize-controls.js @@ -3700,8 +3700,8 @@ parentContainer = ( section.contentContainer.is( 'ul' ) ) ? section.contentContainer : section.contentContainer.find( 'ul:first' ); if ( ! control.container.parent().is( parentContainer ) ) { parentContainer.append( control.container ); - control.renderContent(); } + control.renderContent(); control.deferred.embedded.resolve(); }); }); diff --git a/wp-admin/js/customize-controls.min.js b/wp-admin/js/customize-controls.min.js index 550bb7b4ab..3c3cc18e65 100644 --- a/wp-admin/js/customize-controls.min.js +++ b/wp-admin/js/customize-controls.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(e,Z){var a,t,s,n,i,o,r,ee=wp.customize;ee.OverlayNotification=ee.Notification.extend({loading:!1,initialize:function(e,t){var n=this;ee.Notification.prototype.initialize.call(n,e,t),n.containerClasses+=" notification-overlay",n.loading&&(n.containerClasses+=" notification-loading")},render:function(){var e=ee.Notification.prototype.render.call(this);return e.on("keydown",_.bind(this.handleEscape,this)),e},handleEscape:function(e){var t=this;27===e.which&&(e.stopPropagation(),t.dismissible&&t.parent&&t.parent.remove(t.code))}}),ee.Notifications=ee.Values.extend({alt:!1,defaultConstructor:ee.Notification,initialize:function(e){var t=this;ee.Values.prototype.initialize.call(t,e),_.bindAll(t,"constrainFocus"),t._addedIncrement=0,t._addedOrder={},t.bind("add",function(e){t.trigger("change",e)}),t.bind("removed",function(e){t.trigger("change",e)})},count:function(){return _.size(this._value)},add:function(e,t){var n,i,a=this;return i="string"==typeof e?(n=e,t):(n=e.code,e),a.has(n)||(a._addedIncrement+=1,a._addedOrder[n]=a._addedIncrement),ee.Values.prototype.add.call(a,n,i)},remove:function(e){return delete this._addedOrder[e],ee.Values.prototype.remove.call(this,e)},get:function(e){var t,a,o=this;return t=_.values(o._value),_.extend({sort:!1},e).sort&&(a={error:4,warning:3,success:2,info:1},t.sort(function(e,t){var n=0,i=0;return _.isUndefined(a[e.type])||(n=a[e.type]),_.isUndefined(a[t.type])||(i=a[t.type]),n!==i?i-n:o._addedOrder[t.code]-o._addedOrder[e.code]})),t},render:function(){var e,t,n,i,a=this,o=!1,s=[],r={};a.container&&a.container.length&&(e=a.get({sort:!0}),a.container.toggle(0!==e.length),a.container.is(a.previousContainer)&&_.isEqual(e,a.previousNotifications)||((n=a.container.children("ul").first()).length||(n=Z("
    "),a.container.append(n)),n.find("> [data-code]").remove(),_.each(a.previousNotifications,function(e){r[e.code]=e}),_.each(e,function(e){var t;!wp.a11y||r[e.code]&&_.isEqual(e.message,r[e.code].message)||wp.a11y.speak(e.message,"assertive"),t=Z(e.render()),e.container=t,n.append(t),e.extended(ee.OverlayNotification)&&s.push(e)}),t=Boolean(s.length),a.previousNotifications&&(o=Boolean(_.find(a.previousNotifications,function(e){return e.extended(ee.OverlayNotification)}))),t!==o&&(Z(document.body).toggleClass("customize-loading",t),a.container.toggleClass("has-overlay-notifications",t),t?(a.previousActiveElement=document.activeElement,Z(document).on("keydown",a.constrainFocus)):Z(document).off("keydown",a.constrainFocus)),t?(a.focusContainer=s[s.length-1].container,a.focusContainer.prop("tabIndex",-1),(i=a.focusContainer.find(":focusable")).length?i.first().focus():a.focusContainer.focus()):a.previousActiveElement&&(Z(a.previousActiveElement).focus(),a.previousActiveElement=null),a.previousNotifications=e,a.previousContainer=a.container,a.trigger("rendered")))},constrainFocus:function(e){var t,n=this;e.stopPropagation(),9===e.which&&(0===(t=n.focusContainer.find(":focusable")).length&&(t=n.focusContainer),Z.contains(n.focusContainer[0],e.target)&&Z.contains(n.focusContainer[0],document.activeElement)?t.last().is(e.target)&&!e.shiftKey?(e.preventDefault(),t.first().focus()):t.first().is(e.target)&&e.shiftKey&&(e.preventDefault(),t.last().focus()):(e.preventDefault(),t.first().focus()))}}),ee.Setting=ee.Value.extend({defaults:{transport:"refresh",dirty:!1},initialize:function(e,t,n){var i,a=this;i=_.extend({previewer:ee.previewer},a.defaults,n||{}),ee.Value.prototype.initialize.call(a,t,i),a.id=e,a._dirty=i.dirty,a.notifications=new ee.Notifications,a.bind(a.preview)},preview:function(){var e,t=this;"postMessage"!==(e=t.transport)||ee.state("previewerAlive").get()||(e="refresh"),"postMessage"===e?t.previewer.send("setting",[t.id,t()]):"refresh"===e&&t.previewer.refresh()},findControls:function(){var n=this,i=[];return ee.control.each(function(t){_.each(t.settings,function(e){e.id===n.id&&i.push(t)})}),i}}),ee._latestRevision=0,ee._lastSavedRevision=0,ee._latestSettingRevisions={},ee.bind("change",function(e){ee._latestRevision+=1,ee._latestSettingRevisions[e.id]=ee._latestRevision}),ee.bind("ready",function(){ee.bind("add",function(e){e._dirty&&(ee._latestRevision+=1,ee._latestSettingRevisions[e.id]=ee._latestRevision)})}),ee.dirtyValues=function(n){var i={};return ee.each(function(e){var t;e._dirty&&(t=ee._latestSettingRevisions[e.id],ee.state("changesetStatus").get()&&n&&n.unsaved&&(_.isUndefined(t)||t<=ee._lastSavedRevision)||(i[e.id]=e.get()))}),i},ee.requestChangesetUpdate=function(n,e){var t,i,a,o,s={};return t=new Z.Deferred,0!==ee.state("processing").get()?(t.reject("already_processing"),t.promise()):(o=_.extend({title:null,date:null,autosave:!1,force:!1},e),n&&_.extend(s,n),_.each(ee.dirtyValues({unsaved:!0}),function(e,t){n&&null===n[t]||(s[t]=_.extend({},s[t]||{},{value:e}))}),ee.trigger("changeset-save",s,o),!o.force&&_.isEmpty(s)&&null===o.title&&null===o.date?(t.resolve({}),t.promise()):o.status?t.reject({code:"illegal_status_in_changeset_update"}).promise():o.date&&o.autosave?t.reject({code:"illegal_autosave_with_date_gmt"}).promise():(ee.state("processing").set(ee.state("processing").get()+1),t.always(function(){ee.state("processing").set(ee.state("processing").get()-1)}),delete(a=ee.previewer.query({excludeCustomizedSaved:!0})).customized,_.extend(a,{nonce:ee.settings.nonce.save,customize_theme:ee.settings.theme.stylesheet,customize_changeset_data:JSON.stringify(s)}),null!==o.title&&(a.customize_changeset_title=o.title),null!==o.date&&(a.customize_changeset_date=o.date),!1!==o.autosave&&(a.customize_changeset_autosave="true"),ee.trigger("save-request-params",a),(i=wp.ajax.post("customize_save",a)).done(function(e){var n={};ee._lastSavedRevision=Math.max(ee._latestRevision,ee._lastSavedRevision),ee.state("changesetStatus").set(e.changeset_status),e.changeset_date&&ee.state("changesetDate").set(e.changeset_date),t.resolve(e),ee.trigger("changeset-saved",e),e.setting_validities&&_.each(e.setting_validities,function(e,t){!0===e&&_.isObject(s[t])&&!_.isUndefined(s[t].value)&&(n[t]=s[t].value)}),ee.previewer.send("changeset-saved",_.extend({},e,{saved_changeset_values:n}))}),i.fail(function(e){t.reject(e),ee.trigger("changeset-error",e)}),i.always(function(e){e.setting_validities&&ee._handleSettingValidities({settingValidities:e.setting_validities})}),t.promise()))},ee.utils.bubbleChildValueChanges=function(n,e){Z.each(e,function(e,t){n[t].bind(function(e,t){n.parent&&e!==t&&n.parent.trigger("change",n)})})},t=function(e){var t,n,i,a;t=this,i=function(){var e;e=(t.extended(ee.Panel)||t.extended(ee.Section))&&t.expanded&&t.expanded()?t.contentContainer:t.container,0===(a=e.find(".control-focus:first")).length&&(a=e.find("input, select, textarea, button, object, a[href], [tabindex]").filter(":visible").first()),a.focus()},(e=e||{}).completeCallback?(n=e.completeCallback,e.completeCallback=function(){i(),n()}):e.completeCallback=i,ee.state("paneVisible").set(!0),t.expand?t.expand(e):e.completeCallback()},ee.utils.prioritySort=function(e,t){return e.priority()===t.priority()&&"number"==typeof e.params.instanceNumber&&"number"==typeof t.params.instanceNumber?e.params.instanceNumber-t.params.instanceNumber:e.priority()-t.priority()},ee.utils.isKeydownButNotEnterEvent=function(e){return"keydown"===e.type&&13!==e.which},ee.utils.areElementListsEqual=function(e,t){return e.length===t.length&&-1===_.indexOf(_.map(_.zip(e,t),function(e){return Z(e[0]).is(e[1])}),!1)},ee.utils.highlightButton=function(e,t){var n,i="button-see-me",a=!1;function o(){a=!0}return(n=_.extend({delay:0,focusTarget:e},t)).focusTarget.on("focusin",o),setTimeout(function(){n.focusTarget.off("focusin",o),a||(e.addClass(i),e.one("animationend",function(){e.removeClass(i)}))},n.delay),o},ee.utils.getCurrentTimestamp=function(){var e,t,n;return t=_.now(),e=new Date(ee.settings.initialServerDate.replace(/-/g,"/")),n=t-ee.settings.initialClientTimestamp,n+=ee.settings.initialClientTimestamp-ee.settings.initialServerTimestamp,e.setTime(e.getTime()+n),e.getTime()},ee.utils.getRemainingTime=function(e){var t;return t=(e instanceof Date?e.getTime():"string"==typeof e?new Date(e.replace(/-/g,"/")).getTime():e)-ee.utils.getCurrentTimestamp(),t=Math.ceil(t/1e3)},n=document.createElement("div"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},s=(o=_.find(_.keys(i),function(e){return!_.isUndefined(n.style[e])}))?i[o]:null,a=ee.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:Z.noop},defaultExpandedArguments:{duration:"fast",completeCallback:Z.noop},containerType:"container",defaults:{title:"",description:"",priority:100,type:"default",content:null,active:!0,instanceNumber:null},initialize:function(e,t){var n=this;n.id=e,a.instanceCounter||(a.instanceCounter=0),a.instanceCounter++,Z.extend(n,{params:_.defaults(t.params||t,n.defaults)}),n.params.instanceNumber||(n.params.instanceNumber=a.instanceCounter),n.notifications=new ee.Notifications,n.templateSelector=n.params.templateId||"customize-"+n.containerType+"-"+n.params.type,n.container=Z(n.params.content),0===n.container.length&&(n.container=Z(n.getContainer())),n.headContainer=n.container,n.contentContainer=n.getContent(),n.container=n.container.add(n.contentContainer),n.deferred={embedded:new Z.Deferred},n.priority=new ee.Value,n.active=new ee.Value,n.activeArgumentsQueue=[],n.expanded=new ee.Value,n.expandedArgumentsQueue=[],n.active.bind(function(e){var t=n.activeArgumentsQueue.shift();t=Z.extend({},n.defaultActiveArguments,t),e=e&&n.isContextuallyActive(),n.onChangeActive(e,t)}),n.expanded.bind(function(e){var t=n.expandedArgumentsQueue.shift();t=Z.extend({},n.defaultExpandedArguments,t),n.onChangeExpanded(e,t)}),n.deferred.embedded.done(function(){n.setupNotifications(),n.attachEvents()}),ee.utils.bubbleChildValueChanges(n,["priority","active"]),n.priority.set(n.params.priority),n.active.set(n.params.active),n.expanded.set(!1)},getNotificationsContainerElement:function(){return this.contentContainer.find(".customize-control-notifications-container:first")},setupNotifications:function(){var e,t=this;t.notifications.container=t.getNotificationsContainerElement(),e=function(){t.expanded.get()&&t.notifications.render()},t.expanded.bind(e),e(),t.notifications.bind("change",_.debounce(e))},ready:function(){},_children:function(t,e){var n=this,i=[];return ee[e].each(function(e){e[t].get()===n.id&&i.push(e)}),i.sort(ee.utils.prioritySort),i},isContextuallyActive:function(){throw new Error("Container.isContextuallyActive() must be overridden in a subclass.")},onChangeActive:function(e,t){var n,i=this,a=i.headContainer;t.unchanged?t.completeCallback&&t.completeCallback():(n="resolved"===ee.previewer.deferred.active.state()?t.duration:0,i.extended(ee.Panel)&&(ee.panel.each(function(e){e!==i&&e.expanded()&&(e,n=0)}),e||_.each(i.sections(),function(e){e.collapse({duration:0})})),Z.contains(document,a.get(0))?e?a.slideDown(n,t.completeCallback):i.expanded()?i.collapse({duration:n,completeCallback:function(){a.slideUp(n,t.completeCallback)}}):a.slideUp(n,t.completeCallback):(a.toggle(e),t.completeCallback&&t.completeCallback()))},_toggleActive:function(e,t){return t=t||{},e&&this.active.get()||!e&&!this.active.get()?(t.unchanged=!0,this.onChangeActive(this.active.get(),t),!1):(t.unchanged=!1,this.activeArgumentsQueue.push(t),this.active.set(e),!0)},activate:function(e){return this._toggleActive(!0,e)},deactivate:function(e){return this._toggleActive(!1,e)},onChangeExpanded:function(){throw new Error("Must override with subclass.")},_toggleExpanded:function(e,t){var n,i=this;return n=(t=t||{}).completeCallback,!(e&&!i.active())&&(ee.state("paneVisible").set(!0),t.completeCallback=function(){n&&n.apply(i,arguments),e?i.container.trigger("expanded"):i.container.trigger("collapsed")},e&&i.expanded.get()||!e&&!i.expanded.get()?(t.unchanged=!0,i.onChangeExpanded(i.expanded.get(),t),!1):(t.unchanged=!1,i.expandedArgumentsQueue.push(t),i.expanded.set(e),!0))},expand:function(e){return this._toggleExpanded(!0,e)},collapse:function(e){return this._toggleExpanded(!1,e)},_animateChangeExpanded:function(t){if(s){var n,i,a=this,o=a.contentContainer,e=o.closest(".wp-full-overlay");n=e.add(o),(!a.panel||""===a.panel()||!!ee.panel(a.panel()).contentContainer.hasClass("skip-transition"))&&(n=n.add("#customize-info, .customize-pane-parent")),i=function(e){2===e.eventPhase&&Z(e.target).is(o)&&(o.off(s,i),n.removeClass("busy"),t&&t())},o.on(s,i),n.addClass("busy"),_.defer(function(){var e=o.closest(".wp-full-overlay-sidebar-content"),t=e.scrollTop(),n=o.data("previous-scrollTop")||0,i=a.expanded();i&&0"},getContent:function(){var e=this.container,t=e.find(".accordion-section-content, .control-panel-content").first(),n="sub-"+e.attr("id"),i=n,a=e.attr("aria-owns");return a&&(i=i+" "+a),e.attr("aria-owns",i),t.detach().attr({id:n,class:"customize-pane-child "+t.attr("class")+" "+e.attr("class")})}}),ee.Section=a.extend({containerType:"section",containerParent:"#customize-theme-controls",containerPaneParent:".customize-pane-parent",defaults:{title:"",description:"",priority:100,type:"default",content:null,active:!0,instanceNumber:null,panel:null,customizeAction:""},initialize:function(e,t){var n,i=this;(n=t.params||t).type||_.find(ee.sectionConstructor,function(e,t){return e===i.constructor&&(n.type=t,!0)}),a.prototype.initialize.call(i,e,n),i.id=e,i.panel=new ee.Value,i.panel.bind(function(e){Z(i.headContainer).toggleClass("control-subsection",!!e)}),i.panel.set(i.params.panel||""),ee.utils.bubbleChildValueChanges(i,["panel"]),i.embed(),i.deferred.embedded.done(function(){i.ready()})},embed:function(){var e,n=this;n.containerParent=ee.ensure(n.containerParent),e=function(e){var t;e?ee.panel(e,function(e){e.deferred.embedded.done(function(){t=e.contentContainer,n.headContainer.parent().is(t)||t.append(n.headContainer),n.contentContainer.parent().is(n.headContainer)||n.containerParent.append(n.contentContainer),n.deferred.embedded.resolve()})}):(t=ee.ensure(n.containerPaneParent),n.headContainer.parent().is(t)||t.append(n.headContainer),n.contentContainer.parent().is(n.headContainer)||n.containerParent.append(n.contentContainer),n.deferred.embedded.resolve())},n.panel.bind(e),e(n.panel.get())},attachEvents:function(){var e,t,n=this;n.container.hasClass("cannot-expand")||(n.container.find(".accordion-section-title, .customize-section-back").on("click keydown",function(e){ee.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),n.expanded()?n.collapse():n.expand())}),n.container.find(".customize-section-title .customize-help-toggle").on("click",function(){(e=n.container.find(".section-meta")).hasClass("cannot-expand")||((t=e.find(".customize-section-description:first")).toggleClass("open"),t.slideToggle(n.defaultExpandedArguments.duration,function(){t.trigger("toggled")}),Z(this).attr("aria-expanded",function(e,t){return"true"===t?"false":"true"}))}))},isContextuallyActive:function(){var e=this.controls(),t=0;return _(e).each(function(e){e.active()&&(t+=1)}),0!==t},controls:function(){return this._children("section","control")},onChangeExpanded:function(e,t){var n,i,a=this,o=a.headContainer.closest(".wp-full-overlay-sidebar-content"),s=a.contentContainer,r=a.headContainer.closest(".wp-full-overlay"),c=s.find(".customize-section-back"),l=a.headContainer.find(".accordion-section-title").first();e&&!s.hasClass("open")?(n=t.unchanged?t.completeCallback:Z.proxy(function(){a._animateChangeExpanded(function(){l.attr("tabindex","-1"),c.attr("tabindex","0"),c.focus(),s.css("top",""),o.scrollTop(0),t.completeCallback&&t.completeCallback()}),s.addClass("open"),r.addClass("section-open"),ee.state("expandedSection").set(a)},this),t.allowMultiple||ee.section.each(function(e){e!==a&&e.collapse({duration:t.duration})}),a.panel()?ee.panel(a.panel()).expand({duration:t.duration,completeCallback:n}):(t.allowMultiple||ee.panel.each(function(e){e.collapse()}),n())):!e&&s.hasClass("open")?(a.panel()&&(i=ee.panel(a.panel())).contentContainer.hasClass("skip-transition")&&i.collapse(),a._animateChangeExpanded(function(){c.attr("tabindex","-1"),l.attr("tabindex","0"),l.focus(),s.css("top",""),t.completeCallback&&t.completeCallback()}),s.removeClass("open"),r.removeClass("section-open"),a===ee.state("expandedSection").get()&&ee.state("expandedSection").set(!1)):t.completeCallback&&t.completeCallback()}}),ee.ThemesSection=ee.Section.extend({currentTheme:"",overlay:"",template:"",screenshotQueue:null,$window:null,$body:null,loaded:0,loading:!1,fullyLoaded:!1,term:"",tags:"",nextTerm:"",nextTags:"",filtersHeight:0,headerContainer:null,updateCountDebounced:null,initialize:function(e,t){var n=this;n.headerContainer=Z(),n.$window=Z(window),n.$body=Z(document.body),ee.Section.prototype.initialize.call(n,e,t),n.updateCountDebounced=_.debounce(n.updateCount,500)},embed:function(){var e,n=this;e=function(e){var t;ee.panel(e,function(e){e.deferred.embedded.done(function(){t=e.contentContainer,n.headContainer.parent().is(t)||t.find(".customize-themes-full-container-container").before(n.headContainer),n.contentContainer.parent().is(n.headContainer)||n.containerParent.append(n.contentContainer),n.deferred.embedded.resolve()})})},n.panel.bind(e),e(n.panel.get())},ready:function(){var t=this;t.overlay=t.container.find(".theme-overlay"),t.template=wp.template("customize-themes-details-view"),t.container.on("keydown",function(e){t.overlay.find(".theme-wrap").is(":visible")&&(39===e.keyCode&&t.nextTheme(),37===e.keyCode&&t.previousTheme(),27===e.keyCode&&(t.$body.hasClass("modal-open")?t.closeDetails():t.headerContainer.find(".customize-themes-section-title").focus(),e.stopPropagation()))}),t.renderScreenshots=_.throttle(t.renderScreenshots,100),_.bindAll(t,"renderScreenshots","loadMore","checkTerm","filtersChecked")},isContextuallyActive:function(){return this.active()},attachEvents:function(){var e,a=this;function t(){var e=a.headerContainer.find(".customize-themes-section-title");e.toggleClass("selected",a.expanded()),e.attr("aria-expanded",a.expanded()?"true":"false"),a.expanded()||e.removeClass("details-open")}a.container.find(".customize-section-back").on("click keydown",function(e){ee.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),a.collapse())}),a.headerContainer=Z("#accordion-section-"+a.id),a.headerContainer.on("click",".customize-themes-section-title",function(){a.headerContainer.find(".filter-details").length&&(a.headerContainer.find(".customize-themes-section-title").toggleClass("details-open").attr("aria-expanded",function(e,t){return"true"===t?"false":"true"}),a.headerContainer.find(".filter-details").slideToggle(180)),a.expanded()||a.expand()}),a.container.on("click",".theme-actions .preview-theme",function(){ee.panel("themes").loadThemePreview(Z(this).data("slug"))}),a.container.on("click",".left",function(){a.previousTheme()}),a.container.on("click",".right",function(){a.nextTheme()}),a.container.on("click",".theme-backdrop, .close",function(){a.closeDetails()}),"local"===a.params.filter_type?a.container.on("input",".wp-filter-search-themes",function(e){a.filterSearch(e.currentTarget.value)}):"remote"===a.params.filter_type&&(e=_.debounce(a.checkTerm,500),a.contentContainer.on("input",".wp-filter-search",function(){ee.panel("themes").expanded()&&(e(a),a.expanded()||a.expand())}),a.contentContainer.on("click",".filter-group input",function(){a.filtersChecked(),a.checkTerm(a)})),a.contentContainer.on("click",".feature-filter-toggle",function(e){var t=Z(".customize-themes-full-container"),n=Z(e.currentTarget);if(a.filtersHeight=n.parent().next(".filter-drawer").height(),!(0 .accordion-section-title .customize-help-toggle").on("click",function(){if(!t.hasClass("cannot-expand")){var e=t.find(".customize-panel-description:first");t.hasClass("open")?(t.toggleClass("open"),e.slideUp(n.defaultExpandedArguments.duration,function(){e.trigger("toggled")}),Z(this).attr("aria-expanded",!1)):(e.slideDown(n.defaultExpandedArguments.duration,function(){e.trigger("toggled")}),t.toggleClass("open"),Z(this).attr("aria-expanded",!0))}})},sections:function(){return this._children("panel","section")},isContextuallyActive:function(){var e=this.sections(),t=0;return _(e).each(function(e){e.active()&&e.isContextuallyActive()&&(t+=1)}),0!==t},onChangeExpanded:function(e,t){if(t.unchanged)t.completeCallback&&t.completeCallback();else{var n=this,i=n.contentContainer,a=i.closest(".wp-full-overlay"),o=i.closest(".wp-full-overlay-sidebar-content"),s=n.headContainer.find(".accordion-section-title"),r=i.find(".customize-panel-back"),c=n.sections();e&&!i.hasClass("current-panel")?(ee.section.each(function(e){n.id!==e.panel()&&e.collapse({duration:0})}),ee.panel.each(function(e){n!==e&&e.collapse({duration:0})}),n.params.autoExpandSoleSection&&1===c.length&&c[0].active.get()?(i.addClass("current-panel skip-transition"),a.addClass("in-sub-panel"),c[0].expand({completeCallback:t.completeCallback})):(n._animateChangeExpanded(function(){s.attr("tabindex","-1"),r.attr("tabindex","0"),r.focus(),i.css("top",""),o.scrollTop(0),t.completeCallback&&t.completeCallback()}),i.addClass("current-panel"),a.addClass("in-sub-panel")),ee.state("expandedPanel").set(n)):!e&&i.hasClass("current-panel")&&(i.hasClass("skip-transition")?i.removeClass("skip-transition"):n._animateChangeExpanded(function(){s.attr("tabindex","0"),r.attr("tabindex","-1"),s.focus(),i.css("top",""),t.completeCallback&&t.completeCallback()}),a.removeClass("in-sub-panel"),i.removeClass("current-panel"),n===ee.state("expandedPanel").get()&&ee.state("expandedPanel").set(!1))}},renderContent:function(){var e,t=this;(e=0!==Z("#tmpl-"+t.templateSelector+"-content").length?wp.template(t.templateSelector+"-content"):wp.template("customize-panel-default-content"))&&t.headContainer&&t.contentContainer.html(e(_.extend({id:t.id},t.params)))}}),ee.ThemesPanel=ee.Panel.extend({initialize:function(e,t){this.installingThemes=[],ee.Panel.prototype.initialize.call(this,e,t)},canSwitchTheme:function(e){return!(!e||e!==ee.settings.theme.stylesheet)||"publish"===ee.state("selectedChangesetStatus").get()&&(""===ee.state("changesetStatus").get()||"auto-draft"===ee.state("changesetStatus").get())},attachEvents:function(){var t=this;function e(){t.canSwitchTheme()?t.notifications.remove("theme_switch_unavailable"):t.notifications.add(new ee.Notification("theme_switch_unavailable",{message:ee.l10n.themePreviewUnavailable,type:"warning"}))}ee.Panel.prototype.attachEvents.apply(t),ee.settings.theme._canInstall&&ee.settings.theme._filesystemCredentialsNeeded&&t.notifications.add(new ee.Notification("theme_install_unavailable",{message:ee.l10n.themeInstallUnavailable,type:"info",dismissible:!0})),e(),ee.state("selectedChangesetStatus").bind(e),ee.state("changesetStatus").bind(e),t.contentContainer.on("click",".customize-theme",function(){t.collapse()}),t.contentContainer.on("click",".customize-themes-section-title, .customize-themes-mobile-back",function(){Z(".wp-full-overlay").toggleClass("showing-themes")}),t.contentContainer.on("click",".theme-install",function(e){t.installTheme(e)}),t.contentContainer.on("click",".update-theme, #update-theme",function(e){e.preventDefault(),e.stopPropagation(),t.updateTheme(e)}),t.contentContainer.on("click",".delete-theme",function(e){t.deleteTheme(e)}),_.bindAll(t,"installTheme","updateTheme")},onChangeExpanded:function(e,t){var n,i,a=!1;ee.Panel.prototype.onChangeExpanded.apply(this,[e,t]),t.unchanged?t.completeCallback&&t.completeCallback():(n=this.headContainer.closest(".wp-full-overlay"),e?(n.addClass("in-themes-panel").delay(200).find(".customize-themes-full-container").addClass("animate"),_.delay(function(){n.addClass("themes-panel-expanded")},200),600",{id:"customize-control-"+e.replace(/]/g,"").replace(/\[/g,"-"),class:"customize-control customize-control-"+a.params.type})),a.id=e,a.selector="#customize-control-"+e.replace(/\]/g,"").replace(/\[/g,"-"),a.params.content?a.container=Z(a.params.content):a.container=Z(a.selector),a.params.templateId?a.templateSelector=a.params.templateId:a.templateSelector="customize-control-"+a.params.type+"-content",a.deferred=_.extend(a.deferred||{},{embedded:new Z.Deferred}),a.section=new ee.Value,a.priority=new ee.Value,a.active=new ee.Value,a.activeArgumentsQueue=[],a.notifications=new ee.Notifications({alt:a.altNotice}),a.elements=[],a.active.bind(function(e){var t=a.activeArgumentsQueue.shift();t=Z.extend({},a.defaultActiveArguments,t),a.onChangeActive(e,t)}),a.section.set(a.params.section),a.priority.set(isNaN(a.params.priority)?10:a.params.priority),a.active.set(a.params.active),ee.utils.bubbleChildValueChanges(a,["section","priority","active"]),a.settings={},n={},a.params.setting&&(n.default=a.params.setting),_.extend(n,a.params.settings),_.each(n,function(e,t){var n;_.isObject(e)&&_.isFunction(e.extended)&&e.extended(ee.Value)?a.settings[t]=e:_.isString(e)&&((n=ee(e))?a.settings[t]=n:o.push(e))}),i=function(){_.each(n,function(e,t){!a.settings[t]&&_.isString(e)&&(a.settings[t]=ee(e))}),a.settings[0]&&!a.settings.default&&(a.settings.default=a.settings[0]),a.setting=a.settings.default||null,a.linkElements(),a.embed()},0===o.length?i():ee.apply(ee,o.concat(i)),a.deferred.embedded.done(function(){a.linkElements(),a.setupNotifications(),a.ready()})},linkElements:function(){var i,a,o,s=this;i=s.container.find("[data-customize-setting-link], [data-customize-setting-key-link]"),a={},i.each(function(){var e,t,n=Z(this);if(!n.data("customizeSettingLinked")){if(n.data("customizeSettingLinked",!0),n.is(":radio")){if(e=n.prop("name"),a[e])return;a[e]=!0,n=i.filter('[name="'+e+'"]')}n.data("customizeSettingLink")?t=ee(n.data("customizeSettingLink")):n.data("customizeSettingKeyLink")&&(t=s.settings[n.data("customizeSettingKeyLink")]),t&&(o=new ee.Element(n),s.elements.push(o),o.sync(t),o.set(t()))}})},embed:function(){var e,n=this;e=function(e){var t;e&&ee.section(e,function(e){e.deferred.embedded.done(function(){t=e.contentContainer.is("ul")?e.contentContainer:e.contentContainer.find("ul:first"),n.container.parent().is(t)||(t.append(n.container),n.renderContent()),n.deferred.embedded.resolve()})})},n.section.bind(e),e(n.section.get())},ready:function(){var t,n=this;"dropdown-pages"===n.params.type&&n.params.allow_addition&&((t=n.container.find(".new-content-item")).hide(),n.container.on("click",".add-new-toggle",function(e){Z(e.currentTarget).slideUp(180),t.slideDown(180),t.find(".create-item-input").focus()}),n.container.on("click",".add-content",function(){n.addNewPage()}),n.container.on("keydown",".create-item-input",function(e){13===e.which&&n.addNewPage()}))},getNotificationsContainerElement:function(){var e,t,n=this;return(t=n.container.find(".customize-control-notifications-container:first")).length||(t=Z('
    '),n.container.hasClass("customize-control-nav_menu_item")?n.container.find(".menu-item-settings:first").prepend(t):n.container.hasClass("customize-control-widget_form")?n.container.find(".widget-inside:first").prepend(t):(e=n.container.find(".customize-control-title")).length?e.after(t):n.container.prepend(t)),t},setupNotifications:function(){var n,e,i=this;_.each(i.settings,function(n){n.notifications&&(n.notifications.bind("add",function(e){var t=_.extend({},e,{setting:n.id});i.notifications.add(new ee.Notification(n.id+":"+e.code,t))}),n.notifications.bind("remove",function(e){i.notifications.remove(n.id+":"+e.code)}))}),n=function(){var e=i.section();(!e||ee.section.has(e)&&ee.section(e).expanded())&&i.notifications.render()},i.notifications.bind("rendered",function(){var e=i.notifications.get();i.container.toggleClass("has-notifications",0!==e.length),i.container.toggleClass("has-error",0!==_.where(e,{type:"error"}).length)}),e=function(e,t){t&&ee.section.has(t)&&ee.section(t).expanded.unbind(n),e&&ee.section(e,function(e){e.expanded.bind(n),n()})},i.section.bind(e),e(i.section.get()),i.notifications.bind("change",_.debounce(n))},renderNotifications:function(){var e,t,n=this,i=!1;"undefined"!=typeof console&&console.warn&&console.warn("[DEPRECATED] wp.customize.Control.prototype.renderNotifications() is deprecated in favor of instantating a wp.customize.Notifications and calling its render() method."),(e=n.getNotificationsContainerElement())&&e.length&&(t=[],n.notifications.each(function(e){t.push(e),"error"===e.type&&(i=!0)}),0===t.length?e.stop().slideUp("fast"):e.stop().slideDown("fast",null,function(){Z(this).css("height","auto")}),n.notificationsTemplate||(n.notificationsTemplate=wp.template("customize-control-notifications")),n.container.toggleClass("has-notifications",0!==t.length),n.container.toggleClass("has-error",i),e.empty().append(Z.trim(n.notificationsTemplate({notifications:t,altNotice:Boolean(n.altNotice)}))))},expand:function(e){ee.section(this.section()).expand(e)},focus:t,onChangeActive:function(e,t){t.unchanged?t.completeCallback&&t.completeCallback():Z.contains(document,this.container[0])?e?this.container.slideDown(t.duration,t.completeCallback):this.container.slideUp(t.duration,t.completeCallback):(this.container.toggle(e),t.completeCallback&&t.completeCallback())},toggle:function(e){return this.onChangeActive(e,this.defaultActiveArguments)},activate:a.prototype.activate,deactivate:a.prototype.deactivate,_toggleActive:a.prototype._toggleActive,dropdownInit:function(){function e(e){"string"==typeof e&&i.statuses&&i.statuses[e]?n.html(i.statuses[e]).show():n.hide()}var t=this,n=this.container.find(".dropdown-status"),i=this.params,a=!1;this.container.on("click keydown",".dropdown",function(e){ee.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),a||t.container.toggleClass("open"),t.container.hasClass("open")&&t.container.parent().parent().find("li.library-selected").focus(),a=!0,setTimeout(function(){a=!1},400))}),this.setting.bind(e),e(this.setting())},renderContent:function(){var e,t,n,i,a=this;t=["button","checkbox","date","datetime-local","email","month","number","password","radio","range","search","select","tel","time","text","textarea","week","url"],(n=a.templateSelector)==="customize-control-"+a.params.type+"-content"&&_.contains(t,a.params.type)&&!document.getElementById("tmpl-"+n)&&0===a.container.children().length&&(n="customize-control-default-content"),document.getElementById("tmpl-"+n)&&(e=wp.template(n))&&a.container&&a.container.html(e(a.params)),a.notifications.container=a.getNotificationsContainerElement(),(!(i=a.section())||ee.section.has(i)&&ee.section(i).expanded())&&a.notifications.render()},addNewPage:function(){var e,a,o,t,s,r,c=this;"dropdown-pages"===c.params.type&&c.params.allow_addition&&ee.Menus&&(a=c.container.find(".add-new-toggle"),o=c.container.find(".new-content-item"),t=c.container.find(".create-item-input"),s=t.val(),r=c.container.find("select"),s?(t.removeClass("invalid"),t.attr("disabled","disabled"),(e=ee.Menus.insertAutoDraftPost({post_title:s,post_type:"page"})).done(function(e){var t,n,i;t=new ee.Menus.AvailableItemModel({id:"post-"+e.post_id,title:s,type:"post_type",type_label:ee.Menus.data.l10n.page_label,object:"page",object_id:e.post_id,url:e.url}),ee.Menus.availableMenuItemsPanel.collection.add(t),n=Z("#available-menu-items-post_type-page").find(".available-menu-items-list"),i=wp.template("available-menu-item"),n.prepend(i(t.attributes)),r.focus(),c.setting.set(String(e.post_id)),o.slideUp(180),a.slideDown(180)}),e.always(function(){t.val("").removeAttr("disabled")})):t.addClass("invalid"))}}),ee.ColorControl=ee.Control.extend({ready:function(){var t,n=this,e="hue"===this.params.mode,i=!1;e?(t=this.container.find(".color-picker-hue")).val(n.setting()).wpColorPicker({change:function(e,t){i=!0,n.setting(t.color.h()),i=!1}}):(t=this.container.find(".color-picker-hex")).val(n.setting()).wpColorPicker({change:function(){i=!0,n.setting.set(t.wpColorPicker("color")),i=!1},clear:function(){i=!0,n.setting.set(""),i=!1}}),n.setting.bind(function(e){i||(t.val(e),t.wpColorPicker("color",e))}),n.container.on("keydown",function(e){27===e.which&&n.container.find(".wp-picker-container").hasClass("wp-picker-active")&&(t.wpColorPicker("close"),n.container.find(".wp-color-result").focus(),e.stopPropagation())})}}),ee.MediaControl=ee.Control.extend({ready:function(){var n=this;function e(e){var t=Z.Deferred();n.extended(ee.UploadControl)?t.resolve():(e=parseInt(e,10),_.isNaN(e)||e<=0?(delete n.params.attachment,t.resolve()):n.params.attachment&&n.params.attachment.id===e&&t.resolve()),"pending"===t.state()&&wp.media.attachment(e).fetch().done(function(){n.params.attachment=this.attributes,t.resolve(),wp.customize.previewer.send(n.setting.id+"-attachment-data",this.attributes)}),t.done(function(){n.renderContent()})}_.bindAll(n,"restoreDefault","removeFile","openFrame","select","pausePlayer"),n.container.on("click keydown",".upload-button",n.openFrame),n.container.on("click keydown",".upload-button",n.pausePlayer),n.container.on("click keydown",".thumbnail-image img",n.openFrame),n.container.on("click keydown",".default-button",n.restoreDefault),n.container.on("click keydown",".remove-button",n.pausePlayer),n.container.on("click keydown",".remove-button",n.removeFile),n.container.on("click keydown",".remove-button",n.cleanupPlayer),ee.section(n.section()).container.on("expanded",function(){n.player&&n.player.setControlsSize()}).on("collapsed",function(){n.pausePlayer()}),e(n.setting()),n.setting.bind(e)},pausePlayer:function(){this.player&&this.player.pause()},cleanupPlayer:function(){this.player&&wp.media.mixin.removePlayer(this.player)},openFrame:function(e){ee.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),this.frame||this.initFrame(),this.frame.open())},initFrame:function(){this.frame=wp.media({button:{text:this.params.button_labels.frame_button},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:this.params.mime_type}),multiple:!1,date:!1})]}),this.frame.on("select",this.select)},select:function(){var e,t=this.frame.state().get("selection").first().toJSON(),n=window._wpmejsSettings||{};this.params.attachment=t,this.setting(t.id),(e=this.container.find("audio, video").get(0))?this.player=new MediaElementPlayer(e,n):this.cleanupPlayer()},restoreDefault:function(e){ee.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),this.params.attachment=this.params.defaultAttachment,this.setting(this.params.defaultAttachment.url))},removeFile:function(e){ee.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),this.params.attachment={},this.setting(""),this.renderContent())}}),ee.UploadControl=ee.MediaControl.extend({select:function(){var e,t=this.frame.state().get("selection").first().toJSON(),n=window._wpmejsSettings||{};this.params.attachment=t,this.setting(t.url),(e=this.container.find("audio, video").get(0))?this.player=new MediaElementPlayer(e,n):this.cleanupPlayer()},success:function(){},removerVisibility:function(){}}),ee.ImageControl=ee.UploadControl.extend({thumbnailSrc:function(){}}),ee.BackgroundControl=ee.UploadControl.extend({ready:function(){ee.UploadControl.prototype.ready.apply(this,arguments)},select:function(){ee.UploadControl.prototype.select.apply(this,arguments),wp.ajax.post("custom-background-add",{nonce:_wpCustomizeBackground.nonces.add,wp_customize:"on",customize_theme:ee.settings.theme.stylesheet,attachment_id:this.params.attachment.id})}}),ee.BackgroundPositionControl=ee.Control.extend({ready:function(){var e,i=this;i.container.on("change",'input[name="background-position"]',function(){var e=Z(this).val().split(" ");i.settings.x(e[0]),i.settings.y(e[1])}),e=_.debounce(function(){var e,t,n;e=i.settings.x.get(),t=i.settings.y.get(),n=String(e)+" "+String(t),i.container.find('input[name="background-position"][value="'+n+'"]').click()}),i.settings.x.bind(e),i.settings.y.bind(e),e()}}),ee.CroppedImageControl=ee.MediaControl.extend({openFrame:function(e){ee.utils.isKeydownButNotEnterEvent(e)||(this.initFrame(),this.frame.setState("library").open())},initFrame:function(){var e=_wpMediaViewsL10n;this.frame=wp.media({button:{text:e.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var e=this.frame.state().get("selection").first().toJSON();this.params.width!==e.width||this.params.height!==e.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):(this.setImageFromAttachment(e),this.frame.close())},onCropped:function(e){this.setImageFromAttachment(e)},calculateImageSelectOptions:function(e,t){var n,i,a,o=t.get("control"),s=!!parseInt(o.params.flex_width,10),r=!!parseInt(o.params.flex_height,10),c=e.get("width"),l=e.get("height"),d=parseInt(o.params.width,10),u=parseInt(o.params.height,10),p=d/u,h=d,f=u;return t.set("canSkipCrop",!o.mustBeCropped(s,r,d,u,c,l)),p",{title:ee.l10n.previewIframeTitle,name:"customize-"+a.channel()}),a.iframe.attr("onmousewheel",""),a.iframe.attr("sandbox","allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts"),c?a.iframe.attr("data-src",e.href):a.iframe.attr("src",e.href),a.iframe.appendTo(a.container),a.targetWindow(a.iframe[0].contentWindow),c&&((i=Z("
    ",{action:e.href,target:a.iframe.attr("name"),method:"post",hidden:"hidden"})).append(Z("",{type:"hidden",name:"_method",value:"GET"})),_.each(a.query,function(e,t){i.append(Z("",{type:"hidden",name:t,value:e}))}),a.container.append(i),i.submit(),i.remove()),a.bind("iframe-loading-error",function(e){a.iframe.remove(),0!==e?-1!==e?t.rejectWith(a,["request failure"]):t.rejectWith(a,["cheatin"]):a.login(t)}),a.iframe.one("load",function(){o=!0,s?t.resolveWith(a,[r]):setTimeout(function(){t.rejectWith(a,["ready timeout"])},a.sensitivity)})},login:function(n){var i,a=this;if(i=function(){n.rejectWith(a,["logged out"])},this.triedLogin)return i();Z.get(ee.settings.url.ajax,{action:"logged-in"}).fail(i).done(function(e){var t;"1"!==e&&i(),(t=Z(""; @@ -352,8 +352,13 @@ ' . __( 'Search results for “%s”' ) . '', esc_html( $s ) ); + echo ''; + printf( + /* translators: %s: Search query. */ + __( 'Search results for: %s' ), + '' . esc_html( $s ) . '' + ); + echo ''; } ?> diff --git a/wp-admin/network/upgrade.php b/wp-admin/network/upgrade.php index 98e3a8b41f..8b0194e6ce 100644 --- a/wp-admin/network/upgrade.php +++ b/wp-admin/network/upgrade.php @@ -45,7 +45,7 @@ switch ( $action ) { case 'upgrade': - $n = ( isset( $_GET['n'] ) ) ? intval( $_GET['n'] ) : 0; + $n = ( isset( $_GET['n'] ) ) ? (int) $_GET['n'] : 0; if ( $n < 5 ) { /** diff --git a/wp-admin/network/users.php b/wp-admin/network/users.php index c2e6ee5d6b..e15a5811cd 100644 --- a/wp-admin/network/users.php +++ b/wp-admin/network/users.php @@ -26,7 +26,7 @@ check_admin_referer( 'deleteuser' ); - $id = intval( $_GET['id'] ); + $id = (int) $_GET['id']; if ( $id > 1 ) { $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle arrays. $title = __( 'Users' ); @@ -278,8 +278,13 @@ endif; if ( strlen( $usersearch ) ) { - /* translators: %s: Search query. */ - printf( '' . __( 'Search results for “%s”' ) . '', esc_html( $usersearch ) ); + echo ''; + printf( + /* translators: %s: Search query. */ + __( 'Search results for: %s' ), + '' . esc_html( $usersearch ) . '' + ); + echo ''; } ?> diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 975e01937e..aad04ced9b 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -18,7 +18,7 @@ $title = __( 'General Settings' ); $parent_file = 'options-general.php'; -/* translators: Date and time format for exact current time, mainly about timezones, see https://www.php.net/date */ +/* translators: Date and time format for exact current time, mainly about timezones, see https://www.php.net/manual/datetime.format.php */ $timezone_format = _x( 'Y-m-d H:i:s', 'timezone date format' ); add_action( 'admin_head', 'options_general_add_js' ); diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index a52e95ebb7..55a0cc2304 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -72,7 +72,7 @@ $prefix = '/index.php'; } -/** +/* * In a subdirectory configuration of multisite, the `/blog` prefix is used by * default on the main site to avoid collisions with other sites created on that * network. If the `permalink_structure` option has been changed to remove this @@ -82,36 +82,17 @@ $blog_prefix = '/blog'; } -$category_base = get_option( 'category_base' ); -$tag_base = get_option( 'tag_base' ); -$update_required = false; - -if ( $iis7_permalinks ) { - if ( ( ! file_exists( $home_path . 'web.config' ) && win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' ) ) { - $writable = true; - } else { - $writable = false; - } -} elseif ( $is_nginx ) { - $writable = false; -} else { - if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) { - $writable = true; - } else { - $writable = false; - $existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) ); - $new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) ); - $update_required = ( $new_rules !== $existing_rules ); - } -} +$category_base = get_option( 'category_base' ); +$tag_base = get_option( 'tag_base' ); -$using_index_permalinks = $wp_rewrite->using_index_permalinks(); +$structure_updated = false; +$htaccess_update_required = false; if ( isset( $_POST['permalink_structure'] ) || isset( $_POST['category_base'] ) ) { check_admin_referer( 'update-permalink' ); if ( isset( $_POST['permalink_structure'] ) ) { - if ( isset( $_POST['selection'] ) && 'custom' != $_POST['selection'] ) { + if ( isset( $_POST['selection'] ) && 'custom' !== $_POST['selection'] ) { $permalink_structure = $_POST['selection']; } else { $permalink_structure = $_POST['permalink_structure']; @@ -129,46 +110,78 @@ $permalink_structure = sanitize_option( 'permalink_structure', $permalink_structure ); $wp_rewrite->set_permalink_structure( $permalink_structure ); + + $structure_updated = true; } if ( isset( $_POST['category_base'] ) ) { $category_base = $_POST['category_base']; + if ( ! empty( $category_base ) ) { $category_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $category_base ) ); } + $wp_rewrite->set_category_base( $category_base ); } if ( isset( $_POST['tag_base'] ) ) { $tag_base = $_POST['tag_base']; + if ( ! empty( $tag_base ) ) { $tag_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $tag_base ) ); } + $wp_rewrite->set_tag_base( $tag_base ); } +} + +if ( $iis7_permalinks ) { + if ( ( ! file_exists( $home_path . 'web.config' ) && win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' ) ) { + $writable = true; + } else { + $writable = false; + } +} elseif ( $is_nginx ) { + $writable = false; +} else { + if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) { + $writable = true; + } else { + $writable = false; + $existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) ); + $new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) ); + + $htaccess_update_required = ( $new_rules !== $existing_rules ); + } +} +$using_index_permalinks = $wp_rewrite->using_index_permalinks(); + +if ( $structure_updated ) { $message = __( 'Permalink structure updated.' ); - if ( $iis7_permalinks ) { - if ( $permalink_structure && ! $using_index_permalinks && ! $writable ) { + if ( ! is_multisite() && $permalink_structure && ! $using_index_permalinks ) { + if ( $iis7_permalinks ) { + if ( ! $writable ) { + $message = sprintf( + /* translators: %s: web.config */ + __( 'You should update your %s file now.' ), + 'web.config' + ); + } else { + $message = sprintf( + /* translators: %s: web.config */ + __( 'Permalink structure updated. Remove write access on %s file now!' ), + 'web.config' + ); + } + } elseif ( ! $is_nginx && $htaccess_update_required && ! $writable ) { $message = sprintf( - /* translators: %s: web.config */ + /* translators: %s: .htaccess */ __( 'You should update your %s file now.' ), - 'web.config' - ); - } elseif ( $permalink_structure && ! $using_index_permalinks && $writable ) { - $message = sprintf( - /* translators: %s: web.config */ - __( 'Permalink structure updated. Remove write access on %s file now!' ), - 'web.config' + '.htaccess' ); } - } elseif ( ! $is_nginx && $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) { - $message = sprintf( - /* translators: %s: .htaccess */ - __( 'You should update your %s file now.' ), - '.htaccess' - ); } if ( ! get_settings_errors() ) { @@ -400,7 +413,7 @@ class="button button-secondary"

    Documentation on Nginx configuration.' ); ?>

    'site-visibility', 'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site visibility' ) : __( 'Search engine visibility' ), - 'content' => '

    ' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to “Discourage search engines from indexing this site” and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.' ) . '

    ' . - '

    ' . __( 'When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, “Search engines discouraged,” to remind you that your site is not being crawled.' ) . '

    ', + 'content' => '

    ' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to “Discourage search engines from indexing this site” and click the Save Changes button at the bottom of the screen.' ) . '

    ' . + '

    ' . __( 'Note that even when set to discourage search engines, your site is still visible on the web and not all search engines adhere to this directive.' ) . '

    ' . + '

    ' . __( 'When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, “Search engines discouraged”, to remind you that you have directed search engines to not crawl your site.' ) . '

    ', ) ); @@ -137,10 +138,10 @@ -

    Warning: these pages should not be the same!' ); ?>

    +

    Warning: these pages should not be the same!' ); ?>

    -

    Warning: these pages should not be the same as your Privacy Policy page!' ); ?>

    +

    Warning: these pages should not be the same as your Privacy Policy page!' ); ?>

    diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 50d5acee4f..7467ace6aa 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -195,7 +195,7 @@

    ' . esc_html( $file ) . '' ); } else { @@ -203,7 +203,7 @@ printf( __( 'Browsing %s (active)' ), '' . esc_html( $file ) . '' ); } } else { - if ( is_writeable( $real_file ) ) { + if ( is_writable( $real_file ) ) { /* translators: %s: Plugin file name. */ printf( __( 'Editing %s (inactive)' ), '' . esc_html( $file ) . '' ); } else { @@ -275,7 +275,7 @@

    - +
    diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index fe8ea41fb2..d8f909a7da 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -162,7 +162,7 @@ echo '
    '; echo '

    ' . esc_html( $title ) . '

    '; - $url = self_admin_url( 'update.php?action=update-selected&plugins=' . urlencode( join( ',', $plugins ) ) ); + $url = self_admin_url( 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) ) ); $url = wp_nonce_url( $url, 'bulk-update-plugins' ); echo ""; @@ -727,8 +727,13 @@ } if ( strlen( $s ) ) { - /* translators: %s: Search query. */ - printf( '' . __( 'Search results for “%s”' ) . '', esc_html( urldecode( $s ) ) ); + echo ''; + printf( + /* translators: %s: Search query. */ + __( 'Search results for: %s' ), + '' . esc_html( urldecode( $s ) ) . '' + ); + echo ''; } ?> diff --git a/wp-admin/post.php b/wp-admin/post.php index 759e4b6b93..c4a0ab17e5 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -291,7 +291,14 @@ wp_die( __( 'Error in restoring the item from Trash.' ) ); } - wp_redirect( add_query_arg( 'untrashed', 1, $sendback ) ); + $sendback = add_query_arg( + array( + 'untrashed' => 1, + 'ids' => $post_id, + ), + $sendback + ); + wp_redirect( $sendback ); exit; case 'delete': diff --git a/wp-admin/privacy-policy-guide.php b/wp-admin/privacy-policy-guide.php index 566f3f14cd..137a5016f9 100644 --- a/wp-admin/privacy-policy-guide.php +++ b/wp-admin/privacy-policy-guide.php @@ -10,7 +10,7 @@ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_privacy_options' ) ) { - wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) ); + wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) ); } if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { diff --git a/wp-admin/privacy.php b/wp-admin/privacy.php index a007b4347d..222f4b13b2 100644 --- a/wp-admin/privacy.php +++ b/wp-admin/privacy.php @@ -18,15 +18,27 @@
    -
    - +
    + + ' ); ?>" /> + <?php _e( 'Code is Poetry' ); ?>' ); ?>" /> +
    -
    -

    - - -

    +
    +
    +

    + + +

    +
    + +
    + +
    +
    + <?php _e( 'New' ); ?>' ); ?>" /> +
    ').css(n).appendTo(a)[0];return c.set(_.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&gn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=fs(a,e.element,e.before);gn(e.caret).css(t)})},destroy:function(){return he.clearInterval(t)}}},ms=function(){return cs.isIE()||cs.isEdge()||cs.isFirefox()},gs=function(e){return ls(e)||jo.isTable(e)&&ms()},ps=jo.isContentEditableFalse,hs=jo.matchStyleValues("display","block table table-cell table-caption list-item"),vs=ka,ys=Sa,bs=jo.isElement,Cs=Ha,xs=function(e){return 0=o.data.length-1)return 1===e&&(r=s(o))?Rs(r):n;if(Oa(o)&&i<=1)return-1===e&&(r=u(o))?Ds(r):n;if(i===o.data.length)return(r=s(o))?Rs(r):n;if(0===i)return(r=u(o))?Ds(r):n}return n},Bs=function(e,t){return _.from(ks(e?0:-1,t)).filter(ps)},Ps=function(e,t,n){var r=Os(e,t,n);return-1===e?Su.fromRangeStart(r):Su.fromRangeEnd(r)},Is=function(e){return _.from(e.getNode()).map(ar.fromDom)},Ls=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Fs=function(e,t){var n=Ts(e,t);return!(n||!jo.isBr(e.getNode()))||n};(ku=Tu||(Tu={}))[ku.Backwards=-1]="Backwards",ku[ku.Forwards=1]="Forwards";var Ms,zs,Us,js=jo.isContentEditableFalse,Vs=jo.isText,Hs=jo.isElement,qs=jo.isBr,$s=Ha,Ws=function(e){return Ua(e)||!!qa(t=e)&&!0!==j(te(t.getElementsByTagName("*")),function(e,t){return e||Ia(t)},!1);var t},Ks=$a,Xs=function(e,t){return e.hasChildNodes()&&tu.length-1)return!!fc(c,i,r)||lc(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},mc=function(e){return jo.isText(e)&&0=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=b(l,n)||l,i=b(d,n)||d,C(l,r,!0),(s=y(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Fc=(Ms=mr,zs="text",{get:function(e){if(!Ms(e))throw new Error("Can only get "+zs+" value of a "+zs+" node");return Us(e).getOr("")},getOption:Us=function(e){return Ms(e)?_.from(e.dom().nodeValue):_.none()},set:function(e,t){if(!Ms(e))throw new Error("Can only set raw "+zs+" value of a "+zs+" node");e.dom().nodeValue=t}}),Mc=function(e){return Fc.get(e)},zc=function(r,o,i,a){return Vr(o).fold(function(){return"skipping"},function(e){return"br"===a||mr(n=o)&&"\ufeff"===Mc(n)?"valid":dr(t=o)&&Gi(t,aa())?"existing":Ju(o)?"caret":wc.isValid(r,i,a)&&wc.isValid(r,lr(e),i)?"valid":"invalid-child";var t,n})},Uc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++ga+String(i)):a,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Uc(s.getDoc(),f,c,l.decorate);ya(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=Yu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();jc(s,u,c,l.decorate,f),s.selection.moveToBookmark(a)}})};function Hc(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?_.from(n[e]).map(function(e){return e.settings}):_.none()}});da(s,r);var o=fa(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){Vc(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ca(s,_.some(e)).each(function(e){var t=e.elements;z(t,ji)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=ar.fromDom(t.getBody()),o=Qi(r,"["+ua()+'="'+n+'"]'),i={},z(o,function(e){var t=Er(e,sa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return W(e,function(e){return e.dom()})},vr(u,function(e,t){return{k:t,v:a(e,t)}})}}}var qc=function(e){return Xt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},$c=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||jo.isBr(t));var t},Wc=function(e){return 0'))},rl=function(n){Gr(n).each(function(t){Hr(t).each(function(e){Co(n)&&wo(t)&&Co(e)&&Ui(t)})})},ol=Xt.makeMap;function il(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=ol(e.indent_before||""),c=ol(e.indent_after||""),l=ti.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0":" />",n&&u&&c[e]&&0"),u&&c[e]&&0")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push(""):d.push(""),u&&d.push("\n")},doctype:function(e){d.push("",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function al(t,g){void 0===g&&(g=di());var p=il(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1|)$/," "):o("nextSibling")||(t=t.replace(/( | )(
    |)$/," "))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=al({validate:e.settings.validate},e.schema),d='​',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,y,b,C,x,w=(l=g.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&g.isCollapsed()&&p.isBlock(N.firstChild)&&(h=e,(v=N.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&p.isEmpty(N.firstChild)&&((l=p.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(cl(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),y=e.selection.getRng(),b=t,C=y.startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(b)||(b+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var E,S,T,k={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,k),!0===n.paste&&Gc(e.schema,u)&&Qc(p,i))return l=Jc(o,p,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!p.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(fl(e,d),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:p.getOuterHTML(i),t=o.serialize(r.parse(t.replace(//i,function(){return o.serialize(u)}))),i===a?p.setHTML(a,t):p.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):fl(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new el(r);Xt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),fe.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),ll(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=_u.fromRangeStart(e);if(t=Js(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,p.get("mce_marker")),E=e.getBody(),Xt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,T=e.selection.getStart(),_.from(S.getParent(T,"td,th")).map(ar.fromDom).each(rl),e.fire("SetContent",s),e.addVisual()}},ml=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Xt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};dl(e,o.content,o.details)},gl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,pl=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},hl=function(e){return e.getParam("iframe_attrs",{})},vl=function(e){return e.getParam("doctype","")},yl=function(e){return e.getParam("document_base_url","")},bl=function(e){return pl(e,"body_id","tinymce")},Cl=function(e){return pl(e,"body_class","")},xl=function(e){return e.getParam("content_security_policy","")},wl=function(e){return e.getParam("br_in_pre",!0)},Nl=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},El=function(e){return e.getParam("forced_root_block_attrs",{})},Sl=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Tl=function(e){return e.getParam("no_newline_selector","")},kl=function(e){return e.getParam("keep_styles",!0)},_l=function(e){return e.getParam("end_container_on_empty_block",!1)},Al=function(e){return Xt.explode(e.getParam("font_size_style_values",""))},Rl=function(e){return Xt.explode(e.getParam("font_size_classes",""))},Dl=function(e){return e.getParam("images_dataimg_filter",q(!0),"function")},Ol=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Bl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Pl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},Il=function(e){return e.getParam("images_upload_url","","string")},Ll=function(e){return e.getParam("images_upload_base_path","","string")},Fl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Ml=function(e){return e.getParam("images_upload_handler",null,"function")},zl=function(e){return e.getParam("content_css_cors",!1,"boolean")},Ul=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},jl=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Ta(n)?jo.isText(n.nextSibling)?_u(n.nextSibling,0):_u.after(n):Aa(t)?_u(n,r+1):t:Ta(n)?jo.isText(n.previousSibling)?_u(n.previousSibling,n.previousSibling.data.length):_u.before(n):Ra(t)?_u(n,r-1):t},Vl={isInlineTarget:function(e,t){return Lr(ar.fromDom(t),Ul(e))},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(Si.DOM.getParents(i.container(),"*",o),r));return _.from(a[a.length-1])},isRtl:function(e){return"rtl"===Si.DOM.getStyle(e,"direction",!0)||(t=e.textContent,gl.test(t));var t},isAtZwsp:function(e){return Aa(e)||Ra(e)},normalizePosition:jl,normalizeForwards:d(jl,!0),normalizeBackwards:d(jl,!1),hasSameParentBlock:function(e,t,n){var r=Ss(t,e),o=Ss(n,e);return r&&r===o}},Hl=function(e,t){return zr(e,t)?na(t,function(e){return No(e)||So(e)},(n=e,function(e){return Mr(n,ar.fromDom(e.dom().parentNode))})):_.none();var n},ql=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},$l=function(i,a,u){return ru(sc.firstPositionIn(u),sc.lastPositionIn(u),function(e,t){var n=Vl.normalizePosition(!0,e),r=Vl.normalizePosition(!1,t),o=Vl.normalizePosition(!1,a);return i?sc.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):sc.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Wl=function(e,t){var n,r,o,i=ar.fromDom(e),a=ar.fromDom(t);return n=a,r="pre,code",o=d(Mr,i),ra(n,r,o).isSome()},Kl=function(e,t){return Ha(t)&&!1===(r=e,o=t,jo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===Wl(r,o))||(n=t,jo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Xl(t);var n,r,o},Xl=jo.hasAttribute("data-mce-bookmark"),Yl=jo.hasAttribute("data-mce-bogus"),Gl=jo.hasAttributeValue("data-mce-bogus","all"),Jl=function(e){return function(e){var t,n,r=0;if(Kl(e,e))return!1;if(!(n=e.firstChild))return!0;t=new go(n,e);do{if(Gl(n))n=t.next(!0);else if(Yl(n))n=t.next();else if(jo.isBr(n))r++,n=t.next();else{if(Kl(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Ql=Ar("block","position"),Zl=Ar("from","to"),ef=function(e,t){var n=ar.fromDom(e),r=ar.fromDom(t.container());return Hl(n,r).map(function(e){return Ql(e,t)})},tf=function(o,i,e){var t=ef(o,_u.fromRangeStart(e)),n=t.bind(function(e){return sc.fromPosition(i,o,e.position()).bind(function(e){return ef(o,e).map(function(e){return t=o,n=i,r=e,jo.isBr(r.position().getNode())&&!1===Jl(r.block())?sc.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?sc.fromPosition(n,t,e).bind(function(e){return ef(t,e)}):_.some(r)}).getOr(r):r;var t,n,r})})});return ru(t,n,Zl).filter(function(e){return!1===Mr((r=e).from().block(),r.to().block())&&Vr((n=e).from().block()).bind(function(t){return Vr(n.to().block()).filter(function(e){return Mr(t,e)})}).isSome()&&(t=e,!1===jo.isContentEditableFalse(t.from().block().dom())&&!1===jo.isContentEditableFalse(t.to().block().dom()));var t,n,r})},nf=function(e,t,n){return n.collapsed?tf(e,t,n):_.none()},rf=function(e,t,n){return zr(t,e)?function(e,t){for(var n=D(t)?t:b,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=ar.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Mr(e,t)}).slice(0,-1):[]},of=function(e,t){return rf(e,t,q(!1))},af=of,uf=function(e,t){return[e].concat(of(e,t))},sf=function(e){var t,n=(t=Kr(e),Y(t,Co).fold(function(){return t},function(e){return t.slice(0,e)}));return z(n,Ui),n},cf=function(e,t){var n=uf(t,e);return X(n.reverse(),Jl).each(Ui)},lf=function(e,t,n,r){if(Jl(n))return nl(n),sc.firstPositionIn(n.dom());0===U($r(r),function(e){return!Jl(e)}).length&&Jl(t)&&Pi(r,ar.fromTag("br"));var o=sc.prevPosition(n.dom(),_u.before(r.dom()));return z(sf(t),function(e){Pi(r,e)}),cf(e,t),o},ff=function(e,t,n){if(Jl(n))return Ui(n),Jl(t)&&nl(t),sc.firstPositionIn(t.dom());var r=sc.lastPositionIn(n.dom());return z(sf(t),function(e){Fi(n,e)}),cf(e,t),r},df=function(e,t){return zr(t,e)?(n=uf(e,t),_.from(n[n.length-1])):_.none();var n},mf=function(e,t){sc.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(ar.fromDom).filter(wo).each(Ui)},gf=function(e,t,n){return mf(!0,t),mf(!1,n),df(t,n).fold(d(ff,e,t,n),d(lf,e,t,n))},pf=function(e,t,n,r){return t?gf(e,r,n):gf(e,n,r)},hf=function(t,n){var e,r=ar.fromDom(t.getBody());return(e=nf(r.dom(),n,t.selection.getRng()).bind(function(e){return pf(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},vf=function(e,t){var n=ar.fromDom(t),r=d(Mr,e);return ta(n,_o,r).isSome()},yf=function(e,t){var n,r,o=sc.prevPosition(e.dom(),_u.fromRangeStart(t)).isNone(),i=sc.nextPosition(e.dom(),_u.fromRangeEnd(t)).isNone();return!(vf(n=e,(r=t).startContainer)||vf(n,r.endContainer))&&o&&i},bf=function(e){var n,r,o,t,i=ar.fromDom(e.getBody()),a=e.selection.getRng();return yf(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ru(Hl(n,ar.fromDom(o.startContainer)),Hl(n,ar.fromDom(o.endContainer)),function(e,t){return!1===Mr(e,t)&&(o.deleteContents(),pf(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},Cf=function(e,t){return!e.selection.isCollapsed()&&bf(e)},xf=function(a){if(!k(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return z(a,function(e,r){var t=gr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,j((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},Wf=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return $f(e,t,o)},Kf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===_u.isTextPosition(n)&&o===r.parentNode&&i>_u.before(r).offset()?_u(t.container(),t.offset()-1):t;var n,r,o,i},Xf=function(e){return Ha(e.previousSibling)?_.some((t=e.previousSibling,jo.isText(t)?_u(t,t.data.length):_u.after(t))):e.previousSibling?sc.lastPositionIn(e.previousSibling):_.none();var t},Yf=function(e){return Ha(e.nextSibling)?_.some((t=e.nextSibling,jo.isText(t)?_u(t,0):_u.before(t))):e.nextSibling?sc.firstPositionIn(e.nextSibling):_.none();var t},Gf=function(r,o){return Xf(o).orThunk(function(){return Yf(o)}).orThunk(function(){return e=r,t=o,n=_u.before(t.previousSibling?t.previousSibling:t.parentNode),sc.prevPosition(e,n).fold(function(){return sc.nextPosition(e,_u.after(t))},_.some);var e,t,n})},Jf=function(n,r){return Yf(r).orThunk(function(){return Xf(r)}).orThunk(function(){return e=n,t=r,sc.nextPosition(e,_u.after(t)).fold(function(){return sc.prevPosition(e,_u.before(t))},_.some);var e,t})},Qf=function(e,t,n){return(r=e,o=t,i=n,r?Jf(o,i):Gf(o,i)).map(d(Kf,n));var r,o,i},Zf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},ed=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(lr(t))},td=function(e){if(Jl(e)){var t=ar.fromHtml('
    ');return zi(e),Fi(e,t),_.some(_u.before(t.dom()))}return _.none()},nd=function(e,t,l){var n,r,o,i,a=Hr(e).filter(mr),u=qr(e).filter(mr);return Ui(e),(n=a,r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Jn((r=u).data).length,r.appendData(o.data),Ui(ar.fromDom(o)),i&&Wf(r,a),n.container()===s?_u(u,c):n},n.isSome()&&r.isSome()&&o.isSome()?_.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):_.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Jn(r).length,$f(t,n-o,o);var t,n,r,o}),u.each(function(e){return Wf(e.dom(),0)})),t})},rd=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=Qf(n,t.getBody(),e.dom()),u=ta(e,d(ed,t),(o=t.getBody(),function(e){return e.dom()===o})),s=nd(e,a,(i=e,br(t.schema.getTextInlineElements(),lr(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(td).fold(function(){r&&Zf(t,n,s)},function(e){r&&Zf(t,n,_.some(e))})},od=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Os(t?1:-1,e,n),o=_u.fromRangeStart(r),i=ar.fromDom(e),!1===t&&Ff(o)?_.some(jf.remove(o.getNode(!0))):t&&Lf(o)?_.some(jf.remove(o.getNode())):!1===t&&Lf(o)&&Sf(i,o)?Tf(i,o).map(function(e){return jf.remove(e.getNode())}):t&&Ff(o)&&Ef(i,o)?kf(i,o).map(function(e){return jf.remove(e.getNode())}):qf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),rd(o,i,ar.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?_u.before(e):_u.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},id=function(e,t){var n,r=e.selection.getNode();return!!jo.isContentEditableFalse(r)&&(n=ar.fromDom(e.getBody()),z(Qi(n,".mce-offscreen-selection"),Ui),rd(e,t,ar.fromDom(e.selection.getNode())),ql(e),!0)},ad=function(e,t){return e.selection.isCollapsed()?od(e,t):id(e,t)},ud=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(jo.isContentEditableTrue(t)||jo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return jo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(_u.before(t).toRange())),!0},sd=jo.isText,cd=function(e){return sd(e)&&e.data[0]===xa},ld=function(e){return sd(e)&&e.data[e.data.length-1]===xa},fd=function(e){return e.ownerDocument.createTextNode(xa)},dd=function(e,t){return e?function(e){if(sd(e.previousSibling))return ld(e.previousSibling)||e.previousSibling.appendData(xa),e.previousSibling;if(sd(e))return cd(e)||e.insertData(0,xa),e;var t=fd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(sd(e.nextSibling))return cd(e.nextSibling)||e.nextSibling.insertData(0,xa),e.nextSibling;if(sd(e))return ld(e)||e.appendData(xa),e;var t=fd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},md=d(dd,!0),gd=d(dd,!1),pd=function(e,t){return jo.isText(e.container())?dd(t,e.container()):dd(t,e.getNode())},hd=function(e,t){var n=t.get();return n&&e.container()===n&&Ta(n)},vd=function(n,e){return e.fold(function(e){ss.remove(n.get());var t=md(e);return n.set(t),_.some(_u(t,t.length-1))},function(e){return sc.firstPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),1);ss.remove(n.get());var t=pd(e,!0);return n.set(t),_u(t,1)})},function(e){return sc.lastPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),n.get().length-1);ss.remove(n.get());var t=pd(e,!1);return n.set(t),_u(t,t.length-1)})},function(e){ss.remove(n.get());var t=gd(e);return n.set(t),_.some(_u(t,1))})},yd=function(e,t){for(var n=0;ni.left&&a.rightr.top&&o.bottomo.childNodes.length-1&&(c=!1),jo.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new go(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),jo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){hg(s)},forwardDelete:function(){vg(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return jg(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=mp(e,function(e){return!!a.matchNode(e,n)});return-1!==gp(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0"),u))[o.length-1]=Xt.extend(o[o.length-1],{func:n,scope:r||i}),Xt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(Xp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Xt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Xp(Yp(Xt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Zp=function(e){var t=Ur(e).dom();return e.dom()===t.activeElement},eh=function(t){return(e=Ur(t),n=e!==undefined?e.dom():V.document,_.from(n.activeElement).map(ar.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},th=function(t,e){return(n=e,n.collapsed?_.from(eu(n.startContainer,n.startOffset)).map(ar.fromDom):_.none()).bind(function(e){return ko(e)?_.some(e):!1===zr(t,e)?_.some(t):_.none()});var n},nh=function(t,e){th(ar.fromDom(t.getBody()),e).bind(function(e){return sc.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},rh=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},oh=function(e){var t,n=e.getBody();return n&&(t=ar.fromDom(n),Zp(t)||eh(t).isSome())},ih=function(e){return e.inline?oh(e):(t=e).iframeElement&&Zp(ar.fromDom(t.iframeElement));var t},ah=function(e){return e.editorManager.setActive(e)},uh=function(e,t){e.removed||(t?ah(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return rh(u),nh(t,o),ah(t);t.bookmark!==undefined&&!1===ih(t)&&up(t).each(function(e){t.selection.setRng(e),o=e}),n||(fe.opera||rh(r),t.getWin().focus()),(fe.gecko||n)&&(rh(r),nh(t,o)),ah(t)}(e))},sh=ih,ch=function(e,t){return t.dom()[e]},lh=function(e,t){return parseInt(kr(t,e),10)},fh=d(ch,"clientWidth"),dh=d(ch,"clientHeight"),mh=d(lh,"margin-top"),gh=d(lh,"margin-left"),ph=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=ar.fromDom(e.getBody()),p=e.inline?g:(r=g,ar.fromDom(r.dom().ownerDocument.documentElement)),h=(o=e.inline,a=t,u=n,s=(i=p).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+gh(i):0),y:u-(o?s.top+i.dom().clientTop+mh(i):0)});return l=h.x,f=h.y,d=fh(c=p),m=dh(c),0<=l&&0<=f&&l<=d&&f<=m},hh=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,_.from(t).map(ar.fromDom)).map(function(e){return zr(Ur(e),e)}).getOr(!1)};function vh(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0t;var t}},cv=function(n){return function(e){return t=n,e.line===t;var t}},lv=jo.isContentEditableFalse,fv=Es,dv=function(e,t){return Math.abs(e.left-t)},mv=function(e,t){return Math.abs(e.right-t)},gv=function(e,t){return e>=t.left&&e<=t.right},pv=function(e,o){return Ht.reduce(e,function(e,t){var n,r;return n=Math.min(dv(e,o),mv(e,o)),r=Math.min(dv(t,o),mv(t,o)),gv(o,t)?t:gv(o,e)?e:r===n&&lv(t.node)?t:r=e.top&&n<=e.bottom});return(r=pv(f,t))&&(r=pv((a=e,c=function(t,e){var n;return n=U(ov([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),hv(tv.Up,a,d(c,Ga),u.node),hv(tv.Down,a,d(c,Ja),u.node),s),t))&&gs(r.node)?(i=t,{node:(o=r).node,before:dv(o,i)i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Sv(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Tv(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},_v=function(e){var n;kv(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(xv(t)||xv(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Av=function(t){var e=Vi(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=fg(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Rv=jo.isContentEditableTrue,Dv=jo.isContentEditableFalse,Ov=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Rv(t)||Dv(t))return t;t=t.parentNode}return null},Bv=function(g){var p,e,t,a=g.getBody(),o=ds(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return sh(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},y=function(e,t){return t=Os(e,a,t),-1===e?_u.fromRangeStart(t):_u.fromRangeEnd(t)},n=function(e){return ka(e)||Oa(e)||Ba(e)},b=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e){var t=g.schema.getShortEndedElements(),n=g.dom.createRng(),r=e.startContainer,o=e.startOffset,i=e.endContainer,a=e.endOffset;return br(t,r.nodeName.toLowerCase())?0===o?n.setStartBefore(r):n.setStartAfter(r):n.setStart(r,o),br(t,i.nodeName.toLowerCase())?0===a?n.setEndBefore(i):n.setEndAfter(i):n.setEnd(i,a),n},l=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!b(e))if(!1===t){if(c=y(-1,e),gs(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(gs(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=y(1,e),gs(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(gs(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Dv(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&i===e.endContainer&&(n=i.childNodes[a]),Dv(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=oa(ar.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('
    ').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&fe.ie?(r.empty().append('

    \xa0

    ').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),z(Qi(ar.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){Sr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},f=function(){p&&(p.removeAttribute("data-mce-selected"),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null},C=function(){o.hide()};return fe.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&ph(g,e.clientX,e.clientY)&&u(lg(g,t,!1))}),g.on("click",function(e){var t;(t=Ov(g,e.target))&&(Dv(t)&&(e.preventDefault(),g.focus()),Rv(t)&&g.dom.isChildOf(t,g.selection.getNode())&&f())}),g.on("blur NewBlock",function(){f()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Dv(Ov(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Js(e);if(!e.firstChild)return!1;var n=_u.before(e.firstChild),r=t.next(n);return r&&!Lf(r)&&!Ff(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=Ov(n,e.target);Dv(t)&&(r||(e.preventDefault(),l(cg(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==ph(g,e.clientX,e.clientY))if(t=Ov(g,n))Dv(t)?(e.preventDefault(),l(cg(g,t))):(f(),Rv(t)&&e.shiftKey||yv(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===gs(n)){f(),C();var r=vv(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){rv.modifierPressed(e)||(e.keyCode,Dv(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){e.range=c(e.range);var t=l(e.range,e.forward);t&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||f()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!fe.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),_v(g),Av(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Pa(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Pv=function(e){for(var t=e;/)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0k(n)?(C=_(b*y),b=_(C/y)):(b=_(C/y),C=_(b*y))),N.setStyles(D(s),{width:b,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=b+" × "+C,f[2]<0&&s.clientWidth<=b&&N.setStyle(s,"left",g+(h-b)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=A.scrollWidth-x)+(n=A.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(Tp(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",b),e("height",C),N.unbind(S,"mousemove",B),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",B),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),kp(a,u,b,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;I(),M(),t=N.getPos(e,A),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,b=C=0),n=a.fire("ObjectSelected",{target:e}),O(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===fe.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,y=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=A.scrollWidth,w=A.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),A.appendChild(s),N.bind(S,"mousemove",B),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",B),N.bind(T,"mouseup",P)),c=N.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):I(),u.setAttribute("data-mce-selected","1")},I=function(){var e,t;for(e in M(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},L=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],A)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):I())},F=function(e){return Ab(function(e,t){for(;t&&t!==e;){if(Rb(t)||Ab(t))return t;t=t.parentNode}return null}(a.getBody(),e))},M=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},z=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){z(),fe.ie&&11<=fe.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||F(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(A,"mscontrolselect",function(e){var t=function(e){he.setEditorTimeout(a,function(){a.selection.select(e)})};if(F(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=he.throttle(function(e){a.composing||L(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",I),a.on("contextmenu",n)}),a.on("remove",M),{isResizable:O,showResizeRect:o,hideResizeRect:I,updateResizeRect:L,destroy:function(){u=s=null}}},Ob=function(e){return jo.isContentEditableTrue(e)||jo.isContentEditableFalse(e)},Bb=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Xt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,jo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Ob))?null:i}return r},Pb=function(n,e){return W(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},Ib=function(e,t){var n=(t||V.document).createDocumentFragment();return z(e,function(e){n.appendChild(e.dom())}),ar.fromDom(n)},Lb=Ar("element","width","rows"),Fb=Ar("element","cells"),Mb=Ar("x","y"),zb=function(e,t){var n=parseInt(Er(e,t),10);return isNaN(n)?1:n},Ub=function(e){return j(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},jb=function(e,t){for(var n=e.rows(),r=0;r_
    '+t),e.dom.remove("__mce_tmp")):l.pasteHTML(t)}u.no_events||e.fire("SetContent",u)}else e.fire("SetContent",u)},eC=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return _.from(i).map(ar.fromDom).map(function(e){return r&&t.collapsed?e:Xr(e,o(e,a)).getOr(e)}).bind(function(e){return dr(e)?_.some(e):Vr(e)}).map(function(e){return e.dom()}).getOr(e)},tC=function(e,t,n){return eC(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},nC=function(e,t,n){return eC(e,t,!1,n,function(e,t){return 0t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return og(c,e,t)},placeCaretAt:function(e,t){return i(Bb(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?_u.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=_b(p),t=Db(p,c),p.bookmarkManager=n,p.controlSelection=t,p};(kb=Tb||(Tb={}))[kb.Br=0]="Br",kb[kb.Block=1]="Block",kb[kb.Wrap=2]="Wrap",kb[kb.Eol=3]="Eol";var sC=function(e,t){return e===Tu.Backwards?t.reverse():t},cC=function(e,t,n,r){for(var o,i,a,u,s,c,l=Js(n),f=r,d=[];f&&(s=l,c=f,o=t===Tu.Forwards?s.next(c):s.prev(c));){if(jo.isBr(o.getNode(!1)))return t===Tu.Forwards?{positions:sC(t,d).concat([o]),breakType:Tb.Br,breakAt:_.some(o)}:{positions:sC(t,d),breakType:Tb.Br,breakAt:_.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,jo.isBr(u.getNode(i===Tu.Forwards))?Tb.Br:!1===Ts(a,u)?Tb.Block:Tb.Wrap);return{positions:sC(t,d),breakType:m,breakAt:_.some(o)}}d.push(o),f=o}else f=o}return{positions:sC(t,d),breakType:Tb.Eol,breakAt:_.none()}},lC=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Tu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},fC=function(e,i){return j(e,function(e,o){return e.fold(function(){return _.some(o)},function(r){return ru(Z(r.getClientRects()),Z(o.getClientRects()),function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},_.none())},dC=function(t,e){return Z(e.getClientRects()).bind(function(e){return fC(t,e.left)})},mC=d(cC,Su.isAbove,-1),gC=d(cC,Su.isBelow,1),pC=d(lC,-1,mC),hC=d(lC,1,gC),vC=jo.isContentEditableFalse,yC=Za,bC=function(e,t,n,r){var o=e===Tu.Forwards,i=o?Lf:Ff;if(!r.collapsed){var a=yC(r);if(vC(a))return sg(e,t,a,e===Tu.Backwards,!0)}var u=Sa(r.startContainer),s=Ps(e,t.getBody(),r);if(i(s))return cg(t,s.getNode(!o));var c=Vl.normalizePosition(o,n(s));if(!c)return u?r:null;if(i(c))return sg(e,t,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&Fs(c,l)?sg(e,t,l.getNode(!o),o,!0):u?fg(t,c.toRange(),!0):null},CC=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=yC(r),o=Ps(e,t.getBody(),r),i=n(t.getBody(),sv(1),o),a=U(i,cv(1)),s=Ht.last(o.getClientRects()),(Lf(o)||zf(o))&&(d=o.getNode()),(Ff(o)||Uf(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=pv(a,c))&&vC(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),sg(e,t,u.node,l'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},wC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Js((e=l).getBody()),o=d(Ls,r.next),i=d(Ls,r.prev),a=t?Tu.Forwards:Tu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=bC(a,e,u,s))?n:(n=xC(e,a,s))||null);return!!c&&(dg(l,c),!0)}},NC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?uv:av,i=(e=u).selection.getRng(),(n=CC(r,e,o,i))?n:(n=xC(e,r,i))||null);return!!a&&(dg(u,a),!0)}},EC=function(r,o){return function(){var t,e=o?_u.fromRangeEnd(r.selection.getRng()):_u.fromRangeStart(r.selection.getRng()),n=o?gC(r.getBody(),e):mC(r.getBody(),e);return(o?ee(n.positions):Z(n.positions)).filter((t=o,function(e){return t?Ff(e):Lf(e)})).fold(q(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},SC=function(e,t,n,r,o){var i,a,u,s,c=Qi(ar.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=Ka(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,j(a,function(e,r){return e.fold(function(){return _.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return _.some(nt}),_C=function(t,n){return Z(n.getClientRects()).bind(function(e){return TC(t,e.left,e.top)}).bind(function(e){return dC((t=e,sc.lastPositionIn(t).map(function(e){return mC(t,e).positions.concat(e)}).getOr([])),n);var t})},AC=function(t,n){return ee(n.getClientRects()).bind(function(e){return kC(t,e.left,e.top)}).bind(function(e){return dC((t=e,sc.firstPositionIn(t).map(function(e){return[e].concat(gC(t,e).positions)}).getOr([])),n);var t})},RC=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===Tb.Wrap&&0===a.positions.length||!jo.isBr(n.getNode())&&(i=u).breakType===Tb.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},DC=d(RC,mC),OC=d(RC,gC),BC=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(ms()&&(o=t,i=s,a=n,u=_u.fromRangeStart(i),sc.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=sg(c,e,n,!t,!0);return dg(e,l),!0}return!1},PC=function(e,t){var n=t.getNode(e);return jo.isElement(n)&&"TABLE"===n.nodeName?_.some(n):_.none()},IC=function(u,s,c){var e=PC(!!s,c),t=!1===s;e.fold(function(){return dg(u,c.toRange())},function(a){return sc.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return dg(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Nl(r=u))?r.undoManager.transact(function(){var e=ar.fromTag(i);Nr(e,El(r)),Fi(e,ar.fromTag("br")),n?Ii(ar.fromDom(o),e):Pi(ar.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),dg(r,t)}):dg(r,t.toRange()));var n,r,o,t,i})})},LC=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=_u.fromRangeStart(l),d=e.getBody();if(!t&&DC(r,f)){var m=(u=d,_C(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return fC(pC(u,_u.before(s)),e.left)})}).getOr(_u.before(s)));return IC(e,t,m),!0}return!(!t||!OC(r,f))&&(o=d,m=AC(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return fC(hC(o,_u.after(i)),e.left)})}).getOr(_u.after(i)),IC(e,t,m),!0)},FC=function(t,n){return function(){return _.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return _.from(t.dom.getParent(e,"table")).map(function(e){return BC(t,n,e)})}).getOr(!1)}},MC=function(n,r){return function(){return _.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return _.from(n.dom.getParent(t,"table")).map(function(e){return LC(n,r,e,t)})}).getOr(!1)}},zC=function(e){return F(["figcaption"],lr(e))},UC=function(e){var t=V.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},jC=function(e,t,n){n?Fi(e,t):Li(e,t)},VC=function(e,t,n,r){return""===t?(l=e,f=r,d=ar.fromTag("br"),jC(l,d,f),UC(d)):(o=e,i=r,a=t,u=n,s=ar.fromTag(a),c=ar.fromTag("br"),Nr(s,u),Fi(s,c),jC(o,s,i),UC(c));var o,i,a,u,s,c,l,f,d},HC=function(e,t,n){return t?(o=e.dom(),gC(o,n).breakAt.isNone()):(r=e.dom(),mC(r,n).breakAt.isNone());var r,o},qC=function(t,n){var e,r,o,i=ar.fromDom(t.getBody()),a=_u.fromRangeStart(t.selection.getRng()),u=Nl(t),s=El(t);return(e=a,r=i,o=d(Mr,r),na(ar.fromDom(e.container()),Co,o).filter(zC)).exists(function(){if(HC(i,n,a)){var e=VC(i,u,s,n);return t.selection.setRng(e),!0}return!1})},$C=function(e,t){return function(){return!!e.selection.isCollapsed()&&qC(e,t)}},WC=function(e,r){return G(W(e,function(e){return Zy({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},KC=function(e){for(var t=[],n=1;n'},cx=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},lx=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},fx=function(e,t,n){return!1===jo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===xa?0:n:n===t.data.length-1&&t.data.charAt(n)===xa?t.data.length:n},dx=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},mx=function(o,i,e){_.from(e.style).map(o.dom.parseStyle).each(function(e){var t=function(e){var t={},n=e.dom();if(Cr(n))for(var r=0;rs.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&jo.isText(s)?s.nodeValue.length:0),(u=dx(x,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=dx(m,r);if(!(a=m.getParent(r,m.isBlock))||!lx(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),gx(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),gx(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,E,s,i)),c=x.getParent(s,x.isBlock),l=c?x.getParent(c.parentNode,x.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&x.isEmpty(c)?ux(a,S,l,c,m):m&&c===a.getBody()||(m=m||"P",Sa(c)?(r=Pa(c),x.isEmpty(c)&&sx(c),gx(a,r),QC(a,r)):T()?k():T(!0)?(r=c.parentNode.insertBefore(S(),c),QC(a,cx(c,"HR")?r:c)):((t=(b=E,C=b.cloneRange(),C.setStart(b.startContainer,fx(!0,b.startContainer,b.startOffset)),C.setEnd(b.endContainer,fx(!1,b.endContainer,b.endOffset)),C).cloneRange()).setEndAfter(c),o=t.extractContents(),y=o,z(Ji(ar.fromDom(y),mr),function(e){var t=e.dom();t.nodeValue=wa(t.nodeValue)}),function(e){for(;jo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,x.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;jo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(x,N,r),p=x,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),x.isEmpty(c)&&sx(c),r.normalize(),x.isEmpty(r)?(x.remove(r),k()):(gx(a,r),QC(a,r))),x.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},hx=function(e,t){return ex(e).filter(function(e){return 0",yl(f)!==f.documentBaseUrl&&(g+=''),g+='',d=bl(f),m=Cl(f),xl(f)&&(g+=''),g+='
    '),Cw.add(t.iframeContainer,l),p},ww=function(e,t){var n=xw(e,t);t.editorContainer&&(Cw.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=Cw.isHidden(t.editorContainer)),e.getElement().style.display="none",Cw.setAttrib(e.id,"aria-hidden","true"),n||bw(e)},Nw=Si.DOM,Ew=function(t,n,e){var r=_h.get(e),o=_h.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=Xt.trim(e),r&&-1===Xt.inArray(n,e)){if(Xt.each(_h.dependencies(e),function(e){Ew(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(iE){kh.pluginInitError(t,e,iE)}}},Sw=function(e){return e.replace(/^\-/,"")},Tw=function(e){return{editorContainer:e,iframeContainer:e}},kw=function(e){var t,n,r=e.getElement();return e.inline?Tw(null):(t=r,n=Nw.create("div"),Nw.insertAfter(n,t),Tw(n))},_w=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,S(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Nw.getStyle(f,"width")||"100%",a=l.height||Nw.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))=n.length)for(r=0,o=e.length;r=n.length||e[r]!==n[r]){i=r+1;break}if(e.length=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r]*>( | |\\s|\xa0|
    |)<\\/"+a+">[\r\n]*|
    [\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||Ao(ar.fromDom(n))?t.content=r:t.content=Xt.trim(r),t.no_events||e.fire("GetContent",t),t.content},jw=function(e,t){t(e),e.firstChild&&jw(e.firstChild,t),e.next&&jw(e.next,t)},Vw=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&jw(t.firstChild,function(t){z(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),z(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);z(r,function(t){z(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Hw=function(e){return e instanceof sb},qw=function(e,t){var r;e.dom.setHTML(e.getBody(),t),sh(r=e)&&sc.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=jo.isTable(t)?sc.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},$w=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Hw(s)?"":s,Hw(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),_.from(u.getBody()).fold(q(s),function(e){return Hw(s)?function(e,t,n,r){Vw(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=al({validate:e.validate},e.schema).serialize(n);return r.content=Ao(ar.fromDom(t))?o:Xt.trim(o),qw(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='
    ',"TABLE"===n.nodeName?r=""+a+"":/^(UL|OL)$/.test(n.nodeName)&&(r="
  • "+a+"
  • "),(i=Nl(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='
    '),qw(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=al({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Ao(ar.fromDom(n))?r:Xt.trim(r),qw(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Ww=Si.DOM,Kw=function(e){return _.from(e).each(function(e){return e.destroy()})},Xw=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Ww.remove(o.nextSibling),Np(e),e.editorManager.remove(e),!e.inline&&r&&(i=e,Ww.setStyle(i.id,"display",i.orgDisplay)),Ep(e),Ww.remove(e.getContainer()),Kw(t),Kw(n),e.destroy()}var i},Yw=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Kw(i),Kw(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),Ww.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Gw=Si.DOM,Jw=Xt.extend,Qw=Xt.each,Zw=Xt.resolve,eN=fe.ie,tN=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"40px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=$p(zp,c,a,u),l.settings=t,Bi.language=t.language||"en",Bi.languageLoad=t.language_load,Bi.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new zw(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Qp(l),l.loadedCSS={},l.editorCommands=new pp(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(fe.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(fe.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=gn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Jw(tN.prototype={render:function(){Bw(this)},focus:function(e){uh(this,e)},hasFocus:function(){return sh(this)},execCallback:function(e){for(var t=[],n=1;n=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=ON(e.x,t.x),r=ON(e.y,t.y),o=DN(e.x+e.w,t.x+t.w),i=DN(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:IN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=ON(0,t.x-u),o=ON(0,t.y-s),i=ON(0,c-f),a=ON(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),IN(u,s,(c-=i)-u,(l-=a)-s)},create:IN,fromClientRect:function(e){return IN(e.left,e.top,e.width,e.height)}},FN={},MN={add:function(e,t){FN[e.toLowerCase()]=t},has:function(e){return!!FN[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=FN.hasOwnProperty(t)?FN[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=FN[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},zN=Xt.each,UN=Xt.extend,jN=function(){};jN.extend=_N=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!AN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in AN=!0,e=new this,AN=!1,n.Mixins&&(zN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&zN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&zN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&zN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=UN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=_N,i};var VN=Math.min,HN=Math.max,qN=Math.round,$N=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r+~]|"+at+")"+at+"*"),mt=new RegExp("="+at+"*([^\\]'\"]*?)"+at+"*\\]","g"),gt=new RegExp(ct),pt=new RegExp("^"+ut+"$"),ht={ID:new RegExp("^#("+ut+")"),CLASS:new RegExp("^\\.("+ut+")"),TAG:new RegExp("^("+ut+"|[*])"),ATTR:new RegExp("^"+st),PSEUDO:new RegExp("^"+ct),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+at+"*(even|odd|(([+-]|)(\\d*)n|)"+at+"*(?:([+-]|)"+at+"*(\\d+)|))"+at+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+at+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+at+"*((?:-\\d)?\\d*)"+at+"*\\)|)(?=[^-]|$)","i")},vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/^[^{]+\{\s*\[native \w/,Ct=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,wt=/'|\\/g,Nt=new RegExp("\\\\([\\da-f]{1,6}"+at+"?|("+at+")|.)","ig"),Et=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{rt.apply(et=ot.call($e.childNodes),$e.childNodes),et[$e.childNodes.length].nodeType}catch(iE){rt={apply:et.length?function(e,t){nt.apply(e,ot.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var St=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:$e)!==Me&&Fe(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Me).nodeType)&&9!==u)return[];if(Ue&&!r){if(o=Ct.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&He(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return rt.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&ke.getElementsByClassName)return rt.apply(n,t.getElementsByClassName(a)),n}if(ke.qsa&&(!je||!je.test(e))){if(f=l=qe,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=De(e),(l=t.getAttribute("id"))?f=l.replace(wt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Pt(c[s]);d=xt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return rt.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return Be(e.replace(lt,"$1"),t,n,r)};function Tt(){var r=[];return function e(t,n){return r.push(t+" ")>_e.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function kt(e){return e[qe]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function At(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Rt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Dt(a){return kt(function(i){return i=+i,kt(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Qe&&e}for(Te in ke=St.support={},Re=St.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Fe=St.setDocument=function(e){var t,s=e?e.ownerDocument||e:$e,n=s.defaultView;return s!==Me&&9===s.nodeType&&s.documentElement?(ze=(Me=s).documentElement,Ue=!Re(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Fe()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Fe()})),ke.attributes=!0,ke.getElementsByTagName=!0,ke.getElementsByClassName=bt.test(s.getElementsByClassName),ke.getById=!0,_e.find.ID=function(e,t){if(typeof t.getElementById!==Qe&&Ue){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_e.filter.ID=function(e){var t=e.replace(Nt,Et);return function(e){return e.getAttribute("id")===t}},_e.find.TAG=ke.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Qe)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},_e.find.CLASS=ke.getElementsByClassName&&function(e,t){if(Ue)return t.getElementsByClassName(e)},Ve=[],je=[],ke.disconnectedMatch=!0,je=je.length&&new RegExp(je.join("|")),Ve=Ve.length&&new RegExp(Ve.join("|")),t=bt.test(ze.compareDocumentPosition),He=t||bt.test(ze.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Je=t?function(e,t){if(e===t)return Le=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!ke.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===$e&&He($e,e)?-1:t===s||t.ownerDocument===$e&&He($e,t)?1:Ie?it.call(Ie,e)-it.call(Ie,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Le=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:Ie?it.call(Ie,e)-it.call(Ie,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===$e?-1:u[r]===$e?1:0},s):Me},St.matches=function(e,t){return St(e,null,null,t)},St.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Me&&Fe(e),t=t.replace(mt,"='$1']"),ke.matchesSelector&&Ue&&(!Ve||!Ve.test(t))&&(!je||!je.test(t)))try{var n=(void 0).call(e,t);if(n||ke.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(iE){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Nt,Et),e[3]=(e[3]||e[4]||e[5]||"").replace(Nt,Et),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||St.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&St.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ht.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&>.test(n)&&(t=De(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Nt,Et).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Xe[e+" "];return t||(t=new RegExp("(^|"+at+")"+e+"("+at+"|$)"))&&Xe(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Qe&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=St.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1)[^>]*$|#([\w\-]*)$)/,Zt=Se.Event,en=Xt.makeMap("children,contents,next,prev"),tn=function(e){return void 0!==e},nn=function(e){return"string"==typeof e},rn=function(e,t){var n,r,o;for(o=(t=t||Yt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},on=function(e,t,n,r){var o;if(nn(t))t=rn(t,bn(e[0]));else if(t.length&&!t.nodeType){if(t=gn.makeArray(t),r)for(o=t.length-1;0<=o;o--)on(e,t[o],n,r);else for(o=0;o"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Qt.exec(e)))return gn(t).find(e);if(n[1])for(r=rn(e,bn(t)).firstChild;r;)Gt.call(o,r),r=r.nextSibling;else{if(!(r=bn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Xt.toArray(this)},add:function(e,t){var n,r,o=this;if(nn(e))return o.add(gn(e));if(!1!==t)for(n=gn.unique(o.toArray().concat(gn.makeArray(e))),o.length=n.length,r=0;r=a.length&&r(o)}))})})},co=function(e){return so(e,uo.nu)},lo=function(n){return{is:function(e){return n===e},isValue:C,isError:b,getOr:q(n),getOrThunk:q(n),getOrDie:q(n),or:function(e){return lo(n)},orThunk:function(e){return lo(n)},fold:function(e,t){return t(n)},map:function(e){return lo(e(n))},mapError:function(e){return lo(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return _.some(n)}}},fo=function(n){return{is:b,isValue:b,isError:C,getOr:$,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return fo(n)},mapError:function(e){return fo(e(n))},each:o,bind:function(e){return fo(n)},exists:b,forall:C,toOption:_.none}},mo={value:lo,error:fo,fromOption:function(e,t){return e.fold(function(){return fo(t)},lo)}};function go(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var po,ho,vo,yo=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xo=/[<>&\"\']/g,Yo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Go={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};ho={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},vo={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Jo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n>10),56320+(1023&t))):Go[t]||String.fromCharCode(t):vo[e]||po[e]||(n=e,(r=ar.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},ni={},ri={},oi=Xt.makeMap,ii=Xt.each,ai=Xt.extend,ui=Xt.explode,si=Xt.inArray,ci=function(e,t){return(e=Xt.trim(e))?e.split(t||" "):[]},li=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n
    ').css(n).appendTo(a)[0];return c.set(_.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&gn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=fs(a,e.element,e.before);gn(e.caret).css(t)})},destroy:function(){return he.clearInterval(t)}}},ms=function(){return cs.isIE()||cs.isEdge()||cs.isFirefox()},gs=function(e){return ls(e)||jo.isTable(e)&&ms()},ps=jo.isContentEditableFalse,hs=jo.matchStyleValues("display","block table table-cell table-caption list-item"),vs=ka,ys=Sa,bs=jo.isElement,Cs=Ha,xs=function(e){return 0=o.data.length-1)return 1===e&&(r=s(o))?Rs(r):n;if(Oa(o)&&i<=1)return-1===e&&(r=u(o))?Ds(r):n;if(i===o.data.length)return(r=s(o))?Rs(r):n;if(0===i)return(r=u(o))?Ds(r):n}return n},Bs=function(e,t){return _.from(ks(e?0:-1,t)).filter(ps)},Ps=function(e,t,n){var r=Os(e,t,n);return-1===e?Su.fromRangeStart(r):Su.fromRangeEnd(r)},Is=function(e){return _.from(e.getNode()).map(ar.fromDom)},Ls=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Fs=function(e,t){var n=Ts(e,t);return!(n||!jo.isBr(e.getNode()))||n};(ku=Tu||(Tu={}))[ku.Backwards=-1]="Backwards",ku[ku.Forwards=1]="Forwards";var Ms,zs,Us,js=jo.isContentEditableFalse,Vs=jo.isText,Hs=jo.isElement,qs=jo.isBr,$s=Ha,Ws=function(e){return Ua(e)||!!qa(t=e)&&!0!==j(te(t.getElementsByTagName("*")),function(e,t){return e||Ia(t)},!1);var t},Ks=$a,Xs=function(e,t){return e.hasChildNodes()&&tu.length-1)return!!fc(c,i,r)||lc(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},mc=function(e){return jo.isText(e)&&0=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=b(l,n)||l,i=b(d,n)||d,C(l,r,!0),(s=y(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Fc=(Ms=mr,zs="text",{get:function(e){if(!Ms(e))throw new Error("Can only get "+zs+" value of a "+zs+" node");return Us(e).getOr("")},getOption:Us=function(e){return Ms(e)?_.from(e.dom().nodeValue):_.none()},set:function(e,t){if(!Ms(e))throw new Error("Can only set raw "+zs+" value of a "+zs+" node");e.dom().nodeValue=t}}),Mc=function(e){return Fc.get(e)},zc=function(r,o,i,a){return Vr(o).fold(function(){return"skipping"},function(e){return"br"===a||mr(n=o)&&"\ufeff"===Mc(n)?"valid":dr(t=o)&&Gi(t,aa())?"existing":Ju(o)?"caret":wc.isValid(r,i,a)&&wc.isValid(r,lr(e),i)?"valid":"invalid-child";var t,n})},Uc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++ga+String(i)):a,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Uc(s.getDoc(),f,c,l.decorate);ya(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=Yu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();jc(s,u,c,l.decorate,f),s.selection.moveToBookmark(a)}})};function Hc(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?_.from(n[e]).map(function(e){return e.settings}):_.none()}});da(s,r);var o=fa(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){Vc(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ca(s,_.some(e)).each(function(e){var t=e.elements;z(t,ji)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=ar.fromDom(t.getBody()),o=Qi(r,"["+ua()+'="'+n+'"]'),i={},z(o,function(e){var t=Er(e,sa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return W(e,function(e){return e.dom()})},vr(u,function(e,t){return{k:t,v:a(e,t)}})}}}var qc=function(e){return Xt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},$c=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||jo.isBr(t));var t},Wc=function(e){return 0'))},rl=function(n){Gr(n).each(function(t){Hr(t).each(function(e){Co(n)&&wo(t)&&Co(e)&&Ui(t)})})},ol=Xt.makeMap;function il(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=ol(e.indent_before||""),c=ol(e.indent_after||""),l=ti.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0":" />",n&&u&&c[e]&&0"),u&&c[e]&&0")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push(""):d.push(""),u&&d.push("\n")},doctype:function(e){d.push("",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function al(t,g){void 0===g&&(g=di());var p=il(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1|)$/," "):o("nextSibling")||(t=t.replace(/( | )(
    |)$/," "))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=al({validate:e.settings.validate},e.schema),d='​',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,y,b,C,x,w=(l=g.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&g.isCollapsed()&&p.isBlock(N.firstChild)&&(h=e,(v=N.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&p.isEmpty(N.firstChild)&&((l=p.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(cl(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),y=e.selection.getRng(),b=t,C=y.startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(b)||(b+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var E,S,T,k={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,k),!0===n.paste&&Gc(e.schema,u)&&Qc(p,i))return l=Jc(o,p,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!p.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(fl(e,d),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:p.getOuterHTML(i),t=o.serialize(r.parse(t.replace(//i,function(){return o.serialize(u)}))),i===a?p.setHTML(a,t):p.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):fl(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new el(r);Xt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),fe.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),ll(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=_u.fromRangeStart(e);if(t=Js(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,p.get("mce_marker")),E=e.getBody(),Xt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,T=e.selection.getStart(),_.from(S.getParent(T,"td,th")).map(ar.fromDom).each(rl),e.fire("SetContent",s),e.addVisual()}},ml=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Xt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};dl(e,o.content,o.details)},gl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,pl=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},hl=function(e){return e.getParam("iframe_attrs",{})},vl=function(e){return e.getParam("doctype","")},yl=function(e){return e.getParam("document_base_url","")},bl=function(e){return pl(e,"body_id","tinymce")},Cl=function(e){return pl(e,"body_class","")},xl=function(e){return e.getParam("content_security_policy","")},wl=function(e){return e.getParam("br_in_pre",!0)},Nl=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},El=function(e){return e.getParam("forced_root_block_attrs",{})},Sl=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Tl=function(e){return e.getParam("no_newline_selector","")},kl=function(e){return e.getParam("keep_styles",!0)},_l=function(e){return e.getParam("end_container_on_empty_block",!1)},Al=function(e){return Xt.explode(e.getParam("font_size_style_values",""))},Rl=function(e){return Xt.explode(e.getParam("font_size_classes",""))},Dl=function(e){return e.getParam("images_dataimg_filter",q(!0),"function")},Ol=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Bl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Pl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},Il=function(e){return e.getParam("images_upload_url","","string")},Ll=function(e){return e.getParam("images_upload_base_path","","string")},Fl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Ml=function(e){return e.getParam("images_upload_handler",null,"function")},zl=function(e){return e.getParam("content_css_cors",!1,"boolean")},Ul=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},jl=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Ta(n)?jo.isText(n.nextSibling)?_u(n.nextSibling,0):_u.after(n):Aa(t)?_u(n,r+1):t:Ta(n)?jo.isText(n.previousSibling)?_u(n.previousSibling,n.previousSibling.data.length):_u.before(n):Ra(t)?_u(n,r-1):t},Vl={isInlineTarget:function(e,t){return Lr(ar.fromDom(t),Ul(e))},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(Si.DOM.getParents(i.container(),"*",o),r));return _.from(a[a.length-1])},isRtl:function(e){return"rtl"===Si.DOM.getStyle(e,"direction",!0)||(t=e.textContent,gl.test(t));var t},isAtZwsp:function(e){return Aa(e)||Ra(e)},normalizePosition:jl,normalizeForwards:d(jl,!0),normalizeBackwards:d(jl,!1),hasSameParentBlock:function(e,t,n){var r=Ss(t,e),o=Ss(n,e);return r&&r===o}},Hl=function(e,t){return zr(e,t)?na(t,function(e){return No(e)||So(e)},(n=e,function(e){return Mr(n,ar.fromDom(e.dom().parentNode))})):_.none();var n},ql=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},$l=function(i,a,u){return ru(sc.firstPositionIn(u),sc.lastPositionIn(u),function(e,t){var n=Vl.normalizePosition(!0,e),r=Vl.normalizePosition(!1,t),o=Vl.normalizePosition(!1,a);return i?sc.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):sc.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Wl=function(e,t){var n,r,o,i=ar.fromDom(e),a=ar.fromDom(t);return n=a,r="pre,code",o=d(Mr,i),ra(n,r,o).isSome()},Kl=function(e,t){return Ha(t)&&!1===(r=e,o=t,jo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===Wl(r,o))||(n=t,jo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Xl(t);var n,r,o},Xl=jo.hasAttribute("data-mce-bookmark"),Yl=jo.hasAttribute("data-mce-bogus"),Gl=jo.hasAttributeValue("data-mce-bogus","all"),Jl=function(e){return function(e){var t,n,r=0;if(Kl(e,e))return!1;if(!(n=e.firstChild))return!0;t=new go(n,e);do{if(Gl(n))n=t.next(!0);else if(Yl(n))n=t.next();else if(jo.isBr(n))r++,n=t.next();else{if(Kl(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Ql=Ar("block","position"),Zl=Ar("from","to"),ef=function(e,t){var n=ar.fromDom(e),r=ar.fromDom(t.container());return Hl(n,r).map(function(e){return Ql(e,t)})},tf=function(o,i,e){var t=ef(o,_u.fromRangeStart(e)),n=t.bind(function(e){return sc.fromPosition(i,o,e.position()).bind(function(e){return ef(o,e).map(function(e){return t=o,n=i,r=e,jo.isBr(r.position().getNode())&&!1===Jl(r.block())?sc.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?sc.fromPosition(n,t,e).bind(function(e){return ef(t,e)}):_.some(r)}).getOr(r):r;var t,n,r})})});return ru(t,n,Zl).filter(function(e){return!1===Mr((r=e).from().block(),r.to().block())&&Vr((n=e).from().block()).bind(function(t){return Vr(n.to().block()).filter(function(e){return Mr(t,e)})}).isSome()&&(t=e,!1===jo.isContentEditableFalse(t.from().block().dom())&&!1===jo.isContentEditableFalse(t.to().block().dom()));var t,n,r})},nf=function(e,t,n){return n.collapsed?tf(e,t,n):_.none()},rf=function(e,t,n){return zr(t,e)?function(e,t){for(var n=D(t)?t:b,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=ar.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Mr(e,t)}).slice(0,-1):[]},of=function(e,t){return rf(e,t,q(!1))},af=of,uf=function(e,t){return[e].concat(of(e,t))},sf=function(e){var t,n=(t=Kr(e),Y(t,Co).fold(function(){return t},function(e){return t.slice(0,e)}));return z(n,Ui),n},cf=function(e,t){var n=uf(t,e);return X(n.reverse(),Jl).each(Ui)},lf=function(e,t,n,r){if(Jl(n))return nl(n),sc.firstPositionIn(n.dom());0===U($r(r),function(e){return!Jl(e)}).length&&Jl(t)&&Pi(r,ar.fromTag("br"));var o=sc.prevPosition(n.dom(),_u.before(r.dom()));return z(sf(t),function(e){Pi(r,e)}),cf(e,t),o},ff=function(e,t,n){if(Jl(n))return Ui(n),Jl(t)&&nl(t),sc.firstPositionIn(t.dom());var r=sc.lastPositionIn(n.dom());return z(sf(t),function(e){Fi(n,e)}),cf(e,t),r},df=function(e,t){return zr(t,e)?(n=uf(e,t),_.from(n[n.length-1])):_.none();var n},mf=function(e,t){sc.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(ar.fromDom).filter(wo).each(Ui)},gf=function(e,t,n){return mf(!0,t),mf(!1,n),df(t,n).fold(d(ff,e,t,n),d(lf,e,t,n))},pf=function(e,t,n,r){return t?gf(e,r,n):gf(e,n,r)},hf=function(t,n){var e,r=ar.fromDom(t.getBody());return(e=nf(r.dom(),n,t.selection.getRng()).bind(function(e){return pf(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},vf=function(e,t){var n=ar.fromDom(t),r=d(Mr,e);return ta(n,_o,r).isSome()},yf=function(e,t){var n,r,o=sc.prevPosition(e.dom(),_u.fromRangeStart(t)).isNone(),i=sc.nextPosition(e.dom(),_u.fromRangeEnd(t)).isNone();return!(vf(n=e,(r=t).startContainer)||vf(n,r.endContainer))&&o&&i},bf=function(e){var n,r,o,t,i=ar.fromDom(e.getBody()),a=e.selection.getRng();return yf(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ru(Hl(n,ar.fromDom(o.startContainer)),Hl(n,ar.fromDom(o.endContainer)),function(e,t){return!1===Mr(e,t)&&(o.deleteContents(),pf(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},Cf=function(e,t){return!e.selection.isCollapsed()&&bf(e)},xf=function(a){if(!k(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return z(a,function(e,r){var t=gr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,j((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},Wf=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return $f(e,t,o)},Kf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===_u.isTextPosition(n)&&o===r.parentNode&&i>_u.before(r).offset()?_u(t.container(),t.offset()-1):t;var n,r,o,i},Xf=function(e){return Ha(e.previousSibling)?_.some((t=e.previousSibling,jo.isText(t)?_u(t,t.data.length):_u.after(t))):e.previousSibling?sc.lastPositionIn(e.previousSibling):_.none();var t},Yf=function(e){return Ha(e.nextSibling)?_.some((t=e.nextSibling,jo.isText(t)?_u(t,0):_u.before(t))):e.nextSibling?sc.firstPositionIn(e.nextSibling):_.none();var t},Gf=function(r,o){return Xf(o).orThunk(function(){return Yf(o)}).orThunk(function(){return e=r,t=o,n=_u.before(t.previousSibling?t.previousSibling:t.parentNode),sc.prevPosition(e,n).fold(function(){return sc.nextPosition(e,_u.after(t))},_.some);var e,t,n})},Jf=function(n,r){return Yf(r).orThunk(function(){return Xf(r)}).orThunk(function(){return e=n,t=r,sc.nextPosition(e,_u.after(t)).fold(function(){return sc.prevPosition(e,_u.before(t))},_.some);var e,t})},Qf=function(e,t,n){return(r=e,o=t,i=n,r?Jf(o,i):Gf(o,i)).map(d(Kf,n));var r,o,i},Zf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},ed=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(lr(t))},td=function(e){if(Jl(e)){var t=ar.fromHtml('
    ');return zi(e),Fi(e,t),_.some(_u.before(t.dom()))}return _.none()},nd=function(e,t,l){var n,r,o,i,a=Hr(e).filter(mr),u=qr(e).filter(mr);return Ui(e),(n=a,r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Jn((r=u).data).length,r.appendData(o.data),Ui(ar.fromDom(o)),i&&Wf(r,a),n.container()===s?_u(u,c):n},n.isSome()&&r.isSome()&&o.isSome()?_.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):_.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Jn(r).length,$f(t,n-o,o);var t,n,r,o}),u.each(function(e){return Wf(e.dom(),0)})),t})},rd=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=Qf(n,t.getBody(),e.dom()),u=ta(e,d(ed,t),(o=t.getBody(),function(e){return e.dom()===o})),s=nd(e,a,(i=e,br(t.schema.getTextInlineElements(),lr(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(td).fold(function(){r&&Zf(t,n,s)},function(e){r&&Zf(t,n,_.some(e))})},od=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Os(t?1:-1,e,n),o=_u.fromRangeStart(r),i=ar.fromDom(e),!1===t&&Ff(o)?_.some(jf.remove(o.getNode(!0))):t&&Lf(o)?_.some(jf.remove(o.getNode())):!1===t&&Lf(o)&&Sf(i,o)?Tf(i,o).map(function(e){return jf.remove(e.getNode())}):t&&Ff(o)&&Ef(i,o)?kf(i,o).map(function(e){return jf.remove(e.getNode())}):qf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),rd(o,i,ar.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?_u.before(e):_u.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},id=function(e,t){var n,r=e.selection.getNode();return!!jo.isContentEditableFalse(r)&&(n=ar.fromDom(e.getBody()),z(Qi(n,".mce-offscreen-selection"),Ui),rd(e,t,ar.fromDom(e.selection.getNode())),ql(e),!0)},ad=function(e,t){return e.selection.isCollapsed()?od(e,t):id(e,t)},ud=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(jo.isContentEditableTrue(t)||jo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return jo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(_u.before(t).toRange())),!0},sd=jo.isText,cd=function(e){return sd(e)&&e.data[0]===xa},ld=function(e){return sd(e)&&e.data[e.data.length-1]===xa},fd=function(e){return e.ownerDocument.createTextNode(xa)},dd=function(e,t){return e?function(e){if(sd(e.previousSibling))return ld(e.previousSibling)||e.previousSibling.appendData(xa),e.previousSibling;if(sd(e))return cd(e)||e.insertData(0,xa),e;var t=fd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(sd(e.nextSibling))return cd(e.nextSibling)||e.nextSibling.insertData(0,xa),e.nextSibling;if(sd(e))return ld(e)||e.appendData(xa),e;var t=fd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},md=d(dd,!0),gd=d(dd,!1),pd=function(e,t){return jo.isText(e.container())?dd(t,e.container()):dd(t,e.getNode())},hd=function(e,t){var n=t.get();return n&&e.container()===n&&Ta(n)},vd=function(n,e){return e.fold(function(e){ss.remove(n.get());var t=md(e);return n.set(t),_.some(_u(t,t.length-1))},function(e){return sc.firstPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),1);ss.remove(n.get());var t=pd(e,!0);return n.set(t),_u(t,1)})},function(e){return sc.lastPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),n.get().length-1);ss.remove(n.get());var t=pd(e,!1);return n.set(t),_u(t,t.length-1)})},function(e){ss.remove(n.get());var t=gd(e);return n.set(t),_.some(_u(t,1))})},yd=function(e,t){for(var n=0;no.childNodes.length-1&&(c=!1),jo.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new go(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),jo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){dg(s)},forwardDelete:function(){mg(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return Fg(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=cp(e,function(e){return!!a.matchNode(e,n)});return-1!==lp(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0"),u))[o.length-1]=Xt.extend(o[o.length-1],{func:n,scope:r||i}),Xt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(qp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Xt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),qp($p(Xt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Yp=function(e){var t=Ur(e).dom();return e.dom()===t.activeElement},Gp=function(t){return(e=Ur(t),n=e!==undefined?e.dom():V.document,_.from(n.activeElement).map(ar.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},Jp=function(t,e){return(n=e,n.collapsed?_.from(eu(n.startContainer,n.startOffset)).map(ar.fromDom):_.none()).bind(function(e){return ko(e)?_.some(e):!1===zr(t,e)?_.some(t):_.none()});var n},Qp=function(t,e){Jp(ar.fromDom(t.getBody()),e).bind(function(e){return sc.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},Zp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},eh=function(e){var t,n=e.getBody();return n&&(t=ar.fromDom(n),Yp(t)||Gp(t).isSome())},th=function(e){return e.inline?eh(e):(t=e).iframeElement&&Yp(ar.fromDom(t.iframeElement));var t},nh=function(e){return e.editorManager.setActive(e)},rh=function(e,t){e.removed||(t?nh(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return Zp(u),Qp(t,o),nh(t);t.bookmark!==undefined&&!1===th(t)&&rp(t).each(function(e){t.selection.setRng(e),o=e}),n||(fe.opera||Zp(r),t.getWin().focus()),(fe.gecko||n)&&(Zp(r),Qp(t,o)),nh(t)}(e))},oh=th,ih=function(e,t){return t.dom()[e]},ah=function(e,t){return parseInt(kr(t,e),10)},uh=d(ih,"clientWidth"),sh=d(ih,"clientHeight"),ch=d(ah,"margin-top"),lh=d(ah,"margin-left"),fh=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=ar.fromDom(e.getBody()),p=e.inline?g:(r=g,ar.fromDom(r.dom().ownerDocument.documentElement)),h=(o=e.inline,a=t,u=n,s=(i=p).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+lh(i):0),y:u-(o?s.top+i.dom().clientTop+ch(i):0)});return l=h.x,f=h.y,d=uh(c=p),m=sh(c),0<=l&&0<=f&&l<=d&&f<=m},dh=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,_.from(t).map(ar.fromDom)).map(function(e){return zr(Ur(e),e)}).getOr(!1)};function mh(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0t;var t}},iv=function(n){return function(e){return t=n,e.line===t;var t}},av=jo.isContentEditableFalse,uv=Es,sv=function(e,t){return Math.abs(e.left-t)},cv=function(e,t){return Math.abs(e.right-t)},lv=function(e,t){return e>=t.left&&e<=t.right},fv=function(e,o){return Ht.reduce(e,function(e,t){var n,r;return n=Math.min(sv(e,o),cv(e,o)),r=Math.min(sv(t,o),cv(t,o)),lv(o,t)?t:lv(o,e)?e:r===n&&av(t.node)?t:r=e.top&&n<=e.bottom});return(r=fv(f,t))&&(r=fv((a=e,c=function(t,e){var n;return n=U(ev([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),dv(Jh.Up,a,d(c,Ga),u.node),dv(Jh.Down,a,d(c,Ja),u.node),s),t))&&gs(r.node)?(i=t,{node:(o=r).node,before:sv(o,i)i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=xv(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),wv(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},Ev=function(e){var n;Nv(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(vv(t)||vv(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Sv=function(t){var e=Vi(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=sg(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Tv=jo.isContentEditableTrue,kv=jo.isContentEditableFalse,_v=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Tv(t)||kv(t))return t;t=t.parentNode}return null},Av=function(g){var p,e,t,a=g.getBody(),o=ds(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return oh(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},y=function(e,t){return t=Os(e,a,t),-1===e?_u.fromRangeStart(t):_u.fromRangeEnd(t)},n=function(e){return ka(e)||Oa(e)||Ba(e)},b=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e){var t=g.schema.getShortEndedElements(),n=g.dom.createRng(),r=e.startContainer,o=e.startOffset,i=e.endContainer,a=e.endOffset;return br(t,r.nodeName.toLowerCase())?0===o?n.setStartBefore(r):n.setStartAfter(r):n.setStart(r,o),br(t,i.nodeName.toLowerCase())?0===a?n.setEndBefore(i):n.setEndAfter(i):n.setEnd(i,a),n},l=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!b(e))if(!1===t){if(c=y(-1,e),gs(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(gs(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=y(1,e),gs(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(gs(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&kv(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&i===e.endContainer&&(n=i.childNodes[a]),kv(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=oa(ar.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('
    ').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&fe.ie?(r.empty().append('

    \xa0

    ').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),z(Qi(ar.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){Sr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},f=function(){p&&(p.removeAttribute("data-mce-selected"),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null},C=function(){o.hide()};return fe.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&fh(g,e.clientX,e.clientY)&&u(ug(g,t,!1))}),g.on("click",function(e){var t;(t=_v(g,e.target))&&(kv(t)&&(e.preventDefault(),g.focus()),Tv(t)&&g.dom.isChildOf(t,g.selection.getNode())&&f())}),g.on("blur NewBlock",function(){f()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==kv(_v(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Js(e);if(!e.firstChild)return!1;var n=_u.before(e.firstChild),r=t.next(n);return r&&!Lf(r)&&!Ff(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=_v(n,e.target);kv(t)&&(r||(e.preventDefault(),l(ag(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==fh(g,e.clientX,e.clientY))if(t=_v(g,n))kv(t)?(e.preventDefault(),l(ag(g,t))):(f(),Tv(t)&&e.shiftKey||gv(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===gs(n)){f(),C();var r=mv(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){Zh.modifierPressed(e)||(e.keyCode,kv(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){e.range=c(e.range);var t=l(e.range,e.forward);t&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||f()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!fe.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),Ev(g),Sv(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Pa(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Rv=function(e){for(var t=e;/)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0k(n)?(C=_(b*y),b=_(C/y)):(b=_(C/y),C=_(b*y))),N.setStyles(D(s),{width:b,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=b+" × "+C,f[2]<0&&s.clientWidth<=b&&N.setStyle(s,"left",g+(h-b)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=A.scrollWidth-x)+(n=A.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(wp(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",b),e("height",C),N.unbind(S,"mousemove",B),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",B),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),Np(a,u,b,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;I(),M(),t=N.getPos(e,A),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,b=C=0),n=a.fire("ObjectSelected",{target:e}),O(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===fe.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,y=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=A.scrollWidth,w=A.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),A.appendChild(s),N.bind(S,"mousemove",B),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",B),N.bind(T,"mouseup",P)),c=N.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):I(),u.setAttribute("data-mce-selected","1")},I=function(){var e,t;for(e in M(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},L=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],A)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):I())},F=function(e){return Sb(function(e,t){for(;t&&t!==e;){if(Tb(t)||Sb(t))return t;t=t.parentNode}return null}(a.getBody(),e))},M=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},z=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){z(),fe.ie&&11<=fe.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||F(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(A,"mscontrolselect",function(e){var t=function(e){he.setEditorTimeout(a,function(){a.selection.select(e)})};if(F(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=he.throttle(function(e){a.composing||L(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",I),a.on("contextmenu",n)}),a.on("remove",M),{isResizable:O,showResizeRect:o,hideResizeRect:I,updateResizeRect:L,destroy:function(){u=s=null}}},_b=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},Ab=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&jo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=_b(t).y-_b(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+ai.left&&a.rightr.top&&o.bottome?t.cells().length:e},0)},Ub=function(e,t){for(var n=e.rows(),r=0;r_
    ',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('_'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Zb=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return _.from(i).map(ar.fromDom).map(function(e){return r&&t.collapsed?e:Xr(e,o(e,a)).getOr(e)}).bind(function(e){return dr(e)?_.some(e):Vr(e)}).map(function(e){return e.dom()}).getOr(e)},eC=function(e,t,n){return Zb(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},tC=function(e,t,n){return Zb(e,t,!1,n,function(e,t){return 0t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return Ab(c,e,t)},placeCaretAt:function(e,t){return i(Ob(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?_u.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=Eb(p),t=kb(p,c),p.bookmarkManager=n,p.controlSelection=t,p};(Nb=wb||(wb={}))[Nb.Br=0]="Br",Nb[Nb.Block=1]="Block",Nb[Nb.Wrap=2]="Wrap",Nb[Nb.Eol=3]="Eol";var uC=function(e,t){return e===Tu.Backwards?t.reverse():t},sC=function(e,t,n,r){for(var o,i,a,u,s,c,l=Js(n),f=r,d=[];f&&(s=l,c=f,o=t===Tu.Forwards?s.next(c):s.prev(c));){if(jo.isBr(o.getNode(!1)))return t===Tu.Forwards?{positions:uC(t,d).concat([o]),breakType:wb.Br,breakAt:_.some(o)}:{positions:uC(t,d),breakType:wb.Br,breakAt:_.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,jo.isBr(u.getNode(i===Tu.Forwards))?wb.Br:!1===Ts(a,u)?wb.Block:wb.Wrap);return{positions:uC(t,d),breakType:m,breakAt:_.some(o)}}d.push(o),f=o}else f=o}return{positions:uC(t,d),breakType:wb.Eol,breakAt:_.none()}},cC=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Tu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},lC=function(e,i){return j(e,function(e,o){return e.fold(function(){return _.some(o)},function(r){return ru(Z(r.getClientRects()),Z(o.getClientRects()),function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},_.none())},fC=function(t,e){return Z(e.getClientRects()).bind(function(e){return lC(t,e.left)})},dC=d(sC,Su.isAbove,-1),mC=d(sC,Su.isBelow,1),gC=d(cC,-1,dC),pC=d(cC,1,mC),hC=jo.isContentEditableFalse,vC=Za,yC=function(e,t,n,r){var o=e===Tu.Forwards,i=o?Lf:Ff;if(!r.collapsed){var a=vC(r);if(hC(a))return ig(e,t,a,e===Tu.Backwards,!0)}var u=Sa(r.startContainer),s=Ps(e,t.getBody(),r);if(i(s))return ag(t,s.getNode(!o));var c=Vl.normalizePosition(o,n(s));if(!c)return u?r:null;if(i(c))return ig(e,t,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&Fs(c,l)?ig(e,t,l.getNode(!o),o,!0):u?sg(t,c.toRange(),!0):null},bC=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=vC(r),o=Ps(e,t.getBody(),r),i=n(t.getBody(),ov(1),o),a=U(i,iv(1)),s=Ht.last(o.getClientRects()),(Lf(o)||zf(o))&&(d=o.getNode()),(Ff(o)||Uf(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=fv(a,c))&&hC(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),ig(e,t,u.node,l'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},xC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Js((e=l).getBody()),o=d(Ls,r.next),i=d(Ls,r.prev),a=t?Tu.Forwards:Tu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=yC(a,e,u,s))?n:(n=CC(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},wC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?rv:nv,i=(e=u).selection.getRng(),(n=bC(r,e,o,i))?n:(n=CC(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},NC=function(r,o){return function(){var t,e=o?_u.fromRangeEnd(r.selection.getRng()):_u.fromRangeStart(r.selection.getRng()),n=o?mC(r.getBody(),e):dC(r.getBody(),e);return(o?ee(n.positions):Z(n.positions)).filter((t=o,function(e){return t?Ff(e):Lf(e)})).fold(q(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},EC=function(e,t,n,r,o){var i,a,u,s,c=Qi(ar.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=Ka(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,j(a,function(e,r){return e.fold(function(){return _.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return _.some(nt}),kC=function(t,n){return Z(n.getClientRects()).bind(function(e){return SC(t,e.left,e.top)}).bind(function(e){return fC((t=e,sc.lastPositionIn(t).map(function(e){return dC(t,e).positions.concat(e)}).getOr([])),n);var t})},_C=function(t,n){return ee(n.getClientRects()).bind(function(e){return TC(t,e.left,e.top)}).bind(function(e){return fC((t=e,sc.firstPositionIn(t).map(function(e){return[e].concat(mC(t,e).positions)}).getOr([])),n);var t})},AC=function(e,t){e.selection.setRng(t),Rb(e,t)},RC=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===wb.Wrap&&0===a.positions.length||!jo.isBr(n.getNode())&&(i=u).breakType===wb.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},DC=d(RC,dC),OC=d(RC,mC),BC=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(ms()&&(o=t,i=s,a=n,u=_u.fromRangeStart(i),sc.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=ig(c,e,n,!t,!0);return AC(e,l),!0}return!1},PC=function(e,t){var n=t.getNode(e);return jo.isElement(n)&&"TABLE"===n.nodeName?_.some(n):_.none()},IC=function(u,s,c){var e=PC(!!s,c),t=!1===s;e.fold(function(){return AC(u,c.toRange())},function(a){return sc.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return AC(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Nl(r=u))?r.undoManager.transact(function(){var e=ar.fromTag(i);Nr(e,El(r)),Fi(e,ar.fromTag("br")),n?Ii(ar.fromDom(o),e):Pi(ar.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),AC(r,t)}):AC(r,t.toRange()));var n,r,o,t,i})})},LC=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=_u.fromRangeStart(l),d=e.getBody();if(!t&&DC(r,f)){var m=(u=d,kC(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return lC(gC(u,_u.before(s)),e.left)})}).getOr(_u.before(s)));return IC(e,t,m),!0}return!(!t||!OC(r,f))&&(o=d,m=_C(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return lC(pC(o,_u.after(i)),e.left)})}).getOr(_u.after(i)),IC(e,t,m),!0)},FC=function(t,n){return function(){return _.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return _.from(t.dom.getParent(e,"table")).map(function(e){return BC(t,n,e)})}).getOr(!1)}},MC=function(n,r){return function(){return _.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return _.from(n.dom.getParent(t,"table")).map(function(e){return LC(n,r,e,t)})}).getOr(!1)}},zC=function(e){return F(["figcaption"],lr(e))},UC=function(e){var t=V.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},jC=function(e,t,n){n?Fi(e,t):Li(e,t)},VC=function(e,t,n,r){return""===t?(l=e,f=r,d=ar.fromTag("br"),jC(l,d,f),UC(d)):(o=e,i=r,a=t,u=n,s=ar.fromTag(a),c=ar.fromTag("br"),Nr(s,u),Fi(s,c),jC(o,s,i),UC(c));var o,i,a,u,s,c,l,f,d},HC=function(e,t,n){return t?(o=e.dom(),mC(o,n).breakAt.isNone()):(r=e.dom(),dC(r,n).breakAt.isNone());var r,o},qC=function(t,n){var e,r,o,i=ar.fromDom(t.getBody()),a=_u.fromRangeStart(t.selection.getRng()),u=Nl(t),s=El(t);return(e=a,r=i,o=d(Mr,r),na(ar.fromDom(e.container()),Co,o).filter(zC)).exists(function(){if(HC(i,n,a)){var e=VC(i,u,s,n);return t.selection.setRng(e),!0}return!1})},$C=function(e,t){return function(){return!!e.selection.isCollapsed()&&qC(e,t)}},WC=function(e,r){return G(W(e,function(e){return Yy({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},KC=function(e){for(var t=[],n=1;n'},cx=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},lx=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},fx=function(e,t,n){return!1===jo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===xa?0:n:n===t.data.length-1&&t.data.charAt(n)===xa?t.data.length:n},dx=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},mx=function(o,i,e){_.from(e.style).map(o.dom.parseStyle).each(function(e){var t=function(e){var t={},n=e.dom();if(Cr(n))for(var r=0;rs.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&jo.isText(s)?s.nodeValue.length:0),(u=dx(x,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=dx(m,r);if(!(a=m.getParent(r,m.isBlock))||!lx(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),gx(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),gx(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,E,s,i)),c=x.getParent(s,x.isBlock),l=c?x.getParent(c.parentNode,x.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&x.isEmpty(c)?ux(a,S,l,c,m):m&&c===a.getBody()||(m=m||"P",Sa(c)?(r=Pa(c),x.isEmpty(c)&&sx(c),gx(a,r),QC(a,r)):T()?k():T(!0)?(r=c.parentNode.insertBefore(S(),c),QC(a,cx(c,"HR")?r:c)):((t=(b=E,C=b.cloneRange(),C.setStart(b.startContainer,fx(!0,b.startContainer,b.startOffset)),C.setEnd(b.endContainer,fx(!1,b.endContainer,b.endOffset)),C).cloneRange()).setEndAfter(c),o=t.extractContents(),y=o,z(Ji(ar.fromDom(y),mr),function(e){var t=e.dom();t.nodeValue=wa(t.nodeValue)}),function(e){for(;jo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,x.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;jo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(x,N,r),p=x,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),x.isEmpty(c)&&sx(c),r.normalize(),x.isEmpty(r)?(x.remove(r),k()):(gx(a,r),QC(a,r))),x.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},hx=function(e,t){return ex(e).filter(function(e){return 0",yl(f)!==f.documentBaseUrl&&(g+=''),g+='',d=bl(f),m=Cl(f),xl(f)&&(g+=''),g+='
    '),Cw.add(t.iframeContainer,l),p},ww=function(e,t){var n=xw(e,t);t.editorContainer&&(Cw.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=Cw.isHidden(t.editorContainer)),e.getElement().style.display="none",Cw.setAttrib(e.id,"aria-hidden","true"),n||bw(e)},Nw=Si.DOM,Ew=function(t,n,e){var r=Eh.get(e),o=Eh.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=Xt.trim(e),r&&-1===Xt.inArray(n,e)){if(Xt.each(Eh.dependencies(e),function(e){Ew(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(iE){Nh.pluginInitError(t,e,iE)}}},Sw=function(e){return e.replace(/^\-/,"")},Tw=function(e){return{editorContainer:e,iframeContainer:e}},kw=function(e){var t,n,r=e.getElement();return e.inline?Tw(null):(t=r,n=Nw.create("div"),Nw.insertAfter(n,t),Tw(n))},_w=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,S(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Nw.getStyle(f,"width")||"100%",a=l.height||Nw.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))=n.length)for(r=0,o=e.length;r=n.length||e[r]!==n[r]){i=r+1;break}if(e.length=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r]*>( | |\\s|\xa0|
    |)<\\/"+a+">[\r\n]*|
    [\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||Ao(ar.fromDom(n))?t.content=r:t.content=Xt.trim(r),t.no_events||e.fire("GetContent",t),t.content},jw=function(e,t){t(e),e.firstChild&&jw(e.firstChild,t),e.next&&jw(e.next,t)},Vw=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&jw(t.firstChild,function(t){z(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),z(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);z(r,function(t){z(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Hw=function(e){return e instanceof ob},qw=function(e,t){var r;e.dom.setHTML(e.getBody(),t),oh(r=e)&&sc.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=jo.isTable(t)?sc.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},$w=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Hw(s)?"":s,Hw(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),_.from(u.getBody()).fold(q(s),function(e){return Hw(s)?function(e,t,n,r){Vw(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=al({validate:e.validate},e.schema).serialize(n);return r.content=Ao(ar.fromDom(t))?o:Xt.trim(o),qw(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='
    ',"TABLE"===n.nodeName?r=""+a+"":/^(UL|OL)$/.test(n.nodeName)&&(r="
  • "+a+"
  • "),(i=Nl(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='
    '),qw(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=al({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Ao(ar.fromDom(n))?r:Xt.trim(r),qw(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Ww=Si.DOM,Kw=function(e){return _.from(e).each(function(e){return e.destroy()})},Xw=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Ww.remove(o.nextSibling),bp(e),e.editorManager.remove(e),!e.inline&&r&&(i=e,Ww.setStyle(i.id,"display",i.orgDisplay)),Cp(e),Ww.remove(e.getContainer()),Kw(t),Kw(n),e.destroy()}var i},Yw=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Kw(i),Kw(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),Ww.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Gw=Si.DOM,Jw=Xt.extend,Qw=Xt.each,Zw=Xt.resolve,eN=fe.ie,tN=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"40px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=jp(Ip,c,a,u),l.settings=t,Bi.language=t.language||"en",Bi.languageLoad=t.language_load,Bi.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new zw(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Xp(l),l.loadedCSS={},l.editorCommands=new fp(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(fe.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(fe.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=gn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Jw(tN.prototype={render:function(){Bw(this)},focus:function(e){rh(this,e)},hasFocus:function(){return oh(this)},execCallback:function(e){for(var t=[],n=1;n=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=ON(e.x,t.x),r=ON(e.y,t.y),o=DN(e.x+e.w,t.x+t.w),i=DN(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:IN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=ON(0,t.x-u),o=ON(0,t.y-s),i=ON(0,c-f),a=ON(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),IN(u,s,(c-=i)-u,(l-=a)-s)},create:IN,fromClientRect:function(e){return IN(e.left,e.top,e.width,e.height)}},FN={},MN={add:function(e,t){FN[e.toLowerCase()]=t},has:function(e){return!!FN[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=FN.hasOwnProperty(t)?FN[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=FN[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},zN=Xt.each,UN=Xt.extend,jN=function(){};jN.extend=_N=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!AN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in AN=!0,e=new this,AN=!1,n.Mixins&&(zN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&zN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&zN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&zN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=UN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=_N,i};var VN=Math.min,HN=Math.max,qN=Math.round,$N=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r+~]|"+at+")"+at+"*"),mt=new RegExp("="+at+"*([^\\]'\"]*?)"+at+"*\\]","g"),gt=new RegExp(ct),pt=new RegExp("^"+ut+"$"),ht={ID:new RegExp("^#("+ut+")"),CLASS:new RegExp("^\\.("+ut+")"),TAG:new RegExp("^("+ut+"|[*])"),ATTR:new RegExp("^"+st),PSEUDO:new RegExp("^"+ct),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+at+"*(even|odd|(([+-]|)(\\d*)n|)"+at+"*(?:([+-]|)"+at+"*(\\d+)|))"+at+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+at+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+at+"*((?:-\\d)?\\d*)"+at+"*\\)|)(?=[^-]|$)","i")},vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/^[^{]+\{\s*\[native \w/,Ct=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,wt=/'|\\/g,Nt=new RegExp("\\\\([\\da-f]{1,6}"+at+"?|("+at+")|.)","ig"),Et=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{rt.apply(et=ot.call($e.childNodes),$e.childNodes),et[$e.childNodes.length].nodeType}catch(iE){rt={apply:et.length?function(e,t){nt.apply(e,ot.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var St=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:$e)!==Me&&Fe(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Me).nodeType)&&9!==u)return[];if(Ue&&!r){if(o=Ct.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&He(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return rt.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&ke.getElementsByClassName)return rt.apply(n,t.getElementsByClassName(a)),n}if(ke.qsa&&(!je||!je.test(e))){if(f=l=qe,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=De(e),(l=t.getAttribute("id"))?f=l.replace(wt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Pt(c[s]);d=xt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return rt.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return Be(e.replace(lt,"$1"),t,n,r)};function Tt(){var r=[];return function e(t,n){return r.push(t+" ")>_e.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function kt(e){return e[qe]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function At(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Rt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Dt(a){return kt(function(i){return i=+i,kt(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Qe&&e}for(Te in ke=St.support={},Re=St.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Fe=St.setDocument=function(e){var t,s=e?e.ownerDocument||e:$e,n=s.defaultView;return s!==Me&&9===s.nodeType&&s.documentElement?(ze=(Me=s).documentElement,Ue=!Re(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Fe()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Fe()})),ke.attributes=!0,ke.getElementsByTagName=!0,ke.getElementsByClassName=bt.test(s.getElementsByClassName),ke.getById=!0,_e.find.ID=function(e,t){if(typeof t.getElementById!==Qe&&Ue){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_e.filter.ID=function(e){var t=e.replace(Nt,Et);return function(e){return e.getAttribute("id")===t}},_e.find.TAG=ke.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Qe)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},_e.find.CLASS=ke.getElementsByClassName&&function(e,t){if(Ue)return t.getElementsByClassName(e)},Ve=[],je=[],ke.disconnectedMatch=!0,je=je.length&&new RegExp(je.join("|")),Ve=Ve.length&&new RegExp(Ve.join("|")),t=bt.test(ze.compareDocumentPosition),He=t||bt.test(ze.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Je=t?function(e,t){if(e===t)return Le=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!ke.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===$e&&He($e,e)?-1:t===s||t.ownerDocument===$e&&He($e,t)?1:Ie?it.call(Ie,e)-it.call(Ie,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Le=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:Ie?it.call(Ie,e)-it.call(Ie,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===$e?-1:u[r]===$e?1:0},s):Me},St.matches=function(e,t){return St(e,null,null,t)},St.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Me&&Fe(e),t=t.replace(mt,"='$1']"),ke.matchesSelector&&Ue&&(!Ve||!Ve.test(t))&&(!je||!je.test(t)))try{var n=(void 0).call(e,t);if(n||ke.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(iE){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Nt,Et),e[3]=(e[3]||e[4]||e[5]||"").replace(Nt,Et),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||St.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&St.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ht.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&>.test(n)&&(t=De(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Nt,Et).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Xe[e+" "];return t||(t=new RegExp("(^|"+at+")"+e+"("+at+"|$)"))&&Xe(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Qe&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=St.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1)[^>]*$|#([\w\-]*)$)/,Zt=Se.Event,en=Xt.makeMap("children,contents,next,prev"),tn=function(e){return void 0!==e},nn=function(e){return"string"==typeof e},rn=function(e,t){var n,r,o;for(o=(t=t||Yt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},on=function(e,t,n,r){var o;if(nn(t))t=rn(t,bn(e[0]));else if(t.length&&!t.nodeType){if(t=gn.makeArray(t),r)for(o=t.length-1;0<=o;o--)on(e,t[o],n,r);else for(o=0;o"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Qt.exec(e)))return gn(t).find(e);if(n[1])for(r=rn(e,bn(t)).firstChild;r;)Gt.call(o,r),r=r.nextSibling;else{if(!(r=bn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Xt.toArray(this)},add:function(e,t){var n,r,o=this;if(nn(e))return o.add(gn(e));if(!1!==t)for(n=gn.unique(o.toArray().concat(gn.makeArray(e))),o.length=n.length,r=0;r=a.length&&r(o)}))})})},co=function(e){return so(e,uo.nu)},lo=function(n){return{is:function(e){return n===e},isValue:C,isError:b,getOr:q(n),getOrThunk:q(n),getOrDie:q(n),or:function(e){return lo(n)},orThunk:function(e){return lo(n)},fold:function(e,t){return t(n)},map:function(e){return lo(e(n))},mapError:function(e){return lo(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return _.some(n)}}},fo=function(n){return{is:b,isValue:b,isError:C,getOr:$,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return fo(n)},mapError:function(e){return fo(e(n))},each:o,bind:function(e){return fo(n)},exists:b,forall:C,toOption:_.none}},mo={value:lo,error:fo,fromOption:function(e,t){return e.fold(function(){return fo(t)},lo)}};function go(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var po,ho,vo,yo=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xo=/[<>&\"\']/g,Yo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Go={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};ho={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},vo={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Jo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n>10),56320+(1023&t))):Go[t]||String.fromCharCode(t):vo[e]||po[e]||(n=e,(r=ar.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},ni={},ri={},oi=Xt.makeMap,ii=Xt.each,ai=Xt.extend,ui=Xt.explode,si=Xt.inArray,ci=function(e,t){return(e=Xt.trim(e))?e.split(t||" "):[]},li=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n
    ').css(n).appendTo(a)[0];return c.set(_.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&gn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=fs(a,e.element,e.before);gn(e.caret).css(t)})},destroy:function(){return he.clearInterval(t)}}},ms=function(){return cs.isIE()||cs.isEdge()||cs.isFirefox()},gs=function(e){return ls(e)||jo.isTable(e)&&ms()},ps=jo.isContentEditableFalse,hs=jo.matchStyleValues("display","block table table-cell table-caption list-item"),vs=ka,ys=Sa,bs=jo.isElement,Cs=Ha,xs=function(e){return 0=o.data.length-1)return 1===e&&(r=s(o))?Rs(r):n;if(Oa(o)&&i<=1)return-1===e&&(r=u(o))?Ds(r):n;if(i===o.data.length)return(r=s(o))?Rs(r):n;if(0===i)return(r=u(o))?Ds(r):n}return n},Bs=function(e,t){return _.from(ks(e?0:-1,t)).filter(ps)},Ps=function(e,t,n){var r=Os(e,t,n);return-1===e?Su.fromRangeStart(r):Su.fromRangeEnd(r)},Is=function(e){return _.from(e.getNode()).map(ar.fromDom)},Ls=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Fs=function(e,t){var n=Ts(e,t);return!(n||!jo.isBr(e.getNode()))||n};(ku=Tu||(Tu={}))[ku.Backwards=-1]="Backwards",ku[ku.Forwards=1]="Forwards";var Ms,zs,Us,js=jo.isContentEditableFalse,Vs=jo.isText,Hs=jo.isElement,qs=jo.isBr,$s=Ha,Ws=function(e){return Ua(e)||!!qa(t=e)&&!0!==j(te(t.getElementsByTagName("*")),function(e,t){return e||Ia(t)},!1);var t},Ks=$a,Xs=function(e,t){return e.hasChildNodes()&&tu.length-1)return!!fc(c,i,r)||lc(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},mc=function(e){return jo.isText(e)&&0=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=b(l,n)||l,i=b(d,n)||d,C(l,r,!0),(s=y(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Fc=(Ms=mr,zs="text",{get:function(e){if(!Ms(e))throw new Error("Can only get "+zs+" value of a "+zs+" node");return Us(e).getOr("")},getOption:Us=function(e){return Ms(e)?_.from(e.dom().nodeValue):_.none()},set:function(e,t){if(!Ms(e))throw new Error("Can only set raw "+zs+" value of a "+zs+" node");e.dom().nodeValue=t}}),Mc=function(e){return Fc.get(e)},zc=function(r,o,i,a){return Vr(o).fold(function(){return"skipping"},function(e){return"br"===a||mr(n=o)&&"\ufeff"===Mc(n)?"valid":dr(t=o)&&Gi(t,aa())?"existing":Ju(o)?"caret":wc.isValid(r,i,a)&&wc.isValid(r,lr(e),i)?"valid":"invalid-child";var t,n})},Uc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++ga+String(i)):a,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Uc(s.getDoc(),f,c,l.decorate);ya(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=Yu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();jc(s,u,c,l.decorate,f),s.selection.moveToBookmark(a)}})};function Hc(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?_.from(n[e]).map(function(e){return e.settings}):_.none()}});da(s,r);var o=fa(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){Vc(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ca(s,_.some(e)).each(function(e){var t=e.elements;z(t,ji)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=ar.fromDom(t.getBody()),o=Qi(r,"["+ua()+'="'+n+'"]'),i={},z(o,function(e){var t=Er(e,sa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return W(e,function(e){return e.dom()})},vr(u,function(e,t){return{k:t,v:a(e,t)}})}}}var qc=function(e){return Xt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},$c=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||jo.isBr(t));var t},Wc=function(e){return 0'))},rl=function(n){Gr(n).each(function(t){Hr(t).each(function(e){Co(n)&&wo(t)&&Co(e)&&Ui(t)})})},ol=Xt.makeMap;function il(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=ol(e.indent_before||""),c=ol(e.indent_after||""),l=ti.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0":" />",n&&u&&c[e]&&0"),u&&c[e]&&0")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push(""):d.push(""),u&&d.push("\n")},doctype:function(e){d.push("",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function al(t,g){void 0===g&&(g=di());var p=il(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1|)$/," "):o("nextSibling")||(t=t.replace(/( | )(
    |)$/," "))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=al({validate:e.settings.validate},e.schema),d='​',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,y,b,C,x,w=(l=g.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&g.isCollapsed()&&p.isBlock(N.firstChild)&&(h=e,(v=N.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&p.isEmpty(N.firstChild)&&((l=p.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(cl(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),y=e.selection.getRng(),b=t,C=y.startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(b)||(b+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var E,S,T,k={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,k),!0===n.paste&&Gc(e.schema,u)&&Qc(p,i))return l=Jc(o,p,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!p.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(fl(e,d),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:p.getOuterHTML(i),t=o.serialize(r.parse(t.replace(//i,function(){return o.serialize(u)}))),i===a?p.setHTML(a,t):p.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):fl(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new el(r);Xt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),fe.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),ll(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=_u.fromRangeStart(e);if(t=Js(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,p.get("mce_marker")),E=e.getBody(),Xt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,T=e.selection.getStart(),_.from(S.getParent(T,"td,th")).map(ar.fromDom).each(rl),e.fire("SetContent",s),e.addVisual()}},ml=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Xt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};dl(e,o.content,o.details)},gl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,pl=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},hl=function(e){return e.getParam("iframe_attrs",{})},vl=function(e){return e.getParam("doctype","")},yl=function(e){return e.getParam("document_base_url","")},bl=function(e){return pl(e,"body_id","tinymce")},Cl=function(e){return pl(e,"body_class","")},xl=function(e){return e.getParam("content_security_policy","")},wl=function(e){return e.getParam("br_in_pre",!0)},Nl=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},El=function(e){return e.getParam("forced_root_block_attrs",{})},Sl=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Tl=function(e){return e.getParam("no_newline_selector","")},kl=function(e){return e.getParam("keep_styles",!0)},_l=function(e){return e.getParam("end_container_on_empty_block",!1)},Al=function(e){return Xt.explode(e.getParam("font_size_style_values",""))},Rl=function(e){return Xt.explode(e.getParam("font_size_classes",""))},Dl=function(e){return e.getParam("images_dataimg_filter",q(!0),"function")},Ol=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Bl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Pl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},Il=function(e){return e.getParam("images_upload_url","","string")},Ll=function(e){return e.getParam("images_upload_base_path","","string")},Fl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Ml=function(e){return e.getParam("images_upload_handler",null,"function")},zl=function(e){return e.getParam("content_css_cors",!1,"boolean")},Ul=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},jl=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Ta(n)?jo.isText(n.nextSibling)?_u(n.nextSibling,0):_u.after(n):Aa(t)?_u(n,r+1):t:Ta(n)?jo.isText(n.previousSibling)?_u(n.previousSibling,n.previousSibling.data.length):_u.before(n):Ra(t)?_u(n,r-1):t},Vl={isInlineTarget:function(e,t){return Lr(ar.fromDom(t),Ul(e))},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(Si.DOM.getParents(i.container(),"*",o),r));return _.from(a[a.length-1])},isRtl:function(e){return"rtl"===Si.DOM.getStyle(e,"direction",!0)||(t=e.textContent,gl.test(t));var t},isAtZwsp:function(e){return Aa(e)||Ra(e)},normalizePosition:jl,normalizeForwards:d(jl,!0),normalizeBackwards:d(jl,!1),hasSameParentBlock:function(e,t,n){var r=Ss(t,e),o=Ss(n,e);return r&&r===o}},Hl=function(e,t){return zr(e,t)?na(t,function(e){return No(e)||So(e)},(n=e,function(e){return Mr(n,ar.fromDom(e.dom().parentNode))})):_.none();var n},ql=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},$l=function(i,a,u){return ru(sc.firstPositionIn(u),sc.lastPositionIn(u),function(e,t){var n=Vl.normalizePosition(!0,e),r=Vl.normalizePosition(!1,t),o=Vl.normalizePosition(!1,a);return i?sc.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):sc.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Wl=function(e,t){var n,r,o,i=ar.fromDom(e),a=ar.fromDom(t);return n=a,r="pre,code",o=d(Mr,i),ra(n,r,o).isSome()},Kl=function(e,t){return Ha(t)&&!1===(r=e,o=t,jo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===Wl(r,o))||(n=t,jo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Xl(t);var n,r,o},Xl=jo.hasAttribute("data-mce-bookmark"),Yl=jo.hasAttribute("data-mce-bogus"),Gl=jo.hasAttributeValue("data-mce-bogus","all"),Jl=function(e){return function(e){var t,n,r=0;if(Kl(e,e))return!1;if(!(n=e.firstChild))return!0;t=new go(n,e);do{if(Gl(n))n=t.next(!0);else if(Yl(n))n=t.next();else if(jo.isBr(n))r++,n=t.next();else{if(Kl(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Ql=Ar("block","position"),Zl=Ar("from","to"),ef=function(e,t){var n=ar.fromDom(e),r=ar.fromDom(t.container());return Hl(n,r).map(function(e){return Ql(e,t)})},tf=function(o,i,e){var t=ef(o,_u.fromRangeStart(e)),n=t.bind(function(e){return sc.fromPosition(i,o,e.position()).bind(function(e){return ef(o,e).map(function(e){return t=o,n=i,r=e,jo.isBr(r.position().getNode())&&!1===Jl(r.block())?sc.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?sc.fromPosition(n,t,e).bind(function(e){return ef(t,e)}):_.some(r)}).getOr(r):r;var t,n,r})})});return ru(t,n,Zl).filter(function(e){return!1===Mr((r=e).from().block(),r.to().block())&&Vr((n=e).from().block()).bind(function(t){return Vr(n.to().block()).filter(function(e){return Mr(t,e)})}).isSome()&&(t=e,!1===jo.isContentEditableFalse(t.from().block().dom())&&!1===jo.isContentEditableFalse(t.to().block().dom()));var t,n,r})},nf=function(e,t,n){return n.collapsed?tf(e,t,n):_.none()},rf=function(e,t,n){return zr(t,e)?function(e,t){for(var n=D(t)?t:b,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=ar.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Mr(e,t)}).slice(0,-1):[]},of=function(e,t){return rf(e,t,q(!1))},af=of,uf=function(e,t){return[e].concat(of(e,t))},sf=function(e){var t,n=(t=Kr(e),Y(t,Co).fold(function(){return t},function(e){return t.slice(0,e)}));return z(n,Ui),n},cf=function(e,t){var n=uf(t,e);return X(n.reverse(),Jl).each(Ui)},lf=function(e,t,n,r){if(Jl(n))return nl(n),sc.firstPositionIn(n.dom());0===U($r(r),function(e){return!Jl(e)}).length&&Jl(t)&&Pi(r,ar.fromTag("br"));var o=sc.prevPosition(n.dom(),_u.before(r.dom()));return z(sf(t),function(e){Pi(r,e)}),cf(e,t),o},ff=function(e,t,n){if(Jl(n))return Ui(n),Jl(t)&&nl(t),sc.firstPositionIn(t.dom());var r=sc.lastPositionIn(n.dom());return z(sf(t),function(e){Fi(n,e)}),cf(e,t),r},df=function(e,t){return zr(t,e)?(n=uf(e,t),_.from(n[n.length-1])):_.none();var n},mf=function(e,t){sc.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(ar.fromDom).filter(wo).each(Ui)},gf=function(e,t,n){return mf(!0,t),mf(!1,n),df(t,n).fold(d(ff,e,t,n),d(lf,e,t,n))},pf=function(e,t,n,r){return t?gf(e,r,n):gf(e,n,r)},hf=function(t,n){var e,r=ar.fromDom(t.getBody());return(e=nf(r.dom(),n,t.selection.getRng()).bind(function(e){return pf(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},vf=function(e,t){var n=ar.fromDom(t),r=d(Mr,e);return ta(n,_o,r).isSome()},yf=function(e,t){var n,r,o=sc.prevPosition(e.dom(),_u.fromRangeStart(t)).isNone(),i=sc.nextPosition(e.dom(),_u.fromRangeEnd(t)).isNone();return!(vf(n=e,(r=t).startContainer)||vf(n,r.endContainer))&&o&&i},bf=function(e){var n,r,o,t,i=ar.fromDom(e.getBody()),a=e.selection.getRng();return yf(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ru(Hl(n,ar.fromDom(o.startContainer)),Hl(n,ar.fromDom(o.endContainer)),function(e,t){return!1===Mr(e,t)&&(o.deleteContents(),pf(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},Cf=function(e,t){return!e.selection.isCollapsed()&&bf(e)},xf=function(a){if(!k(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return z(a,function(e,r){var t=gr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,j((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},Wf=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return $f(e,t,o)},Kf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===_u.isTextPosition(n)&&o===r.parentNode&&i>_u.before(r).offset()?_u(t.container(),t.offset()-1):t;var n,r,o,i},Xf=function(e){return Ha(e.previousSibling)?_.some((t=e.previousSibling,jo.isText(t)?_u(t,t.data.length):_u.after(t))):e.previousSibling?sc.lastPositionIn(e.previousSibling):_.none();var t},Yf=function(e){return Ha(e.nextSibling)?_.some((t=e.nextSibling,jo.isText(t)?_u(t,0):_u.before(t))):e.nextSibling?sc.firstPositionIn(e.nextSibling):_.none();var t},Gf=function(r,o){return Xf(o).orThunk(function(){return Yf(o)}).orThunk(function(){return e=r,t=o,n=_u.before(t.previousSibling?t.previousSibling:t.parentNode),sc.prevPosition(e,n).fold(function(){return sc.nextPosition(e,_u.after(t))},_.some);var e,t,n})},Jf=function(n,r){return Yf(r).orThunk(function(){return Xf(r)}).orThunk(function(){return e=n,t=r,sc.nextPosition(e,_u.after(t)).fold(function(){return sc.prevPosition(e,_u.before(t))},_.some);var e,t})},Qf=function(e,t,n){return(r=e,o=t,i=n,r?Jf(o,i):Gf(o,i)).map(d(Kf,n));var r,o,i},Zf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},ed=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(lr(t))},td=function(e){if(Jl(e)){var t=ar.fromHtml('
    ');return zi(e),Fi(e,t),_.some(_u.before(t.dom()))}return _.none()},nd=function(e,t,l){var n,r,o,i,a=Hr(e).filter(mr),u=qr(e).filter(mr);return Ui(e),(n=a,r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Jn((r=u).data).length,r.appendData(o.data),Ui(ar.fromDom(o)),i&&Wf(r,a),n.container()===s?_u(u,c):n},n.isSome()&&r.isSome()&&o.isSome()?_.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):_.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Jn(r).length,$f(t,n-o,o);var t,n,r,o}),u.each(function(e){return Wf(e.dom(),0)})),t})},rd=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=Qf(n,t.getBody(),e.dom()),u=ta(e,d(ed,t),(o=t.getBody(),function(e){return e.dom()===o})),s=nd(e,a,(i=e,br(t.schema.getTextInlineElements(),lr(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(td).fold(function(){r&&Zf(t,n,s)},function(e){r&&Zf(t,n,_.some(e))})},od=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Os(t?1:-1,e,n),o=_u.fromRangeStart(r),i=ar.fromDom(e),!1===t&&Ff(o)?_.some(jf.remove(o.getNode(!0))):t&&Lf(o)?_.some(jf.remove(o.getNode())):!1===t&&Lf(o)&&Sf(i,o)?Tf(i,o).map(function(e){return jf.remove(e.getNode())}):t&&Ff(o)&&Ef(i,o)?kf(i,o).map(function(e){return jf.remove(e.getNode())}):qf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),rd(o,i,ar.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?_u.before(e):_u.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},id=function(e,t){var n,r=e.selection.getNode();return!!jo.isContentEditableFalse(r)&&(n=ar.fromDom(e.getBody()),z(Qi(n,".mce-offscreen-selection"),Ui),rd(e,t,ar.fromDom(e.selection.getNode())),ql(e),!0)},ad=function(e,t){return e.selection.isCollapsed()?od(e,t):id(e,t)},ud=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(jo.isContentEditableTrue(t)||jo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return jo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(_u.before(t).toRange())),!0},sd=jo.isText,cd=function(e){return sd(e)&&e.data[0]===xa},ld=function(e){return sd(e)&&e.data[e.data.length-1]===xa},fd=function(e){return e.ownerDocument.createTextNode(xa)},dd=function(e,t){return e?function(e){if(sd(e.previousSibling))return ld(e.previousSibling)||e.previousSibling.appendData(xa),e.previousSibling;if(sd(e))return cd(e)||e.insertData(0,xa),e;var t=fd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(sd(e.nextSibling))return cd(e.nextSibling)||e.nextSibling.insertData(0,xa),e.nextSibling;if(sd(e))return ld(e)||e.appendData(xa),e;var t=fd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},md=d(dd,!0),gd=d(dd,!1),pd=function(e,t){return jo.isText(e.container())?dd(t,e.container()):dd(t,e.getNode())},hd=function(e,t){var n=t.get();return n&&e.container()===n&&Ta(n)},vd=function(n,e){return e.fold(function(e){ss.remove(n.get());var t=md(e);return n.set(t),_.some(_u(t,t.length-1))},function(e){return sc.firstPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),1);ss.remove(n.get());var t=pd(e,!0);return n.set(t),_u(t,1)})},function(e){return sc.lastPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),n.get().length-1);ss.remove(n.get());var t=pd(e,!1);return n.set(t),_u(t,t.length-1)})},function(e){ss.remove(n.get());var t=gd(e);return n.set(t),_.some(_u(t,1))})},yd=function(e,t){for(var n=0;ni.left&&a.rightr.top&&o.bottomo.childNodes.length-1&&(c=!1),jo.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new go(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),jo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){hg(s)},forwardDelete:function(){vg(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return jg(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=mp(e,function(e){return!!a.matchNode(e,n)});return-1!==gp(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0"),u))[o.length-1]=Xt.extend(o[o.length-1],{func:n,scope:r||i}),Xt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(Xp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Xt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Xp(Yp(Xt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Zp=function(e){var t=Ur(e).dom();return e.dom()===t.activeElement},eh=function(t){return(e=Ur(t),n=e!==undefined?e.dom():V.document,_.from(n.activeElement).map(ar.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},th=function(t,e){return(n=e,n.collapsed?_.from(eu(n.startContainer,n.startOffset)).map(ar.fromDom):_.none()).bind(function(e){return ko(e)?_.some(e):!1===zr(t,e)?_.some(t):_.none()});var n},nh=function(t,e){th(ar.fromDom(t.getBody()),e).bind(function(e){return sc.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},rh=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},oh=function(e){var t,n=e.getBody();return n&&(t=ar.fromDom(n),Zp(t)||eh(t).isSome())},ih=function(e){return e.inline?oh(e):(t=e).iframeElement&&Zp(ar.fromDom(t.iframeElement));var t},ah=function(e){return e.editorManager.setActive(e)},uh=function(e,t){e.removed||(t?ah(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return rh(u),nh(t,o),ah(t);t.bookmark!==undefined&&!1===ih(t)&&up(t).each(function(e){t.selection.setRng(e),o=e}),n||(fe.opera||rh(r),t.getWin().focus()),(fe.gecko||n)&&(rh(r),nh(t,o)),ah(t)}(e))},sh=ih,ch=function(e,t){return t.dom()[e]},lh=function(e,t){return parseInt(kr(t,e),10)},fh=d(ch,"clientWidth"),dh=d(ch,"clientHeight"),mh=d(lh,"margin-top"),gh=d(lh,"margin-left"),ph=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=ar.fromDom(e.getBody()),p=e.inline?g:(r=g,ar.fromDom(r.dom().ownerDocument.documentElement)),h=(o=e.inline,a=t,u=n,s=(i=p).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+gh(i):0),y:u-(o?s.top+i.dom().clientTop+mh(i):0)});return l=h.x,f=h.y,d=fh(c=p),m=dh(c),0<=l&&0<=f&&l<=d&&f<=m},hh=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,_.from(t).map(ar.fromDom)).map(function(e){return zr(Ur(e),e)}).getOr(!1)};function vh(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0t;var t}},cv=function(n){return function(e){return t=n,e.line===t;var t}},lv=jo.isContentEditableFalse,fv=Es,dv=function(e,t){return Math.abs(e.left-t)},mv=function(e,t){return Math.abs(e.right-t)},gv=function(e,t){return e>=t.left&&e<=t.right},pv=function(e,o){return Ht.reduce(e,function(e,t){var n,r;return n=Math.min(dv(e,o),mv(e,o)),r=Math.min(dv(t,o),mv(t,o)),gv(o,t)?t:gv(o,e)?e:r===n&&lv(t.node)?t:r=e.top&&n<=e.bottom});return(r=pv(f,t))&&(r=pv((a=e,c=function(t,e){var n;return n=U(ov([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),hv(tv.Up,a,d(c,Ga),u.node),hv(tv.Down,a,d(c,Ja),u.node),s),t))&&gs(r.node)?(i=t,{node:(o=r).node,before:dv(o,i)i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Sv(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Tv(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},_v=function(e){var n;kv(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(xv(t)||xv(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Av=function(t){var e=Vi(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=fg(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Rv=jo.isContentEditableTrue,Dv=jo.isContentEditableFalse,Ov=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Rv(t)||Dv(t))return t;t=t.parentNode}return null},Bv=function(g){var p,e,t,a=g.getBody(),o=ds(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return sh(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},y=function(e,t){return t=Os(e,a,t),-1===e?_u.fromRangeStart(t):_u.fromRangeEnd(t)},n=function(e){return ka(e)||Oa(e)||Ba(e)},b=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e){var t=g.schema.getShortEndedElements(),n=g.dom.createRng(),r=e.startContainer,o=e.startOffset,i=e.endContainer,a=e.endOffset;return br(t,r.nodeName.toLowerCase())?0===o?n.setStartBefore(r):n.setStartAfter(r):n.setStart(r,o),br(t,i.nodeName.toLowerCase())?0===a?n.setEndBefore(i):n.setEndAfter(i):n.setEnd(i,a),n},l=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!b(e))if(!1===t){if(c=y(-1,e),gs(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(gs(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=y(1,e),gs(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(gs(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Dv(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&i===e.endContainer&&(n=i.childNodes[a]),Dv(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=oa(ar.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('
    ').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&fe.ie?(r.empty().append('

    \xa0

    ').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),z(Qi(ar.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){Sr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},f=function(){p&&(p.removeAttribute("data-mce-selected"),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null},C=function(){o.hide()};return fe.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&ph(g,e.clientX,e.clientY)&&u(lg(g,t,!1))}),g.on("click",function(e){var t;(t=Ov(g,e.target))&&(Dv(t)&&(e.preventDefault(),g.focus()),Rv(t)&&g.dom.isChildOf(t,g.selection.getNode())&&f())}),g.on("blur NewBlock",function(){f()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Dv(Ov(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Js(e);if(!e.firstChild)return!1;var n=_u.before(e.firstChild),r=t.next(n);return r&&!Lf(r)&&!Ff(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=Ov(n,e.target);Dv(t)&&(r||(e.preventDefault(),l(cg(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==ph(g,e.clientX,e.clientY))if(t=Ov(g,n))Dv(t)?(e.preventDefault(),l(cg(g,t))):(f(),Rv(t)&&e.shiftKey||yv(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===gs(n)){f(),C();var r=vv(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){rv.modifierPressed(e)||(e.keyCode,Dv(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){e.range=c(e.range);var t=l(e.range,e.forward);t&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||f()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!fe.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),_v(g),Av(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Pa(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Pv=function(e){for(var t=e;/)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0k(n)?(C=_(b*y),b=_(C/y)):(b=_(C/y),C=_(b*y))),N.setStyles(D(s),{width:b,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=b+" × "+C,f[2]<0&&s.clientWidth<=b&&N.setStyle(s,"left",g+(h-b)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=A.scrollWidth-x)+(n=A.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(Tp(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",b),e("height",C),N.unbind(S,"mousemove",B),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",B),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),kp(a,u,b,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;I(),M(),t=N.getPos(e,A),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,b=C=0),n=a.fire("ObjectSelected",{target:e}),O(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===fe.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,y=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=A.scrollWidth,w=A.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),A.appendChild(s),N.bind(S,"mousemove",B),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",B),N.bind(T,"mouseup",P)),c=N.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):I(),u.setAttribute("data-mce-selected","1")},I=function(){var e,t;for(e in M(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},L=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],A)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):I())},F=function(e){return Ab(function(e,t){for(;t&&t!==e;){if(Rb(t)||Ab(t))return t;t=t.parentNode}return null}(a.getBody(),e))},M=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},z=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){z(),fe.ie&&11<=fe.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||F(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(A,"mscontrolselect",function(e){var t=function(e){he.setEditorTimeout(a,function(){a.selection.select(e)})};if(F(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=he.throttle(function(e){a.composing||L(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",I),a.on("contextmenu",n)}),a.on("remove",M),{isResizable:O,showResizeRect:o,hideResizeRect:I,updateResizeRect:L,destroy:function(){u=s=null}}},Ob=function(e){return jo.isContentEditableTrue(e)||jo.isContentEditableFalse(e)},Bb=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Xt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,jo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Ob))?null:i}return r},Pb=function(n,e){return W(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},Ib=function(e,t){var n=(t||V.document).createDocumentFragment();return z(e,function(e){n.appendChild(e.dom())}),ar.fromDom(n)},Lb=Ar("element","width","rows"),Fb=Ar("element","cells"),Mb=Ar("x","y"),zb=function(e,t){var n=parseInt(Er(e,t),10);return isNaN(n)?1:n},Ub=function(e){return j(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},jb=function(e,t){for(var n=e.rows(),r=0;r_
    '+t),e.dom.remove("__mce_tmp")):l.pasteHTML(t)}u.no_events||e.fire("SetContent",u)}else e.fire("SetContent",u)},eC=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return _.from(i).map(ar.fromDom).map(function(e){return r&&t.collapsed?e:Xr(e,o(e,a)).getOr(e)}).bind(function(e){return dr(e)?_.some(e):Vr(e)}).map(function(e){return e.dom()}).getOr(e)},tC=function(e,t,n){return eC(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},nC=function(e,t,n){return eC(e,t,!1,n,function(e,t){return 0t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return og(c,e,t)},placeCaretAt:function(e,t){return i(Bb(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?_u.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=_b(p),t=Db(p,c),p.bookmarkManager=n,p.controlSelection=t,p};(kb=Tb||(Tb={}))[kb.Br=0]="Br",kb[kb.Block=1]="Block",kb[kb.Wrap=2]="Wrap",kb[kb.Eol=3]="Eol";var sC=function(e,t){return e===Tu.Backwards?t.reverse():t},cC=function(e,t,n,r){for(var o,i,a,u,s,c,l=Js(n),f=r,d=[];f&&(s=l,c=f,o=t===Tu.Forwards?s.next(c):s.prev(c));){if(jo.isBr(o.getNode(!1)))return t===Tu.Forwards?{positions:sC(t,d).concat([o]),breakType:Tb.Br,breakAt:_.some(o)}:{positions:sC(t,d),breakType:Tb.Br,breakAt:_.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,jo.isBr(u.getNode(i===Tu.Forwards))?Tb.Br:!1===Ts(a,u)?Tb.Block:Tb.Wrap);return{positions:sC(t,d),breakType:m,breakAt:_.some(o)}}d.push(o),f=o}else f=o}return{positions:sC(t,d),breakType:Tb.Eol,breakAt:_.none()}},lC=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Tu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},fC=function(e,i){return j(e,function(e,o){return e.fold(function(){return _.some(o)},function(r){return ru(Z(r.getClientRects()),Z(o.getClientRects()),function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},_.none())},dC=function(t,e){return Z(e.getClientRects()).bind(function(e){return fC(t,e.left)})},mC=d(cC,Su.isAbove,-1),gC=d(cC,Su.isBelow,1),pC=d(lC,-1,mC),hC=d(lC,1,gC),vC=jo.isContentEditableFalse,yC=Za,bC=function(e,t,n,r){var o=e===Tu.Forwards,i=o?Lf:Ff;if(!r.collapsed){var a=yC(r);if(vC(a))return sg(e,t,a,e===Tu.Backwards,!0)}var u=Sa(r.startContainer),s=Ps(e,t.getBody(),r);if(i(s))return cg(t,s.getNode(!o));var c=Vl.normalizePosition(o,n(s));if(!c)return u?r:null;if(i(c))return sg(e,t,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&Fs(c,l)?sg(e,t,l.getNode(!o),o,!0):u?fg(t,c.toRange(),!0):null},CC=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=yC(r),o=Ps(e,t.getBody(),r),i=n(t.getBody(),sv(1),o),a=U(i,cv(1)),s=Ht.last(o.getClientRects()),(Lf(o)||zf(o))&&(d=o.getNode()),(Ff(o)||Uf(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=pv(a,c))&&vC(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),sg(e,t,u.node,l'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},wC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Js((e=l).getBody()),o=d(Ls,r.next),i=d(Ls,r.prev),a=t?Tu.Forwards:Tu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=bC(a,e,u,s))?n:(n=xC(e,a,s))||null);return!!c&&(dg(l,c),!0)}},NC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?uv:av,i=(e=u).selection.getRng(),(n=CC(r,e,o,i))?n:(n=xC(e,r,i))||null);return!!a&&(dg(u,a),!0)}},EC=function(r,o){return function(){var t,e=o?_u.fromRangeEnd(r.selection.getRng()):_u.fromRangeStart(r.selection.getRng()),n=o?gC(r.getBody(),e):mC(r.getBody(),e);return(o?ee(n.positions):Z(n.positions)).filter((t=o,function(e){return t?Ff(e):Lf(e)})).fold(q(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},SC=function(e,t,n,r,o){var i,a,u,s,c=Qi(ar.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=Ka(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,j(a,function(e,r){return e.fold(function(){return _.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return _.some(nt}),_C=function(t,n){return Z(n.getClientRects()).bind(function(e){return TC(t,e.left,e.top)}).bind(function(e){return dC((t=e,sc.lastPositionIn(t).map(function(e){return mC(t,e).positions.concat(e)}).getOr([])),n);var t})},AC=function(t,n){return ee(n.getClientRects()).bind(function(e){return kC(t,e.left,e.top)}).bind(function(e){return dC((t=e,sc.firstPositionIn(t).map(function(e){return[e].concat(gC(t,e).positions)}).getOr([])),n);var t})},RC=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===Tb.Wrap&&0===a.positions.length||!jo.isBr(n.getNode())&&(i=u).breakType===Tb.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},DC=d(RC,mC),OC=d(RC,gC),BC=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(ms()&&(o=t,i=s,a=n,u=_u.fromRangeStart(i),sc.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=sg(c,e,n,!t,!0);return dg(e,l),!0}return!1},PC=function(e,t){var n=t.getNode(e);return jo.isElement(n)&&"TABLE"===n.nodeName?_.some(n):_.none()},IC=function(u,s,c){var e=PC(!!s,c),t=!1===s;e.fold(function(){return dg(u,c.toRange())},function(a){return sc.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return dg(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Nl(r=u))?r.undoManager.transact(function(){var e=ar.fromTag(i);Nr(e,El(r)),Fi(e,ar.fromTag("br")),n?Ii(ar.fromDom(o),e):Pi(ar.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),dg(r,t)}):dg(r,t.toRange()));var n,r,o,t,i})})},LC=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=_u.fromRangeStart(l),d=e.getBody();if(!t&&DC(r,f)){var m=(u=d,_C(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return fC(pC(u,_u.before(s)),e.left)})}).getOr(_u.before(s)));return IC(e,t,m),!0}return!(!t||!OC(r,f))&&(o=d,m=AC(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return fC(hC(o,_u.after(i)),e.left)})}).getOr(_u.after(i)),IC(e,t,m),!0)},FC=function(t,n){return function(){return _.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return _.from(t.dom.getParent(e,"table")).map(function(e){return BC(t,n,e)})}).getOr(!1)}},MC=function(n,r){return function(){return _.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return _.from(n.dom.getParent(t,"table")).map(function(e){return LC(n,r,e,t)})}).getOr(!1)}},zC=function(e){return F(["figcaption"],lr(e))},UC=function(e){var t=V.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},jC=function(e,t,n){n?Fi(e,t):Li(e,t)},VC=function(e,t,n,r){return""===t?(l=e,f=r,d=ar.fromTag("br"),jC(l,d,f),UC(d)):(o=e,i=r,a=t,u=n,s=ar.fromTag(a),c=ar.fromTag("br"),Nr(s,u),Fi(s,c),jC(o,s,i),UC(c));var o,i,a,u,s,c,l,f,d},HC=function(e,t,n){return t?(o=e.dom(),gC(o,n).breakAt.isNone()):(r=e.dom(),mC(r,n).breakAt.isNone());var r,o},qC=function(t,n){var e,r,o,i=ar.fromDom(t.getBody()),a=_u.fromRangeStart(t.selection.getRng()),u=Nl(t),s=El(t);return(e=a,r=i,o=d(Mr,r),na(ar.fromDom(e.container()),Co,o).filter(zC)).exists(function(){if(HC(i,n,a)){var e=VC(i,u,s,n);return t.selection.setRng(e),!0}return!1})},$C=function(e,t){return function(){return!!e.selection.isCollapsed()&&qC(e,t)}},WC=function(e,r){return G(W(e,function(e){return Zy({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},KC=function(e){for(var t=[],n=1;n'},cx=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},lx=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},fx=function(e,t,n){return!1===jo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===xa?0:n:n===t.data.length-1&&t.data.charAt(n)===xa?t.data.length:n},dx=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},mx=function(o,i,e){_.from(e.style).map(o.dom.parseStyle).each(function(e){var t=function(e){var t={},n=e.dom();if(Cr(n))for(var r=0;rs.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&jo.isText(s)?s.nodeValue.length:0),(u=dx(x,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=dx(m,r);if(!(a=m.getParent(r,m.isBlock))||!lx(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),gx(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),gx(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,E,s,i)),c=x.getParent(s,x.isBlock),l=c?x.getParent(c.parentNode,x.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&x.isEmpty(c)?ux(a,S,l,c,m):m&&c===a.getBody()||(m=m||"P",Sa(c)?(r=Pa(c),x.isEmpty(c)&&sx(c),gx(a,r),QC(a,r)):T()?k():T(!0)?(r=c.parentNode.insertBefore(S(),c),QC(a,cx(c,"HR")?r:c)):((t=(b=E,C=b.cloneRange(),C.setStart(b.startContainer,fx(!0,b.startContainer,b.startOffset)),C.setEnd(b.endContainer,fx(!1,b.endContainer,b.endOffset)),C).cloneRange()).setEndAfter(c),o=t.extractContents(),y=o,z(Ji(ar.fromDom(y),mr),function(e){var t=e.dom();t.nodeValue=wa(t.nodeValue)}),function(e){for(;jo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,x.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;jo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(x,N,r),p=x,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),x.isEmpty(c)&&sx(c),r.normalize(),x.isEmpty(r)?(x.remove(r),k()):(gx(a,r),QC(a,r))),x.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},hx=function(e,t){return ex(e).filter(function(e){return 0",yl(f)!==f.documentBaseUrl&&(g+=''),g+='',d=bl(f),m=Cl(f),xl(f)&&(g+=''),g+='
    '),Cw.add(t.iframeContainer,l),p},ww=function(e,t){var n=xw(e,t);t.editorContainer&&(Cw.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=Cw.isHidden(t.editorContainer)),e.getElement().style.display="none",Cw.setAttrib(e.id,"aria-hidden","true"),n||bw(e)},Nw=Si.DOM,Ew=function(t,n,e){var r=_h.get(e),o=_h.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=Xt.trim(e),r&&-1===Xt.inArray(n,e)){if(Xt.each(_h.dependencies(e),function(e){Ew(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(iE){kh.pluginInitError(t,e,iE)}}},Sw=function(e){return e.replace(/^\-/,"")},Tw=function(e){return{editorContainer:e,iframeContainer:e}},kw=function(e){var t,n,r=e.getElement();return e.inline?Tw(null):(t=r,n=Nw.create("div"),Nw.insertAfter(n,t),Tw(n))},_w=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,S(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Nw.getStyle(f,"width")||"100%",a=l.height||Nw.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))=n.length)for(r=0,o=e.length;r=n.length||e[r]!==n[r]){i=r+1;break}if(e.length=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r]*>( | |\\s|\xa0|
    |)<\\/"+a+">[\r\n]*|
    [\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||Ao(ar.fromDom(n))?t.content=r:t.content=Xt.trim(r),t.no_events||e.fire("GetContent",t),t.content},jw=function(e,t){t(e),e.firstChild&&jw(e.firstChild,t),e.next&&jw(e.next,t)},Vw=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&jw(t.firstChild,function(t){z(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),z(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);z(r,function(t){z(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Hw=function(e){return e instanceof sb},qw=function(e,t){var r;e.dom.setHTML(e.getBody(),t),sh(r=e)&&sc.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=jo.isTable(t)?sc.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},$w=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Hw(s)?"":s,Hw(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),_.from(u.getBody()).fold(q(s),function(e){return Hw(s)?function(e,t,n,r){Vw(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=al({validate:e.validate},e.schema).serialize(n);return r.content=Ao(ar.fromDom(t))?o:Xt.trim(o),qw(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='
    ',"TABLE"===n.nodeName?r=""+a+"":/^(UL|OL)$/.test(n.nodeName)&&(r="
  • "+a+"
  • "),(i=Nl(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='
    '),qw(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=al({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Ao(ar.fromDom(n))?r:Xt.trim(r),qw(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Ww=Si.DOM,Kw=function(e){return _.from(e).each(function(e){return e.destroy()})},Xw=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Ww.remove(o.nextSibling),Np(e),e.editorManager.remove(e),!e.inline&&r&&(i=e,Ww.setStyle(i.id,"display",i.orgDisplay)),Ep(e),Ww.remove(e.getContainer()),Kw(t),Kw(n),e.destroy()}var i},Yw=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Kw(i),Kw(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),Ww.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Gw=Si.DOM,Jw=Xt.extend,Qw=Xt.each,Zw=Xt.resolve,eN=fe.ie,tN=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"40px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=$p(zp,c,a,u),l.settings=t,Bi.language=t.language||"en",Bi.languageLoad=t.language_load,Bi.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new zw(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Qp(l),l.loadedCSS={},l.editorCommands=new pp(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(fe.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(fe.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=gn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Jw(tN.prototype={render:function(){Bw(this)},focus:function(e){uh(this,e)},hasFocus:function(){return sh(this)},execCallback:function(e){for(var t=[],n=1;n=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=ON(e.x,t.x),r=ON(e.y,t.y),o=DN(e.x+e.w,t.x+t.w),i=DN(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:IN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=ON(0,t.x-u),o=ON(0,t.y-s),i=ON(0,c-f),a=ON(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),IN(u,s,(c-=i)-u,(l-=a)-s)},create:IN,fromClientRect:function(e){return IN(e.left,e.top,e.width,e.height)}},FN={},MN={add:function(e,t){FN[e.toLowerCase()]=t},has:function(e){return!!FN[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=FN.hasOwnProperty(t)?FN[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=FN[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},zN=Xt.each,UN=Xt.extend,jN=function(){};jN.extend=_N=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!AN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in AN=!0,e=new this,AN=!1,n.Mixins&&(zN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&zN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&zN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&zN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=UN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=_N,i};var VN=Math.min,HN=Math.max,qN=Math.round,$N=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";rTiny']),u=t.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+l}:null;i.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:t},r,u]})}return x(t),t.on("SwitchMode",(a=i,function(e){a.find("*").disabled("readonly"===e.mode)})),i.renderBefore(n.targetNode).reflow(),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly"),n.width&&pe.setStyle(i.getEl(),"width",n.width),t.on("remove",function(){i.remove(),i=null}),R(t,i),F(t),{iframeContainer:i.find("#iframe")[0].getEl(),editorContainer:i.getEl()}},ye=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),xe=0,we={id:function(){return"mceu_"+xe++},create:function(e,t,n){var i=_.document.createElement(e);return p.DOM.setAttribs(i,t),"string"==typeof n?i.innerHTML=n:w.each(n,function(e){e.nodeType&&i.appendChild(e)}),i},createFragment:function(e){return p.DOM.createFragment(e)},getWindowSize:function(){return p.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var i=e.getBoundingClientRect();t=Math.max(i.width||i.right-i.left,e.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return p.DOM.getPos(e,t||we.getContainer())},getContainer:function(){return ce.container?ce.container:_.document.body},getViewPort:function(e){return p.DOM.getViewPort(e)},get:function(e){return _.document.getElementById(e)},addClass:function(e,t){return p.DOM.addClass(e,t)},removeClass:function(e,t){return p.DOM.removeClass(e,t)},hasClass:function(e,t){return p.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return p.DOM.toggleClass(e,t,n)},css:function(e,t,n){return p.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return p.DOM.getStyle(e,t,!0)},on:function(e,t,n,i){return p.DOM.bind(e,t,n,i)},off:function(e,t,n){return p.DOM.unbind(e,t,n)},fire:function(e,t,n){return p.DOM.fire(e,t,n)},innerHtml:function(e,t){p.DOM.setHTML(e,t)}},_e=function(e){return"static"===we.getRuntimeStyle(e,"position")},Re=function(e){return e.state.get("fixed")};function Ce(e,t,n){var i,r,o,s,a,l,u,c,d,f;return d=Ee(),o=(r=we.getPos(t,W.getUiContainer(e))).x,s=r.y,Re(e)&&_e(_.document.body)&&(o-=d.x,s-=d.y),i=e.getEl(),a=(f=we.getSize(i)).width,l=f.height,u=(f=we.getSize(t)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var Ee=function(){var e=_.window;return{x:Math.max(e.pageXOffset,_.document.body.scrollLeft,_.document.documentElement.scrollLeft),y:Math.max(e.pageYOffset,_.document.body.scrollTop,_.document.documentElement.scrollTop),w:e.innerWidth||_.document.documentElement.clientWidth,h:e.innerHeight||_.document.documentElement.clientHeight}},ke=function(e){var t,n=W.getUiContainer(e);return n&&!Re(e)?{x:0,y:0,w:(t=n).scrollWidth-1,h:t.scrollHeight-1}:Ee()},He={testMoveRel:function(e,t){for(var n=ke(this),i=0;in.x&&r.x+r.wn.y&&r.y+r.h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,ze=/^\s*|\s*$/g,Ie=Se.extend({init:function(e){var o=this.match;function s(e,t,n){var i;function r(e){e&&t.push(e)}return r(function(t){if(t)return t=t.toLowerCase(),function(e){return"*"===t||e.type===t}}((i=Be.exec(e.replace(ze,"")))[1])),r(function(t){if(t)return function(e){return e._name===t}}(i[2])),r(function(n){if(n)return n=n.split("."),function(e){for(var t=n.length;t--;)if(!e.classes.contains(n[t]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(e){var t=e[n]?e[n]():"";return i?"="===i?t===r:"*="===i?0<=t.indexOf(r):"~="===i?0<=(" "+t+" ").indexOf(" "+r+" "):"!="===i?t!==r:"^="===i?0===t.indexOf(r):"$="===i&&t.substr(t.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var t;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(t=a(i[1],[]),function(e){return!o(e,t)}):(i=i[2],function(e,t,n){return"first"===i?0===t:"last"===i?t===n-1:"even"===i?t%2==0:"odd"===i?t%2==1:!!e[i]&&e[i]()})}(i[7])),t.pseudo=!!i[7],t.direct=n,t}function a(e,t){var n,i,r,o=[];do{if(Le.exec(""),(i=Le.exec(e))&&(e=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,t),e=[],r=0;r"!==o[r]&&e.push(s(o[r],[],">"===o[r-1]));return t.push(e),t}this._selectors=a(e,[])},match:function(e,t){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(t=t||this._selectors).length;na.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=e.h)!==undefined&&(n=(n=na.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=e.innerW)!==undefined&&(n=(n=na.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=e.innerH)!==undefined&&(n=(n=na.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),e.contentW!==undefined&&(a.contentW=e.contentW),e.contentH!==undefined&&(a.contentH=e.contentH),(t=s._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((o=je.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),s):a},repaint:function(){var e,t,n,i,r,o,s,a,l,u,c=this;l=_.document.createRange?function(e){return e}:Math.round,e=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(e.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(e.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),e.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),e.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((t=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((t=t||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,we.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){var n,i,r,o=this;return nt(o).on(e,"string"!=typeof(n=t)?n:function(e){return i||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(i=t[n]))return r=e,!1}),i?i.call(r,e):(e.action=n,void this.fire("execute",e))}),o},off:function(e,t){return nt(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=nt(this).fire(e,t),!1!==n&&this.parent)for(var i=this.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return nt(this).has(e)},parents:function(e){var t,n=new Ve;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new Ve(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=ye("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,i=n.getEl(n.ariaTarget);return void 0===t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&i.setAttribute("role"===e?e:"aria-"+e,t),n)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return je.translate?je.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var t,e,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(e=o.length;e--;)o[e].remove()}r&&r.items&&(t=[],r.items().each(function(e){e!==n&&t.push(e)}),r.items().set(t),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&ye(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return ye(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return ye(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'
    '},postRender:function(){var e,t,n,i,r,o=this,s=o.settings;for(i in o.$el=ye(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}it(o),s.style&&(e=o.getEl())&&(e.setAttribute("style",s.style),e.style.cssText=s.style),o.settings.border&&(t=o.borderBox,o.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(e){var t,n=e.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(t=o.parent())&&(t._lastRect=null),o.fire(n?"show":"hide"),Ke.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(e,t){var n,i,r=e;for(n=i=0;r&&r!==t&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return t=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===e?(t-=o-i,n-=s-r):"center"===e&&(t-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=t,l.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),t=(e=t).parent()}e||(e=this);for(var i=n.length;i--;)n[i].rootControl=e;return e},reflow:function(){Ke.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function nt(n){return n._eventDispatcher||(n._eventDispatcher=new Te({scope:n,toggleEvent:function(e,t){t&&Te.isNative(e)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[e]=!0,n.state.get("rendered")&&it(n))}})),n._eventDispatcher}function it(a){var e,t,n,l,i,r;function o(e){var t=a.getParentCtrl(e.target);t&&t.fire(e.type,e)}function s(){var e=l._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),l._lastHoverCtrl=null)}function u(e){var t,n,i,r=a.getParentCtrl(e.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;s=t.length&&(e=0),t[e]&&t[e].focus(),e}function h(e,t){var n=-1,i=d();t=t||c(i.getEl());for(var r=0;r
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e,t=this;return t.items().exec("postRender"),t._super(),t._layout.postRender(t),t.state.set("rendered",!0),t.settings.style&&t.$el.css(t.settings.style),t.settings.border&&(e=t.borderBox,t.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),t.parent()||(t.keyboardNav=st({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!==t.w||n.h!==t.h)return e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0},reflow:function(){var e;if(Ke.remove(this),this.visible()){for(rt.repaintControls=[],rt.repaintControls.map={},this.recalc(),e=rt.repaintControls.length;e--;)rt.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),rt.repaintControls=[]}return this}});function ut(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n
    ").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),ye(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(e)},v=function(e){if(ut(e),e.button!==g)return p(e);e.deltaX=e.screenX-b,e.deltaY=e.screenY-y,e.preventDefault(),h.drag(e)},p=function(e){ut(e),ye(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(e)},this.destroy=function(){ye(w).off()},ye(w).on("mousedown touchstart",t)}var dt,ft,ht,mt,gt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this,v=2;function n(){var m,g,e;function t(e,t,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+e)){if(f=t.toLowerCase(),h=n.toLowerCase(),ye(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void ye(a).css("display","none");ye(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+e+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+t]+v,d[h]=u,ye(a).css(d),(d={})[f]=s["scroll"+t]*c,d[h]=u*c,ye(l).css(d)}}e=p.getEl("body"),m=e.scrollWidth>e.clientWidth,g=e.scrollHeight>e.clientHeight,t("h","Left","Width","contentW",m,"Height"),t("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function e(s,a,l,u,c){var d,e=p._id+"-scroll"+s,t=p.classPrefix;ye(p.getEl()).append('
    '),p.draghelper=new ct(e+"t",{start:function(){d=p.getEl("body")["scroll"+a],ye("#"+e).addClass(t+"active")},drag:function(e){var t,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,t=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+e["delta"+u]/t},stop:function(){ye("#"+e).removeClass(t+"active")}})}p.classes.add("scroll"),e("v","Top","Height","Y","Width"),e("h","Left","Width","X","Height")}(),p.on("wheel",function(e){var t=p.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),ye(p.getEl("body")).on("scroll",n)),n())}},pt=lt.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[gt],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}}),vt={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=we.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=this.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},bt=[],yt=[];function xt(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function wt(){dt||(dt=function(e){2!==e.button&&function(e){for(var t=bt.length;t--;){var n=bt[t],i=n.getParentCtrl(e.target);if(n.settings.autohide){if(i&&(xt(i,n)||n.parent()===i))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},ye(_.document).on("click touchstart",dt))}function _t(r){var e=we.getViewPort().y;function t(e,t){for(var n,i=0;ie&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),t(!1,r._autoFixY-e)):(r._autoFixY=r.layoutRect().y,r._autoFixY
    ').appendTo(i.getContainerElm())),u.setTimeout(function(){t.addClass(n+"in"),ye(i.getEl()).addClass(n+"in")}),mt=!0),Rt(!0,i)}}),i.on("show",function(){i.parents().each(function(e){if(e.state.get("fixed"))return i.fixed(!0),!1})}),e.popover&&(i._preBodyHtml='
    ',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",e.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!==e){if(t.state.get("rendered")){var n=we.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e,t=this._super();for(e=bt.length;e--&&bt[e]!==this;);return-1===e&&bt.push(this),t},hide:function(){return Et(this),Rt(!1,this),this._super()},hideAll:function(){Ct.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Rt(!1,this)),this},remove:function(){Et(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Et(e){var t;for(t=bt.length;t--;)bt[t]===e&&bt.splice(t,1);for(t=yt.length;t--;)yt[t]===e&&yt.splice(t,1)}Ct.hideAll=function(){for(var e=bt.length;e--;){var t=bt[e];t&&t.settings.autohide&&(t.hide(),bt.splice(e,1))}};var kt=function(s,n,e){var a,i,l=p.DOM,t=s.getParam("fixed_toolbar_container");t&&(i=l.select(t)[0]);var r=function(){if(a&&a.moveRel&&a.visible()&&!a._fixed){var e=s.selection.getScrollContainer(),t=s.getBody(),n=0,i=0;if(e){var r=l.getPos(t),o=l.getPos(e);n=Math.max(0,o.x-r.x),i=Math.max(0,o.y-r.y)}a.fixed(!1).moveRel(t,s.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(n,i)}},o=function(){a&&(a.show(),r(),l.addClass(s.getBody(),"mce-edit-focus"))},u=function(){a&&(a.hide(),Ct.hideAll(),l.removeClass(s.getBody(),"mce-edit-focus"))},c=function(){var e,t;a?a.visible()||o():(a=n.panel=v.create({type:i?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:(e=i,t=s,!(!e||t.settings.ui_container)),border:1,items:[!1===d(s)?null:{type:"menubar",border:"0 0 1 0",items:re(s)},A(s,f(s))]}),W.setUiContainer(s,a),x(s),i?a.renderTo(i).reflow():a.renderTo().reflow(),R(s,a),o(),F(s),s.on("nodeChange",r),s.on("ResizeWindow",r),s.on("activate",o),s.on("deactivate",u),s.nodeChanged())};return s.settings.content_editable=!0,s.on("focus",function(){!1===m(s)&&e.skinUiCss?l.styleSheetLoader.load(e.skinUiCss,c,c):c()}),s.on("blur hide",u),s.on("remove",function(){a&&(a.remove(),a=null)}),!1===m(s)&&e.skinUiCss?l.styleSheetLoader.load(e.skinUiCss,ge(s)):ge(s)(),{}};function Ht(i,r){var o,s,a=this,l=rt.classPrefix;a.show=function(e,t){function n(){o&&(ye(i).append('
    '),t&&t())}return a.hide(),o=!0,e?s=u.setTimeout(n,e):n(),a},a.hide=function(){var e=i.lastChild;return u.clearTimeout(s),e&&-1!==e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,a}}var St=function(e,t){var n;e.on("ProgressState",function(e){n=n||new Ht(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Tt=function(e,t,n){var i=function(e){var t=e.settings,n=t.skin,i=t.skin_url;if(!1!==n){var r=n||"lightgray";i=i?e.documentBaseURI.toAbsolute(i):l.baseURL+"/skins/"+r}return i}(e);return i&&(n.skinUiCss=i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")),St(e,t),e.getParam("inline",!1,"boolean")?kt(e,t,n):be(e,t,n)},Mt=rt.extend({Mixins:[He],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().lastChild.innerHTML=t.encode(e.value)}),t._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),Nt=rt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==Nt.tooltips&&(r.on("mouseenter",function(e){var t=r.tooltip().moveTo(-65535);if(e.control===r){var n=t.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===n),t.classes.toggle("tooltip-nw","bc-tl"===n),t.classes.toggle("tooltip-ne","bc-tr"===n),t.moveRel(r.getEl(),n)}else t.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new Mt({type:"tooltip"}),W.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){var t=this;function n(e){t.aria("disabled",e),t.classes.toggle("disabled",e)}function i(e){t.aria("pressed",e),t.classes.toggle("active",e)}return t.state.on("change:disabled",function(e){n(e.value)}),t.state.on("change:active",function(e){i(e.value)}),t.state.get("disabled")&&n(!0),t.state.get("active")&&i(!0),t._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),Pt=Nt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'
    0%
    '},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var t=this;function n(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}return t.state.on("change:value",function(e){n(e.value)}),n(t.state.get("value")),t._super()}}),Wt=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")},Dt=rt.extend({Mixins:[He],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.maxWidth,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||0'),e=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&(r=''),t.progressBar&&(o=t.progressBar.renderHtml()),''},postRender:function(){var e=this;return u.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),Wt(e,e.state.get("text"))},100),e._super()},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().firstChild.innerHTML=e.value,Wt(t,e.value)}),t.progressBar&&(t.progressBar.bindStates(),t.progressBar.state.on("change:value",function(e){Wt(t,t.state.get("text"))})),t._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function Ot(o){var s=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(e,t){var n,i=w.extend(e,{maxWidth:(n=s(o),we.getSize(n).width)}),r=new Dt(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),t()},i.timeout)),r.on("close",function(){t()}),r.renderTo(),r},close:function(e){e.close()},reposition:function(e){K(e,function(e){e.moveTo(0,0)}),function(n){if(0e.w&&(n=e.x-Math.max(0,t/2),r.layoutRect({w:t,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),r.layoutRect({w:t,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var e,t=this,n=t._super(),i=0;if(t.settings.title&&!t._fullscreen){e=t.getEl("head");var r=we.getSize(e);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}t.statusbar&&(i+=t.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=we.getWindowSize();return n.x=t.settings.x||Math.max(0,o.w/2-n.w/2),n.y=t.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var e=this,t=e._layout,n=e._id,i=e.classPrefix,r=e.settings,o="",s="",a=r.html;return e.preRender(),t.preRender(e),r.title&&(o='
    '+e.encode(r.title)+'
    '),r.url&&(a=''),void 0===a&&(a=t.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'
    '+o+'
    '+a+"
    "+s+"
    "},fullscreen:function(e){var n,t,i=this,r=_.document.documentElement,o=i.classPrefix;if(e!==i._fullscreen)if(ye(_.window).on("resize",function(){var e;if(i._fullscreen)if(n)i._timer||(i._timer=u.setTimeout(function(){var e=we.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),i._timer=0},50));else{e=(new Date).getTime();var t=we.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),50<(new Date).getTime()-e&&(n=!0)}}),t=i.layoutRect(),i._fullscreen=e){i._initial={x:t.x,y:t.y,w:t.w,h:t.h},i.borderBox=Me("0"),i.getEl("head").style.display="none",t.deltaH-=t.headerH+2,ye([r,_.document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=we.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Me(i.settings.border),i.getEl("head").style.display="",t.deltaH+=t.headerH,ye([r,_.document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var t,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new ct(n._id+"-dragh",{start:function(){t={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(e){n.moveTo(t.x+e.deltaX,t.y+e.deltaY)}}),n.on("submit",function(e){e.isDefaultPrevented()||n.close()}),At.push(n),Lt(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e,t=this;for(t.dragHelper.destroy(),t._super(),t.statusbar&&this.statusbar.remove(),zt(t.classPrefix,!1),e=At.length;e--;)At[e]===t&&At.splice(e,1);Lt(0
    '+this._super(e)}}),jt=Nt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",function(e){e.preventDefault()}),n.on("touchstart",function(e){n.fire("click",e),e.preventDefault()}),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(e=l.image)?(o="none","string"!=typeof e&&(e=_.window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",s&&(n.classes.add("btn-has-text"),a=''+n.encode(s)+""),o=o?r+"ico "+r+"i-"+o:"",t="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'
    "},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(e){var t=n("span."+i,o.getEl());e?(t[0]||(n("button:first",o.getEl()).append(''),t=n("span."+i,o.getEl())),t.html(o.encode(e))):t.remove(),o.classes.toggle("btn-has-text",!!e)}return o.state.on("change:text",function(e){s(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=_.document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),Jt=jt.extend({init:function(e){e=w.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,t=we.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),ye(t).on("change",function(e){var t=e.target.files;n.value=function(){return t.length?n.settings.multiple?t:t[0]:null},e.preventDefault(),t.length&&n.fire("change",e)}),ye(t).on("click",function(e){e.stopPropagation()}),ye(n.getEl("button")).on("click touchstart",function(e){e.stopPropagation(),t.click(),e.preventDefault()}),n.getEl().appendChild(t)},remove:function(){ye(this.getEl("button")).off(),ye(this.getEl("input")).off(),this._super()}}),Gt=lt.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}}),Kt=Nt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+"
    "},bindStates:function(){var o=this;function t(e){o.classes.toggle("checked",e),o.aria("checked",e)}return o.state.on("change:text",function(e){o.getEl("al").firstChild.data=o.translate(e.value)}),o.state.on("change:checked change:value",function(e){o.fire("change"),t(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;if(void 0===t)return o.settings.icon;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=_.document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r)}),o.state.get("checked")&&t(!0),o._super()}}),Zt=tinymce.util.Tools.resolve("tinymce.util.VK"),Qt=Nt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(e){var t=e.target,n=r.getEl();if(ye.contains(n,t)||t===n)for(;t&&t!==n;)t.id&&-1!==t.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),e.aria&&r.menu.items()[0].focus())),t=t.parentNode}),r.on("keydown",function(e){var t;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),r.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),r.fire("submit",{data:t.toJSON()}))}),r.on("keyup",function(e){if("INPUT"===e.target.nodeName){var t=r.state.get("value"),n=e.target.value;n!==t&&(r.state.set("value",n),r.fire("autocomplete",e))}}),r.on("mouseover",function(e){var t=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==e.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=t.text(n).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===i),t.classes.toggle("tooltip-nw","bc-tl"===i),t.classes.toggle("tooltip-ne","bc-tr"===i),t.moveRel(e.target,i)}})},statusLevel:function(e){return 0
    ','
    '+e+"
    "}}),an=Nt.extend({init:function(e){e=w.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=we.create("div",e,""+this.translate(n.text)+""),n.height&&we.css(t,"height",n.height+"px"),n.width&&we.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var i=this,e=function(e){e.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super(),i.$el.on("dragover",function(e){e.preventDefault()}),i.$el.on("dragenter",e),i.$el.on("dragleave",e),i.$el.on("drop",function(e){if(e.preventDefault(),!i.state.get("disabled")){var t=function(e){var t=i.settings.accept;if("string"!=typeof t)return e;var n=new RegExp("("+t.split(/\s*,\s*/).join("|")+")$","i");return w.grep(e,function(e){return n.test(e.name)})}(e.dataTransfer.files);i.value=function(){return t.length?i.settings.multiple?t:t[0]:null},t.length&&i.fire("change",e)}})},remove:function(){this.$el.off(),this._super()}}),ln=Nt.extend({init:function(e){var n=this;e.delimiter||(e.delimiter="\xbb"),n._super(e),n.classes.add("path"),n.canFocus=!0,n.on("click",function(e){var t;(t=e.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[t],index:t})}),n.row(n.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'
    '+this._getDataPathHtml(this.state.get("row"))+"
    "},bindStates:function(){var t=this;return t.state.on("change:row",function(e){t.innerHtml(t._getDataPathHtml(e.value))}),t._super()},_getDataPathHtml:function(e){var t,n,i=e||[],r="",o=this.classPrefix;for(t=0,n=i.length;t
    ":"")+'
    '+i[t].name+"
    ";return r||(r='
    \xa0
    '),r}}),un=ln.extend({postRender:function(){var o=this,s=o.settings.editor;function a(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(e){s.focus(),s.selection.select(this.row()[e.index].element),s.nodeChanged()}),s.on("nodeChange",function(e){for(var t=[],n=e.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||t.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(t)})),o._super()}}),cn=lt.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}}),dn=lt.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,e=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),e.each(function(e){var t,n=e.settings.label;n&&((t=new cn(w.extend({items:{type:"label",id:e._id+"-l",text:n,flex:0,forId:e._id,disabled:e.disabled()}},i.settings.formItemDefaults))).type="formitem",e.aria("labelledby",e._id+"-l"),"undefined"==typeof e.settings.flex&&(e.settings.flex=1),i.replace(e,t),t.add(e))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var n=this;function e(){var e,t,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(e){var t=e.items()[0],n=t.getEl().clientWidth;i=i'+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}}),hn=0,mn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:k(e)}},gn={fromHtml:function(e,t){var n=(t||_.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1",l)),null!==u&&a.push(di("",u)),a))],o=function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(c,t)},s=[],K(n,function(e){s=o(s,e)}),s):mi(e,d(ui))},mi=function(e,t){var n=e.toLowerCase(),i=w.grep(t,function(e){return-1!==e.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===e?[]:i},gi=function(r,i,o,s){var t=function(e){var t=li(o),n=hi(e,t,s,i);r.showAutoComplete(n,e)};r.on("autocomplete",function(){t(r.value())}),r.on("selectitem",function(e){var t=e.value;r.value(t.url);var n,i=(n=t.title).raw?n.raw:n;"image"===s?r.fire("change",{meta:{alt:i,attach:t.attach}}):r.fire("change",{meta:{text:i,attach:t.attach}}),r.focus()}),r.on("click",function(e){0===r.value().length&&"INPUT"===e.target.nodeName&&t("")}),r.on("PostRender",function(){r.getRoot().on("submit",function(e){var t,n,i;e.isDefaultPrevented()||(t=r.value(),i=ui[n=s],/^https?/.test(t)&&(i?j(i,t).isNone()&&(ui[n]=i.slice(0,5).concat(t)):ui[n]=[t]))})})},pi=function(o,e,n){var i=e.filepicker_validator_handler;i&&o.state.on("change:value",function(e){var t;0!==(t=e.value).length?i({url:t,type:n},function(e){var t,n,i,r=(n=(t=e).status,i=t.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},vi=Qt.extend({Statics:{clearHistory:function(){ui={}}},init:function(e){var t,n,i,r=this,o=window.tinymce?window.tinymce.activeEditor:l.activeEditor,s=o.settings,a=e.filetype;e.spellcheck=!1,(i=s.file_picker_types||s.file_browser_callback_types)&&(i=w.makeMap(i,/[, ]/)),i&&!i[a]||(!(n=s.file_picker_callback)||i&&!i[a]?!(n=s.file_browser_callback)||i&&!i[a]||(t=function(){n(r.getEl("inp").id,r.value(),a,window)}):t=function(){var e=r.fire("beforecall").meta;e=w.extend({filetype:a},e),n.call(o,function(e,t){r.value(e).fire("change",{meta:t})},r.value(),e)}),t&&(e.icon="browse",e.onaction=t),r._super(e),r.classes.add("filepicker"),gi(r,s,o.getBody(),a),pi(r,s,a)}}),bi=Xt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}}),yi=Xt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,E,k,H,S,T,M,N,P,W,D,O,A,B,L=[],z=Math.max,I=Math.min;for(i=e.items().filter(":visible"),r=e.layoutRect(),o=e.paddingBox,s=e.settings,f=e.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=e.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(C="y",_="h",R="minH",E="maxH",H="innerH",k="top",S="deltaH",T="contentH",D="left",P="w",M="x",N="innerW",W="minW",O="right",A="deltaW",B="contentW"):(C="x",_="w",R="minW",E="maxW",H="innerW",k="left",S="deltaW",T="contentW",D="top",P="h",M="y",N="innerH",W="minH",O="bottom",A="deltaH",B="contentH"),d=r[H]-o[k]-o[k],w=c=0,t=0,n=i.length;tT[d]?C:T[d],M[f]=E>M[f]?E:M[f];for(k=o.innerW-p.left-p.right,d=_=0;d'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,t&&t()):u.setTimeout(function(){n.html(e)}),this}}),Zi=Nt.extend({init:function(e){this._super(e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+'
    '},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl("body").firstChild.data=t.encode(e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t.state.on("change:help",function(e){t.classes.toggle("has-help",e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),Qi=Nt.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(we.getSize(e.getEl()).width>t.maxW&&(t.minW=t.maxW,e.classes.add("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,we.getSize(e.getEl()).height)),t},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(t=n.settings.forName)&&(e=n.getRoot().find("#"+t)[0])&&(i=e._id),i?'":''+r+""},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.innerHtml(t.encode(e.value)),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),er=lt.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(e){e.classes.add("toolbar-item")}),this._super()}}),tr=er.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),nr=jt.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=v.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(e){"hide"===e.type&&e.control.parent()===n&&n.classes.remove("opened-under"),e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.toggle("opened","show"===e.type)),n.aria("expanded","show"===e.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]);var i=n.menu.layoutRect(),r=n.$el.offset().top+n.layoutRect().h;r>i.y&&r'+t.encode(o)+""),r=t.settings.icon?i+"ico "+i+"i-"+r:"",t.aria("role",t.parent()instanceof tr?"menuitem":"button"),'
    '},postRender:function(){var r=this;return r.on("click",function(e){e.control===r&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(e.target,r.getEl())&&(r.focus(),r.showMenu(!e.aria),e.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(e){var t,n=e.control,i=r.parent();n&&i&&n instanceof nr&&n.parent()===i&&(i.items().filter("MenuButton").each(function(e){e.hideMenu&&e!==n&&(e.menu&&e.menu.visible()&&(t=!0),e.hideMenu())}),t&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),ir=Ct.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=w.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==ce.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var t,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new Ht(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close",i)),n.requestTime=t=(new Date).getTime(),n.settings.itemsFactory(function(e){0!==e.length?n.requestTime===t&&(n.getEl().style.width="",n.getEl("body").style.width="",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(e),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var n=this;return n.items().each(function(e){var t=e.settings;if(t.icon||t.image||t.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on("postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(e){e.control===n&&("show"===e.type?u.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),rr=nr.extend({init:function(i){var t,r,o,n,s=this;s._super(i),i=s.settings,s._values=t=i.values,t&&("undefined"!=typeof i.value&&function e(t){for(var n=0;n").replace(new RegExp(c("]mce~match!"),"g"),"")}return s&&t.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(e){var t,n,i={};for(i=ce.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t\xa0":"",o=f(t.encode(d(o))),u=f(t.encode(d(u))),'
    '+e+("-"!==o?''+o+"":"")+(l?'
    '+l+"
    ":"")+(i.menu?'
    ':"")+(u?'":"")+"
    "},postRender:function(){var t=this,n=t.settings,e=n.textStyle;if("function"==typeof e&&(e=e.call(this)),e){var i=t.getEl("text");i&&(i.setAttribute("style",e),t._textStyle=e)}return t.on("mouseenter click",function(e){e.control===t&&(n.menu||"click"!==e.type?(t.showMenu(),e.aria&&t.menu.focus(!0)):(t.fire("select"),u.requestAnimationFrame(function(){t.parent().hideAll()})))}),t._super(),t},hover:function(){return this.parent().items().each(function(e){e.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var i=e.getEl("text");i.setAttribute("style",n),t&&(i.style.color="",i.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),sr=Kt.extend({Defaults:{classes:"radio",role:"radio"}}),ar=Nt.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"===e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var t=this;t._super(),t.resizeDragHelper=new ct(this._id,{start:function(){t.fire("ResizeStart")},drag:function(e){"both"!==t.settings.direction&&(e.deltaX=0),t.fire("Resize",e)},stop:function(){t.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function lr(e){var t="";if(e)for(var n=0;n'+e[n]+"";return t}var ur=Nt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var n=this;n._super(e),n.settings.size&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e,t=this,n="";return e=lr(t._options),t.size&&(n=' size = "'+t.size+'"'),'"},bindStates:function(){var t=this;return t.state.on("change:options",function(e){t.getEl().innerHTML=lr(e.value)}),t._super()}});function cr(e,t,n){return e
    '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,i,r,o,s,a,l,u,c,d,f,h,m=this;e=m._minValue,t=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function t(e){var t,n,i,r;t=cr(t=(((t=m.value())+(r=n=o))/((i=s)-r)+.05*e)*(i-n)-n,o,s),m.value(t),m.fire("dragstart",{value:t}),m.fire("drag",{value:t}),m.fire("dragend",{value:t})}m.on("keydown",function(e){switch(e.keyCode){case 37:case 38:t(-1);break;case 39:case 40:t(1)}})}(e,t),s=e,a=t,l=m.getEl("handle"),m._dragHelper=new ct(m._id,{handle:m._id+"-handle",start:function(e){u=e[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-we.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(e){var t=e[n]-u;f=cr(c+t,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),fr(this,this.value())},bindStates:function(){var t=this;return t.state.on("change:value",function(e){fr(t,e.value)}),t._super()}}),mr=Nt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'
    '}}),gr=nr.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),i=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,ye(e).css({width:i.w-we.getSize(t).width,height:i.h-2}),ye(t).css({height:i.h-2}),this},activeMenu:function(e){ye(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(e=a.image)?(o="none","string"!=typeof e&&(e=_.window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l=''+n.encode(s)+""),t="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'
    '},postRender:function(){var n=this.settings.onclick;return this.on("click",function(e){var t=e.target;if(e.control===this)for(;t;){if(e.aria&&"down"!==e.aria.key||"BUTTON"===t.nodeName&&-1===t.className.indexOf("open"))return e.stopImmediatePropagation(),void(n&&n.call(this,e));t=t.parentNode}}),delete this.settings.onclick,this._super()}}),pr=xi.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),vr=pt.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var e;this.activeTabId&&(e=this.getEl(this.activeTabId),ye(e).removeClass(this.classPrefix+"active"),e.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(e=this.getEl("t"+n)).setAttribute("aria-selected","true"),ye(e).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(e,t){n!==t&&e.hide()})},renderHtml:function(){var i=this,e=i._layout,r="",o=i.classPrefix;return i.preRender(),e.preRender(i),i.items().each(function(e,t){var n=i._id+"-t"+t;e.aria("role","tabpanel"),e.aria("labelledby",n),r+='"}),'
    '+r+'
    '+e.renderHtml(i)+"
    "},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on("click",function(e){var t=e.target.parentNode;if(t&&t.id===i._id+"-head")for(var n=t.childNodes.length;n--;)t.childNodes[n]===e.target&&i.activateTab(n)})},initLayoutRect:function(){var e,t,n,i=this;t=(t=we.getSize(i.getEl("head")).width)<0?0:t,n=0,i.items().each(function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)}),i.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})});var r=we.getSize(i.getEl("head")).height;return i.settings.minWidth=t,i.settings.minHeight=n+r,(e=i._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),br=Nt.extend({init:function(e){var n=this;n._super(e),n.classes.add("textbox"),e.multiline?n.classes.add("multiline"):(n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))}),n.on("keyup",function(e){n.state.set("value",e.target.value)}))},repaint:function(){var e,t,n,i,r,o=this,s=0;e=o.getEl().style,t=o._layoutRect,r=o._lastRepaintRect||{};var a=_.document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(e.lineHeight=t.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),t.x!==r.x&&(e.left=t.x+"px",r.x=t.x),t.y!==r.y&&(e.top=t.y+"px",r.y=t.y),t.w!==r.w&&(e.width=t.w-i+"px",r.w=t.w),t.h!==r.h&&(e.height=t.h-s+"px",r.h=t.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var t,e,n=this,i=n.settings;return t={id:n._id,hidefocus:"1"},w.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){t[e]=i[e]}),n.disabled()&&(t.disabled="disabled"),i.subtype&&(t.type=i.subtype),(e=we.create(i.multiline?"textarea":"input",t)).value=n.state.get("value"),e.className=n.classes.toString(),e.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var t=this;t.getEl().value=t.state.get("value"),t._super(),t.$el.on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)})},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.getEl().value!==e.value&&(t.getEl().value=e.value)}),t.state.on("change:disabled",function(e){t.getEl().disabled=e.value}),t._super()},remove:function(){this.$el.off(),this._super()}}),yr=function(){return{Selector:Ie,Collection:Ve,ReflowQueue:Ke,Control:rt,Factory:v,KeyboardNavigation:st,Container:lt,DragHelper:ct,Scrollable:gt,Panel:pt,Movable:He,Resizable:vt,FloatPanel:Ct,Window:It,MessageBox:Yt,Tooltip:Mt,Widget:Nt,Progress:Pt,Notification:Dt,Layout:qt,AbsoluteLayout:Xt,Button:jt,ButtonGroup:Gt,Checkbox:Kt,ComboBox:Qt,ColorBox:en,PanelButton:tn,ColorButton:rn,ColorPicker:sn,Path:ln,ElementPath:un,FormItem:cn,Form:dn,FieldSet:fn,FilePicker:vi,FitLayout:bi,FlexLayout:yi,FlowLayout:xi,FormatControls:Ji,GridLayout:Gi,Iframe:Ki,InfoBox:Zi,Label:Qi,Toolbar:er,MenuBar:tr,MenuButton:nr,MenuItem:or,Throbber:Ht,Menu:ir,ListBox:rr,Radio:sr,ResizeHandle:ar,SelectBox:ur,Slider:hr,Spacer:mr,SplitButton:gr,StackLayout:pr,TabPanel:vr,TextBox:br,DropZone:an,BrowseButton:Jt}},xr=function(n){n.ui?w.each(yr(),function(e,t){n.ui[t]=e}):n.ui=yr()};w.each(yr(),function(e,t){v.add(t,e)}),xr(window.tinymce?window.tinymce:{}),r.add("modern",function(e){return Ji.setup(e),$t(e)})}(window); // Source: wp-includes/js/tinymce/plugins/charmap/plugin.min.js diff --git a/wp-includes/js/twemoji.js b/wp-includes/js/twemoji.js index a3ef4298c9..ea86c63ae8 100644 --- a/wp-includes/js/twemoji.js +++ b/wp-includes/js/twemoji.js @@ -24,7 +24,7 @@ var twemoji = (function ( ///////////////////////// // default assets url, by default will be Twitter Inc. CDN - base: 'https://twemoji.maxcdn.com/v/13.0.0/', + base: 'https://twemoji.maxcdn.com/v/13.0.1/', // default assets file extensions, by default '.png' ext: '.png', diff --git a/wp-includes/js/twemoji.min.js b/wp-includes/js/twemoji.min.js index 02eff41be9..ab0eef7f6d 100644 --- a/wp-includes/js/twemoji.min.js +++ b/wp-includes/js/twemoji.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -var twemoji=function(){"use strict";var f={base:"https://twemoji.maxcdn.com/v/13.0.0/",ext:".png",size:"72x72",className:"emoji",convert:{fromCodePoint:function(d){var u="string"==typeof d?parseInt(d,16):d;if(u<65536)return a(u);return a(55296+((u-=65536)>>10),56320+(1023&u))},toCodePoint:i},onerror:function(){this.parentNode&&this.parentNode.replaceChild(C(this.alt,!1),this)},parse:function(d,u){u&&"function"!=typeof u||(u={callback:u});return("string"==typeof d?function(d,b){return o(d,function(d){var u,f,c=d,e=N(d),a=b.callback(e,b);if(e&&a){for(f in c="")}return c})}:function(d,u){var f,c,e,a,b,t,r,n,o,i,s,l,p,m=function d(u,f){var c,e,a=u.childNodes,b=a.length;for(;b--;)c=a[b],3===(e=c.nodeType)?f.push(c):1!==e||"ownerSVGElement"in c||x.test(c.nodeName.toLowerCase())||d(c,f);return f}(d,[]),h=m.length;for(;h--;){for(e=!1,a=document.createDocumentFragment(),b=m[h],t=b.nodeValue,n=0;r=g.exec(t);){if((o=r.index)!==n&&a.appendChild(C(t.slice(n,o),!0)),s=r[0],l=N(s),n=o+s.length,p=u.callback(l,u),l&&p){for(c in(i=new Image).onerror=u.onerror,i.setAttribute("draggable","false"),f=u.attributes(s,l))f.hasOwnProperty(c)&&0!==c.indexOf("on")&&!i.hasAttribute(c)&&i.setAttribute(c,f[c]);i.className=u.className,i.alt=s,i.src=p,e=!0,a.appendChild(i)}i||a.appendChild(C(s,!1)),i=null}e&&(n":">","'":"'",'"':"""},g=/(?:\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[\xa9\xae\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,c=/\uFE0F/g,e=String.fromCharCode(8205),t=/[&<>'"]/g,x=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,a=String.fromCharCode;return f;function C(d,u){return document.createTextNode(u?d.replace(c,""):d)}function b(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function N(d){return i(d.indexOf(e)<0?d.replace(c,""):d)}function r(d){return u[d]}function n(){return null}function o(d,u){return String(d).replace(g,u)}function i(d,u){for(var f=[],c=0,e=0,a=0;a>10),56320+(1023&u))},toCodePoint:i},onerror:function(){this.parentNode&&this.parentNode.replaceChild(C(this.alt,!1),this)},parse:function(d,u){u&&"function"!=typeof u||(u={callback:u});return("string"==typeof d?function(d,b){return o(d,function(d){var u,f,c=d,e=N(d),a=b.callback(e,b);if(e&&a){for(f in c="")}return c})}:function(d,u){var f,c,e,a,b,t,r,n,o,i,s,l,p,m=function d(u,f){var c,e,a=u.childNodes,b=a.length;for(;b--;)c=a[b],3===(e=c.nodeType)?f.push(c):1!==e||"ownerSVGElement"in c||x.test(c.nodeName.toLowerCase())||d(c,f);return f}(d,[]),h=m.length;for(;h--;){for(e=!1,a=document.createDocumentFragment(),b=m[h],t=b.nodeValue,n=0;r=g.exec(t);){if((o=r.index)!==n&&a.appendChild(C(t.slice(n,o),!0)),s=r[0],l=N(s),n=o+s.length,p=u.callback(l,u),l&&p){for(c in(i=new Image).onerror=u.onerror,i.setAttribute("draggable","false"),f=u.attributes(s,l))f.hasOwnProperty(c)&&0!==c.indexOf("on")&&!i.hasAttribute(c)&&i.setAttribute(c,f[c]);i.className=u.className,i.alt=s,i.src=p,e=!0,a.appendChild(i)}i||a.appendChild(C(s,!1)),i=null}e&&(n":">","'":"'",'"':"""},g=/(?:\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[\xa9\xae\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,c=/\uFE0F/g,e=String.fromCharCode(8205),t=/[&<>'"]/g,x=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,a=String.fromCharCode;return f;function C(d,u){return document.createTextNode(u?d.replace(c,""):d)}function b(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function N(d){return i(d.indexOf(e)<0?d.replace(c,""):d)}function r(d){return u[d]}function n(){return null}function o(d,u){return String(d).replace(g,u)}function i(d,u){for(var f=[],c=0,e=0,a=0;a[\\d]+)/");return i<0?"":((t=(t=e.substr(0,i-1)).split("/")).pop(),t=t.pop())},wp.api.utils.decorateFromRoute=function(e,t){_.each(e,function(e){_.includes(e.methods,"POST")||_.includes(e.methods,"PUT")?_.isEmpty(e.args)||(_.isEmpty(t.prototype.args)?t.prototype.args=e.args:t.prototype.args=_.extend(t.prototype.args,e.args)):_.includes(e.methods,"GET")&&(_.isEmpty(e.args)||(_.isEmpty(t.prototype.options)?t.prototype.options=e.args:t.prototype.options=_.extend(t.prototype.options,e.args)))})},wp.api.utils.addMixinsAndHelpers=function(t,e,i){function n(e,t,i,n,o){var s,a,r,p;return p=jQuery.Deferred(),a=e.get("_embedded")||{},_.isNumber(t)&&0!==t?(a[n]&&(r=_.findWhere(a[n],{id:t})),r=r||{id:t},(s=new wp.api.models[i](r)).get(o)?p.resolve(s):s.fetch({success:function(e){p.resolve(e)},error:function(e,t){p.reject(t)}}),p.promise()):(p.reject(),p)}var o=!1,s=["date","modified","date_gmt","modified_gmt"],a={setDate:function(e,t){var i=t||"date";if(_.indexOf(s,i)<0)return!1;this.set(i,e.toISOString())},getDate:function(e){var t=e||"date",i=this.get(t);return!(_.indexOf(s,t)<0||_.isNull(i))&&new Date(wp.api.utils.parseISO8601(i))}},d=function(e,t){_.each(e.models,function(e){e.set("parent_post",t)})},r={getMeta:function(e){return this.get("meta")[e]},getMetas:function(){return this.get("meta")},setMetas:function(e){var t=this.get("meta");_.extend(t,e),this.set("meta",t)},setMeta:function(e,t){var i=this.get("meta");i[e]=t,this.set("meta",i)}},p={getRevisions:function(){return function(e,t,i,n){var o,s,a,r="",p="",c=jQuery.Deferred();return o=e.get("id"),s=e.get("_embedded")||{},_.isNumber(o)&&0!==o?(_.isUndefined(i)||_.isUndefined(s[i])?r={parent:o}:p=_.isUndefined(n)?s[i]:s[i][n],a=new wp.api.collections[t](p,r),_.isUndefined(a.models[0])?a.fetch({success:function(e){d(e,o),c.resolve(e)},error:function(e,t){c.reject(t)}}):(d(a,o),c.resolve(a)),c.promise()):(c.reject(),c)}(this,"PostRevisions")}},c={getTags:function(){var e=this.get("tags"),t=new wp.api.collections.Tags;return _.isEmpty(e)?jQuery.Deferred().resolve([]):t.fetch({data:{include:e}})},setTags:function(e){var i,n=this,o=[];if(_.isString(e))return!1;_.isArray(e)?(new wp.api.collections.Tags).fetch({data:{per_page:100},success:function(t){_.each(e,function(e){(i=new wp.api.models.Tag(t.findWhere({slug:e}))).set("parent_post",n.get("id")),o.push(i)}),e=new wp.api.collections.Tags(o),n.setTagsWithCollection(e)}}):this.setTagsWithCollection(e)},setTagsWithCollection:function(e){return this.set("tags",e.pluck("id")),this.save()}},l={getCategories:function(){var e=this.get("categories"),t=new wp.api.collections.Categories;return _.isEmpty(e)?jQuery.Deferred().resolve([]):t.fetch({data:{include:e}})},setCategories:function(e){var i,n=this,o=[];if(_.isString(e))return!1;_.isArray(e)?(new wp.api.collections.Categories).fetch({data:{per_page:100},success:function(t){_.each(e,function(e){(i=new wp.api.models.Category(t.findWhere({slug:e}))).set("parent_post",n.get("id")),o.push(i)}),e=new wp.api.collections.Categories(o),n.setCategoriesWithCollection(e)}}):this.setCategoriesWithCollection(e)},setCategoriesWithCollection:function(e){return this.set("categories",e.pluck("id")),this.save()}},u={getAuthorUser:function(){return n(this,this.get("author"),"User","author","name")}},g={getFeaturedMedia:function(){return n(this,this.get("featured_media"),"Media","wp:featuredmedia","source_url")}};return _.isUndefined(t.prototype.args)||(_.each(s,function(e){_.isUndefined(t.prototype.args[e])||(o=!0)}),o&&(t=t.extend(a)),_.isUndefined(t.prototype.args.author)||(t=t.extend(u)),_.isUndefined(t.prototype.args.featured_media)||(t=t.extend(g)),_.isUndefined(t.prototype.args.categories)||(t=t.extend(l)),_.isUndefined(t.prototype.args.meta)||(t=t.extend(r)),_.isUndefined(t.prototype.args.tags)||(t=t.extend(c)),_.isUndefined(i.collections[e+"Revisions"])||(t=t.extend(p))),t}}(window),function(){"use strict";var i=window.wpApiSettings||{},e=["Comment","Media","Comment","Post","Page","Status","Taxonomy","Type"];wp.api.WPApiBaseModel=Backbone.Model.extend({initialize:function(){-1===_.indexOf(e,this.name)&&(this.requireForceForDelete=!0)},sync:function(e,i,t){var n;return t=t||{},_.isNull(i.get("date_gmt"))&&i.unset("date_gmt"),_.isEmpty(i.get("slug"))&&i.unset("slug"),_.isFunction(i.nonce)&&!_.isEmpty(i.nonce())&&(n=t.beforeSend,t.beforeSend=function(e){if(e.setRequestHeader("X-WP-Nonce",i.nonce()),n)return n.apply(this,arguments)},t.complete=function(e){var t=e.getResponseHeader("X-WP-Nonce");t&&_.isFunction(i.nonce)&&i.nonce()!==t&&i.endpointModel.set("nonce",t)}),this.requireForceForDelete&&"delete"===e&&(i.url=i.url()+"?force=true"),Backbone.sync(e,i,t)},save:function(e,t){return!(!_.includes(this.methods,"PUT")&&!_.includes(this.methods,"POST"))&&Backbone.Model.prototype.save.call(this,e,t)},destroy:function(e){return!!_.includes(this.methods,"DELETE")&&Backbone.Model.prototype.destroy.call(this,e)}}),wp.api.models.Schema=wp.api.WPApiBaseModel.extend({defaults:{_links:{},namespace:null,routes:{}},initialize:function(e,t){t=t||{},wp.api.WPApiBaseModel.prototype.initialize.call(this,e,t),this.apiRoot=t.apiRoot||i.root,this.versionString=t.versionString||i.versionString},url:function(){return this.apiRoot+this.versionString}})}(),function(){"use strict";window.wpApiSettings;wp.api.WPApiBaseCollection=Backbone.Collection.extend({initialize:function(e,t){this.state={data:{},currentPage:null,totalPages:null,totalObjects:null},_.isUndefined(t)?this.parent="":this.parent=t.parent},sync:function(e,i,t){var n,o,s=this;return t=t||{},_.isFunction(i.nonce)&&!_.isEmpty(i.nonce())&&(n=t.beforeSend,t.beforeSend=function(e){if(e.setRequestHeader("X-WP-Nonce",i.nonce()),n)return n.apply(s,arguments)},t.complete=function(e){var t=e.getResponseHeader("X-WP-Nonce");t&&_.isFunction(i.nonce)&&i.nonce()!==t&&i.endpointModel.set("nonce",t)}),"read"===e&&(t.data?(s.state.data=_.clone(t.data),delete s.state.data.page):s.state.data=t.data={},void 0===t.data.page?(s.state.currentPage=null,s.state.totalPages=null,s.state.totalObjects=null):s.state.currentPage=t.data.page-1,o=t.success,t.success=function(e,t,i){if(_.isUndefined(i)||(s.state.totalPages=parseInt(i.getResponseHeader("x-wp-totalpages"),10),s.state.totalObjects=parseInt(i.getResponseHeader("x-wp-total"),10)),null===s.state.currentPage?s.state.currentPage=1:s.state.currentPage++,o)return o.apply(this,arguments)}),Backbone.sync(e,i,t)},more:function(e){if((e=e||{}).data=e.data||{},_.extend(e.data,this.state.data),void 0===e.data.page){if(!this.hasMore())return!1;null===this.state.currentPage||this.state.currentPage<=1?e.data.page=2:e.data.page=this.state.currentPage+1}return this.fetch(e)},hasMore:function(){return null===this.state.totalPages||null===this.state.totalObjects||null===this.state.currentPage?null:this.state.currentPage[\\d]+)/");return i<0?"":((t=(t=e.substr(0,i-1)).split("/")).pop(),t=t.pop())},wp.api.utils.decorateFromRoute=function(e,t){_.each(e,function(e){_.includes(e.methods,"POST")||_.includes(e.methods,"PUT")?_.isEmpty(e.args)||(_.isEmpty(t.prototype.args)?t.prototype.args=e.args:t.prototype.args=_.extend(t.prototype.args,e.args)):_.includes(e.methods,"GET")&&(_.isEmpty(e.args)||(_.isEmpty(t.prototype.options)?t.prototype.options=e.args:t.prototype.options=_.extend(t.prototype.options,e.args)))})},wp.api.utils.addMixinsAndHelpers=function(t,e,i){function n(e,t,i,n,o){var s,a,r,p;return p=jQuery.Deferred(),a=e.get("_embedded")||{},_.isNumber(t)&&0!==t?(a[n]&&(r=_.findWhere(a[n],{id:t})),r=r||{id:t},(s=new wp.api.models[i](r)).get(o)?p.resolve(s):s.fetch({success:function(e){p.resolve(e)},error:function(e,t){p.reject(t)}}),p.promise()):(p.reject(),p)}var o=!1,s=["date","modified","date_gmt","modified_gmt"],a={setDate:function(e,t){var i=t||"date";if(_.indexOf(s,i)<0)return!1;this.set(i,e.toISOString())},getDate:function(e){var t=e||"date",i=this.get(t);return!(_.indexOf(s,t)<0||_.isNull(i))&&new Date(wp.api.utils.parseISO8601(i))}},d=function(e,t){_.each(e.models,function(e){e.set("parent_post",t)})},r={getMeta:function(e){return this.get("meta")[e]},getMetas:function(){return this.get("meta")},setMetas:function(e){var t=this.get("meta");_.extend(t,e),this.set("meta",t)},setMeta:function(e,t){var i=this.get("meta");i[e]=t,this.set("meta",i)}},p={getRevisions:function(){return function(e,t,i,n){var o,s,a,r="",p="",c=jQuery.Deferred();return o=e.get("id"),s=e.get("_embedded")||{},_.isNumber(o)&&0!==o?(_.isUndefined(i)||_.isUndefined(s[i])?r={parent:o}:p=_.isUndefined(n)?s[i]:s[i][n],a=new wp.api.collections[t](p,r),_.isUndefined(a.models[0])?a.fetch({success:function(e){d(e,o),c.resolve(e)},error:function(e,t){c.reject(t)}}):(d(a,o),c.resolve(a)),c.promise()):(c.reject(),c)}(this,"PostRevisions")}},c={getTags:function(){var e=this.get("tags"),t=new wp.api.collections.Tags;return _.isEmpty(e)?jQuery.Deferred().resolve([]):t.fetch({data:{include:e}})},setTags:function(e){var i,n=this,o=[];if(_.isString(e))return!1;_.isArray(e)?(new wp.api.collections.Tags).fetch({data:{per_page:100},success:function(t){_.each(e,function(e){(i=new wp.api.models.Tag(t.findWhere({slug:e}))).set("parent_post",n.get("id")),o.push(i)}),e=new wp.api.collections.Tags(o),n.setTagsWithCollection(e)}}):this.setTagsWithCollection(e)},setTagsWithCollection:function(e){return this.set("tags",e.pluck("id")),this.save()}},l={getCategories:function(){var e=this.get("categories"),t=new wp.api.collections.Categories;return _.isEmpty(e)?jQuery.Deferred().resolve([]):t.fetch({data:{include:e}})},setCategories:function(e){var i,n=this,o=[];if(_.isString(e))return!1;_.isArray(e)?(new wp.api.collections.Categories).fetch({data:{per_page:100},success:function(t){_.each(e,function(e){(i=new wp.api.models.Category(t.findWhere({slug:e}))).set("parent_post",n.get("id")),o.push(i)}),e=new wp.api.collections.Categories(o),n.setCategoriesWithCollection(e)}}):this.setCategoriesWithCollection(e)},setCategoriesWithCollection:function(e){return this.set("categories",e.pluck("id")),this.save()}},u={getAuthorUser:function(){return n(this,this.get("author"),"User","author","name")}},g={getFeaturedMedia:function(){return n(this,this.get("featured_media"),"Media","wp:featuredmedia","source_url")}};return _.isUndefined(t.prototype.args)||(_.each(s,function(e){_.isUndefined(t.prototype.args[e])||(o=!0)}),o&&(t=t.extend(a)),_.isUndefined(t.prototype.args.author)||(t=t.extend(u)),_.isUndefined(t.prototype.args.featured_media)||(t=t.extend(g)),_.isUndefined(t.prototype.args.categories)||(t=t.extend(l)),_.isUndefined(t.prototype.args.meta)||(t=t.extend(r)),_.isUndefined(t.prototype.args.tags)||(t=t.extend(c)),_.isUndefined(i.collections[e+"Revisions"])||(t=t.extend(p))),t}}(window),function(){"use strict";var i=window.wpApiSettings||{},e=["Comment","Media","Comment","Post","Page","Status","Taxonomy","Type"];wp.api.WPApiBaseModel=Backbone.Model.extend({initialize:function(){-1===_.indexOf(e,this.name)&&(this.requireForceForDelete=!0)},sync:function(e,i,t){var n;return t=t||{},_.isNull(i.get("date_gmt"))&&i.unset("date_gmt"),_.isEmpty(i.get("slug"))&&i.unset("slug"),_.isFunction(i.nonce)&&!_.isEmpty(i.nonce())&&(n=t.beforeSend,t.beforeSend=function(e){if(e.setRequestHeader("X-WP-Nonce",i.nonce()),n)return n.apply(this,arguments)},t.complete=function(e){var t=e.getResponseHeader("X-WP-Nonce");t&&_.isFunction(i.nonce)&&i.nonce()!==t&&i.endpointModel.set("nonce",t)}),this.requireForceForDelete&&"delete"===e&&(i.url=i.url()+"?force=true"),Backbone.sync(e,i,t)},save:function(e,t){return!(!_.includes(this.methods,"PUT")&&!_.includes(this.methods,"POST"))&&Backbone.Model.prototype.save.call(this,e,t)},destroy:function(e){return!!_.includes(this.methods,"DELETE")&&Backbone.Model.prototype.destroy.call(this,e)}}),wp.api.models.Schema=wp.api.WPApiBaseModel.extend({defaults:{_links:{},namespace:null,routes:{}},initialize:function(e,t){t=t||{},wp.api.WPApiBaseModel.prototype.initialize.call(this,e,t),this.apiRoot=t.apiRoot||i.root,this.versionString=t.versionString||i.versionString},url:function(){return this.apiRoot+this.versionString}})}(),function(){"use strict";window.wpApiSettings;wp.api.WPApiBaseCollection=Backbone.Collection.extend({initialize:function(e,t){this.state={data:{},currentPage:null,totalPages:null,totalObjects:null},_.isUndefined(t)?this.parent="":this.parent=t.parent},sync:function(e,i,t){var n,o,s=this;return t=t||{},_.isFunction(i.nonce)&&!_.isEmpty(i.nonce())&&(n=t.beforeSend,t.beforeSend=function(e){if(e.setRequestHeader("X-WP-Nonce",i.nonce()),n)return n.apply(s,arguments)},t.complete=function(e){var t=e.getResponseHeader("X-WP-Nonce");t&&_.isFunction(i.nonce)&&i.nonce()!==t&&i.endpointModel.set("nonce",t)}),"read"===e&&(t.data?(s.state.data=_.clone(t.data),delete s.state.data.page):s.state.data=t.data={},void 0===t.data.page?(s.state.currentPage=null,s.state.totalPages=null,s.state.totalObjects=null):s.state.currentPage=t.data.page-1,o=t.success,t.success=function(e,t,i){if(_.isUndefined(i)||(s.state.totalPages=parseInt(i.getResponseHeader("x-wp-totalpages"),10),s.state.totalObjects=parseInt(i.getResponseHeader("x-wp-total"),10)),null===s.state.currentPage?s.state.currentPage=1:s.state.currentPage++,o)return o.apply(this,arguments)}),Backbone.sync(e,i,t)},more:function(e){if((e=e||{}).data=e.data||{},_.extend(e.data,this.state.data),void 0===e.data.page){if(!this.hasMore())return!1;null===this.state.currentPage||this.state.currentPage<=1?e.data.page=2:e.data.page=this.state.currentPage+1}return this.fetch(e)},hasMore:function(){return null===this.state.totalPages||null===this.state.totalObjects||null===this.state.currentPage?null:this.state.currentPage>10),56320+(1023&u))},toCodePoint:i},onerror:function(){this.parentNode&&this.parentNode.replaceChild(C(this.alt,!1),this)},parse:function(d,u){u&&"function"!=typeof u||(u={callback:u});return("string"==typeof d?function(d,b){return o(d,function(d){var u,f,c=d,e=N(d),a=b.callback(e,b);if(e&&a){for(f in c="")}return c})}:function(d,u){var f,c,e,a,b,t,r,n,o,i,s,l,p,m=function d(u,f){var c,e,a=u.childNodes,b=a.length;for(;b--;)c=a[b],3===(e=c.nodeType)?f.push(c):1!==e||"ownerSVGElement"in c||x.test(c.nodeName.toLowerCase())||d(c,f);return f}(d,[]),h=m.length;for(;h--;){for(e=!1,a=document.createDocumentFragment(),b=m[h],t=b.nodeValue,n=0;r=g.exec(t);){if((o=r.index)!==n&&a.appendChild(C(t.slice(n,o),!0)),s=r[0],l=N(s),n=o+s.length,p=u.callback(l,u),l&&p){for(c in(i=new Image).onerror=u.onerror,i.setAttribute("draggable","false"),f=u.attributes(s,l))f.hasOwnProperty(c)&&0!==c.indexOf("on")&&!i.hasAttribute(c)&&i.setAttribute(c,f[c]);i.className=u.className,i.alt=s,i.src=p,e=!0,a.appendChild(i)}i||a.appendChild(C(s,!1)),i=null}e&&(n":">","'":"'",'"':"""},g=/(?:\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[\xa9\xae\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,c=/\uFE0F/g,e=String.fromCharCode(8205),t=/[&<>'"]/g,x=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,a=String.fromCharCode;return f;function C(d,u){return document.createTextNode(u?d.replace(c,""):d)}function b(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function N(d){return i(d.indexOf(e)<0?d.replace(c,""):d)}function r(d){return u[d]}function n(){return null}function o(d,u){return String(d).replace(g,u)}function i(d,u){for(var f=[],c=0,e=0,a=0;a>10),56320+(1023&u))},toCodePoint:i},onerror:function(){this.parentNode&&this.parentNode.replaceChild(C(this.alt,!1),this)},parse:function(d,u){u&&"function"!=typeof u||(u={callback:u});return("string"==typeof d?function(d,b){return o(d,function(d){var u,f,c=d,e=N(d),a=b.callback(e,b);if(e&&a){for(f in c="")}return c})}:function(d,u){var f,c,e,a,b,t,r,n,o,i,s,l,p,m=function d(u,f){var c,e,a=u.childNodes,b=a.length;for(;b--;)c=a[b],3===(e=c.nodeType)?f.push(c):1!==e||"ownerSVGElement"in c||x.test(c.nodeName.toLowerCase())||d(c,f);return f}(d,[]),h=m.length;for(;h--;){for(e=!1,a=document.createDocumentFragment(),b=m[h],t=b.nodeValue,n=0;r=g.exec(t);){if((o=r.index)!==n&&a.appendChild(C(t.slice(n,o),!0)),s=r[0],l=N(s),n=o+s.length,p=u.callback(l,u),l&&p){for(c in(i=new Image).onerror=u.onerror,i.setAttribute("draggable","false"),f=u.attributes(s,l))f.hasOwnProperty(c)&&0!==c.indexOf("on")&&!i.hasAttribute(c)&&i.setAttribute(c,f[c]);i.className=u.className,i.alt=s,i.src=p,e=!0,a.appendChild(i)}i||a.appendChild(C(s,!1)),i=null}e&&(n":">","'":"'",'"':"""},g=/(?:\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[\xa9\xae\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,c=/\uFE0F/g,e=String.fromCharCode(8205),t=/[&<>'"]/g,x=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,a=String.fromCharCode;return f;function C(d,u){return document.createTextNode(u?d.replace(c,""):d)}function b(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function N(d){return i(d.indexOf(e)<0?d.replace(c,""):d)}function r(d){return u[d]}function n(){return null}function o(d,u){return String(d).replace(g,u)}function i(d,u){for(var f=[],c=0,e=0,a=0;a. $relative = implode( '/', $relative ); - } elseif ( ! isset( $src_url['host'] ) || $src_url['host'] === $site_url['host'] ) { + } elseif ( ! isset( $src_url['host'] ) || ! isset( $site_url['host'] ) || $src_url['host'] === $site_url['host'] ) { if ( ! isset( $site_url['path'] ) ) { $relative = trim( $src_url['path'], '/' ); } elseif ( ( strpos( $src_url['path'], trailingslashit( $site_url['path'] ) ) === 0 ) ) { @@ -1617,7 +1617,7 @@ function wp_dropdown_languages( $args = array() ) { // Combine the output string. $output = sprintf( ''; if ( $parsed_args['echo'] ) { diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 58366208b1..027f2b8ea2 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -164,7 +164,10 @@ function get_permalink( $post = 0, $leavename = false ) { */ $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename ); - if ( $permalink && ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ), true ) ) { + if ( + $permalink && + ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future', 'trash' ), true ) + ) { $category = ''; if ( strpos( $permalink, '%category%' ) !== false ) { @@ -452,6 +455,8 @@ function get_attachment_link( $post = null, $leavename = false ) { * Filters the permalink for an attachment. * * @since 2.0.0 + * @since 5.6.0 Providing an empty string will now disable + * the view attachment page link on the media modal. * * @param string $link The attachment's permalink. * @param int $post_id Attachment ID. @@ -515,7 +520,7 @@ function get_month_link( $year, $month ) { $monthlink = $wp_rewrite->get_month_permastruct(); if ( ! empty( $monthlink ) ) { $monthlink = str_replace( '%year%', $year, $monthlink ); - $monthlink = str_replace( '%monthnum%', zeroise( intval( $month ), 2 ), $monthlink ); + $monthlink = str_replace( '%monthnum%', zeroise( (int) $month, 2 ), $monthlink ); $monthlink = home_url( user_trailingslashit( $monthlink, 'month' ) ); } else { $monthlink = home_url( '?m=' . $year . zeroise( $month, 2 ) ); @@ -560,8 +565,8 @@ function get_day_link( $year, $month, $day ) { $daylink = $wp_rewrite->get_day_permastruct(); if ( ! empty( $daylink ) ) { $daylink = str_replace( '%year%', $year, $daylink ); - $daylink = str_replace( '%monthnum%', zeroise( intval( $month ), 2 ), $daylink ); - $daylink = str_replace( '%day%', zeroise( intval( $day ), 2 ), $daylink ); + $daylink = str_replace( '%monthnum%', zeroise( (int) $month, 2 ), $daylink ); + $daylink = str_replace( '%day%', zeroise( (int) $day, 2 ), $daylink ); $daylink = home_url( user_trailingslashit( $daylink, 'day' ) ); } else { $daylink = home_url( '?m=' . $year . zeroise( $month, 2 ) . zeroise( $day, 2 ) ); @@ -1208,7 +1213,8 @@ function get_search_comments_feed_link( $search_query = '', $feed = '' ) { * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $post_type Post type. - * @return string|false The post type archive permalink. + * @return string|false The post type archive permalink. False if the post type + * does not exist or does not have an archive. */ function get_post_type_archive_link( $post_type ) { global $wp_rewrite; @@ -1263,10 +1269,11 @@ function get_post_type_archive_link( $post_type ) { * * @since 3.1.0 * - * @param string $post_type Post type + * @param string $post_type Post type. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). - * @return string|false The post type feed permalink. + * @return string|false The post type feed permalink. False if the post type + * does not exist or does not have an archive. */ function get_post_type_archive_feed_link( $post_type, $feed = '' ) { $default_feed = get_default_feed(); @@ -1353,8 +1360,8 @@ function get_preview_post_link( $post = null, $query_args = array(), $preview_li * * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. * @param string $context Optional. How to output the '&' character. Default '&'. - * @return string|null The edit post link for the given post. null if the post type is invalid or does - * not allow an editing UI. + * @return string|null The edit post link for the given post. Null if the post type does not exist + * or does not allow an editing UI. */ function get_edit_post_link( $id = 0, $context = 'display' ) { $post = get_post( $id ); @@ -1961,6 +1968,7 @@ function adjacent_posts_rel_link( $title = '%title', $in_same_term = false, $exc * or theme templates. * * @since 3.0.0 + * @since 5.6.0 No longer used in core. * * @see adjacent_posts_rel_link() */ @@ -2317,7 +2325,7 @@ function get_next_posts_page_link( $max_page = 0 ) { if ( ! $paged ) { $paged = 1; } - $nextpage = intval( $paged ) + 1; + $nextpage = (int) $paged + 1; if ( ! $max_page || $max_page >= $nextpage ) { return get_pagenum_link( $nextpage ); } @@ -2366,7 +2374,7 @@ function get_next_posts_link( $label = null, $max_page = 0 ) { $paged = 1; } - $nextpage = intval( $paged ) + 1; + $nextpage = (int) $paged + 1; if ( null === $label ) { $label = __( 'Next Page »' ); @@ -2415,7 +2423,7 @@ function get_previous_posts_page_link() { global $paged; if ( ! is_single() ) { - $nextpage = intval( $paged ) - 1; + $nextpage = (int) $paged - 1; if ( $nextpage < 1 ) { $nextpage = 1; } @@ -2888,7 +2896,7 @@ function get_next_comments_link( $label = '', $max_page = 0 ) { $page = 1; } - $nextpage = intval( $page ) + 1; + $nextpage = (int) $page + 1; if ( empty( $max_page ) ) { $max_page = $wp_query->max_num_comment_pages; @@ -2943,11 +2951,11 @@ function get_previous_comments_link( $label = '' ) { $page = get_query_var( 'cpage' ); - if ( intval( $page ) <= 1 ) { + if ( (int) $page <= 1 ) { return; } - $prevpage = intval( $page ) - 1; + $prevpage = (int) $page - 1; if ( empty( $label ) ) { $label = __( '« Older Comments' ); @@ -3910,7 +3918,7 @@ function wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) { if ( 'page' === $post->post_type && get_option( 'page_on_front' ) == $post->ID && 'page' === get_option( 'show_on_front' ) ) { $shortlink = home_url( '/' ); - } elseif ( $post_type->public ) { + } elseif ( $post_type && $post_type->public ) { $shortlink = home_url( '?p=' . $post_id ); } } diff --git a/wp-includes/load.php b/wp-includes/load.php index 8cc14e06db..6bd7614ecd 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -86,6 +86,47 @@ function wp_fix_server_vars() { $_SERVER['PHP_SELF'] = preg_replace( '/(\?.*)?$/', '', $_SERVER['REQUEST_URI'] ); $PHP_SELF = $_SERVER['PHP_SELF']; } + + wp_populate_basic_auth_from_authorization_header(); +} + +/** + * Populates the Basic Auth server details from the Authorization header. + * + * Some servers running in CGI or FastCGI mode don't pass the Authorization + * header on to WordPress. If it's been rewritten to the `HTTP_AUTHORIZATION` header, + * fill in the proper $_SERVER variables instead. + * + * @since 5.6.0 + */ +function wp_populate_basic_auth_from_authorization_header() { + // If we don't have anything to pull from, return early. + if ( ! isset( $_SERVER['HTTP_AUTHORIZATION'] ) && ! isset( $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] ) ) { + return; + } + + // If either PHP_AUTH key is already set, do nothing. + if ( isset( $_SERVER['PHP_AUTH_USER'] ) || isset( $_SERVER['PHP_AUTH_PW'] ) ) { + return; + } + + // From our prior conditional, one of these must be set. + $header = isset( $_SERVER['HTTP_AUTHORIZATION'] ) ? $_SERVER['HTTP_AUTHORIZATION'] : $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + + // Test to make sure the pattern matches expected. + if ( ! preg_match( '%^Basic [a-z\d/+]*={0,2}$%i', $header ) ) { + return; + } + + // Removing `Basic ` the token would start six characters in. + $token = substr( $header, 6 ); + $userpass = base64_decode( $token ); + + list( $user, $pass ) = explode( ':', $userpass ); + + // Now shove them in the proper keys where we're expecting later on. + $_SERVER['PHP_AUTH_USER'] = $user; + $_SERVER['PHP_AUTH_PW'] = $pass; } /** @@ -112,7 +153,11 @@ function wp_check_php_mysql_versions() { exit( 1 ); } - if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) { + if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) + // This runs before default constants are defined, so we can't assume WP_CONTENT_DIR is set yet. + && ( defined( 'WP_CONTENT_DIR' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) + || ! file_exists( ABSPATH . 'wp-content/db.php' ) ) + ) { require_once ABSPATH . WPINC . '/functions.php'; wp_load_translations_early(); $args = array( @@ -134,7 +179,7 @@ function wp_check_php_mysql_versions() { * The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable, * or a constant of the same name. * - * Possible values include 'local', 'development', 'staging', 'production'. + * Possible values are 'local', 'development', 'staging', and 'production'. * If not set, the type defaults to 'production'. * * @since 5.5.0 @@ -1446,17 +1491,30 @@ function wp_doing_cron() { } /** - * Check whether variable is a WordPress Error. + * Checks whether the given variable is a WordPress Error. * - * Returns true if $thing is an object of the WP_Error class. + * Returns whether `$thing` is an instance of the `WP_Error` class. * * @since 2.1.0 * - * @param mixed $thing Check if unknown variable is a WP_Error object. - * @return bool True, if WP_Error. False, if not WP_Error. + * @param mixed $thing The variable to check. + * @return bool Whether the variable is an instance of WP_Error. */ function is_wp_error( $thing ) { - return ( $thing instanceof WP_Error ); + $is_wp_error = ( $thing instanceof WP_Error ); + + if ( $is_wp_error ) { + /** + * Fires when `is_wp_error()` is called and its parameter is an instance of `WP_Error`. + * + * @since 5.6.0 + * + * @param WP_Error $thing The error object passed to `is_wp_error()`. + */ + do_action( 'is_wp_error_instance', $thing ); + } + + return $is_wp_error; } /** @@ -1537,11 +1595,11 @@ function wp_finalize_scraping_edited_file_errors( $scrape_key ) { */ function wp_is_json_request() { - if ( isset( $_SERVER['HTTP_ACCEPT'] ) && false !== strpos( $_SERVER['HTTP_ACCEPT'], 'application/json' ) ) { + if ( isset( $_SERVER['HTTP_ACCEPT'] ) && wp_is_json_media_type( $_SERVER['HTTP_ACCEPT'] ) ) { return true; } - if ( isset( $_SERVER['CONTENT_TYPE'] ) && 'application/json' === $_SERVER['CONTENT_TYPE'] ) { + if ( isset( $_SERVER['CONTENT_TYPE'] ) && wp_is_json_media_type( $_SERVER['CONTENT_TYPE'] ) ) { return true; } @@ -1577,6 +1635,24 @@ function wp_is_jsonp_request() { } +/** + * Checks whether a string is a valid JSON Media Type. + * + * @since 5.6.0 + * + * @param string $media_type A Media Type string to check. + * @return bool True if string is a valid JSON Media Type. + */ +function wp_is_json_media_type( $media_type ) { + static $cache = array(); + + if ( ! isset( $cache[ $media_type ] ) ) { + $cache[ $media_type ] = (bool) preg_match( '/(^|\s|,)application\/([\w!#\$&-\^\.\+]+\+)?json(\+oembed)?($|\s|;|,)/i', $media_type ); + } + + return $cache[ $media_type ]; +} + /** * Checks whether current request is an XML request, or is expecting an XML response. * diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 0a07b5619f..84952584ab 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -160,7 +160,7 @@ function wp_print_media_templates() { /* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */ __( 'Describe the purpose of the image%3$s. Leave empty if the image is purely decorative.' ), esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ), - 'target="_blank" rel="noopener noreferrer"', + 'target="_blank" rel="noopener"', sprintf( ' %s', /* translators: Accessibility text. */ @@ -309,10 +309,10 @@ function wp_print_media_templates() { @@ -366,7 +366,7 @@ function wp_print_media_templates() { <# } #> <# if ( 'audio' === data.type ) { #> -
    +
    @@ -405,10 +405,27 @@ function wp_print_media_templates() {

    -
    {{ data.filename }}
    -
    {{ data.mime }}
    {{ data.dateFormatted }}
    - +
    + + <# if ( data.authorLink ) { #> + {{ data.authorName }} + <# } else { #> + {{ data.authorName }} + <# } #> +
    + <# if ( data.uploadedToTitle ) { #> +
    + + <# if ( data.uploadedToLink ) { #> + {{ data.uploadedToTitle }} + <# } else { #> + {{ data.uploadedToTitle }} + <# } #> +
    + <# } #> +
    {{ data.filename }}
    +
    {{ data.mime }}
    {{ data.filesizeHumanReadable }}
    <# if ( 'image' === data.type && ! data.uploading ) { #> <# if ( data.width && data.height ) { #> @@ -442,6 +459,10 @@ function wp_print_media_templates() {
    <# } #> + <# if ( data.mediaStates ) { #> +
    {{ data.mediaStates }}
    + <# } #> +
    <# if ( data.compat && data.compat.meta ) { #> {{{ data.compat.meta }}} @@ -485,25 +506,11 @@ function wp_print_media_templates() { - - - {{ data.authorName }} - - <# if ( data.uploadedToTitle ) { #> - - - <# if ( data.uploadedToLink ) { #> - {{ data.uploadedToTitle }} - <# } else { #> - {{ data.uploadedToTitle }} - <# } #> - - <# } #> - + @@ -511,11 +518,19 @@ function wp_print_media_templates() {
    - - <# if ( data.can.save ) { #> | + <# if ( data.link ) { #> + + <# } #> + <# if ( data.can.save ) { #> + <# if ( data.link ) { #> + | + <# } #> <# } #> - <# if ( ! data.uploading && data.can.remove ) { #> | + <# if ( ! data.uploading && data.can.remove ) { #> + <# if ( data.link || data.can.save ) { #> + | + <# } #> <# if ( 'trash' === data.status ) { #> @@ -536,7 +551,7 @@ function wp_print_media_templates() {
    <# if ( data.uploading ) { #>
    - <# } else if ( 'image' === data.type && data.sizes ) { #> + <# } else if ( 'image' === data.type && data.size && data.size.url ) { #>
    @@ -595,15 +610,41 @@ function wp_print_media_templates() {
    -
    - <# if ( data.uploading ) { #> -
    - <# } else if ( 'image' === data.type && data.sizes ) { #> - - <# } else { #> - - <# } #> -
    + + <# if ( 'audio' === data.type ) { #> +
    + +
    + <# } else if ( 'video' === data.type ) { + var w_rule = ''; + if ( data.width ) { + w_rule = 'width: ' + data.width + 'px;'; + } else if ( wp.media.view.settings.contentWidth ) { + w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;'; + } + #> +
    + +
    + <# } else { #> +
    + <# if ( data.uploading ) { #> +
    + <# } else if ( 'image' === data.type && data.size && data.size.url ) { #> + + <# } else { #> + + <# } #> +
    + <# } #> +
    {{ data.filename }}
    {{ data.dateFormatted }}
    @@ -636,6 +677,10 @@ function wp_print_media_templates() {
    <# } #> + <# if ( data.mediaStates ) { #> +
    {{ data.mediaStates }}
    + <# } #> + <# if ( ! data.uploading && data.can.remove ) { #> <# if ( 'trash' === data.status ) { #> @@ -694,7 +739,7 @@ function wp_print_media_templates() {
    - +
    diff --git a/wp-includes/media.php b/wp-includes/media.php index bd15e841ac..e651dcbccf 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -42,13 +42,12 @@ function wp_get_additional_image_sizes() { * * @since 2.5.0 * - * @global int $content_width + * @global int $content_width * * @param int $width Width of the image in pixels. * @param int $height Height of the image in pixels. - * @param string|array $size Optional. Image size. Accepts any valid image size, or an array - * of width and height values in pixels (in that order). - * Default 'medium'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array + * of width and height values in pixels (in that order). Default 'medium'. * @param string $context Optional. Could be 'display' (like in a theme) or 'edit' * (like inserting into an editor). Default null. * @return int[] { @@ -71,23 +70,23 @@ function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co $max_width = $size[0]; $max_height = $size[1]; } elseif ( 'thumb' === $size || 'thumbnail' === $size ) { - $max_width = intval( get_option( 'thumbnail_size_w' ) ); - $max_height = intval( get_option( 'thumbnail_size_h' ) ); + $max_width = (int) get_option( 'thumbnail_size_w' ); + $max_height = (int) get_option( 'thumbnail_size_h' ); // Last chance thumbnail size defaults. if ( ! $max_width && ! $max_height ) { $max_width = 128; $max_height = 96; } } elseif ( 'medium' === $size ) { - $max_width = intval( get_option( 'medium_size_w' ) ); - $max_height = intval( get_option( 'medium_size_h' ) ); + $max_width = (int) get_option( 'medium_size_w' ); + $max_height = (int) get_option( 'medium_size_h' ); } elseif ( 'medium_large' === $size ) { - $max_width = intval( get_option( 'medium_large_size_w' ) ); - $max_height = intval( get_option( 'medium_large_size_h' ) ); + $max_width = (int) get_option( 'medium_large_size_w' ); + $max_height = (int) get_option( 'medium_large_size_h' ); - if ( intval( $content_width ) > 0 ) { - $max_width = min( intval( $content_width ), $max_width ); + if ( (int) $content_width > 0 ) { + $max_width = min( (int) $content_width, $max_width ); } } elseif ( 'large' === $size ) { /* @@ -96,18 +95,18 @@ function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co * itself, and within the theme's content width if it's known. The user * can resize it in the editor if they wish. */ - $max_width = intval( get_option( 'large_size_w' ) ); - $max_height = intval( get_option( 'large_size_h' ) ); + $max_width = (int) get_option( 'large_size_w' ); + $max_height = (int) get_option( 'large_size_h' ); - if ( intval( $content_width ) > 0 ) { - $max_width = min( intval( $content_width ), $max_width ); + if ( (int) $content_width > 0 ) { + $max_width = min( (int) $content_width, $max_width ); } } elseif ( ! empty( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ), true ) ) { - $max_width = intval( $_wp_additional_image_sizes[ $size ]['width'] ); - $max_height = intval( $_wp_additional_image_sizes[ $size ]['height'] ); + $max_width = (int) $_wp_additional_image_sizes[ $size ]['width']; + $max_height = (int) $_wp_additional_image_sizes[ $size ]['height']; // Only in admin. Assume that theme authors know what they're doing. - if ( intval( $content_width ) > 0 && 'edit' === $context ) { - $max_width = min( intval( $content_width ), $max_width ); + if ( (int) $content_width > 0 && 'edit' === $context ) { + $max_width = min( (int) $content_width, $max_width ); } } else { // $size === 'full' has no constraint. $max_width = $width; @@ -125,10 +124,11 @@ function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co * @type int $0 The maximum width in pixels. * @type int $1 The maximum height in pixels. * } - * @param string|array $size Size of what the result image should be. - * @param string $context The context the image is being resized for. - * Possible values are 'display' (like in a theme) - * or 'edit' (like inserting into an editor). + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). + * @param string $context The context the image is being resized for. + * Possible values are 'display' (like in a theme) + * or 'edit' (like inserting into an editor). */ list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size, $context ); @@ -155,10 +155,10 @@ function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co function image_hwstring( $width, $height ) { $out = ''; if ( $width ) { - $out .= 'width="' . intval( $width ) . '" '; + $out .= 'width="' . (int) $width . '" '; } if ( $height ) { - $out .= 'height="' . intval( $height ) . '" '; + $out .= 'height="' . (int) $height . '" '; } return $out; } @@ -177,9 +177,8 @@ function image_hwstring( $width, $height ) { * @since 2.5.0 * * @param int $id Attachment ID for image. - * @param string|int[] $size Optional. Image size to scale to. Accepts any valid image size name, - * or an array of width and height values in pixels (in that order). - * Default 'medium'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array + * of width and height values in pixels (in that order). Default 'medium'. * @return array|false { * Array of image data, or boolean false if no image is available. * @@ -202,8 +201,8 @@ function image_downsize( $id, $size = 'medium' ) { * * @param bool|array $downsize Whether to short-circuit the image downsize. * @param int $id Attachment ID for image. - * @param array|string $size Requested size of image. Image size name, or array of width - * and height values (in that order). + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ $out = apply_filters( 'image_downsize', false, $id, $size ); @@ -367,9 +366,8 @@ function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) { * @param string $alt Image description for the alt attribute. * @param string $title Image description for the title attribute. * @param string $align Part of the class name for aligning the image. - * @param string|array $size Optional. Registered image size to retrieve a tag for. Accepts any - * valid image size, or an array of width and height values in pixels - * (in that order). Default 'medium'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of + * width and height values in pixels (in that order). Default 'medium'. * @return string HTML IMG element for given image attachment */ function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) { @@ -379,7 +377,8 @@ function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) { $title = $title ? 'title="' . esc_attr( $title ) . '" ' : ''; - $class = 'align' . esc_attr( $align ) . ' size-' . esc_attr( $size ) . ' wp-image-' . $id; + $size_class = is_array( $size ) ? implode( 'x', $size ) : $size; + $class = 'align' . esc_attr( $align ) . ' size-' . esc_attr( $size_class ) . ' wp-image-' . $id; /** * Filters the value of the attachment's image tag class attribute. @@ -389,8 +388,8 @@ function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) { * @param string $class CSS class name or space-separated list of classes. * @param int $id Attachment ID. * @param string $align Part of the class name for aligning the image. - * @param string|array $size Size of image. Image size or array of width and height values (in that order). - * Default 'medium'. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ $class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size ); @@ -406,8 +405,8 @@ function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) { * @param string $alt Image description for the alt attribute. * @param string $title Image description for the title attribute. * @param string $align Part of the class name for aligning the image. - * @param string|array $size Size of image. Image size or array of width and height values (in that order). - * Default 'medium'. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ return apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); } @@ -744,18 +743,17 @@ function wp_image_matches_ratio( $source_width, $source_height, $target_width, $ * @since 2.5.0 * * @param int $post_id Attachment ID. - * @param array|string $size Optional. Image size. Accepts any valid image size, or an array - * of width and height values in pixels (in that order). - * Default 'thumbnail'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array + * of width and height values in pixels (in that order). Default 'thumbnail'. * @return array|false { * Array of file relative path, width, and height on success. Additionally includes absolute - * path and URL if registered size is passed to $size parameter. False on failure. + * path and URL if registered size is passed to `$size` parameter. False on failure. * - * @type string $file Image's path relative to uploads directory - * @type int $width Width of image - * @type int $height Height of image - * @type string $path Image's absolute filesystem path. - * @type string $url Image's URL. + * @type string $file Path of image relative to uploads directory. + * @type int $width Width of image in pixels. + * @type int $height Height of image in pixels. + * @type string $path Absolute filesystem path of image. + * @type string $url URL of image. * } */ function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) { @@ -778,7 +776,7 @@ function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) { foreach ( $imagedata['sizes'] as $_size => $data ) { // If there's an exact match to an existing image size, short circuit. - if ( intval( $data['width'] ) === intval( $size[0] ) && intval( $data['height'] ) === intval( $size[1] ) ) { + if ( (int) $data['width'] === (int) $size[0] && (int) $data['height'] === (int) $size[1] ) { $candidates[ $data['width'] * $data['height'] ] = $data; break; } @@ -844,9 +842,9 @@ function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) { * * @param array $data Array of file relative path, width, and height on success. May also include * file absolute path and URL. - * @param int $post_id The post_id of the image attachment - * @param string|array $size Registered image size or flat array of initially-requested height and width - * dimensions (in that order). + * @param int $post_id The ID of the image attachment. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size ); } @@ -899,16 +897,16 @@ function wp_get_registered_image_subsizes() { if ( isset( $additional_sizes[ $size_name ]['width'] ) ) { // For sizes added by plugins and themes. - $size_data['width'] = intval( $additional_sizes[ $size_name ]['width'] ); + $size_data['width'] = (int) $additional_sizes[ $size_name ]['width']; } else { // For default sizes set in options. - $size_data['width'] = intval( get_option( "{$size_name}_size_w" ) ); + $size_data['width'] = (int) get_option( "{$size_name}_size_w" ); } if ( isset( $additional_sizes[ $size_name ]['height'] ) ) { - $size_data['height'] = intval( $additional_sizes[ $size_name ]['height'] ); + $size_data['height'] = (int) $additional_sizes[ $size_name ]['height']; } else { - $size_data['height'] = intval( get_option( "{$size_name}_size_h" ) ); + $size_data['height'] = (int) get_option( "{$size_name}_size_h" ); } if ( empty( $size_data['width'] ) && empty( $size_data['height'] ) ) { @@ -938,8 +936,8 @@ function wp_get_registered_image_subsizes() { * @since 2.5.0 * * @param int $attachment_id Image attachment ID. - * @param string|int[] $size Optional. Image size. Accepts any valid image size name, or an array of width - * and height values in pixels (in that order). Default 'thumbnail'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of + * width and height values in pixels (in that order). Default 'thumbnail'. * @param bool $icon Optional. Whether the image should fall back to a mime type icon. Default false. * @return array|false { * Array of image data, or boolean false if no image is available. @@ -986,15 +984,15 @@ function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon * @type bool $3 Whether the image is a resized image. * } * @param int $attachment_id Image attachment ID. - * @param string|int[] $size Requested size of image. Image size name, or array of width - * and height values (in that order). + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). * @param bool $icon Whether the image should be treated as an icon. */ return apply_filters( 'wp_get_attachment_image_src', $image, $attachment_id, $size, $icon ); } /** - * Get an HTML img element representing an image attachment + * Get an HTML img element representing an image attachment. * * While `$size` will accept an array, it is better to register a size with * add_image_size() so that a cropped version is generated. It's much more @@ -1006,8 +1004,8 @@ function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon * @since 5.5.0 The `$loading` attribute was added. * * @param int $attachment_id Image attachment ID. - * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width - * and height values in pixels (in that order). Default 'thumbnail'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array + * of width and height values in pixels (in that order). Default 'thumbnail'. * @param bool $icon Optional. Whether the image should be treated as an icon. Default false. * @param string|array $attr { * Optional. Attributes for the image markup. @@ -1037,7 +1035,7 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f $size_class = $size; if ( is_array( $size_class ) ) { - $size_class = join( 'x', $size_class ); + $size_class = implode( 'x', $size_class ); } $default_attr = array( @@ -1083,11 +1081,11 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f * * @since 2.8.0 * - * @param array $attr Array of attribute values for the image markup, keyed by attribute name. + * @param string[] $attr Array of attribute values for the image markup, keyed by attribute name. * See wp_get_attachment_image(). * @param WP_Post $attachment Image attachment post. - * @param string|array $size Requested size. Image size or array of width and height values - * (in that order). Default 'thumbnail'. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). */ $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size ); @@ -1101,7 +1099,20 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f $html .= ' />'; } - return $html; + /** + * HTML img element representing an image attachment. + * + * @since 5.6.0 + * + * @param string $html HTML img element or empty string on failure. + * @param int $attachment_id Image attachment ID. + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). + * @param bool $icon Whether the image should be treated as an icon. + * @param string[] $attr Array of attribute values for the image markup, keyed by attribute name. + * See wp_get_attachment_image(). + */ + return apply_filters( 'wp_get_attachment_image', $html, $attachment_id, $size, $icon, $attr ); } /** @@ -1110,8 +1121,8 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f * @since 4.4.0 * * @param int $attachment_id Image attachment ID. - * @param string|array $size Optional. Image size to retrieve. Accepts any valid image size, or an array - * of width and height values in pixels (in that order). Default 'thumbnail'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of + * width and height values in pixels (in that order). Default 'thumbnail'. * @param bool $icon Optional. Whether the image should be treated as an icon. Default false. * @return string|false Attachment URL or false if no image is available. */ @@ -1153,9 +1164,14 @@ function _wp_get_attachment_relative_path( $file ) { * @since 4.4.0 * @access private * - * @param string $size_name Image size. Accepts any valid image size name ('thumbnail', 'medium', etc.). + * @param string $size_name Image size. Accepts any registered image size name. * @param array $image_meta The image meta data. - * @return array|bool The image meta data as returned by `wp_get_attachment_metadata()`. + * @return array|false { + * Array of width and height or false if the size isn't present in the meta data. + * + * @type int $0 Image width. + * @type int $1 Image height. + * } */ function _wp_get_image_size_from_meta( $size_name, $image_meta ) { if ( 'full' === $size_name ) { @@ -1181,7 +1197,7 @@ function _wp_get_image_size_from_meta( $size_name, $image_meta ) { * @see wp_calculate_image_srcset() * * @param int $attachment_id Image attachment ID. - * @param array|string $size Optional. Image size. Accepts any valid image size, or an array of + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). Default 'medium'. * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. @@ -1221,7 +1237,7 @@ function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $imag * @param string $image_src The 'src' of the image. * @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'. * @param int $attachment_id Optional. The image attachment ID. Default 0. - * @return string|bool The 'srcset' attribute value. False on error or when only one source exists. + * @return string|false The 'srcset' attribute value. False on error or when only one source exists. */ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attachment_id = 0 ) { /** @@ -1422,8 +1438,8 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac * @see wp_calculate_image_sizes() * * @param int $attachment_id Image attachment ID. - * @param array|string $size Optional. Image size. Accepts any valid image size, or an array of width - * and height values in pixels (in that order). Default 'medium'. + * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of + * width and height values in pixels (in that order). Default 'medium'. * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. * @return string|bool A valid source size value for use in a 'sizes' attribute or false. @@ -1453,14 +1469,14 @@ function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image * * @since 4.4.0 * - * @param array|string $size Image size to retrieve. Accepts any valid image size, or an array - * of width and height values in pixels (in that order). Default 'medium'. + * @param string|int[] $size Image size. Accepts any registered image size name, or an array of + * width and height values in pixels (in that order). * @param string $image_src Optional. The URL to the image file. Default null. * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. * @param int $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id` * is needed when using the image size name as argument for `$size`. Default 0. - * @return string|bool A valid source size value for use in a 'sizes' attribute or false. + * @return string|false A valid source size value for use in a 'sizes' attribute or false. */ function wp_calculate_image_sizes( $size, $image_src = null, $image_meta = null, $attachment_id = 0 ) { $width = 0; @@ -1493,8 +1509,8 @@ function wp_calculate_image_sizes( $size, $image_src = null, $image_meta = null, * @since 4.4.0 * * @param string $sizes A source size value for use in a 'sizes' attribute. - * @param array|string $size Requested size. Image size or array of width and height values - * in pixels (in that order). + * @param string|int[] $size Requested image size. Can be any registered image size name, or + * an array of width and height values in pixels (in that order). * @param string|null $image_src The URL to the image file or null. * @param array|null $image_meta The image meta data as returned by wp_get_attachment_metadata() or null. * @param int $attachment_id Image attachment ID of the original image or 0. @@ -1558,7 +1574,7 @@ function wp_image_file_matches_image_meta( $image_location, $image_meta, $attach } /** - * Filter whether an image path or URI matches image meta. + * Filters whether an image path or URI matches image meta. * * @since 5.5.0 * @@ -1684,12 +1700,13 @@ function wp_image_add_srcset_and_sizes( $image, $image_meta, $attachment_id ) { } /** - * Determine whether to add the `loading` attribute to the specified tag in the specified context. + * Determines whether to add the `loading` attribute to the specified tag in the specified context. * * @since 5.5.0 * * @param string $tag_name The tag name. - * @param string $context Additional context, like the current filter name or the function name from where this was called. + * @param string $context Additional context, like the current filter name + * or the function name from where this was called. * @return bool Whether to add the attribute. */ function wp_lazy_loading_enabled( $tag_name, $context ) { @@ -1704,7 +1721,8 @@ function wp_lazy_loading_enabled( $tag_name, $context ) { * * @param bool $default Default value. * @param string $tag_name The tag name. - * @param string $context Additional context, like the current filter name or the function name from where this was called. + * @param string $context Additional context, like the current filter name + * or the function name from where this was called. */ return (bool) apply_filters( 'wp_lazy_loading_enabled', $default, $tag_name, $context ); } @@ -1817,7 +1835,7 @@ function wp_img_tag_add_loading_attr( $image, $context ) { * @since 5.5.0 * * @param string|bool $value The `loading` attribute value. Returning a falsey value will result in - * the attribute being omitted for the image. Default is `lazy`. + * the attribute being omitted for the image. Default 'lazy'. * @param string $image The HTML `img` tag to be filtered. * @param string $context Additional context about how the function was called or where the img tag is. */ @@ -2147,8 +2165,8 @@ function img_caption_shortcode( $attr, $content = null ) { * @type string $captiontag HTML tag to use for each image's caption. * Default 'dd', or 'figcaption' when the theme registers HTML5 gallery support. * @type int $columns Number of columns of images to display. Default 3. - * @type string|array $size Size of the images to display. Accepts any valid image size, or an array of width - * and height values in pixels (in that order). Default 'thumbnail'. + * @type string|int[] $size Size of the images to display. Accepts any registered image size name, or an array + * of width and height values in pixels (in that order). Default 'thumbnail'. * @type string $ids A comma-separated list of IDs of attachments to display. Default empty. * @type string $include A comma-separated list of IDs of attachments to include. Default empty. * @type string $exclude A comma-separated list of IDs of attachments to exclude. Default empty. @@ -2211,7 +2229,7 @@ function gallery_shortcode( $attr ) { 'gallery' ); - $id = intval( $atts['id'] ); + $id = (int) $atts['id']; if ( ! empty( $atts['include'] ) ) { $_attachments = get_posts( @@ -2289,7 +2307,7 @@ function gallery_shortcode( $attr ) { $icontag = 'dt'; } - $columns = intval( $atts['columns'] ); + $columns = (int) $atts['columns']; $itemwidth = $columns > 0 ? floor( 100 / $columns ) : 100; $float = is_rtl() ? 'right' : 'left'; @@ -2330,7 +2348,7 @@ function gallery_shortcode( $attr ) { \n\t\t"; } - $size_class = sanitize_html_class( $atts['size'] ); + $size_class = sanitize_html_class( is_array( $atts['size'] ) ? implode( 'x', $atts['size'] ) : $atts['size'] ); $gallery_div = "